aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java69
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java24
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java347
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java98
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java4
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackCreationException.java14
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsITTest.java6
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java24
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java20
-rw-r--r--adapters/mso-adapter-utils/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json2
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java15
-rw-r--r--adapters/mso-catalog-db-adapter/pom.xml53
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java6
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java3
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java46
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java14
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java50
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java14
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java7
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVnfcs.java8
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundException.java14
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundExceptionMapper.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java)36
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceMapper.java49
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java32
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfMapper.java37
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java115
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql62
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql4
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql21
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.2__AddNfValidData.sql5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql47
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.1__UpdatedCloudSiteTable.sql5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql3
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql4
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.1__AddControllerActorAndBlueprint.sql23
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.2__AddScopeAndActionColumnsInOrchestrationFlowReference.sql5
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java74
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfTest.java36
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/ServiceMapperTest.java1
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java374
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json1
-rw-r--r--adapters/mso-openstack-adapters/pom.xml7
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java26
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java36
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java35
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java34
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java49
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java28
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java65
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java171
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/MsoOpenstackAdaptersApplication.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/WebSecurityConfigImpl.java50
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java1
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java189
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java3
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java50
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java262
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java11
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java11
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java17
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java17
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java11
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java14
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java134
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java1
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java46
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java16
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java45
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java91
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java4
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java104
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java24
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java3
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java5
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImplTest.java9
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/application-test.yaml4
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/schema.sql10
-rw-r--r--adapters/mso-requests-db-adapter/pom.xml3
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java21
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java23
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/MSORequestDBApplication.java16
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java14
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql12
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql21
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.5__Drop_Table_Active_Requests.sql4
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.6__UpdateRequestProcessingData.sql9
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.1__Drop_Columns_from_Infra_requests_archive_tables.sql17
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.2__Add_PNF_Column_Infra_Requests_archive_tables.sql4
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java28
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java67
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java55
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java25
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql22
-rw-r--r--adapters/mso-sdnc-adapter/pom.xml3
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java6
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java5
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/WebSecurityConfigImpl.java50
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java8
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java2
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java146
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java2
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java142
-rw-r--r--adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json1
-rw-r--r--adapters/mso-ve-vnfm-adapter/pom.xml61
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/Application.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/ICryptoHandler.java)22
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java)37
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml23
-rw-r--r--adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java (renamed from adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/WMAdapterRestTest.java)36
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java6
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java50
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java6
-rw-r--r--adapters/mso-vfc-adapter/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-vfc-adapter/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml52
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json230
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml43
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json3117
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json7311
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt12
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java2
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java10
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicWebSecurityConfigurerAdapter.java (renamed from adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/WebSecurityConfigImpl.java)37
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter.java180
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/JsonSerializerConfiguration.java)40
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java88
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java27
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java18
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java74
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java56
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java195
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java102
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java34
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java39
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java9
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java40
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java107
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java188
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementController.java107
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/exception/GlobalExceptionHandler.java)30
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java74
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java43
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2ResourceServer.java)29
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmRepository.java)28
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml0
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml0
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml17
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java17
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java655
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementControllerTest.java70
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java62
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml6
-rw-r--r--adapters/pom.xml2
-rw-r--r--adapters/so-appc-orchestrator/pom.xml221
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/AppcOrchestratorApplication.java46
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallback.java84
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerClient.java244
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerOrchestratorException.java37
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupport.java207
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/StatusCategory.java16
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/ConfigurationParameters.java53
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Identity.java24
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Parameters.java99
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/RequestParameters.java59
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java50
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImpl.java112
-rw-r--r--adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskService.java31
-rw-r--r--adapters/so-appc-orchestrator/src/main/resources/application.yaml18
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/TestApplication.java43
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java113
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupportTest.java79
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/beans/BeansTest.java20
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplITTest.java88
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java236
-rw-r--r--adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskTest.java76
-rw-r--r--adapters/so-appc-orchestrator/src/test/resources/application-test.yaml17
-rw-r--r--adapters/so-appc-orchestrator/src/test/resources/logback-test.xml31
-rw-r--r--asdc-controller/pom.xml5
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java14
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java48
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java7
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java35
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java3
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java45
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java2
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java6
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java5
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/WorkflowArtifact.java3
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java8
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java4
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java1157
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java557
-rw-r--r--asdc-controller/src/main/resources/application-aaf.yaml0
-rw-r--r--asdc-controller/src/main/resources/application-basic.yaml0
-rw-r--r--asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java39
-rw-r--r--asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java5
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/TestApplication.java2
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java160
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java102
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java75
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java239
-rw-r--r--asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csarbin35636 -> 0 bytes
-rw-r--r--asdc-controller/src/test/resources/download/service-Testservice140-csar.csarbin35457 -> 0 bytes
-rw-r--r--asdc-controller/src/test/resources/download/service-pnfservice.csarbin0 -> 27525 bytes
-rw-r--r--asdc-controller/src/test/resources/download/service-vnfservice.csarbin0 -> 27602 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json47
-rw-r--r--asdc-controller/src/test/resources/resource-examples/ccvpn/service-Ccvpnservice-csar.csarbin0 -> 55786 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json173
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csarbin0 -> 95725 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml1186
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env10
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml103
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json25
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env9
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml109
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json25
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.env27
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.yaml243
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/demo-vcpe-rescust-notification.json108
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-csar.csarbin0 -> 84583 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-template.yml822
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vcpe_vgwbf175ab04fa20_modules.json25
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vendor-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vf-license-model.xml1
-rw-r--r--asdc-controller/src/test/resources/schema.sql32
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcess.groovy375
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy40
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/FalloutHandler.groovy472
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy38
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy47
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/FlowValidatorRunner.java7
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionCompletion.java (renamed from common/src/main/java/org/onap/so/utils/TargetEntities.java)10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListener.java44
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListenerRunner.java64
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/BpmnRestClient.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CryptoHandler.java75
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/Metadata.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java13
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PServer.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceSubscription.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VpnBondingLink.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java21
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java5
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ServiceModel.java32
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java19
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java222
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java122
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java32
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java57
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundException.java15
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java132
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForPnf.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForVnf.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java32
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn376
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn486
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtilsTest.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy214
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy333
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy135
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java149
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/SerializableChecker.java163
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/BuildingBlockValidatorRunnerTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/WorkflowValidatorRunnerTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/MyDisabledValidator.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/ValidationConfig.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/util/CryptoHandlerTest.java55
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java91
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/SerializationTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java390
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java157
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java21
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundExceptionTest.java19
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/Client/InfraActiveRequestExpected.json8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/InfraActiveRequestExpected.json8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/response/infraActiveRequestsResponse.json10
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java10
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java1
-rw-r--r--bpmn/mso-infrastructure-bpmn/pom.xml22
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java10
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java8
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java14
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java3
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutorListener.java42
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java12
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java8
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java8
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java51
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/resources/application-aaf.yaml0
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/resources/application-basic.yaml0
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java13
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java166
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImplTest.java118
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceTest.java59
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn109
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn2
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn6
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn125
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn42
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn347
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java163
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java20
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java15
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java18
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java1
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java15
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java15
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java15
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java1
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java18
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java14
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java16
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java15
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java15
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy14
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy32
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy44
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy12
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy16
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy64
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy26
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy22
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy16
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy28
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java9
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java19
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java32
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java7
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java76
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationId.java45
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAai.java34
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfBaseTasks.java29
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java51
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java33
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java9
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java8
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationIdTest.java129
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAaiTest.java50
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfTasksUtils.java17
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java37
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java46
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java25
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java96
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java43
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTask.java60
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java66
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java20
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProvider.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java25
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java (renamed from bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImpl.java)52
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProvider.java58
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java189
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java106
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/UnassignNetworkException.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/VnfNotFoundException.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java96
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java37
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java38
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java664
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java128
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java45
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java149
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java47
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java99
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java128
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java28
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java248
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java79
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameterTest.java62
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java)14
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java98
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessorTest.java166
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java55
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java237
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBBTest.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java95
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java27
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java170
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java1011
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java42
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java65
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleAddonRequest.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestBridgeEnabled.json71
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestDhcpDisabled.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestMultipleDhcp.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestNoUserParams.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestTrueBackout.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithCloudResources.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithSingleAvailabilityZone.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithNoEnvironmentAndWorkloadContextRequest.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithVolumeGroupRequest.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterDeleteVfModuleRequest.json7
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json57
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json434
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json13
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/appcTaskRequest.json12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json66
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java2
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java6
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java8
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java10
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java19
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java6
-rw-r--r--common/pom.xml107
-rw-r--r--common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java104
-rw-r--r--common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java30
-rw-r--r--common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java49
-rw-r--r--common/src/main/java/org/onap/so/client/BaseClient.java6
-rw-r--r--common/src/main/java/org/onap/so/client/HttpClient.java8
-rw-r--r--common/src/main/java/org/onap/so/client/HttpClientFactory.java8
-rw-r--r--common/src/main/java/org/onap/so/client/RestClient.java20
-rw-r--r--common/src/main/java/org/onap/so/client/RestTemplateConfig.java9
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java4
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIRestClient.java6
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIVersion.java2
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java6
-rw-r--r--common/src/main/java/org/onap/so/client/adapter/rest/AdapterRestClient.java6
-rw-r--r--common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java9
-rw-r--r--common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java16
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryRestClient.java5
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java14
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java23
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/__.java2
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java7
-rw-r--r--common/src/main/java/org/onap/so/client/grm/GRMRestClient.java6
-rw-r--r--common/src/main/java/org/onap/so/client/policy/PolicyRestClient.java6
-rw-r--r--common/src/main/java/org/onap/so/constants/OrchestrationRequestFormat.java2
-rw-r--r--common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java16
-rw-r--r--common/src/main/java/org/onap/so/externaltasks/logging/AuditMDCSetup.java56
-rw-r--r--common/src/main/java/org/onap/so/listener/ListenerRunner.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/ListenerRunner.java)8
-rw-r--r--common/src/main/java/org/onap/so/listener/Skip.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/Skip.java)2
-rw-r--r--common/src/main/java/org/onap/so/logger/ErrorCode.java2
-rw-r--r--common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java8
-rw-r--r--common/src/main/java/org/onap/so/logger/LogConstants.java2
-rw-r--r--common/src/main/java/org/onap/so/logger/MdcConstants.java10
-rw-r--r--common/src/main/java/org/onap/so/logger/ScheduledTasksMDCSetup.java75
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java136
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java173
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java111
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/PayloadLoggingFilter.java158
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java34
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SOMetricLogClientFilter.java61
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SOSpringClientFilter.java67
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java156
-rw-r--r--common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java132
-rw-r--r--common/src/main/java/org/onap/so/rest/exceptions/HttpResouceNotFoundException.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfOperationRepository.java)16
-rw-r--r--common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java16
-rw-r--r--common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java18
-rw-r--r--common/src/main/java/org/onap/so/security/SecurityFilters.java41
-rw-r--r--common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java (renamed from adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java)49
-rw-r--r--common/src/main/java/org/onap/so/security/SoCadiFilter.java118
-rw-r--r--common/src/main/java/org/onap/so/security/SoNoAuthWebSecurityConfigurerAdapter.java (renamed from vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java)35
-rw-r--r--common/src/main/java/org/onap/so/security/SoUserCredentialConfiguration.java (renamed from common/src/main/java/org/onap/so/security/WebSecurityConfig.java)34
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/Pnfs.java114
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java11
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestInfo.java13
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java13
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java12
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java3
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java11
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/Vnfs.java13
-rw-r--r--common/src/main/java/org/onap/so/utils/Components.java23
-rw-r--r--common/src/main/java/org/onap/so/utils/CryptoUtils.java6
-rw-r--r--common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java46
-rw-r--r--common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java36
-rw-r--r--common/src/test/java/org/onap/so/BeansTest.java1
-rw-r--r--common/src/test/java/org/onap/so/client/HttpClientTest.java8
-rw-r--r--common/src/test/java/org/onap/so/client/RestClientTest.java4
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java16
-rw-r--r--common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java37
-rw-r--r--common/src/test/java/org/onap/so/client/adapter/rest/AdapterRestClientTest.java6
-rw-r--r--common/src/test/java/org/onap/so/client/dmaap/rest/DMaaPRestClientTest.java97
-rw-r--r--common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java118
-rw-r--r--common/src/test/java/org/onap/so/externaltasks/logging/AuditMDCSetupTest.java93
-rw-r--r--common/src/test/java/org/onap/so/logger/ScheduledTasksMDCSetupTest.java83
-rw-r--r--common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java5
-rw-r--r--common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java65
-rw-r--r--cxf-logging/pom.xml5
-rw-r--r--cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java3
-rw-r--r--cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java2
-rw-r--r--deployment-configs/src/main/resources/logger/logback-spring.xml231
-rw-r--r--docs/api/apis/consumed-apis.rst (renamed from docs/api/apis/SO_Interface.rst)1324
-rw-r--r--docs/api/apis/e2eServiceInstances-api.rst185
-rw-r--r--docs/api/apis/serviceInstances-api.rst1192
-rw-r--r--docs/api/offered_consumed_apis.rst13
-rw-r--r--docs/architecture/architecture.rst2
-rw-r--r--docs/release-notes.rst180
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java10
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java9
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java1
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java19
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/ResponseHandler.java16
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/RequestIdFilter.java20
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiException.java11
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java63
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/DuplicateRequestException.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/RequestDbFailureException.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ValidateException.java5
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java6
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/filters/RequestIdFilterTest.java31
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java54
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json103
-rw-r--r--mso-api-handlers/mso-api-handler-infra/pom.xml28
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java61
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ApiHandlerApplication.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java146
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java57
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java33
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java157
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java84
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java83
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java22
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java (renamed from adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/BPRestCallbackTest.java)37
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java (renamed from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java)4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java40
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java116
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java124
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java52
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java21
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java28
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java28
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java194
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java672
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java22
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java888
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java (renamed from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java)9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java17
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WebSecurityConfigImpl.java56
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java15
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java85
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java134
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/exception/AAIEntityNotFound.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandler.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandler.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VFModuleRestHandler.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandler.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandler.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidator.java (renamed from common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java)35
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidatorListenerRunner.java80
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java21
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java29
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java21
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java78
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfOperationalEnvironment.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java23
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/resources/application-aaf.yaml0
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/resources/application-basic.yaml0
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java55
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java308
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerUnitTest.java378
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/E2EServiceInstancesTest.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java182
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java37
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java55
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java91
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java35
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java30
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequestTest.java12
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java225
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesUnitTest.java100
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilderTest.java82
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandlerTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandlerTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VfModuleRestHandlerTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandlerTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandlerTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestrationTest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/DeactivateVnfOperationalEnvironmentTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java32
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql31
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/AAIEntityNotFoundResponse.json8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ExecutePNFCustomWorkflow.json20
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVfModuleNoCloudConfig.json28
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVnfNoCloudConfig.json58
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceInstanceNoOE.json33
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/createInfraActiveRequests.json10
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequest.json10
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequestNoBody.json9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/Vnf.json2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/VnfLookup.json30
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml32
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql31
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql31
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java2
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java13
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java4
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java96
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java3
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java54
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql14
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql75
-rw-r--r--mso-api-handlers/mso-requests-db/pom.xml5
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java26
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java31
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java110
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/RequestProcessingData.java10
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java88
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java6
-rw-r--r--mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java39
-rw-r--r--mso-catalog-db/pom.xml5
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java18
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java12
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java91
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java43
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java10
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java11
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java7
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java9
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java28
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java13
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java33
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java198
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java15
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Cvnfc.java136
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java13
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java19
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java33
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java1
-rw-r--r--mso-catalog-db/src/test/resources/data.sql7
-rw-r--r--mso-catalog-db/src/test/resources/schema.sql23
-rw-r--r--packages/docker/pom.xml39
-rw-r--r--packages/docker/src/main/docker/docker-files/Dockerfile.so-app1
-rw-r--r--packages/docker/src/main/docker/docker-files/certs/org.onap.so.jksbin0 -> 3582 bytes
-rw-r--r--packages/docker/src/main/docker/docker-files/certs/org.onap.so.keyfile27
-rw-r--r--packages/docker/src/main/docker/docker-files/certs/org.onap.so.trust.jksbin0 -> 1413 bytes
-rw-r--r--packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml357
-rw-r--r--packages/docker/src/main/docker/docker-files/scripts/start-app.sh10
-rw-r--r--pom.xml73
-rw-r--r--so-monitoring/readme.md35
-rw-r--r--so-monitoring/so-monitoring-service/pom.xml9
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java3
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java23
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java35
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java9
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java39
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/application.yaml6
-rw-r--r--so-monitoring/so-monitoring-ui/pom.xml6
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/README.md9
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts12
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts20
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts46
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts50
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts2
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html15
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss24
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts82
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts45
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts8
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts108
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts81
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html63
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts5
-rw-r--r--so-simulator/.gitignore22
-rw-r--r--so-simulator/README.md62
-rw-r--r--so-simulator/pom.xml91
-rw-r--r--so-simulator/src/main/docker/Dockerfile24
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/AAIPropertiesImpl.java (renamed from common/src/main/java/org/onap/so/utils/TargetEntity.java)69
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/Simulator.java47
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java34
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java42
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java64
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/DefaultScenario.java34
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java38
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java53
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDeleteAudit.java52
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/NetworkCreateDeleteCloud.java48
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseStack.java35
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseVfModuleStackById.java48
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java23
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java49
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdFailure.java49
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java38
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java38
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModule.java51
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java51
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java40
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java24
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java36
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java37
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java37
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/nova/NovaKeyPairDelete.java19
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCHAPort0.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort0.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort1.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCRole1Port0.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCService1Port0.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCTrusted.java28
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsRole1Sub1.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub0.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub1.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub2.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java27
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByStackName.java27
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryRole1StackResources.java27
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryService1StackResources.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsRole1Sub0.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub0.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub1.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub2.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/AssignVFModule.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/QueryVFModule.java24
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/HealthCheck.java24
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java29
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java31
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro1.java31
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro2.java30
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro3.java30
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVNF.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ServiceInstance.java35
-rw-r--r--so-simulator/src/main/resources/META-INF/citrus-simulator-context.xml17
-rw-r--r--so-simulator/src/main/resources/META-INF/services/org.onap.so.client.RestProperties1
-rw-r--r--so-simulator/src/main/resources/application.properties28
-rw-r--r--so-simulator/src/main/resources/logback-spring.xml58
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/CreateAAIInventory.json170
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork1.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCHAPort0.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort0.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort1.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCRole1Port0.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTrustedPort.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTservice1Port0.json52
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetNovaServer.json75
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetStackResources.json206
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesKeyPairFailure.json230
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesMacro.json157
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface0.json41
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface1Resources.json70
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/SampleRequest.json1
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/StackResourcesRole1ResourceGroup.json29
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/StackResourcesservice1ResourceGroup.json79
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_Create.json11
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_Created.json17
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_Deleted.json17
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_Failure.json17
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_In_Progress.json17
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Stack_KeyPair_Failure.json44
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/Sync_Stack_Failure.json10
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0.json41
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0Resources.json72
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1.json43
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1Resources.json72
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2.json41
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2Resources.json72
-rw-r--r--so-simulator/src/main/resources/properties/aai-client.properties3
-rw-r--r--so-simulator/src/main/resources/sdnc/HealthCheck.json7
-rw-r--r--so-simulator/src/main/resources/sdnc/gr-api/AsyncRequest.xml10
-rw-r--r--so-simulator/src/main/resources/sdnc/gr-api/Network_Assign_Success.json20
-rw-r--r--so-simulator/src/main/resources/sdnc/gr-api/SDNCFailure.json8
-rw-r--r--so-simulator/src/main/resources/sdnc/gr-api/SDNCSuccess.json20
-rw-r--r--so-simulator/src/main/resources/sdnc/vnf-api/AssignResponseSuccess.xml13
-rw-r--r--so-simulator/src/main/resources/sdnc/vnf-api/NetworkAssignResponse.xml14
-rw-r--r--so-simulator/src/test/resources/citrus-context.xml23
-rw-r--r--so-simulator/src/test/resources/log4j.properties12
-rw-r--r--version.properties2
-rw-r--r--vnfm-simulator/README.md1
-rw-r--r--vnfm-simulator/packages/docker/pom.xml168
-rw-r--r--vnfm-simulator/packages/docker/src/main/docker/Dockerfile28
-rw-r--r--vnfm-simulator/packages/docker/src/main/docker/start-app.sh38
-rw-r--r--vnfm-simulator/packages/pom.xml50
-rw-r--r--vnfm-simulator/pom.xml43
-rw-r--r--vnfm-simulator/vnfm-api/pom.xml110
-rw-r--r--vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.json8143
-rw-r--r--vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.yaml8404
-rw-r--r--vnfm-simulator/vnfm-service/pom.xml171
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java53
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java46
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/constants/Constant.java39
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java171
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfInstance.java182
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfOperation.java80
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/Vnfds.java97
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java47
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/AuthorizationServerConfig.java28
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2AccessTokenAdapter.java31
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmCacheRepository.java60
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/InstantiateOperationProgressor.java123
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/OperationProgressor.java348
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SubscriptionService.java21
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SvnfmService.java169
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/TerminateOperationProgressor.java74
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java106
-rw-r--r--vnfm-simulator/vnfm-service/src/main/resources/application.yaml64
-rw-r--r--vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-adapter.crt.pem30
-rw-r--r--vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12bin4079 -> 0 bytes
-rw-r--r--vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/controllers/TestSvnfmController.java85
-rw-r--r--vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/InstantiateOperatorProgressorTest.java158
-rw-r--r--vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java104
979 files changed, 43025 insertions, 33645 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
index e821d806dd..9042095e84 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
@@ -258,7 +258,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
// The workflow completed with errors. Must try to back it out.
if (!backout) {
logger.warn("{} Deployment installation failed, backout deletion suppressed {} {}",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue(),
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue(),
"Exception in Deployment Installation, backout suppressed");
} else {
// Poll on delete if we rollback - use same values for now
@@ -278,13 +278,13 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
// Didn't uninstall successfully. Log this error
logger.error("{} Create Deployment: Cloudify error rolling back deployment install: {} {}",
MessageEnum.RA_CREATE_STACK_ERR, installWorkflow.getError(),
- ErrorCode.BusinessProcesssError.getValue());
+ ErrorCode.BusinessProcessError.getValue());
}
} catch (Exception e) {
// Catch-all for backout errors trying to uninstall/delete
// Log this error, and return the original exception
logger.error("{} Create Stack: Nested exception rolling back deployment install: {}",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue(), e);
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue(), e);
}
}
@@ -299,7 +299,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
if (!backout) {
logger.warn("{} Deployment installation failed, backout deletion suppressed {}",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue());
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue());
} else {
// Poll on delete if we rollback - use same values for now
int deletePollInterval = createPollInterval;
@@ -318,7 +318,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
// Catch-all for backout errors trying to uninstall/delete
// Log this error, and return the original exception
logger.error("{} Create Stack: Nested exception rolling back deployment install: {} ",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue(), e);
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue(), e);
}
}
@@ -350,7 +350,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
} catch (CloudifyConnectException ce) {
// Couldn't connect to Cloudify
logger.error("{} QueryDeploymentOutputs: Cloudify connection failure: {} ", MessageEnum.RA_CREATE_STACK_ERR,
- ErrorCode.BusinessProcesssError.getValue(), ce);
+ ErrorCode.BusinessProcessError.getValue(), ce);
throw new MsoIOException(ce.getMessage(), ce);
} catch (CloudifyResponseException re) {
if (re.getStatus() == 404) {
@@ -419,7 +419,11 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
logger.debug("pollTimeout remaining: " + pollTimeout);
execution = queryExecution.execute();
- status = execution.getStatus();
+ if (execution != null) {
+ status = execution.getStatus();
+ } else {
+ status = TERMINATED;
+ }
}
// Broke the loop. Check again for a terminal state
@@ -431,32 +435,32 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
// Workflow failed. Log it and return the execution object (don't throw exception here)
logger.error("{} Cloudify workflow failure: {} {} Execute Workflow: Failed: {}",
MessageEnum.RA_CREATE_STACK_ERR, execution.getError(),
- ErrorCode.BusinessProcesssError.getValue(), execution.getError());
+ ErrorCode.BusinessProcessError.getValue(), execution.getError());
return execution;
} else if (status.equals(CANCELLED)) {
// Workflow was cancelled, leaving the deployment in an indeterminate state. Log it and return the
// execution object (don't throw exception here)
logger.error("{} Cloudify workflow cancelled. Deployment is in an indeterminate state {} {} {}",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue(),
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue(),
"Execute Workflow cancelled: ", workflowId);
return execution;
} else {
// Can only get here after a timeout
logger.error("{} Cloudify workflow timeout {} Execute Workflow: Timed Out",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue());
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue());
}
} catch (CloudifyConnectException ce) {
logger.error("{} {} Execute Workflow ({} {}): Cloudify connection failure {} ",
- MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcesssError.getValue(), command, ce);
+ MessageEnum.RA_CREATE_STACK_ERR, ErrorCode.BusinessProcessError.getValue(), command, ce);
savedException = ce;
} catch (CloudifyResponseException re) {
logger.error("{} {} Execute Workflow ({}): Cloudify response error {} ", MessageEnum.RA_CREATE_STACK_ERR,
- ErrorCode.BusinessProcesssError.getValue(), command, re.getMessage(), re);
+ ErrorCode.BusinessProcessError.getValue(), command, re.getMessage(), re);
savedException = re;
} catch (RuntimeException e) {
// Catch-all
logger.error("{} {} Execute Workflow ({}): Internal error {}", MessageEnum.RA_CREATE_STACK_ERR,
- ErrorCode.BusinessProcesssError.getValue(), command, e.getMessage(), e);
+ ErrorCode.BusinessProcessError.getValue(), command, e.getMessage(), e);
savedException = e;
}
@@ -478,12 +482,14 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
boolean timedOut = false;
int cancelTimeout = timeout; // TODO: For now, just use same timeout
- String status = cancelExecution.getStatus();
-
+ String status = null;
+ if (cancelExecution != null) {
+ status = cancelExecution.getStatus();
+ }
// Poll for completion. Create a reusable cloudify query request
GetExecution queryExecution = cloudify.executions().byId(executionId);
- while (!timedOut && !status.equals(CANCELLED)) {
+ while (!timedOut && !CANCELLED.equals(status)) {
// workflow is still running; check for timeout
if (cancelTimeout <= 0) {
logger.debug("Cancel timeout for workflow {} on deployment {}", workflowId, deploymentId);
@@ -497,11 +503,13 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
logger.debug("pollTimeout remaining: {}", cancelTimeout);
execution = queryExecution.execute();
- status = execution.getStatus();
+ if (execution != null) {
+ status = execution.getStatus();
+ }
}
// Broke the loop. Check again for a terminal state
- if (status.equals(CANCELLED)) {
+ if (CANCELLED.equals(status)) {
// Finished cancelling. Return the original exception
logger.debug("Cancel workflow {} completed on deployment {}", workflowId, deploymentId);
throw new MsoCloudifyException(-1, "", "", savedException);
@@ -558,7 +566,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
Executions executions = listExecutions.execute();
// If no executions, does this give NOT_FOUND or empty set?
- if (executions.getItems().isEmpty()) {
+ if (executions == null || executions.getItems().isEmpty()) {
return new DeploymentInfoBuilder().withId(deployment.getId())
.withDeploymentInputs(deployment.getInputs()).build();
} else {
@@ -570,7 +578,7 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
} catch (CloudifyConnectException ce) {
// Couldn't connect to Cloudify
logger.error("{} QueryDeployment: Cloudify connection failure: {} ", MessageEnum.RA_CREATE_STACK_ERR,
- ErrorCode.BusinessProcesssError.getValue(), ce);
+ ErrorCode.BusinessProcessError.getValue(), ce);
throw new MsoIOException(ce.getMessage(), ce);
} catch (CloudifyResponseException re) {
if (re.getStatus() == 404) {
@@ -747,16 +755,19 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
GetBlueprint getRequest = cloudify.blueprints().getMetadataById(blueprintId);
try {
Blueprint bp = getRequest.execute();
- logger.debug("Blueprint exists: {}", bp.getId());
- return true;
+ if (bp != null) {
+ logger.debug("Blueprint exists: {}", bp.getId());
+ return true;
+ } else {
+ logger.debug("Null blueprint!");
+ return false;
+ }
} catch (CloudifyResponseException ce) {
if (ce.getStatus() == 404) {
return false;
} else {
throw ce;
}
- } catch (Exception e) {
- throw e;
}
}
@@ -795,8 +806,12 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
GetBlueprint getRequest = cloudify.blueprints().getMetadataById(blueprintId);
try {
Blueprint bp = getRequest.execute();
- logger.debug("Blueprint {} already exists.", bp.getId());
- return false;
+ if (bp != null) {
+ logger.debug("Blueprint {} already exists.", bp.getId());
+ return false;
+ } else {
+ logger.debug("Null blueprint!");
+ }
} catch (CloudifyResponseException ce) {
if (ce.getStatus() == 404) {
// This is the expected result.
@@ -804,8 +819,6 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin {
} else {
throw ce;
}
- } catch (Exception e) {
- throw e;
}
// Create a blueprint ZIP file in memory
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
index 8cacf8526a..47ba076e0e 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -132,14 +132,14 @@ public class MsoHeatEnvironmentEntry {
}
public boolean hasResources() {
- if (this.resources != null && this.resources.size() > 0) {
+ if (this.resources != null && !this.resources.isEmpty()) {
return true;
}
return false;
}
public boolean hasParameters() {
- if (this.parameters != null && this.parameters.size() > 0) {
+ if (this.parameters != null && !this.parameters.isEmpty()) {
return true;
}
return false;
@@ -147,7 +147,7 @@ public class MsoHeatEnvironmentEntry {
public boolean containsParameter(String paramName) {
boolean contains = false;
- if (this.parameters == null || this.parameters.size() < 1) {
+ if (this.parameters == null || this.parameters.isEmpty()) {
return false;
}
if (this.parameters.contains(new MsoHeatEnvironmentParameter(paramName))) {
@@ -246,22 +246,4 @@ public class MsoHeatEnvironmentEntry {
sb.append(this.rawEntry.substring(indexOf));
return sb;
}
-
- public void setHPAParameters(StringBuilder hpasb) {
- try {
- MsoYamlEditorWithEnvt yaml = new MsoYamlEditorWithEnvt(hpasb.toString().getBytes());
- Set<MsoHeatEnvironmentParameter> hpaParams = yaml.getParameterListFromEnvt();
- for (MsoHeatEnvironmentParameter hpaparam : hpaParams) {
- for (MsoHeatEnvironmentParameter param : this.parameters) {
- if (param.getName() == hpaparam.getName()) {
- param.setValue(hpaparam.getValue());
- }
- }
- }
- } catch (Exception e) {
- logger.debug("Exception:", e);
- this.errorString = e.getMessage();
- // e.printStackTrace();
- }
- }
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
index 6565db7ebc..16639d9166 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
@@ -89,6 +89,10 @@ import com.woorea.openstack.heat.model.Stacks;
@Component
public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
+ private static final String CREATE_FAILED = "CREATE_FAILED";
+
+ private static final String DELETE_FAILED = "DELETE_FAILED";
+
private static final String CREATE_COMPLETE = "CREATE_COMPLETE";
private static final String DELETE_COMPLETE = "DELETE_COMPLETE";
@@ -123,52 +127,14 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
// Properties names and variables (with default values)
protected String createPollIntervalProp = "org.onap.so.adapters.po.pollInterval";
- private String deletePollIntervalProp = "org.onap.so.adapters.po.pollInterval";
- private String deletePollTimeoutProp = "org.onap.so.adapters.po.pollTimeout";
private String pollingMultiplierProp = "org.onap.so.adapters.po.pollMultiplier";
protected static final String CREATE_POLL_INTERVAL_DEFAULT = "15";
- private static final String DELETE_POLL_INTERVAL_DEFAULT = "15";
private static final String POLLING_MULTIPLIER_DEFAULT = "60";
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
- /**
- * keep this old method signature here to maintain backwards compatibility. keep others as well. this method does
- * not include environment, files, or heatFiles
- */
- public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
- String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion, int timeoutMinutes)
- throws MsoException {
- // Just call the new method with the environment & files variable set to null
- return this.createStack(cloudSiteId, cloudOwner, tenantId, stackName, null, heatTemplate, stackInputs,
- pollForCompletion, timeoutMinutes, null, null, null, true);
- }
- // This method has environment, but not files or heatFiles
- public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
- String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion, int timeoutMinutes,
- String environment) throws MsoException {
- // Just call the new method with the files/heatFiles variables set to null
- return this.createStack(cloudSiteId, cloudOwner, tenantId, stackName, null, heatTemplate, stackInputs,
- pollForCompletion, timeoutMinutes, environment, null, null, true);
- }
-
- // This method has environment and files, but not heatFiles.
- public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
- String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion, int timeoutMinutes,
- String environment, Map<String, Object> files) throws MsoException {
- return this.createStack(cloudSiteId, cloudOwner, tenantId, stackName, null, heatTemplate, stackInputs,
- pollForCompletion, timeoutMinutes, environment, files, null, true);
- }
-
- // This method has environment, files, heatfiles
- public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
- String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion, int timeoutMinutes,
- String environment, Map<String, Object> files, Map<String, Object> heatFiles) throws MsoException {
- return this.createStack(cloudSiteId, cloudOwner, tenantId, stackName, null, heatTemplate, stackInputs,
- pollForCompletion, timeoutMinutes, environment, files, heatFiles, true);
- }
/**
* Create a new Stack in the specified cloud location and tenant. The Heat template and parameter map are passed in
@@ -208,23 +174,52 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
* @throws MsoOpenstackException Thrown if the Openstack API call returns an exception.
*/
- @SuppressWarnings("unchecked")
public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
VduModelInfo vduModel, String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion,
- int timeoutMinutes, String environment, Map<String, Object> files, Map<String, Object> heatFiles,
- boolean backout) throws MsoException {
-
+ int timeoutMinutes, String environment, Map<String, Object> nestedTemplates, Map<String, Object> heatFiles,
+ boolean backout, boolean failIfExists) throws MsoException {
stripMultiCloudInputs(stackInputs);
- CreateStackParam createStack =
- createStackParam(stackName, heatTemplate, stackInputs, timeoutMinutes, environment, files, heatFiles);
- Stack currentStack = createStack(createStack, cloudSiteId, tenantId);
- currentStack.setStackName(stackName);
- if (pollForCompletion) {
- currentStack =
+ CreateStackParam createStack = createStackParam(stackName, heatTemplate, stackInputs, timeoutMinutes,
+ environment, nestedTemplates, heatFiles);
+ Stack currentStack = queryHeatStack(stackName, cloudSiteId, tenantId);
+ if (currentStack != null) {
+ logger.debug("Existing Stack found with Status: {} ", currentStack.getStackStatus());
+ if (CREATE_COMPLETE.equals(currentStack.getStackStatus())) {
+ new StackInfoMapper(currentStack).map();
+ } else if (CREATE_IN_PROGRESS.equals(currentStack.getStackStatus())) {
+ currentStack = processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout, currentStack,
+ createStack, true);
+ } else if (CREATE_FAILED.equals(currentStack.getStackStatus())
+ || DELETE_FAILED.equals(currentStack.getStackStatus())) {
+ try {
processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout, currentStack, createStack, true);
+ } catch (MsoException e) {
+ if (e instanceof StackCreationException) {
+ logger.warn("Error during Stack will attempt to recreate stack");
+ currentStack = createStack(createStack, cloudSiteId, tenantId);
+ currentStack.setStackName(stackName);
+ if (pollForCompletion) {
+ currentStack = processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout,
+ currentStack, createStack, true);
+ } else {
+ currentStack = queryHeatStack(currentStack.getStackName() + "/" + currentStack.getId(),
+ cloudSiteId, tenantId);
+ }
+ } else {
+ throw e;
+ }
+ }
+ }
} else {
- currentStack =
- queryHeatStack(currentStack.getStackName() + "/" + currentStack.getId(), cloudSiteId, tenantId);
+ currentStack = createStack(createStack, cloudSiteId, tenantId);
+ currentStack.setStackName(stackName);
+ if (pollForCompletion) {
+ currentStack = processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout, currentStack,
+ createStack, true);
+ } else {
+ currentStack =
+ queryHeatStack(currentStack.getStackName() + "/" + currentStack.getId(), cloudSiteId, tenantId);
+ }
}
return new StackInfoMapper(currentStack).map();
}
@@ -270,7 +265,8 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
Stack heatStack, CreateStackParam stackCreate, boolean keyPairCleanUp) throws MsoException {
Stack latestStack = null;
try {
- latestStack = pollStackForStatus(timeoutMinutes, heatStack, CREATE_IN_PROGRESS, cloudSiteId, tenantId);
+ latestStack =
+ pollStackForStatus(timeoutMinutes, heatStack, CREATE_IN_PROGRESS, cloudSiteId, tenantId, false);
} catch (MsoException me) {
logger.error("Exception in Create Stack", me);
}
@@ -280,67 +276,76 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
protected Stack postProcessStackCreate(Stack stack, boolean backout, int timeoutMinutes, boolean cleanUpKeyPair,
String cloudSiteId, String tenantId, CreateStackParam stackCreate) throws MsoException {
+ boolean stackCreationFailed = false;
+ boolean stackRollbackFailed = false;
if (stack == null) {
throw new StackCreationException("Unknown Error in Stack Creation");
- }
-
- logger.info("Performing post processing backout: {} cleanUpKeyPair: {}, stack {}", backout, cleanUpKeyPair,
- stack);
- if (!CREATE_COMPLETE.equals(stack.getStackStatus())) {
- if (cleanUpKeyPair && !Strings.isNullOrEmpty(stack.getStackStatusReason())
- && isKeyPairFailure(stack.getStackStatusReason())) {
- return handleKeyPairConflict(cloudSiteId, tenantId, stackCreate, timeoutMinutes, backout, stack);
- }
- if (!backout) {
- logger.info("Status is not CREATE_COMPLETE, stack deletion suppressed");
- throw new StackCreationException("Stack rollback suppressed, stack not deleted");
- } else {
- logger.info("Status is not CREATE_COMPLETE, stack deletion will be executed");
- String errorMessage = "Stack Creation Failed Openstack Status: " + stack.getStackStatus()
- + " Status Reason: " + stack.getStackStatusReason();
- try {
- Stack deletedStack = handleUnknownCreateStackFailure(stack, timeoutMinutes, cloudSiteId, tenantId);
- errorMessage = errorMessage + " , Rollback of Stack Creation completed with status: "
- + deletedStack.getStackStatus() + " Status Reason: " + deletedStack.getStackStatusReason();
- } catch (StackRollbackException se) {
- logger.error("Sync Error Deleting Stack during rollback process", se);
- errorMessage = errorMessage + se.getMessage();
- } catch (MsoException e) {
- logger.error("Sync Error Deleting Stack during rollback", e);
-
- errorMessage =
- errorMessage + " , Rollback of Stack Creation failed with sync error: " + e.getMessage();
+ } else {
+ logger.info("Performing post processing backout: {} cleanUpKeyPair: {}, stack {}", backout, cleanUpKeyPair,
+ stack);
+ if (!CREATE_COMPLETE.equals(stack.getStackStatus())) {
+ if (cleanUpKeyPair && !Strings.isNullOrEmpty(stack.getStackStatusReason())
+ && isKeyPairFailure(stack.getStackStatusReason())) {
+ return handleKeyPairConflict(cloudSiteId, tenantId, stackCreate, timeoutMinutes, backout, stack);
+ }
+ if (!backout) {
+ logger.info("Status is not CREATE_COMPLETE, stack deletion suppressed");
+ stackCreationFailed = true;
+ throw new StackCreationException("Stack rollback suppressed, stack not deleted",
+ stackCreationFailed, stackRollbackFailed);
+ } else {
+ logger.info("Status is not CREATE_COMPLETE, stack deletion will be executed");
+ stackCreationFailed = true;
+ String errorMessage = "Stack Creation Failed Openstack Status: " + stack.getStackStatus()
+ + " Status Reason: " + stack.getStackStatusReason();
+ try {
+ Stack deletedStack =
+ handleUnknownCreateStackFailure(stack, timeoutMinutes, cloudSiteId, tenantId);
+ errorMessage = errorMessage + " , Rollback of Stack Creation completed with status: "
+ + deletedStack.getStackStatus() + " Status Reason: "
+ + deletedStack.getStackStatusReason();
+ } catch (MsoException e) {
+ stackRollbackFailed = true;
+ logger.error("Sync Error Deleting Stack during rollback", e);
+ if (e instanceof StackRollbackException) {
+ errorMessage = errorMessage + e.getMessage();
+ } else {
+ errorMessage = errorMessage + " , Rollback of Stack Creation failed with sync error: "
+ + e.getMessage();
+ }
+ }
+ throw new StackCreationException(errorMessage, stackCreationFailed, stackRollbackFailed);
}
- throw new StackCreationException(errorMessage);
+ } else {
+ return stack;
}
- } else {
- return stack;
}
-
}
protected Stack pollStackForStatus(int timeoutMinutes, Stack stack, String stackStatus, String cloudSiteId,
- String tenantId) throws MsoException {
+ String tenantId, boolean notFoundIsSuccess) throws MsoException {
int pollingFrequency =
Integer.parseInt(this.environment.getProperty(createPollIntervalProp, CREATE_POLL_INTERVAL_DEFAULT));
int pollingMultiplier =
Integer.parseInt(this.environment.getProperty(pollingMultiplierProp, POLLING_MULTIPLIER_DEFAULT));
int numberOfPollingAttempts = Math.floorDiv((timeoutMinutes * pollingMultiplier), pollingFrequency);
Heat heatClient = getHeatClient(cloudSiteId, tenantId);
- Stack latestStack = null;
while (true) {
- latestStack = queryHeatStack(heatClient, stack.getStackName() + "/" + stack.getId());
- statusHandler.updateStackStatus(latestStack);
- logger.debug("Polling: {} ({})", latestStack.getStackStatus(), latestStack.getStackName());
- if (stackStatus.equals(latestStack.getStackStatus())) {
- if (numberOfPollingAttempts <= 0) {
- logger.error("Polling of stack timed out with Status: {}", latestStack.getStackStatus());
+ Stack latestStack = queryHeatStack(heatClient, stack.getStackName() + "/" + stack.getId());
+ if (latestStack == null && notFoundIsSuccess) {
+ return null;
+ } else if (latestStack != null) {
+ statusHandler.updateStackStatus(latestStack);
+ if (stackStatus.equals(latestStack.getStackStatus())) {
+ if (numberOfPollingAttempts <= 0) {
+ logger.error("Polling of stack timed out with Status: {}", latestStack.getStackStatus());
+ return latestStack;
+ }
+ sleep(pollingFrequency * 1000L);
+ numberOfPollingAttempts -= 1;
+ } else {
return latestStack;
}
- sleep(pollingFrequency * 1000L);
- numberOfPollingAttempts -= 1;
- } else {
- return latestStack;
}
}
}
@@ -377,17 +382,26 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
protected Stack handleUnknownCreateStackFailure(Stack stack, int timeoutMinutes, String cloudSiteId,
String tenantId) throws MsoException {
if (stack != null && !Strings.isNullOrEmpty(stack.getStackName()) && !Strings.isNullOrEmpty(stack.getId())) {
- OpenStackRequest<Void> request = getHeatClient(cloudSiteId, tenantId).getStacks()
- .deleteByName(stack.getStackName() + "/" + stack.getId());
- executeAndRecordOpenstackRequest(request);
- Stack currentStack = pollStackForStatus(timeoutMinutes, stack, DELETE_IN_PROGRESS, cloudSiteId, tenantId);
- postProcessStackDelete(currentStack);
- return currentStack;
+ return deleteStack(stack, timeoutMinutes, cloudSiteId, tenantId);
} else {
throw new StackCreationException("Cannot Find Stack Name or Id");
}
}
+ private Stack deleteStack(Stack stack, int timeoutMinutes, String cloudSiteId, String tenantId)
+ throws MsoException {
+ OpenStackRequest<Void> request = getHeatClient(cloudSiteId, tenantId).getStacks()
+ .deleteByName(stack.getStackName() + "/" + stack.getId());
+ executeAndRecordOpenstackRequest(request);
+ Stack currentStack = pollStackForStatus(timeoutMinutes, stack, DELETE_IN_PROGRESS, cloudSiteId, tenantId, true);
+ if (currentStack == null) {
+ return currentStack;
+ } else {
+ postProcessStackDelete(currentStack);
+ }
+ return currentStack;
+ }
+
protected void postProcessStackDelete(Stack stack) throws MsoException {
logger.info("Performing post processing on delete stack {}", stack);
if (stack != null && !Strings.isNullOrEmpty(stack.getStackStatus())) {
@@ -449,7 +463,6 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
// Query the Stack.
// An MsoException will propagate transparently to the caller.
Stack heatStack = queryHeatStack(heatClient, stackName);
-
if (heatStack == null) {
// Stack does not exist. Return a StackInfo with status NOTFOUND
return new StackInfo(stackName, HeatStatus.NOTFOUND);
@@ -480,114 +493,16 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
* @throws MsoCloudSiteNotFound
*/
public StackInfo deleteStack(String tenantId, String cloudOwner, String cloudSiteId, String stackName,
- boolean pollForCompletion) throws MsoException {
- Heat heatClient = null;
- try {
- heatClient = getHeatClient(cloudSiteId, tenantId);
- } catch (MsoTenantNotFound e) {
- logger.debug("Tenant with id " + tenantId + "not found.", e);
- return new StackInfo(stackName, HeatStatus.NOTFOUND);
- } catch (MsoException me) {
- logger.error("{} {} Openstack Exception on Token request: ", MessageEnum.RA_CONNECTION_EXCEPTION,
- ErrorCode.AvailabilityError.getValue(), me);
- me.addContext(DELETE_STACK);
- throw me;
- }
-
- // OK if stack not found, perform a query first
- Stack heatStack = queryHeatStack(heatClient, stackName);
- if (heatStack == null || DELETE_COMPLETE.equals(heatStack.getStackStatus())) {
- // Not found. Return a StackInfo with status NOTFOUND
- return new StackInfo(stackName, HeatStatus.NOTFOUND);
- }
-
- // Use canonical name "<stack name>/<stack-id>" to delete.
- // Otherwise, deletion by name returns a 302 redirect.
- // NOTE: This is specific to the v1 Orchestration API.
- String canonicalName = heatStack.getStackName() + "/" + heatStack.getId();
-
- try {
- OpenStackRequest<Void> request = null;
- if (null != heatClient) {
- request = heatClient.getStacks().deleteByName(canonicalName);
- } else {
- logger.debug("Heat Client is NULL");
- }
- executeAndRecordOpenstackRequest(request);
- } catch (OpenStackResponseException e) {
- if (e.getStatus() == 404) {
- // Not found. We are OK with this. Return a StackInfo with status NOTFOUND
- return new StackInfo(stackName, HeatStatus.NOTFOUND);
- } else {
- // Convert the OpenStackResponseException to an MsoOpenstackException
- throw heatExceptionToMsoException(e, DELETE_STACK);
- }
- } catch (OpenStackConnectException e) {
- // Error connecting to Openstack instance. Convert to an MsoException
- throw heatExceptionToMsoException(e, DELETE_STACK);
- } catch (RuntimeException e) {
- // Catch-all
- throw runtimeExceptionToMsoException(e, DELETE_STACK);
- }
-
- // Requery the stack for current status.
- // It will probably still exist with "DELETE_IN_PROGRESS" status.
- heatStack = queryHeatStack(heatClient, canonicalName);
- statusHandler.updateStackStatus(heatStack);
- if (pollForCompletion) {
- int pollInterval = Integer
- .parseInt(this.environment.getProperty(deletePollIntervalProp, "" + DELETE_POLL_INTERVAL_DEFAULT));
- int pollTimeout = Integer
- .parseInt(this.environment.getProperty(deletePollTimeoutProp, "" + DELETE_POLL_INTERVAL_DEFAULT));
- statusHandler.updateStackStatus(heatStack);
- // When querying by canonical name, Openstack returns DELETE_COMPLETE status
- // instead of "404" (which would result from query by stack name).
- while (heatStack != null && !DELETE_COMPLETE.equals(heatStack.getStackStatus())) {
- logger.debug("Stack status: {}", heatStack.getStackStatus());
-
- if ("DELETE_FAILED".equals(heatStack.getStackStatus())) {
- // Throw a 'special case' of MsoOpenstackException to report the Heat status
- String error = "Stack delete error (" + heatStack.getStackStatus() + "): "
- + heatStack.getStackStatusReason();
- MsoOpenstackException me = new MsoOpenstackException(0, "", error);
- me.addContext(DELETE_STACK);
-
- // Alarm this condition, stack deletion failed
-
-
- throw me;
- }
-
- if (pollTimeout <= 0) {
- logger.error("{} Cloud site: {} Tenant: {} Stack: {} Stack status: {} {} Delete Stack Timeout",
- MessageEnum.RA_DELETE_STACK_TIMEOUT, cloudSiteId, tenantId, stackName,
- heatStack.getStackStatus(), ErrorCode.AvailabilityError.getValue());
-
- // Throw a 'special case' of MsoOpenstackException to report the Heat status
- MsoOpenstackException me = new MsoOpenstackException(0, "", "Stack Deletion Timeout");
- me.addContext(DELETE_STACK);
-
- // Alarm this condition, stack deletion failed
-
-
- throw me;
- }
-
- sleep(pollInterval * 1000L);
-
- pollTimeout -= pollInterval;
- logger.debug("pollTimeout remaining: {}", pollTimeout);
-
- heatStack = queryHeatStack(heatClient, canonicalName);
- }
-
- // The stack is gone when this point is reached
+ boolean pollForCompletion, int timeoutMinutes) throws MsoException {
+ Stack currentStack = queryHeatStack(stackName, cloudSiteId, tenantId);
+ if (currentStack == null || DELETE_COMPLETE.equals(currentStack.getStackStatus())) {
return new StackInfo(stackName, HeatStatus.NOTFOUND);
+ } else {
+ currentStack = deleteStack(currentStack, timeoutMinutes, cloudSiteId, tenantId);
+ StackInfo stackInfo = new StackInfoMapper(currentStack).map();
+ stackInfo.setName(stackName);
+ return stackInfo;
}
- // Return the current status (if not polling, the delete may still be in progress)
- StackInfo stackInfo = new StackInfoMapper(heatStack).map();
- stackInfo.setName(stackName);
- return stackInfo;
}
/**
@@ -730,7 +645,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
if (!inputs.containsKey(key)) {
Object obj = otherStackOutputs.get(key);
if (obj instanceof String) {
- inputs.put(key, (String) otherStackOutputs.get(key));
+ inputs.put(key, otherStackOutputs.get(key));
} else if (obj instanceof JsonNode) {
// This is a bit of mess - but I think it's the least impacting
// let's convert it BACK to a string - then it will get converted back later
@@ -929,7 +844,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
* Boolean if any of the conversions should fail, we will default to adding it to the inputs as a string - see if
* Openstack can handle it. Also, will remove any params that are extra. Any aliases will be converted to their
* appropriate name (anyone use this feature?)
- *
+ *
* @param inputs - the Map<String, String> of the inputs received on the request
* @param template the HeatTemplate object - this is so we can also verify if the param is valid for this template
* @return HashMap<String, Object> of the inputs, cleaned and converted
@@ -1111,11 +1026,11 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
}
try {
- StackInfo stackInfo =
- createStack(cloudSiteId, cloudOwner, tenantId, instanceName, vduModel, heatTemplate, inputs, true, // poll
- // for
- // completion
- vduModel.getTimeoutMinutes(), heatEnvironment, nestedTemplates, files, rollbackOnFailure);
+ StackInfo stackInfo = createStack(cloudSiteId, cloudOwner, tenantId, instanceName, vduModel, heatTemplate,
+ inputs, true, // poll
+ // for
+ // completion
+ vduModel.getTimeoutMinutes(), heatEnvironment, nestedTemplates, files, rollbackOnFailure, false);
// Populate a vduInstance from the StackInfo
return stackInfoToVduInstance(stackInfo);
@@ -1156,7 +1071,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
try {
// Delete the Heat stack
- StackInfo stackInfo = deleteStack(tenantId, cloudOwner, cloudSiteId, instanceId, true);
+ StackInfo stackInfo = deleteStack(tenantId, cloudOwner, cloudSiteId, instanceId, true, timeoutMinutes);
// Populate a VduInstance based on the deleted Cloudify Deployment object
VduInstance vduInstance = stackInfoToVduInstance(stackInfo);
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
index 49ba336e3f..ca0180ae4b 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
@@ -22,10 +22,6 @@
package org.onap.so.openstack.utils;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.woorea.openstack.heat.model.CreateStackParam;
-import com.woorea.openstack.heat.model.Stack;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
@@ -52,17 +48,20 @@ import org.onap.so.logger.MessageEnum;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.StackInfo;
import org.onap.so.openstack.exceptions.MsoAdapterException;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.exceptions.MsoOpenstackException;
import org.onap.so.openstack.mappers.StackInfoMapper;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableSet;
+import com.woorea.openstack.heat.model.CreateStackParam;
+import com.woorea.openstack.heat.model.Stack;
@Component
public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
@@ -136,7 +135,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
public StackInfo createStack(String cloudSiteId, String cloudOwner, String tenantId, String stackName,
VduModelInfo vduModel, String heatTemplate, Map<String, ?> stackInputs, boolean pollForCompletion,
int timeoutMinutes, String environment, Map<String, Object> files, Map<String, Object> heatFiles,
- boolean backout) throws MsoException {
+ boolean backout, boolean failIfExists) throws MsoException {
logger.trace("Started MsoMulticloudUtils.createStack");
@@ -299,7 +298,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
responseBody = getQueryBody((java.io.InputStream) response.getEntity());
if (responseBody != null) {
if (logger.isDebugEnabled()) {
- logger.debug("Multicloud Create Response Body: " + responseBody.toString());
+ logger.debug("Multicloud Create Response Body: {}", responseBody);
}
Stack workloadStack = getWorkloadStack(responseBody.getWorkloadStatusReason());
if (workloadStack != null && !responseBody.getWorkloadStatus().equals("GET_FAILED")
@@ -354,7 +353,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
}
}
if (workloadStack != null)
- logger.debug("Multicloud getWorkloadStack() returning Stack Object: {} ", workloadStack.toString());
+ logger.debug("Multicloud getWorkloadStack() returning Stack Object: {} ", workloadStack);
return workloadStack;
}
@@ -457,8 +456,8 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
Response response = multicloudClient.post(multicloudRequest);
if (response.getStatus() != Response.Status.ACCEPTED.getStatusCode()) {
if (logger.isDebugEnabled())
- logger.debug(
- "Multicloud AAI update request failed: " + response.getStatus() + response.getStatusInfo());
+ logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
+ response.getStatusInfo());
return;
}
@@ -470,14 +469,14 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
Integer.parseInt(this.environment.getProperty(createPollIntervalProp, CREATE_POLL_INTERVAL_DEFAULT));
int pollTimeout = (timeoutMinutes * 60) + updatePollInterval;
boolean updateTimedOut = false;
- logger.debug("updatePollInterval=" + updatePollInterval + ", pollTimeout=" + pollTimeout);
+ logger.debug("updatePollInterval={}, pollTimeout={}", updatePollInterval, pollTimeout);
StackInfo stackInfo = null;
while (true) {
try {
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, workloadId);
if (logger.isDebugEnabled())
- logger.debug(stackInfo.getStatus() + " (" + workloadId + ")");
+ logger.debug("{} ({})", stackInfo.getStatus(), workloadId);
if (HeatStatus.UPDATING.equals(stackInfo.getStatus())) {
if (pollTimeout <= 0) {
@@ -494,7 +493,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
pollTimeout -= updatePollInterval;
if (logger.isDebugEnabled())
- logger.debug("pollTimeout remaining: " + pollTimeout);
+ logger.debug("pollTimeout remaining: {}", pollTimeout);
} else {
break;
}
@@ -508,15 +507,14 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
if (updateTimedOut) {
if (logger.isDebugEnabled())
logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ response.getStatusInfo());
} else if (!HeatStatus.UPDATED.equals(stackInfo.getStatus())) {
if (logger.isDebugEnabled())
logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ response.getStatusInfo());
} else {
if (logger.isDebugEnabled())
- logger.debug("Multicloud AAI update successful: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ logger.debug("Multicloud AAI update successful: {} {}", response.getStatus(), response.getStatusInfo());
}
}
@@ -527,7 +525,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
private StackInfo getStackStatus(String cloudSiteId, String cloudOwner, String tenantId, String instanceId,
boolean pollForCompletion, int timeoutMinutes, boolean backout) throws MsoException {
- StackInfo stackInfo = new StackInfo();
+ StackInfo stackInfo;
// If client has requested a final response, poll for stack completion
if (pollForCompletion) {
@@ -543,12 +541,12 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
int deletePollTimeout = pollTimeout;
boolean createTimedOut = false;
StringBuilder stackErrorStatusReason = new StringBuilder("");
- logger.debug("createPollInterval=" + createPollInterval + ", pollTimeout=" + pollTimeout);
+ logger.debug("createPollInterval={}, pollTimeout={} ", createPollInterval, pollTimeout);
while (true) {
try {
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug(stackInfo.getStatus() + " (" + instanceId + ")");
+ logger.debug("{} ({})", stackInfo.getStatus(), instanceId);
if (HeatStatus.BUILDING.equals(stackInfo.getStatus())) {
// Stack creation is still running.
@@ -567,7 +565,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
sleep(createPollInterval * 1000L);
pollTimeout -= createPollInterval;
- logger.debug("pollTimeout remaining: " + pollTimeout);
+ logger.debug("pollTimeout remaining: {}", pollTimeout);
} else {
// save off the status & reason msg before we attempt delete
stackErrorStatusReason
@@ -580,7 +578,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
if (!backout) {
logger.warn(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack error, stack deletion suppressed", "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Exception in Create Stack, stack deletion suppressed"));
} else {
try {
@@ -596,7 +594,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
while (!deleted) {
try {
StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
+ logger.debug("Deleting {}, status: {}", instanceId, queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
logger.error(String.format("%s %s %s %s %s %s %s %s %d %s",
@@ -610,7 +608,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
deletePollTimeout -= deletePollInterval;
}
} else if (HeatStatus.NOTFOUND.equals(queryInfo.getStatus())) {
- logger.debug("DELETE_COMPLETE for " + instanceId);
+ logger.debug("DELETE_COMPLETE for {}", instanceId);
deleted = true;
continue;
} else {
@@ -623,7 +621,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
logger.error(String.format("%s %s %s %s %d %s",
MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack: Nested exception rolling back stack: " + e3, "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create Stack: Nested exception rolling back stack on error on query"));
}
}
@@ -631,7 +629,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
// Just log this one. We will report the original exception.
logger.error(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack: Nested exception rolling back stack: " + e2, "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create Stack: Nested exception rolling back stack"));
}
}
@@ -646,13 +644,13 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
logger.error(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack error: Polling complete with non-success status: " + stackInfo.getStatus() + ", "
+ stackInfo.getStatusMessage(),
- "", "", ErrorCode.BusinessProcesssError.getValue(), "Create Stack error"));
+ "", "", ErrorCode.BusinessProcessError.getValue(), "Create Stack error"));
// Rollback the stack creation, since it is in an indeterminate state.
if (!backout) {
logger.warn(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack errored, stack deletion suppressed", "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create Stack error, stack deletion suppressed"));
} else {
try {
@@ -664,7 +662,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
while (!deleted) {
try {
StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
+ logger.debug("Deleting {}, status: {}", instanceId, queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
logger.error(String.format("%s %s %s %s %s %s %s %s %d %s",
@@ -678,7 +676,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
deletePollTimeout -= deletePollInterval;
}
} else if (HeatStatus.NOTFOUND.equals(queryInfo.getStatus())) {
- logger.debug("DELETE_COMPLETE for " + instanceId);
+ logger.debug("DELETE_COMPLETE for {}", instanceId);
deleted = true;
continue;
} else {
@@ -687,7 +685,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
logger.warn(String.format("%s %s %s %s %d %s",
MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack errored, stack deletion FAILED", "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create Stack error, stack deletion FAILED"));
logger.debug("Stack deletion FAILED on a rollback of a create - " + instanceId
+ ", status=" + queryInfo.getStatus() + ", reason="
@@ -701,7 +699,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
logger.warn(String.format("%s %s %s %s %d %s",
MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack errored, then stack deletion FAILED - exception thrown", "", "",
- ErrorCode.BusinessProcesssError.getValue(), me2.getContextMessage()));
+ ErrorCode.BusinessProcessError.getValue(), me2.getContextMessage()));
}
}
StringBuilder errorContextMessage;
@@ -719,7 +717,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
// shouldn't happen - but handle
logger.error(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
"Create Stack: Nested exception rolling back stack: " + e2, "", "",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Exception in Create Stack: rolling back stack"));
}
}
@@ -730,7 +728,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
} else {
// Get initial status, since it will have been null after the create.
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Multicloud stack query status is: " + stackInfo.getStatus());
+ logger.debug("Multicloud stack query status is: {}", stackInfo.getStatus());
}
return stackInfo;
}
@@ -769,7 +767,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
try {
return new ObjectMapper().readerFor(MulticloudCreateResponse.class).readValue(body);
} catch (Exception e) {
- logger.debug("Exception retrieving multicloud vfModule POST response body " + e);
+ logger.debug("Exception retrieving multicloud vfModule POST response body ", e);
}
return null;
}
@@ -786,7 +784,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
try {
return new ObjectMapper().readerFor(MulticloudQueryResponse.class).readValue(body);
} catch (Exception e) {
- logger.debug("Exception retrieving multicloud workload query response body " + e);
+ logger.debug("Exception retrieving multicloud workload query response body ", e);
}
return null;
}
@@ -823,19 +821,16 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
private RestClient getMulticloudClient(String endpoint, String tenantId) {
HttpClient client = null;
try {
- client = httpClientFactory.newJsonClient(new URL(endpoint), TargetEntity.MULTICLOUD);
+ client = httpClientFactory.newJsonClient(new URL(endpoint), ONAPComponents.MULTICLOUD);
if (tenantId != null && !tenantId.isEmpty()) {
client.addAdditionalHeader("Project", tenantId);
}
} catch (MalformedURLException e) {
- logger.debug(
- String.format("Encountered malformed URL error getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered malformed URL error getting multicloud rest client ", e);
} catch (IllegalArgumentException e) {
- logger.debug(
- String.format("Encountered illegal argument getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered illegal argument getting multicloud rest client ", e);
} catch (UriBuilderException e) {
- logger.debug(
- String.format("Encountered URI builder error getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered URI builder error getting multicloud rest client ", e);
}
return client;
}
@@ -845,7 +840,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
return JSON_MAPPER.readTree(directives);
} catch (Exception e) {
logger.error(String.format("%s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_ERR.toString(),
- "Create Stack: " + e, "", "", ErrorCode.BusinessProcesssError.getValue(),
+ "Create Stack: " + e, "", "", ErrorCode.BusinessProcessError.getValue(),
"Exception in Create Stack: Invalid JSON format of directives" + directives));
MsoException me = new MsoAdapterException("Invalid JSON format of directives parameter: " + directives);
me.addContext(CREATE_STACK);
@@ -886,11 +881,11 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
}
try {
- StackInfo stackInfo =
- createStack(cloudSiteId, cloudOwner, tenantId, instanceName, vduModel, heatTemplate, inputs, true, // poll
- // for
- // completion
- vduModel.getTimeoutMinutes(), heatEnvironment, nestedTemplates, files, rollbackOnFailure);
+ StackInfo stackInfo = createStack(cloudSiteId, cloudOwner, tenantId, instanceName, vduModel, heatTemplate,
+ inputs, true, // poll
+ // for
+ // completion
+ vduModel.getTimeoutMinutes(), heatEnvironment, nestedTemplates, files, rollbackOnFailure, false);
// Populate a vduInstance from the StackInfo
return stackInfoToVduInstance(stackInfo);
} catch (Exception e) {
@@ -962,6 +957,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
/*
* Convert the local DeploymentInfo object (Cloudify-specific) to a generic VduInstance object
*/
+ @Override
protected VduInstance stackInfoToVduInstance(StackInfo stackInfo) {
VduInstance vduInstance = new VduInstance();
@@ -989,7 +985,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
// There are lots of HeatStatus values, so this is a bit long...
HeatStatus heatStatus = stackInfo.getStatus();
String statusMessage = stackInfo.getStatusMessage();
- logger.debug("HeatStatus = " + heatStatus + " msg = " + statusMessage);
+ logger.debug("HeatStatus = {} msg = {}", heatStatus, statusMessage);
if (logger.isDebugEnabled()) {
logger.debug(String.format("Stack Status: %s", heatStatus.toString()));
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
index 069c6c7c5b..44fc620b07 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
@@ -130,13 +130,13 @@ public class MsoNeutronUtils extends MsoCommonUtils {
network.setAdminStateUp(true);
if (type == NetworkType.PROVIDER) {
- if (provider != null && vlans != null && vlans.size() > 0) {
+ if (provider != null && vlans != null && !vlans.isEmpty()) {
network.setProviderPhysicalNetwork(provider);
network.setProviderNetworkType("vlan");
network.setProviderSegmentationId(vlans.get(0));
}
} else if (type == NetworkType.MULTI_PROVIDER) {
- if (provider != null && vlans != null && vlans.size() > 0) {
+ if (provider != null && vlans != null && !vlans.isEmpty()) {
List<Segment> segments = new ArrayList<>(vlans.size());
for (int vlan : vlans) {
Segment segment = new Segment();
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
index ad37b39f30..c575304ade 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
@@ -40,7 +40,7 @@ public class MulticloudQueryResponse implements Serializable {
@JsonProperty("workload_status")
private String workloadStatus;
@JsonProperty("workload_status_reason")
- private JsonNode workloadStatusReason;
+ private transient JsonNode workloadStatusReason;
@JsonCreator
public MulticloudQueryResponse(@JsonProperty("template_type") String templateType,
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackCreationException.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackCreationException.java
index e3936e31f7..ab9c8a6dee 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackCreationException.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackCreationException.java
@@ -24,8 +24,22 @@ import org.onap.so.openstack.exceptions.MsoException;
public class StackCreationException extends MsoException {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6221508301589330950L;
+
+ boolean stackCreationFailed = false;
+ boolean stackRollbackFailed = false;
+
public StackCreationException(String error) {
super(error);
}
+ public StackCreationException(String error, boolean stackCreationFailed, boolean stackRollbackFailed) {
+ super(error);
+ this.stackRollbackFailed = stackRollbackFailed;
+ this.stackCreationFailed = stackCreationFailed;
+ }
+
}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsITTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsITTest.java
index 7e783aa7a4..86b1413291 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsITTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsITTest.java
@@ -133,7 +133,7 @@ public class MsoHeatUtilsITTest extends BaseTest {
@Test
public void deleteVduTest() throws Exception {
VduInstance expected = new VduInstance();
- expected.setVduInstanceId("instanceId");
+ expected.setVduInstanceId("name/stackId");
expected.setVduInstanceName("instanceId");
VduStatus status = new VduStatus();
status.setState(VduStateType.DELETED);
@@ -209,8 +209,8 @@ public class MsoHeatUtilsITTest extends BaseTest {
StubOpenStack.mockOpenStackResponseAccess(wireMockServer, wireMockPort);
StubOpenStack.mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack_Created.json");
StubOpenStack.mockOpenStackGet(wireMockServer, "TEST-stack/stackId");
- StackInfo stackInfo = heatUtils.createStack(cloudSite.getId(), "CloudOwner", "tenantId", "TEST-stack",
- "TEST-heat", new HashMap<>(), false, 1, "TEST-env", new HashMap<>(), new HashMap<>());
+ StackInfo stackInfo = heatUtils.createStack(cloudSite.getId(), "CloudOwner", "tenantId", "TEST-stack", null,
+ "TEST-heat", new HashMap<>(), false, 1, "TEST-env", new HashMap<>(), new HashMap<>(), false, false);
assertNotNull(stackInfo);
}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
index e68364eab8..92cf96ed16 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
@@ -124,7 +124,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
latestStack.setStackStatusReason("Stack Finished");
doReturn(latestStack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id"));
doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId);
- Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false);
Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(latestStack);
Mockito.verify(heatUtils, times(1)).queryHeatStack(isA(Heat.class), eq("stackName/id"));
assertEquals(true, actual != null);
@@ -141,7 +141,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
doNothing().when(stackStatusHandler).updateStackStatus(stack);
doReturn(stack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id"));
doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId);
- Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false);
Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(stack);
Mockito.verify(heatUtils, times(1)).queryHeatStack(isA(Heat.class), eq("stackName/id"));
assertEquals(true, actual != null);
@@ -259,11 +259,12 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
doReturn(stackResource).when(heatClient).getStacks();
doReturn(mockDeleteStack).when(stackResource).deleteByName("stackName/id");
doReturn(deletedStack).when(heatUtils).pollStackForStatus(120, stack, "DELETE_IN_PROGRESS", cloudSiteId,
- tenantId);
+ tenantId, true);
heatUtils.handleUnknownCreateStackFailure(stack, 120, cloudSiteId, tenantId);
Mockito.verify(heatUtils, times(1)).executeAndRecordOpenstackRequest(mockDeleteStack);
- Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "DELETE_IN_PROGRESS", cloudSiteId, tenantId);
+ Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "DELETE_IN_PROGRESS", cloudSiteId, tenantId,
+ true);
Mockito.verify(heatUtils, times(1)).postProcessStackDelete(deletedStack);
}
@@ -357,12 +358,13 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
createStackParam.setStackName("stackName");
doReturn(createdStack).when(heatUtils).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId,
- tenantId);
+ tenantId, false);
doReturn(createdStack).when(heatUtils).postProcessStackCreate(createdStack, true, 120, true, cloudSiteId,
tenantId, createStackParam);
heatUtils.processCreateStack(cloudSiteId, tenantId, 120, true, stack, createStackParam, true);
- Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId,
+ false);
Mockito.verify(heatUtils, times(1)).postProcessStackCreate(createdStack, true, 120, true, cloudSiteId, tenantId,
createStackParam);
}
@@ -387,11 +389,12 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
createStackParam.setStackName("stackName");
doThrow(new StackCreationException("Error")).when(heatUtils).pollStackForStatus(120, stack,
- "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false);
exceptionRule.expect(MsoException.class);
exceptionRule.expectMessage("Error");
heatUtils.processCreateStack(cloudSiteId, tenantId, 120, true, stack, createStackParam, true);
- Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId,
+ false);
Mockito.verify(heatUtils, times(1)).postProcessStackCreate(stack, true, 120, true, cloudSiteId, tenantId,
createStackParam);
}
@@ -527,12 +530,13 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
createStackParam.setStackName("stackName");
doThrow(new StackCreationException("Error")).when(heatUtils).pollStackForStatus(120, stack,
- "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false);
exceptionRule.expect(MsoException.class);
exceptionRule.expectMessage("Error");
heatUtils.processCreateStack(cloudSiteId, tenantId, 120, false, stack, createStackParam, true);
- Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId);
+ Mockito.verify(heatUtils, times(1)).pollStackForStatus(120, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId,
+ false);
Mockito.verify(heatUtils, times(0)).handleUnknownCreateStackFailure(stack, 120, cloudSiteId, tenantId);
}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
index 995db522e9..44a9bc3e10 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoMulticloudUtilsTest.java
@@ -24,8 +24,8 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -95,9 +95,9 @@ public class MsoMulticloudUtilsTest extends BaseTest {
wireMockServer.stubFor(get(urlEqualTo(MULTICLOUD_GET_PATH)).inScenario("CREATE").whenScenarioStateIs("UPDATING")
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("MulticloudGetUpdateResponse.json").withStatus(HttpStatus.SC_OK)));
- StackInfo result =
- multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
- "TEST-heat", new HashMap<>(), true, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false);
+ StackInfo result = multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack",
+ new VduModelInfo(), "TEST-heat", new HashMap<>(), true, 200, "TEST-env", new HashMap<>(),
+ new HashMap<>(), false, false);
wireMockServer.resetScenarios();
assertNotNull(result);
assertEquals("TEST-stack", result.getName());
@@ -155,7 +155,8 @@ public class MsoMulticloudUtilsTest extends BaseTest {
cloudSite.setIdentityService(new CloudIdentity());
when(cloudConfigMock.getCloudSite("MTN13")).thenReturn(Optional.of(cloudSite));
multicloudUtilsMock.createStack("MNT14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
- "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false);
+ "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false,
+ false);
} catch (MsoException e) {
assertEquals("0 : Multicloud client could not be initialized", e.toString());
return;
@@ -169,7 +170,8 @@ public class MsoMulticloudUtilsTest extends BaseTest {
wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH)).willReturn(
aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_BAD_REQUEST)));
multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
- "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false);
+ "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false,
+ false);
} catch (MsoException e) {
assertEquals("0 : Bad Request", e.toString());
return;
@@ -181,9 +183,9 @@ public class MsoMulticloudUtilsTest extends BaseTest {
public void createStackEmptyResponseEntity() throws MsoException {
wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH)).willReturn(
aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_CREATED)));
- StackInfo result =
- multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack", new VduModelInfo(),
- "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(), new HashMap<>(), false);
+ StackInfo result = multicloudUtils.createStack("MTN14", "CloudOwner", "TEST-tenant", "TEST-stack",
+ new VduModelInfo(), "TEST-heat", new HashMap<>(), false, 200, "TEST-env", new HashMap<>(),
+ new HashMap<>(), false, false);
assertNotNull(result);
assertEquals("TEST-stack/", result.getName());
}
diff --git a/adapters/mso-adapter-utils/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json b/adapters/mso-adapter-utils/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
index a26a551f7d..ea05b64e08 100644
--- a/adapters/mso-adapter-utils/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
+++ b/adapters/mso-adapter-utils/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
@@ -3,7 +3,7 @@
"description": null,
"links": null,
"stack_status_reason": null,
- "stack_name": null,
+ "stack_name": "name",
"updated_time": null,
"creation_time": null,
"stack_status": "DELETE_COMPLETE",
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java
index 6a979d754b..7e10bb3801 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
@XmlRootElement(name = "deleteVfModuleRequest")
public class DeleteVfModuleRequest extends VfRequestCommon implements Serializable {
/**
- *
+ *
*/
private static final long serialVersionUID = -8504083539107392561L;
private String cloudSiteId;
@@ -39,6 +39,7 @@ public class DeleteVfModuleRequest extends VfRequestCommon implements Serializab
private String vnfId;
private String vfModuleId;
private String vfModuleStackId;
+ private String modelCustomizationUuid;
private MsoRequest msoRequest = new MsoRequest();
@@ -94,6 +95,14 @@ public class DeleteVfModuleRequest extends VfRequestCommon implements Serializab
this.vfModuleStackId = vfModuleStackId;
}
+ public String getModelCustomizationUuid() {
+ return modelCustomizationUuid;
+ }
+
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+
public MsoRequest getMsoRequest() {
return msoRequest;
}
diff --git a/adapters/mso-catalog-db-adapter/pom.xml b/adapters/mso-catalog-db-adapter/pom.xml
index 9ec98cf96c..9745935925 100644
--- a/adapters/mso-catalog-db-adapter/pom.xml
+++ b/adapters/mso-catalog-db-adapter/pom.xml
@@ -14,6 +14,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
+ <swagger.version>2.0.8</swagger.version>
</properties>
<build>
<plugins>
@@ -84,40 +85,6 @@
</plugins>
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.jvnet.jax-ws-commons
- </groupId>
- <artifactId>
- jaxws-maven-plugin
- </artifactId>
- <versionRange>
- [2.3,)
- </versionRange>
- <goals>
- <goal>wsgen</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore>
- </ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
-
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
@@ -143,10 +110,22 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <version>2.9.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
<dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- <version>1.5.16</version>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-jaxrs2</artifactId>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
index 354c3d07f7..691ae60afd 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
@@ -128,8 +128,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv
private void migrateCloudIdentity(Collection<CloudIdentity> entities, Connection connection) throws SQLException {
logger.debug("Starting migration for CloudConfig-->IdentityService");
String insert =
- "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) "
- + "VALUES (?,?,?,?,?,?,?,?,?,?);";
+ "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `PROJECT_DOMAIN_NAME`, `USER_DOMAIN_NAME`) "
+ + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?);";
try (Statement stmt = connection.createStatement();
PreparedStatement ps = connection.prepareStatement(insert)) {
@@ -157,6 +157,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv
? cloudIdentity.getIdentityAuthenticationType().name()
: null);
ps.setString(10, FLYWAY);
+ ps.setString(11, cloudIdentity.getProjectDomainName());
+ ps.setString(12, cloudIdentity.getUserDomainName());
ps.executeUpdate();
}
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java
index aa19aed515..1ad4238ade 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java
@@ -28,7 +28,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client",
"org.onap.so.logging.jaxrs.filter", "org.onap.so.logging.spring.interceptor", "org.onap.so.client",
- "org.onap.so.configuration", "org.onap.so.db"})
+ "org.onap.so.configuration", "org.onap.so.db", "org.onap.logging.filter",
+ "org.onap.so.logger, org.onap.so.security"})
@EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
@EntityScan("org.onap.so.db.catalog.beans")
@EnableScheduling
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java
index 79aad1ad1a..359c8cd46e 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java
@@ -20,16 +20,25 @@
package org.onap.so.adapters.catalogdb;
+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.logging.filter.base.Constants;
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.adapters.catalogdb.rest.CatalogDbAdapterRest;
import org.onap.so.adapters.catalogdb.rest.ServiceRestImpl;
-import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.adapters.catalogdb.rest.VnfRestImpl;
+import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
import org.springframework.context.annotation.Configuration;
-import io.swagger.jaxrs.config.BeanConfig;
-import io.swagger.jaxrs.listing.ApiListingResource;
-import io.swagger.jaxrs.listing.SwaggerSerializers;
+import io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder;
+import io.swagger.v3.jaxrs2.integration.resources.AcceptHeaderOpenApiResource;
+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("/ecomp/mso/catalog")
@@ -37,18 +46,27 @@ public class JerseyConfiguration extends ResourceConfig {
@PostConstruct
public void setUp() {
+ System.setProperty(Constants.Property.PARTNER_NAME, ONAPComponents.CATALOG_DB.toString());
register(CatalogDbAdapterRest.class);
- register(ApiListingResource.class);
- register(SwaggerSerializers.class);
- register(JaxRsFilterLogging.class);
+ register(SOAuditLogContainerFilter.class);
+ register(OpenApiResource.class);
+ register(AcceptHeaderOpenApiResource.class);
register(ServiceRestImpl.class);
- BeanConfig beanConfig = new BeanConfig();
- beanConfig.setVersion("1.0.2");
- beanConfig.setSchemes(new String[] {"https"});
- beanConfig.setBasePath("/ecomp/mso/catalog");
- beanConfig.setResourcePackage("org.onap.so.adapters.catalogdb.rest");
- beanConfig.setPrettyPrint(true);
- beanConfig.setScan(true);
+ register(VnfRestImpl.class);
+
+ OpenAPI oas = new OpenAPI();
+ Info info = new Info();
+ info.title("Swagger catalog-db-adapter bootstrap code");
+ info.setVersion("1.0.2");
+
+ SwaggerConfiguration oasConfig = new SwaggerConfiguration().openAPI(oas).prettyPrint(true)
+ .resourcePackages(Stream.of("org.onap.so.adapters.catalogdb.rest").collect(Collectors.toSet()));
+
+ try {
+ new JaxrsOpenApiContextBuilder().application(this).openApiConfiguration(oasConfig).buildContext(true);
+ } catch (OpenApiConfigurationException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
}
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java
index 4dabb58f7d..cd3b2a377b 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java
@@ -21,22 +21,32 @@
package org.onap.so.adapters.catalogdb;
-import org.onap.so.logging.spring.interceptor.LoggingInterceptor;
+import org.onap.logging.filter.spring.LoggingInterceptor;
+import org.onap.logging.filter.spring.StatusLoggingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.handler.MappedInterceptor;
@Configuration
+@ComponentScan(basePackages = {"org.onap.logging.filter"})
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Autowired
- LoggingInterceptor loggingInterceptor;
+ private LoggingInterceptor loggingInterceptor;
+
+ @Autowired
+ private StatusLoggingInterceptor statusLoggingInterceptor;
@Bean
public MappedInterceptor mappedLoggingInterceptor() {
return new MappedInterceptor(new String[] {"/**"}, loggingInterceptor);
}
+ @Bean
+ public MappedInterceptor mappedStatusLoggingInterceptor() {
+ return new MappedInterceptor(new String[] {"/**"}, statusLoggingInterceptor);
+ }
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java
deleted file mode 100644
index 1d58975e6b..0000000000
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.catalogdb;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java
index edec48dc95..a98778bf5d 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogQuery.java
@@ -21,6 +21,7 @@
package org.onap.so.adapters.catalogdb.catalogrest;
+import java.io.IOException;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -95,4 +96,17 @@ public abstract class CatalogQuery {
return smartToJSON();
}
+
+ protected boolean isJSONValid(String jsonInString) {
+ try {
+ if (jsonInString == null) {
+ return false;
+ }
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.readValue(jsonInString, String.class);
+ return true;
+ } catch (IOException e) {
+ return false;
+ }
+ }
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
index c1acc319f7..afcb2d5761 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
@@ -123,7 +123,10 @@ public class QueryAllottedResourceCustomization extends CatalogQuery {
put(valueMap, "PROVIDING_SERVICE_MODEL_INVARIANT_UUID", o.getProvidingServiceModelInvariantUUID());
put(valueMap, "PROVIDING_SERVICE_MODEL_UUID", o.getProvidingServiceModelUUID());
put(valueMap, "PROVIDING_SERVICE_MODEL_NAME", o.getProvidingServiceModelName());
- put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+
+ if (isJSONValid(o.getResourceInput())) {
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ }
sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
sep = ",\n";
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
index 5573b23a8d..129718241c 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
@@ -116,7 +116,10 @@ public class QueryServiceNetworks extends CatalogQuery {
put(valueMap, "NETWORK_ROLE", o.getNetworkRole());
put(valueMap, "NETWORK_SCOPE", o.getNetworkScope());
put(valueMap, "NETWORK_TECHNOLOGY", o.getNetworkTechnology());
- put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+
+ if (isJSONValid(o.getResourceInput())) {
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ }
sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
sep = ",\n";
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
index 0b8de60a81..d6e7415a77 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
@@ -23,6 +23,7 @@
package org.onap.so.adapters.catalogdb.catalogrest;
/* should be called QueryVnfResource.java */
+import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +33,7 @@ import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.fasterxml.jackson.databind.ObjectMapper;
@XmlRootElement(name = "serviceVnfs")
public class QueryServiceVnfs extends CatalogQuery {
@@ -120,7 +122,9 @@ public class QueryServiceVnfs extends CatalogQuery {
put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode());
put(valueMap, "VNFC_INSTANCE_GROUP_ORDER", o.getVnfcInstanceGroupOrder());
put(valueMap, "MULTI_STEP_DESIGN", o.getMultiStageDesign());
- put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ if (isJSONValid(o.getResourceInput())) {
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ }
String subitem = new QueryVfModule(vrNull ? null : o.getVfModuleCustomizations()).JSON2(true, true);
valueMap.put("_VFMODULES_", subitem.replaceAll("(?m)^", "\t\t"));
@@ -142,4 +146,5 @@ public class QueryServiceVnfs extends CatalogQuery {
sb.append("}");
return sb.toString();
}
+
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVnfcs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVnfcs.java
index dc73fe904d..24c07d6d3e 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVnfcs.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryVnfcs.java
@@ -20,12 +20,12 @@
package org.onap.so.adapters.catalogdb.catalogrest;
-import org.onap.so.db.catalog.beans.VnfcCustomization;
-import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.onap.so.db.catalog.beans.VnfcCustomization;
@XmlRootElement(name = "vnfcs")
public class QueryVnfcs extends CatalogQuery {
@@ -105,8 +105,10 @@ public class QueryVnfcs extends CatalogQuery {
put(valueMap, "MODEL_INVARIANT_ID", o.getModelInvariantUUID());
put(valueMap, "MODEL_VERSION", o.getModelVersion());
put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID());
- put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ if (isJSONValid(o.getResourceInput())) {
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
+ }
sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
sep = ",\n";
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundException.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundException.java
new file mode 100644
index 0000000000..f8a7ba6da4
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundException.java
@@ -0,0 +1,14 @@
+package org.onap.so.adapters.catalogdb.rest;
+
+public class CatalogEntityNotFoundException extends RuntimeException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -300157844846680791L;
+
+ public CatalogEntityNotFoundException(String errorMessage) {
+ super(errorMessage);
+ }
+
+}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundExceptionMapper.java
index af6064fd6a..c42eaabea7 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterDeletionNotification.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogEntityNotFoundExceptionMapper.java
@@ -1,48 +1,38 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * ONAP - SO
* ================================================================================
- * Modifications Copyright (c) 2019 Samsung
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.svnfm.simulator.notifications;
+package org.onap.so.adapters.catalogdb.rest;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-public class VnfmAdapterDeletionNotification implements Runnable {
+@Provider
+public class CatalogEntityNotFoundExceptionMapper implements ExceptionMapper<CatalogEntityNotFoundException> {
- private static final Logger logger = LoggerFactory.getLogger(VnfmAdapterDeletionNotification.class);
+ private static final Logger logger = LoggerFactory.getLogger(CatalogEntityNotFoundExceptionMapper.class);
@Override
- public void run() {
- try {
- Thread.sleep(10000);
- } catch (final InterruptedException e) {
- logger.error("Error occured while simulating deletion ", e);
- Thread.currentThread().interrupt();
- }
- logger.info("Call to VNFM Adapter-Delete");
+ public Response toResponse(CatalogEntityNotFoundException e) {
+ return Response.status(Response.Status.NOT_FOUND).entity(e).build();
}
-
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceMapper.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceMapper.java
index dd18767762..e74663dbba 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceMapper.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceMapper.java
@@ -22,9 +22,11 @@ package org.onap.so.adapters.catalogdb.rest;
import java.util.ArrayList;
import java.util.List;
+import org.onap.so.db.catalog.beans.CvnfcCustomization;
import org.onap.so.db.catalog.beans.HeatEnvironment;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.rest.catalog.beans.Cvnfc;
import org.onap.so.rest.catalog.beans.Service;
import org.onap.so.rest.catalog.beans.VfModule;
import org.onap.so.rest.catalog.beans.Vnf;
@@ -39,16 +41,23 @@ public class ServiceMapper {
public Service mapService(org.onap.so.db.catalog.beans.Service service, int depth) {
Service restService = new Service();
- restService.setCategory(service.getCategory());
+ if (service.getCategory() != null) {
+ restService.setCategory(service.getCategory());
+ }
restService.setCreated(service.getCreated());
restService.setDescription(service.getDescription());
- restService.setDistrobutionStatus(service.getDistrobutionStatus());
+
+ if (service.getDistrobutionStatus() != null) {
+ restService.setDistrobutionStatus(service.getDistrobutionStatus());
+ }
restService.setEnvironmentContext(service.getEnvironmentContext());
restService.setModelInvariantId(service.getModelInvariantUUID());
restService.setModelName(service.getModelName());
restService.setModelVersionId(service.getModelUUID());
restService.setModelVersion(service.getModelVersion());
- restService.setServiceRole(service.getServiceRole());
+ if (service.getServiceRole() != null) {
+ restService.setServiceRole(service.getServiceRole());
+ }
restService.setServiceType(service.getServiceType());
restService.setWorkloadContext(service.getWorkloadContext());
if (depth > 0)
@@ -63,7 +72,7 @@ public class ServiceMapper {
return vnfs;
}
- private Vnf mapVnf(org.onap.so.db.catalog.beans.VnfResourceCustomization vnfResourceCustomization, int depth) {
+ protected Vnf mapVnf(org.onap.so.db.catalog.beans.VnfResourceCustomization vnfResourceCustomization, int depth) {
Vnf vnf = new Vnf();
vnf.setAvailabilityZoneMaxCount(vnfResourceCustomization.getAvailabilityZoneMaxCount());
vnf.setCategory(vnfResourceCustomization.getVnfResources().getCategory());
@@ -81,9 +90,12 @@ public class ServiceMapper {
vnf.setNfFunction(vnfResourceCustomization.getNfFunction());
vnf.setNfNamingCode(vnfResourceCustomization.getNfNamingCode());
vnf.setNfRole(vnfResourceCustomization.getNfRole());
+ vnf.setNfType(vnfResourceCustomization.getNfType());
+ vnf.setNfDataValid(vnfResourceCustomization.getNfDataValid());
vnf.setOrchestrationMode(vnfResourceCustomization.getVnfResources().getOrchestrationMode());
vnf.setSubCategory(vnfResourceCustomization.getVnfResources().getSubCategory());
vnf.setToscaNodeType(vnfResourceCustomization.getVnfResources().getToscaNodeType());
+
if (depth > 1) {
vnf.setVfModule(mapVfModules(vnfResourceCustomization, depth));
}
@@ -93,11 +105,11 @@ public class ServiceMapper {
private List<VfModule> mapVfModules(VnfResourceCustomization vnfResourceCustomization, int depth) {
List<VfModule> vfModules = new ArrayList<>();
vnfResourceCustomization.getVfModuleCustomizations().parallelStream()
- .forEach(vfModule -> vfModules.add(mapVfModule(vfModule)));
+ .forEach(vfModule -> vfModules.add(mapVfModule(vfModule, depth)));
return vfModules;
}
- private VfModule mapVfModule(VfModuleCustomization vfModuleCust) {
+ private VfModule mapVfModule(VfModuleCustomization vfModuleCust, int depth) {
VfModule vfModule = new VfModule();
vfModule.setAvailabilityZoneCount(vfModuleCust.getAvailabilityZoneCount());
vfModule.setCreated(vfModuleCust.getCreated());
@@ -113,9 +125,34 @@ public class ServiceMapper {
vfModule.setModelName(vfModuleCust.getVfModule().getModelName());
vfModule.setModelVersionId(vfModuleCust.getVfModule().getModelUUID());
vfModule.setModelVersion(vfModuleCust.getVfModule().getModelVersion());
+ if (depth > 3) {
+ vfModule.setVnfc(mapCvnfcs(vfModuleCust));
+ }
return vfModule;
}
+ private List<Cvnfc> mapCvnfcs(VfModuleCustomization vfModuleCustomization) {
+ List<Cvnfc> cvnfcs = new ArrayList<>();
+ vfModuleCustomization.getCvnfcCustomization().parallelStream()
+ .forEach(cvnfcCust -> cvnfcs.add(mapCvnfcCus(cvnfcCust)));
+ return cvnfcs;
+ }
+
+ private Cvnfc mapCvnfcCus(CvnfcCustomization cvnfcCust) {
+ Cvnfc cvnfc = new Cvnfc();
+ cvnfc.setCreated(cvnfcCust.getCreated());
+ cvnfc.setDescription(cvnfcCust.getDescription());
+ cvnfc.setModelCustomizationId(cvnfcCust.getModelCustomizationUUID());
+ cvnfc.setModelInstanceName(cvnfcCust.getModelInstanceName());
+ cvnfc.setModelInvariantId(cvnfcCust.getModelInvariantUUID());
+ cvnfc.setModelName(cvnfcCust.getModelName());
+ cvnfc.setModelVersion(cvnfcCust.getModelVersion());
+ cvnfc.setModelVersionId(cvnfcCust.getModelUUID());
+ cvnfc.setNfcFunction(cvnfcCust.getNfcFunction());
+ cvnfc.setNfcNamingCode(cvnfcCust.getNfcNamingCode());
+ return cvnfc;
+ }
+
private boolean getIsVolumeGroup(VfModuleCustomization vfModuleCust) {
boolean isVolumeGroup = false;
HeatEnvironment envt = vfModuleCust.getVolumeHeatEnv();
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java
index 520de4d38c..9663033c20 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java
@@ -34,11 +34,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.base.Strings;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+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.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
-@Api(value = "/v1/services", tags = "model")
+
+@OpenAPIDefinition(info = @Info(title = "/v1", description = "model"))
@Path("/v1/services")
@Component
public class ServiceRestImpl {
@@ -49,31 +55,37 @@ public class ServiceRestImpl {
@Autowired
private ServiceMapper serviceMapper;
+
@GET
@Path("/{modelUUID}")
@Produces({MediaType.APPLICATION_JSON})
@Transactional(readOnly = true)
public Service findService(@PathParam("modelUUID") String modelUUID, @QueryParam("depth") int depth) {
org.onap.so.db.catalog.beans.Service service = serviceRepo.findOneByModelUUID(modelUUID);
+ if (service == null) {
+ throw new CatalogEntityNotFoundException("Unable to find Service " + modelUUID);
+ }
return serviceMapper.mapService(service, depth);
}
@GET
- @ApiOperation(value = "Find Service Models", response = Service.class, responseContainer = "List",
- notes = "If no query parameters are sent an empty list will be returned")
+ @Operation(description = "Find Service Models", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Service.class)))))
@Produces({MediaType.APPLICATION_JSON})
@Transactional(readOnly = true)
public List<Service> queryServices(
- @ApiParam(value = "modelName", required = false) @QueryParam("modelName") String modelName,
- @ApiParam(value = "distributionStatus",
+ @Parameter(description = "modelName", required = false) @QueryParam("modelName") String modelName,
+ @Parameter(description = "distributionStatus",
required = false) @QueryParam("distributionStatus") String distributionStatus,
- @ApiParam(value = "depth", required = false) @QueryParam("depth") int depth) {
+ @Parameter(description = "depth", required = false) @QueryParam("depth") int depth) {
List<Service> services = new ArrayList<>();
- List<org.onap.so.db.catalog.beans.Service> serviceFromDB = new ArrayList<>();
+ List<org.onap.so.db.catalog.beans.Service> serviceFromDB;
if (!Strings.isNullOrEmpty(modelName) && !Strings.isNullOrEmpty(distributionStatus)) {
serviceFromDB = serviceRepo.findByModelNameAndDistrobutionStatus(modelName, distributionStatus);
} else if (!Strings.isNullOrEmpty(modelName)) {
serviceFromDB = serviceRepo.findByModelName(modelName);
+ } else {
+ serviceFromDB = serviceRepo.findAll();
}
serviceFromDB.stream().forEach(serviceDB -> services.add(serviceMapper.mapService(serviceDB, depth)));
return services;
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfMapper.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfMapper.java
new file mode 100644
index 0000000000..52a8ccb5a7
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfMapper.java
@@ -0,0 +1,37 @@
+package org.onap.so.adapters.catalogdb.rest;
+
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.rest.catalog.beans.Vnf;
+import org.springframework.stereotype.Component;
+import com.google.common.base.Strings;
+
+@Component
+public class VnfMapper {
+
+ public VnfResourceCustomization mapVnf(VnfResourceCustomization vnfCust, Vnf vnf) {
+
+ vnfCust.setAvailabilityZoneMaxCount(vnf.getAvailabilityZoneMaxCount());
+ vnfCust.setMaxInstances(vnf.getMaxInstances());
+ vnfCust.setMinInstances(vnf.getMinInstances());
+ vnfCust.setModelCustomizationUUID(vnf.getModelCustomizationId());
+ vnfCust.setModelInstanceName(vnf.getModelInstanceName());
+ vnfCust.setMultiStageDesign(vnf.getMultiStageDesign());
+ vnfCust.setNfDataValid(vnf.getNfDataValid());
+ vnfCust.setNfFunction(Strings.nullToEmpty(vnf.getNfFunction()));
+ vnfCust.setNfNamingCode(Strings.nullToEmpty(vnf.getNfNamingCode()));
+ vnfCust.setNfRole(Strings.nullToEmpty(vnf.getNfRole()));
+ vnfCust.setNfType(Strings.nullToEmpty(vnf.getNfType()));
+
+ VnfResource vnfRes = vnfCust.getVnfResources();
+ vnfRes.setOrchestrationMode(Strings.nullToEmpty(vnfRes.getOrchestrationMode()));
+ vnfRes.setSubCategory(Strings.nullToEmpty(vnfRes.getSubCategory()));
+ vnfRes.setToscaNodeType(Strings.nullToEmpty(vnfRes.getToscaNodeType()));
+ vnfRes.setModelInvariantUUID(vnfRes.getModelInvariantId());
+ vnfRes.setModelName(vnfRes.getModelName());
+ vnfRes.setModelUUID(vnfRes.getModelUUID());
+ vnfRes.setModelVersion(vnfRes.getModelVersion());
+ return vnfCust;
+ }
+
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java
new file mode 100644
index 0000000000..9202fd21d4
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.catalogdb.rest;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.data.repository.ServiceRepository;
+import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository;
+import org.onap.so.rest.catalog.beans.Service;
+import org.onap.so.rest.catalog.beans.Vnf;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+
+@OpenAPIDefinition(info = @Info(title = "/v1/services/{modelUUID}/vnfs", description = "model"))
+@Path("/v1/services/{modelUUID}/vnfs")
+@Component
+public class VnfRestImpl {
+
+ @Autowired
+ private ServiceRepository serviceRepo;
+
+ @Autowired
+ private ServiceMapper serviceMapper;
+
+ @Autowired
+ private VnfMapper vnfMapper;
+
+ @Autowired
+ private VnfCustomizationRepository vnfCustRepo;
+
+ @GET
+ @Operation(description = "Find a VNF model contained within a service", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Vnf.class)))))
+ @Path("/{modelCustomizationUUID}")
+ @Produces({MediaType.APPLICATION_JSON})
+ @Transactional(readOnly = true)
+ public Vnf findService(@PathParam("modelUUID") String serviceModelUUID,
+ @PathParam("modelCustomizationUUID") String modelCustomizationUUID, @QueryParam("depth") int depth) {
+ org.onap.so.db.catalog.beans.Service service = serviceRepo.findOneByModelUUID(serviceModelUUID);
+ if (service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty()) {
+ throw new WebApplicationException("Vnf Not Found", 404);
+ }
+ List<VnfResourceCustomization> vnfCustom = service.getVnfCustomizations().stream()
+ .filter(vnfCust -> vnfCust.getModelCustomizationUUID().equals(modelCustomizationUUID))
+ .collect(Collectors.toList());
+ if (vnfCustom.isEmpty()) {
+ return null;
+ } else if (vnfCustom.size() > 1) {
+ throw new RuntimeException(
+ "More than one Vnf model returned with model Customization UUID: " + modelCustomizationUUID);
+ }
+ return serviceMapper.mapVnf(vnfCustom.get(0), depth);
+ }
+
+ @PUT
+ @Operation(description = "Update a VNF model contained within a service", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Vnf.class)))))
+ @Path("/{modelCustomizationUUID}")
+ @Produces({MediaType.APPLICATION_JSON})
+ @Transactional
+ public Response findService(@PathParam("modelUUID") String serviceModelUUID,
+ @PathParam("modelCustomizationUUID") String modelCustomizationUUID, Vnf vnf) {
+ org.onap.so.db.catalog.beans.Service service = serviceRepo.findOneByModelUUID(serviceModelUUID);
+ List<VnfResourceCustomization> vnfCustom = service.getVnfCustomizations().stream()
+ .filter(vnfCust -> vnfCust.getModelCustomizationUUID().equals(modelCustomizationUUID))
+ .collect(Collectors.toList());
+ if (vnfCustom.isEmpty()) {
+ throw new RuntimeException("No Vnf Found");
+ } else if (vnfCustom.size() > 1) {
+ throw new RuntimeException(
+ "More than one Vnf model returned with model Customization UUID: " + modelCustomizationUUID);
+ }
+ VnfResourceCustomization vnfCust = vnfMapper.mapVnf(vnfCustom.get(0), vnf);
+ vnfCustRepo.save(vnfCust);
+ return Response.ok().build();
+ }
+
+}
+
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application-aaf.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application-basic.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/application-basic.yaml
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 13d736e747..f5c7cd65c2 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
@@ -25,9 +25,12 @@ INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, I
('VolumeGroup-Delete', 'deleteInstance', 'VolumeGroup', true,true, '7','7', 'DEFAULT', '*'),
('VFModule-Create', 'createInstance', 'VfModule', true,true, '7','7', 'DEFAULT', '*'),
('VFModule-Delete', 'deleteInstance', 'VfModule', true,true, '7','7', 'DEFAULT', '*'),
+('VFModule-Replace', 'replaceInstance', 'VfModule', true,true, '7','7', 'DEFAULT', '*'),
+('VFModule-Replace-Retain-Assignments', 'replaceInstanceRetainAssignments', 'VfModule', true,true, '7','7', 'DEFAULT', '*'),
('NetworkCollection-Macro-Create', 'createInstance', 'NetworkCollection', false,true, '7','7', 'DEFAULT', '*'),
('NetworkCollection-Macro-Delete', 'deleteInstance', 'NetworkCollection', false,true, '7','7', 'DEFAULT', '*'),
-('VFModule-ScaleOut', 'scaleOut', 'VfModule', true, true, '7','7', 'DEFAULT', '*');
+('VFModule-ScaleOut', 'scaleOut', 'VfModule', true, true, '7','7', 'DEFAULT', '*'),
+('VNF-InPlaceUpdate', 'inPlaceSoftwareUpdate', 'Vnf', true, true, '7','7', 'DEFAULT', '*');
INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
@@ -147,7 +150,54 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FL
('VFModule-ScaleOut', '3', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'DEFAULT')),
('VFModule-ScaleOut', '4', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'DEFAULT')),
('VFModule-ScaleOut', '5', 'ConfigurationScaleOutBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'DEFAULT')),
-('VFModule-ScaleOut', '6', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'DEFAULT'));
+('VFModule-ScaleOut', '6', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '3', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '4', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '5', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '6', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '7', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '8', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '9', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '10', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '11', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '12', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '13', 'ChangeModelVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace', '14', 'ChangeModelServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '3', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '4', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '5', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '6', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '7', 'ChangeModelVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '8', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '9', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '10', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '11', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '12', 'ChangeModelVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VFModule-Replace-Retain-Assignments', '13', 'ChangeModelServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Replace-Retain-Assignments' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '1', 'VNFCheckPserversLockedFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '2', 'VNFCheckInMaintFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '3', 'VNFSetInMaintFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '4', 'VNFCheckClosedLoopDisabledFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '5', 'VNFSetClosedLoopDisabledFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '6', 'VNFLockActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '7', 'VNFUpgradePreCheckActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '8', 'VNFQuiesceTrafficActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '9', 'VNFStopActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '10', 'VNFSnapShotActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '11', 'VNFStartActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '12', 'VNFUpgradeBackupActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '13', 'VNFUpgradeSoftwareActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '14', 'VNFUpgradePostCheckActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '15', 'VNFResumeTrafficActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '16', 'VNFUnlockActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '17', 'VNFUnsetInMaintFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT')),
+('VNF-InPlaceUpdate', '18', 'VNFUnsetClosedLoopDisabledFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-InPlaceUpdate' and CLOUD_OWNER = 'DEFAULT'));
+
+
INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
VALUES
@@ -815,3 +865,11 @@ VALUES
UPDATE rainy_day_handler_macro SET reg_ex_error_message = '*' WHERE reg_ex_error_message IS null;
UPDATE rainy_day_handler_macro SET SERVICE_ROLE = '*' WHERE SERVICE_ROLE IS null;
+
+INSERT INTO vnf_components_recipe (VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, VERSION, ORCHESTRATION_URI, RECIPE_TIMEOUT)
+VALUES
+(NULL, 'vfModule', 'replaceInstanceRetainAssignments', '1', '/mso/async/services/WorkflowActionBB', 180);
+
+UPDATE vnf_recipe
+SET ORCHESTRATION_URI = '/mso/async/services/WorkflowActionBB'
+WHERE NF_ROLE = 'GR-API-DEFAULT' AND ACTION = 'inPlaceSoftwareUpdate';
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
index 137f73cf65..42df1adf13 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
@@ -202,4 +202,6 @@ INSERT INTO `workflow` (`ARTIFACT_UUID`,`ARTIFACT_NAME`,`NAME`,`OPERATION_NAME`,
VALUES
('9d45cd30-1a89-4993-87c1-6dd09c1696cf','VFModule-ScaleOut','VNF Scale Out','ScaleOut',1.0,'native static workflow to support ScaleOut','vfModule','native'),
('da6478e4-ea33-3346-ac12-ab121284a333','VnfInPlaceUpdate.bpmn','VnfInPlaceUpdate','inPlaceSoftwareUpdate',1.0,'native static workflow to support inPlaceSoftwareUpdate','vnf','native'),
-('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VnfConfigUpdate','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native');
+('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VnfConfigUpdate','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native'),
+('b2fd5627-55e4-4f4f-8064-9e6f443e9152','DummyPnfWorkflow','Dummy Pnf Workflow','DummyPnfWorkflow',1.0,'Dummy Pnf Workflow to test custom Pnf workflow','pnf','native');
+
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql
index 5d940fb9ea..8e52fbeeaf 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql
@@ -30,3 +30,8 @@ resources:
INSERT INTO `temp_network_heat_template_lookup` (`NETWORK_RESOURCE_MODEL_NAME`, `HEAT_TEMPLATE_ARTIFACT_UUID`,`AIC_VERSION_MIN` , `AIC_VERSION_MAX` )
VALUES ('Generic NeutronNet','efee1d84-b8ec-11e7-abc4-cec278b6b50a','2.0','3.0');
+INSERT INTO `heat_template_params` (`HEAT_TEMPLATE_ARTIFACT_UUID`, `PARAM_NAME`, `IS_REQUIRED`, `PARAM_TYPE`, `PARAM_ALIAS`)
+VALUES ('efee1d84-b8ec-11e7-abc4-cec278b6b50a', 'network_name', 0, 'String', NULL);
+
+INSERT INTO `heat_template_params` (`HEAT_TEMPLATE_ARTIFACT_UUID`, `PARAM_NAME`, `IS_REQUIRED`, `PARAM_TYPE`, `PARAM_ALIAS`)
+VALUES ('efee1d84-b8ec-11e7-abc4-cec278b6b50a', 'shared', 0, 'Boolean', NULL);
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql
index e44a6b97ba..8641e51862 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql
@@ -40,6 +40,27 @@ CREATE TABLE IF NOT EXISTS `catalogdb`.`vnf_resource_to_workflow` (
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
+CREATE TABLE IF NOT EXISTS `catalogdb`.`pnf_resource_to_workflow` (
+ `ID` INT(11) NOT NULL AUTO_INCREMENT,
+ `PNF_RESOURCE_MODEL_UUID` VARCHAR(200) NOT NULL,
+ `WORKFLOW_ID` INT(11) NOT NULL,
+ PRIMARY KEY (`ID`),
+ UNIQUE INDEX `UK_pnf_resource_to_workflow` (`PNF_RESOURCE_MODEL_UUID` ASC, `WORKFLOW_ID` ASC),
+ INDEX `fk_pnf_resource_to_workflow__workflow1_idx` (`WORKFLOW_ID` ASC),
+ INDEX `fk_pnf_resource_to_workflow__pnf_res_mod_uuid_idx` (`PNF_RESOURCE_MODEL_UUID` ASC),
+ CONSTRAINT `fk_pnf_resource_to_workflow__pnf_resource1`
+ FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`)
+ REFERENCES `catalogdb`.`pnf_resource` (`MODEL_UUID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE,
+ CONSTRAINT `fk_pnf_resource_to_workflow__workflow1`
+ FOREIGN KEY (`WORKFLOW_ID`)
+ REFERENCES `catalogdb`.`workflow` (`ID`)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE)
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
+
CREATE TABLE IF NOT EXISTS `catalogdb`.`activity_spec` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`NAME` VARCHAR(200) NOT NULL,
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.2__AddNfValidData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.2__AddNfValidData.sql
new file mode 100644
index 0000000000..93dde1341e
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V6.2__AddNfValidData.sql
@@ -0,0 +1,5 @@
+USE catalogdb;
+
+ALTER TABLE vnf_resource_customization
+ADD IF NOT EXISTS NF_DATA_VALID tinyint(1) DEFAULT 0;
+
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql
new file mode 100644
index 0000000000..30b5010c7c
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.0__AddActivatedForOrchestrationStatus.sql
@@ -0,0 +1,47 @@
+INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE)
+VALUES
+
+('CONFIGURATION', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('CONFIGURATION', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('CONFIGURATION', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+
+('NETWORK', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('NETWORK', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+('NETWORK', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVATED', 'DELETE', 'FAIL'),
+('NETWORK', 'ACTIVATED', 'UPDATE', 'CONTINUE'),
+('NETWORK_COLLECTION', 'ACTIVATED', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'ACTIVATED', 'DELETE', 'CONTINUE'),
+('NETWORK_COLLECTION', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+
+('NO_VALIDATE', 'ACTIVATED', 'CUSTOM', 'CONTINUE'),
+
+('SERVICE', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('SERVICE', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('SERVICE', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('SERVICE', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+('SERVICE', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'),
+
+('VF_MODULE', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+('VF_MODULE', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'),
+('VF_MODULE', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVATED', 'DELETE', 'FAIL'),
+
+('VNF', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('VNF', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+('VNF', 'ACTIVATED', 'CHANGE_MODEL', 'CONTINUE'),
+
+('VOLUME_GROUP', 'ACTIVATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ACTIVATED', 'UNASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'ACTIVATED', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ACTIVATED', 'DEACTIVATE', 'CONTINUE'),
+('VOLUME_GROUP', 'ACTIVATED', 'CREATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ACTIVATED', 'DELETE', 'FAIL'); \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.1__UpdatedCloudSiteTable.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.1__UpdatedCloudSiteTable.sql
new file mode 100644
index 0000000000..ea0af2315c
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.1__UpdatedCloudSiteTable.sql
@@ -0,0 +1,5 @@
+use catalogdb;
+
+ALTER TABLE cloud_sites
+ ADD COLUMN IF NOT EXISTS SUPPORT_FABRIC bit(1)
+ NOT NULL DEFAULT 1
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql
new file mode 100644
index 0000000000..6578b5a297
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.2__UpdateCloudSiteTableSupportFabric.sql
@@ -0,0 +1,3 @@
+use catalogdb;
+
+UPDATE cloud_sites SET SUPPORT_FABRIC = b'0' WHERE CLOUD_VERSION != '1.0.0'; \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql
new file mode 100644
index 0000000000..66c01538f7
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.3__UpdateVnfcCustResourceInputLength.sql
@@ -0,0 +1,4 @@
+use catalogdb;
+
+ALTER TABLE vnfc_customization
+ MODIFY IF EXISTS RESOURCE_INPUT varchar(20000); \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.1__AddControllerActorAndBlueprint.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.1__AddControllerActorAndBlueprint.sql
new file mode 100644
index 0000000000..5560dcc0de
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.1__AddControllerActorAndBlueprint.sql
@@ -0,0 +1,23 @@
+use catalogdb;
+
+ALTER TABLE service
+ADD CONTROLLER_ACTOR varchar(200) null;
+
+ALTER TABLE service
+ADD CDS_BLUEPRINT_NAME varchar(200) null;
+
+ALTER TABLE service
+ADD CDS_BLUEPRINT_VERSION varchar(20) null;
+
+ALTER TABLE service
+ADD SKIP_POST_INSTANTIATION_CONFIGURATION boolean default true;
+
+ALTER TABLE vnf_resource_customization
+ADD CONTROLLER_ACTOR varchar(200) null;
+
+ALTER TABLE pnf_resource_customization
+ADD CONTROLLER_ACTOR varchar(200) null;
+
+ALTER TABLE vf_module_customization
+ADD SKIP_POST_INSTANTIATION_CONFIGURATION boolean default true;
+
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.2__AddScopeAndActionColumnsInOrchestrationFlowReference.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.2__AddScopeAndActionColumnsInOrchestrationFlowReference.sql
new file mode 100644
index 0000000000..19bfb0f1e1
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.2__AddScopeAndActionColumnsInOrchestrationFlowReference.sql
@@ -0,0 +1,5 @@
+use catalogdb;
+
+ALTER TABLE orchestration_flow_reference
+ADD SCOPE VARCHAR (200) DEFAULT NULL,
+ADD ACTION VARCHAR (200) DEFAULT NULL; \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
index 145ba50583..69a23a0eba 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
@@ -21,22 +21,13 @@
package org.onap.so.adapters.catalogdb.catalogrest;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.onap.so.logger.MdcConstants.ENDTIME;
-import static org.onap.so.logger.MdcConstants.INVOCATION_ID;
-import static org.onap.so.logger.MdcConstants.PARTNERNAME;
-import static org.onap.so.logger.MdcConstants.RESPONSECODE;
-import static org.onap.so.logger.MdcConstants.RESPONSEDESC;
-import static org.onap.so.logger.MdcConstants.SERVICE_NAME;
-import static org.onap.so.logger.MdcConstants.STATUSCODE;
import java.io.IOException;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
import org.junit.Test;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
+import org.onap.so.db.catalog.beans.ServiceRecipe;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -45,13 +36,14 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
private static final String ECOMP_MSO_CATALOG_V2_VF_MODULES = "ecomp/mso/catalog/v2/vfModules";
+ private static final String SERVICE_RECIPE = "serviceRecipe";
+
private static final String ECOMP_MSO_CATALOG_V2_SERVICE_ALLOTTED_RESOURCES =
"ecomp/mso/catalog/v2/serviceAllottedResources";
@@ -106,26 +98,6 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
restTemplate.exchange(createURLWithPort("/manage/health"), HttpMethod.GET, entity, String.class);
assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/manage/health", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("200", mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/manage/health", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("COMPLETED", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- }
}
/* Service Resources Endpoint */
@@ -812,31 +784,25 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
JSONAssert.assertEquals(badQueryParamResponse, response.getBody().toString(), false);
+ }
+ @Test
+ public void testCreateServiceRecipe() throws JSONException {
+ ServiceRecipe recipe = new ServiceRecipe();
+ recipe.setAction("action");
+ recipe.setDescription("description");
+ recipe.setOrchestrationUri("http://test");
+ recipe.setRecipeTimeout(120);
+ recipe.setServiceModelUUID(serviceUUID);
+ HttpEntity<ServiceRecipe> entity = new HttpEntity<ServiceRecipe>(recipe, headers);
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(SERVICE_RECIPE));
+
+ ResponseEntity<String> response =
+ restTemplate.exchange(builder.toUriString(), HttpMethod.POST, entity, String.class);
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("v2/vfModules", mdc.get(SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(STATUSCODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ENDTIME));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("500", mdc.get(RESPONSECODE));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("v2/vfModules", mdc.get(SERVICE_NAME));
- assertEquals("ERROR", mdc.get(STATUSCODE));
- assertNotNull(mdc.get(RESPONSEDESC));
- }
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusCode().value());
}
private String createURLWithPort(String uri) {
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfTest.java
new file mode 100644
index 0000000000..b71808b2c8
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfTest.java
@@ -0,0 +1,36 @@
+package org.onap.so.adapters.catalogdb.catalogrest;
+
+import static org.junit.Assert.assertEquals;
+import org.json.JSONException;
+import org.junit.Test;
+
+
+public class QueryServiceVnfTest extends QueryServiceVnfs {
+
+ private QueryServiceVnfs queryServiceVnf = new QueryServiceVnfs();
+
+ private final String invalidJSON =
+ "\"{\\\\\\\"nf_function\\\\\\\":\\\\\\\"DO_STUFF\\\\\\\",\\\"_image_name\\\\\\\":\\\\\\\"test_image\\\"";
+
+ private final String validJSON = "\"{\"nf_function\":\"DO_STUFF\",\"image_name\":\"test_image\"}";
+
+ @Test
+ public void test_IsValidJsonTrue() throws JSONException {
+ boolean isValidJson = queryServiceVnf.isJSONValid(validJSON);
+ assertEquals(true, isValidJson);
+ }
+
+ @Test
+ public void test_IsValidJsonFalse() throws JSONException {
+ boolean isValidJson = queryServiceVnf.isJSONValid(invalidJSON);
+ assertEquals(false, isValidJson);
+ }
+
+ @Test
+ public void test_IsValidJsonNull() throws JSONException {
+ boolean isValidJson = queryServiceVnf.isJSONValid(null);
+ assertEquals(false, isValidJson);
+ }
+
+
+}
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/ServiceMapperTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/ServiceMapperTest.java
index 8decd77656..d46fd9c7ba 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/ServiceMapperTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/ServiceMapperTest.java
@@ -67,6 +67,7 @@ public class ServiceMapperTest {
testService.setModelVersion("modelVersion");
testService.setServiceType("serviceType");
testService.setServiceRole("serviceRole");
+
testService.getVnfCustomizations().add(getTestVnfCustomization());
return testService;
}
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 a955a2c3ce..707a2a45af 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
@@ -22,15 +22,15 @@ package org.onap.so.db.catalog.client;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+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.util.List;
import java.util.UUID;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.adapters.catalogdb.CatalogDBApplication;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
import org.onap.so.db.catalog.beans.AuthenticationType;
import org.onap.so.db.catalog.beans.CloudIdentity;
@@ -56,10 +56,7 @@ import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@@ -74,6 +71,8 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@Autowired
CatalogDbClientPortChanger client;
+
+
@Before
public void initialize() {
client.wiremockPort = String.valueOf(port);
@@ -88,7 +87,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
public void testGetRainyDayHandler_Regex() {
RainyDayHandlerStatus rainyDayHandlerStatus = client.getRainyDayHandlerStatus("AssignServiceInstanceBB", "*",
"*", "*", "*", "The Flavor ID (nd.c6r16d20) could not be found.", "*");
- Assert.assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
+ assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
}
@Test
@@ -97,105 +96,105 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
"*", "*", "*",
"resources.lba_0_dmz_vmi_0: Unknown id: Error: oper 1 url /fqname-to-id body {\"fq_name\": [\"zrdm6bvota05-dmz_sec_group\"], \"type\": \"security-group\"} response Name ['zrdm6bvota05-dmz_sec_group'] not found",
"*");
- Assert.assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
+ assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
}
@Test
public void testGetCloudSiteHappyPath() throws Exception {
CloudSite cloudSite = client.getCloudSite(MTN13);
- Assert.assertNotNull(cloudSite);
- Assert.assertNotNull(cloudSite.getIdentityService());
- Assert.assertEquals("MDT13", cloudSite.getClli());
- Assert.assertEquals("mtn13", cloudSite.getRegionId());
- Assert.assertEquals("MTN13", cloudSite.getIdentityServiceId());
+ assertNotNull(cloudSite);
+ assertNotNull(cloudSite.getIdentityService());
+ assertEquals("MDT13", cloudSite.getClli());
+ assertEquals("mtn13", cloudSite.getRegionId());
+ assertEquals("MTN13", cloudSite.getIdentityServiceId());
}
@Test
public void testGetCloudSiteNotFound() throws Exception {
CloudSite cloudSite = client.getCloudSite(UUID.randomUUID().toString());
- Assert.assertNull(cloudSite);
+ assertNull(cloudSite);
}
@Test
public void testGetCloudifyManagerHappyPath() throws Exception {
CloudifyManager cloudifyManager = client.getCloudifyManager("mtn13");
- Assert.assertNotNull(cloudifyManager);
- Assert.assertEquals("http://localhost:28090/v2.0", cloudifyManager.getCloudifyUrl());
+ assertNotNull(cloudifyManager);
+ assertEquals("http://localhost:28090/v2.0", cloudifyManager.getCloudifyUrl());
}
@Test
public void testGetCloudifyManagerNotFound() throws Exception {
CloudifyManager cloudifyManager = client.getCloudifyManager(UUID.randomUUID().toString());
- Assert.assertNull(cloudifyManager);
+ assertNull(cloudifyManager);
}
@Test
public void testGetCloudSiteByClliAndAicVersionHappyPath() throws Exception {
CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "2.5");
- Assert.assertNotNull(cloudSite);
+ assertNotNull(cloudSite);
}
@Test
public void testGetCloudSiteByClliAndAicVersionNotFound() throws Exception {
CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "232496239746328");
- Assert.assertNull(cloudSite);
+ assertNull(cloudSite);
}
@Test
public void testGetServiceByID() throws Exception {
Service serviceByID = client.getServiceByID("5df8b6de-2083-11e7-93ae-92361f002671");
- Assert.assertNotNull(serviceByID);
- Assert.assertEquals("MSOTADevInfra_vSAMP10a_Service", serviceByID.getModelName());
- Assert.assertEquals("NA", serviceByID.getServiceType());
- Assert.assertEquals("NA", serviceByID.getServiceRole());
+ assertNotNull(serviceByID);
+ assertEquals("MSOTADevInfra_vSAMP10a_Service", serviceByID.getModelName());
+ assertEquals("NA", serviceByID.getServiceType());
+ assertEquals("NA", serviceByID.getServiceRole());
}
@Test
public void testGetServiceByIDNotFound() throws Exception {
Service serviceByID = client.getServiceByID(UUID.randomUUID().toString());
- Assert.assertNull(serviceByID);
+ assertNull(serviceByID);
}
@Test
public void testGetVfModuleByModelUUID() throws Exception {
VfModule vfModule = client.getVfModuleByModelUUID("20c4431c-246d-11e7-93ae-92361f002671");
- Assert.assertNotNull(vfModule);
- Assert.assertNotNull(vfModule.getVfModuleCustomization());
- Assert.assertEquals("78ca26d0-246d-11e7-93ae-92361f002671", vfModule.getModelInvariantUUID());
- Assert.assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
+ assertNotNull(vfModule);
+ assertNotNull(vfModule.getVfModuleCustomization());
+ assertEquals("78ca26d0-246d-11e7-93ae-92361f002671", vfModule.getModelInvariantUUID());
+ assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
}
@Test
public void testGetVfModuleByModelUUIDNotFound() throws Exception {
VfModule vfModule = client.getVfModuleByModelUUID(UUID.randomUUID().toString());
- Assert.assertNull(vfModule);
+ assertNull(vfModule);
}
@Test
public void testGetVnfResourceByModelUUID() throws Exception {
VnfResource vnfResource = client.getVnfResourceByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
- Assert.assertNotNull(vnfResource);
- Assert.assertEquals("vSAMP10a", vnfResource.getModelName());
+ assertNotNull(vnfResource);
+ assertEquals("vSAMP10a", vnfResource.getModelName());
}
@Test
public void testGetVnfResourceByModelUUIDNotFound() throws Exception {
VnfResource vnfResource = client.getVnfResourceByModelUUID(UUID.randomUUID().toString());
- Assert.assertNull(vnfResource);
+ assertNull(vnfResource);
}
@Test
public void testGetVnfResourceCustomizationByModelCustomizationUUID() {
VnfResourceCustomization vnfResourceCustomization =
client.getVnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
- Assert.assertNotNull(vnfResourceCustomization);
- Assert.assertEquals("vSAMP", vnfResourceCustomization.getNfRole());
- Assert.assertNotNull(vnfResourceCustomization.getModelCustomizationUUID());
- Assert.assertNotNull(vnfResourceCustomization.getVnfResources());
- Assert.assertNotNull(vnfResourceCustomization.getVfModuleCustomizations());
- Assert.assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName());
+ assertNotNull(vnfResourceCustomization);
+ assertEquals("vSAMP", vnfResourceCustomization.getNfRole());
+ assertNotNull(vnfResourceCustomization.getModelCustomizationUUID());
+ assertNotNull(vnfResourceCustomization.getVnfResources());
+ assertNotNull(vnfResourceCustomization.getVfModuleCustomizations());
+ assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName());
assertTrue("skip post instantiation configuration", vnfResourceCustomization.isSkipPostInstConf());
}
@@ -203,15 +202,15 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
public void testGetVnfResourceCustomizationByModelCustomizationUUINotFound() {
VnfResourceCustomization vnfResourceCustomization =
client.getVnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
- Assert.assertNull(vnfResourceCustomization);
+ assertNull(vnfResourceCustomization);
}
@Test
public void testGetInstanceGroupByModelUUID() {
InstanceGroup instanceGroup = client.getInstanceGroupByModelUUID("0c8692ef-b9c0-435d-a738-edf31e71f38b");
- Assert.assertNotNull(instanceGroup);
- Assert.assertEquals("network_collection_resource_1806..NetworkCollection..0", instanceGroup.getModelName());
- Assert.assertEquals("org.openecomp.resource.cr.NetworkCollectionResource1806",
+ assertNotNull(instanceGroup);
+ assertEquals("network_collection_resource_1806..NetworkCollection..0", instanceGroup.getModelName());
+ assertEquals("org.openecomp.resource.cr.NetworkCollectionResource1806",
instanceGroup.getToscaNodeType().toString());
}
@@ -219,33 +218,33 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
public void testGetVfModuleCustomizationByModelCuztomizationUUID() {
VfModuleCustomization vfModuleCustomization =
client.getVfModuleCustomizationByModelCuztomizationUUID("cb82ffd8-252a-11e7-93ae-92361f002671");
- Assert.assertNotNull(vfModuleCustomization);
- Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
- Assert.assertEquals("base", vfModuleCustomization.getLabel());
+ assertNotNull(vfModuleCustomization);
+ assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
+ assertEquals("base", vfModuleCustomization.getLabel());
}
@Test
public void testGetVfModuleCustomizationByModelCuztomizationUUIDNotFound() {
VfModuleCustomization vfModuleCustomization =
client.getVfModuleCustomizationByModelCuztomizationUUID(UUID.randomUUID().toString());
- Assert.assertNull(vfModuleCustomization);
+ assertNull(vfModuleCustomization);
}
@Test
public void testGetNetworkResourceCustomizationByModelCustomizationUUID() {
NetworkResourceCustomization networkResourceCustomization =
client.getNetworkResourceCustomizationByModelCustomizationUUID("3bdbb104-476c-483e-9f8b-c095b3d308ac");
- Assert.assertNotNull(networkResourceCustomization);
- Assert.assertNotNull(networkResourceCustomization.getModelCustomizationUUID());
- Assert.assertEquals("CONTRAIL30_GNDIRECT 9", networkResourceCustomization.getModelInstanceName());
- Assert.assertNotNull(networkResourceCustomization.getNetworkResource());
+ assertNotNull(networkResourceCustomization);
+ assertNotNull(networkResourceCustomization.getModelCustomizationUUID());
+ assertEquals("CONTRAIL30_GNDIRECT 9", networkResourceCustomization.getModelInstanceName());
+ assertNotNull(networkResourceCustomization.getNetworkResource());
}
@Test
public void testGetNetworkResourceCustomizationByModelCustomizationUUIDNotFound() {
NetworkResourceCustomization networkResourceCustomization =
client.getNetworkResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
- Assert.assertNull(networkResourceCustomization);
+ assertNull(networkResourceCustomization);
}
@Test
@@ -253,10 +252,10 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
VfModuleCustomization vfModuleCustomization =
client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
"cb82ffd8-252a-11e7-93ae-92361f002672", "20c4431c-246d-11e7-93ae-92361f002672");
- Assert.assertNotNull(vfModuleCustomization);
- Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
- Assert.assertNotNull(vfModuleCustomization.getVfModule());
- Assert.assertEquals("base", vfModuleCustomization.getLabel());
+ assertNotNull(vfModuleCustomization);
+ assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
+ assertNotNull(vfModuleCustomization.getVfModule());
+ assertEquals("base", vfModuleCustomization.getLabel());
}
@Test
@@ -264,44 +263,43 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
VfModuleCustomization vfModuleCustomization =
client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
"cb82ffd8-252a-11e7-93ae-92361f002672", UUID.randomUUID().toString());
- Assert.assertNull(vfModuleCustomization);
+ assertNull(vfModuleCustomization);
}
@Test
public void testGetFirstByServiceModelUUIDAndAction() {
ServiceRecipe serviceRecipe =
client.getFirstByServiceModelUUIDAndAction("4694a55f-58b3-4f17-92a5-796d6f5ffd0d", "createInstance");
- Assert.assertNotNull(serviceRecipe);
- Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
- Assert.assertNotNull(serviceRecipe.getAction());
- Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance",
- serviceRecipe.getOrchestrationUri());
- Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
+ assertNotNull(serviceRecipe);
+ assertNotNull(serviceRecipe.getServiceModelUUID());
+ assertNotNull(serviceRecipe.getAction());
+ assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
+ assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
}
@Test
public void testGetFirstByServiceModelUUIDAndActionNotFound() {
ServiceRecipe serviceRecipe = client.getFirstByServiceModelUUIDAndAction("5df8b6de-2083-11e7-93ae-92361f002671",
UUID.randomUUID().toString());
- Assert.assertNull(serviceRecipe);
+ assertNull(serviceRecipe);
}
@Test
public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersion() {
VnfResource vnfResource = client
.getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", "2.0");
- Assert.assertNotNull(vnfResource);
- Assert.assertNotNull(vnfResource.getModelInvariantId());
- Assert.assertNotNull(vnfResource.getModelVersion());
- Assert.assertNotNull(vnfResource.getHeatTemplates());
- Assert.assertEquals("vSAMP10a", vnfResource.getModelName());
+ assertNotNull(vnfResource);
+ assertNotNull(vnfResource.getModelInvariantId());
+ assertNotNull(vnfResource.getModelVersion());
+ assertNotNull(vnfResource.getHeatTemplates());
+ assertEquals("vSAMP10a", vnfResource.getModelName());
}
@Test
public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersionNotFound() {
VnfResource vnfResource = client.getFirstVnfResourceByModelInvariantUUIDAndModelVersion(
"2fff5b20-214b-11e7-93ae-92361f002671", UUID.randomUUID().toString());
- Assert.assertNull(vnfResource);
+ assertNull(vnfResource);
}
@Test
@@ -310,29 +308,28 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
vnfr.setModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
VnfResourceCustomization firstVnfResourceCustomizationByModelInstanceNameAndVnfResources =
client.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources("vSAMP10a 1", vnfr);
- Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources);
- Assert.assertEquals("vSAMP", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getNfRole());
- Assert.assertEquals("vSAMP10a 1",
+ assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources);
+ assertEquals("vSAMP", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getNfRole());
+ assertEquals("vSAMP10a 1",
firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getModelInstanceName());
- Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVnfResources());
- Assert.assertNotNull(
- firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
+ assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVnfResources());
+ assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
}
@Test
public void testGetFirstVnfRecipeByNfRoleAndAction() {
VnfRecipe vnfRecipe = client.getFirstVnfRecipeByNfRoleAndAction("GR-API-DEFAULT", "createInstance");
- Assert.assertNotNull(vnfRecipe);
- Assert.assertNotNull(vnfRecipe.getNfRole());
- Assert.assertNotNull(vnfRecipe.getAction());
- Assert.assertEquals("Gr api recipe to create vnf", vnfRecipe.getDescription());
- Assert.assertEquals("/mso/async/services/WorkflowActionBB", vnfRecipe.getOrchestrationUri());
+ assertNotNull(vnfRecipe);
+ assertNotNull(vnfRecipe.getNfRole());
+ assertNotNull(vnfRecipe.getAction());
+ assertEquals("Gr api recipe to create vnf", vnfRecipe.getDescription());
+ assertEquals("/mso/async/services/WorkflowActionBB", vnfRecipe.getOrchestrationUri());
}
@Test
public void testGetFirstVnfRecipeByNfRoleAndActionNotFound() {
VnfRecipe vnfRecipe = client.getFirstVnfRecipeByNfRoleAndAction(UUID.randomUUID().toString(), "createInstance");
- Assert.assertNull(vnfRecipe);
+ assertNull(vnfRecipe);
}
@Test
@@ -340,12 +337,12 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
VnfComponentsRecipe vnfComponentsRecipe =
client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
"20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
- Assert.assertNotNull(vnfComponentsRecipe);
- Assert.assertNotNull(vnfComponentsRecipe.getAction());
- Assert.assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
- Assert.assertNotNull(vnfComponentsRecipe.getVnfComponentType());
- Assert.assertEquals("Gr api recipe to create volume-group", vnfComponentsRecipe.getDescription());
- Assert.assertEquals("/mso/async/services/WorkflowActionBB", vnfComponentsRecipe.getOrchestrationUri());
+ assertNotNull(vnfComponentsRecipe);
+ assertNotNull(vnfComponentsRecipe.getAction());
+ assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
+ assertNotNull(vnfComponentsRecipe.getVnfComponentType());
+ assertEquals("Gr api recipe to create volume-group", vnfComponentsRecipe.getDescription());
+ assertEquals("/mso/async/services/WorkflowActionBB", vnfComponentsRecipe.getOrchestrationUri());
}
@@ -355,80 +352,79 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
VnfComponentsRecipe vnfComponentsRecipe =
client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
UUID.randomUUID().toString(), "volumeGroup", "createInstance");
- Assert.assertNull(vnfComponentsRecipe);
+ assertNull(vnfComponentsRecipe);
}
@Test
public void testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction() {
VnfComponentsRecipe vnfComponentsRecipe =
client.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
- Assert.assertNotNull(vnfComponentsRecipe);
- Assert.assertNotNull(vnfComponentsRecipe.getAction());
- Assert.assertNotNull(vnfComponentsRecipe.getVnfComponentType());
- Assert.assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
- Assert.assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1",
- vnfComponentsRecipe.getOrchestrationUri());
+ assertNotNull(vnfComponentsRecipe);
+ assertNotNull(vnfComponentsRecipe.getAction());
+ assertNotNull(vnfComponentsRecipe.getVnfComponentType());
+ assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
+ assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
}
@Test
public void testGetServiceByModelVersionAndModelInvariantUUID() {
Service service =
client.getServiceByModelVersionAndModelInvariantUUID("2.0", "9647dfc4-2083-11e7-93ae-92361f002671");
- Assert.assertNotNull(service);
- Assert.assertNotNull(service.getModelVersion());
- Assert.assertNotNull(service.getModelInvariantUUID());
- Assert.assertEquals("MSOTADevInfra_vSAMP10a_Service", service.getModelName());
- Assert.assertEquals("NA", service.getServiceRole());
+ assertNotNull(service);
+ assertNotNull(service.getModelVersion());
+ assertNotNull(service.getModelInvariantUUID());
+ assertEquals("MSOTADevInfra_vSAMP10a_Service", service.getModelName());
+ assertEquals("NA", service.getServiceRole());
}
@Test
public void testGetServiceByModelVersionAndModelInvariantUUIDNotFound() {
Service service = client.getServiceByModelVersionAndModelInvariantUUID("2.0", UUID.randomUUID().toString());
- Assert.assertNull(service);
+ assertNull(service);
}
@Test
public void testGetVfModuleByModelInvariantUUIDAndModelVersion() {
VfModule vfModule =
client.getVfModuleByModelInvariantUUIDAndModelVersion("78ca26d0-246d-11e7-93ae-92361f002671", "2");
- Assert.assertNotNull(vfModule);
- Assert.assertNotNull(vfModule.getModelVersion());
- Assert.assertNotNull(vfModule.getModelInvariantUUID());
- Assert.assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
- Assert.assertEquals("vSAMP10a DEV Base", vfModule.getDescription());
+ assertNotNull(vfModule);
+ assertNotNull(vfModule.getModelVersion());
+ assertNotNull(vfModule.getModelInvariantUUID());
+ assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
+ assertEquals("vSAMP10a DEV Base", vfModule.getDescription());
}
@Test
public void testGetVfModuleByModelInvariantUUIDAndModelVersionNotFound() {
VfModule vfModule = client.getVfModuleByModelInvariantUUIDAndModelVersion(UUID.randomUUID().toString(), "2");
- Assert.assertNull(vfModule);
+ assertNull(vfModule);
}
@Test
public void testGetServiceByModelInvariantUUIDOrderByModelVersionDesc() {
List<Service> serviceList =
client.getServiceByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
- Assert.assertFalse(serviceList.isEmpty());
- Assert.assertEquals(2, serviceList.size());
+ assertFalse(serviceList.isEmpty());
+ assertEquals(2, serviceList.size());
Service service = serviceList.get(0);
- Assert.assertEquals("2.0", service.getModelVersion());
+ assertEquals("2.0", service.getModelVersion());
}
@Test
public void testGetServiceByModelInvariantUUIDOrderByModelVersionDescNotFound() {
List<Service> serviceList =
client.getServiceByModelInvariantUUIDOrderByModelVersionDesc(UUID.randomUUID().toString());
- Assert.assertTrue(serviceList.isEmpty());
+ assertTrue(serviceList.isEmpty());
}
@Test
public void testGetVfModuleByModelInvariantUUIDOrderByModelVersionDesc() {
List<VfModule> moduleList =
client.getVfModuleByModelInvariantUUIDOrderByModelVersionDesc("78ca26d0-246d-11e7-93ae-92361f002671");
- Assert.assertFalse(moduleList.isEmpty());
- Assert.assertEquals(2, moduleList.size());
+ assertFalse(moduleList.isEmpty());
+ assertEquals(2, moduleList.size());
VfModule module = moduleList.get(0);
- Assert.assertEquals("vSAMP10a DEV Base", module.getDescription());
+ assertEquals("vSAMP10a DEV Base", module.getDescription());
}
@Test
@@ -454,20 +450,20 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
cloudSite.setIdentityService(cloudIdentity);
localClient.postCloudSite(cloudSite);
CloudSite getCloudSite = this.client.getCloudSite("MTN6");
- Assert.assertNotNull(getCloudSite);
- Assert.assertNotNull(getCloudSite.getIdentityService());
- Assert.assertEquals("TESTCLLI", getCloudSite.getClli());
- Assert.assertEquals("regionId", getCloudSite.getRegionId());
- Assert.assertEquals("RANDOMID", getCloudSite.getIdentityServiceId());
+ assertNotNull(getCloudSite);
+ assertNotNull(getCloudSite.getIdentityService());
+ assertEquals("TESTCLLI", getCloudSite.getClli());
+ assertEquals("regionId", getCloudSite.getRegionId());
+ assertEquals("RANDOMID", getCloudSite.getIdentityServiceId());
}
@Test
public void testGetHomingInstance() {
HomingInstance homingInstance = client.getHomingInstance("5df8b6de-2083-11e7-93ae-92361f232671");
- Assert.assertNotNull(homingInstance);
- Assert.assertNotNull(homingInstance.getCloudOwner());
- Assert.assertNotNull(homingInstance.getCloudRegionId());
- Assert.assertNotNull(homingInstance.getOofDirectives());
+ assertNotNull(homingInstance);
+ assertNotNull(homingInstance.getCloudOwner());
+ assertNotNull(homingInstance.getCloudRegionId());
+ assertNotNull(homingInstance.getOofDirectives());
}
@Test
@@ -491,43 +487,43 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
+ "\"id\": \"vsink\"\n" + "}\n" + "]\n" + "}");
localClient.postHomingInstance(homingInstance);
HomingInstance getHomingInstance = this.client.getHomingInstance("5df8d6be-2083-11e7-93ae-92361f232671");
- Assert.assertNotNull(getHomingInstance);
- Assert.assertNotNull(getHomingInstance.getCloudRegionId());
- Assert.assertNotNull(getHomingInstance.getCloudOwner());
- Assert.assertEquals("CloudOwner-1", getHomingInstance.getCloudOwner());
- Assert.assertEquals("CloudRegionOne", getHomingInstance.getCloudRegionId());
+ assertNotNull(getHomingInstance);
+ assertNotNull(getHomingInstance.getCloudRegionId());
+ assertNotNull(getHomingInstance.getCloudOwner());
+ assertEquals("CloudOwner-1", getHomingInstance.getCloudOwner());
+ assertEquals("CloudRegionOne", getHomingInstance.getCloudRegionId());
}
@Test
public void testGetServiceByModelName() {
Service service = client.getServiceByModelName("MSOTADevInfra_Test_Service");
- Assert.assertNotNull(service);
- Assert.assertNotNull(service.getModelVersion());
- Assert.assertNotNull(service.getModelInvariantUUID());
- Assert.assertEquals("MSOTADevInfra_Test_Service", service.getModelName());
- Assert.assertEquals("NA", service.getServiceRole());
+ assertNotNull(service);
+ assertNotNull(service.getModelVersion());
+ assertNotNull(service.getModelInvariantUUID());
+ assertEquals("MSOTADevInfra_Test_Service", service.getModelName());
+ assertEquals("NA", service.getServiceRole());
}
@Test
public void testGetServiceByModelNameNotFound() {
Service service = client.getServiceByModelName("Not_Found");
- Assert.assertNull(service);
+ assertNull(service);
}
@Test
public void testGetServiceByModelUUID() {
Service service = client.getServiceByModelUUID("5df8b6de-2083-11e7-93ae-92361f002679");
- Assert.assertNotNull(service);
- Assert.assertNotNull(service.getModelVersion());
- Assert.assertNotNull(service.getModelInvariantUUID());
- Assert.assertEquals("5df8b6de-2083-11e7-93ae-92361f002679", service.getModelUUID());
- Assert.assertEquals("NA", service.getServiceRole());
+ assertNotNull(service);
+ assertNotNull(service.getModelVersion());
+ assertNotNull(service.getModelInvariantUUID());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002679", service.getModelUUID());
+ assertEquals("NA", service.getServiceRole());
}
@Test
public void testGetServiceByModelUUIDNotFound() {
Service service = client.getServiceByModelUUID("Not_Found");
- Assert.assertNull(service);
+ assertNull(service);
}
@Test
@@ -539,53 +535,52 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
northBoundRequest.setCloudOwner("my-custom-cloud-owner");
client.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("createService", "service", true,
"my-custom-cloud-owner");
- Assert.assertNotNull(northBoundRequest);
- Assert.assertEquals("createService", northBoundRequest.getAction());
- Assert.assertEquals("service", northBoundRequest.getRequestScope());
- Assert.assertEquals(true, northBoundRequest.getIsAlacarte());
- Assert.assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner());
+ assertNotNull(northBoundRequest);
+ assertEquals("createService", northBoundRequest.getAction());
+ assertEquals("service", northBoundRequest.getRequestScope());
+ assertEquals(true, northBoundRequest.getIsAlacarte());
+ assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner());
}
@Test
public void testFindServiceRecipeByActionAndServiceModelUUID() {
ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("createInstance",
"4694a55f-58b3-4f17-92a5-796d6f5ffd0d");
- Assert.assertNotNull(serviceRecipe);
- Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
- Assert.assertNotNull(serviceRecipe.getAction());
- Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance",
- serviceRecipe.getOrchestrationUri());
- Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
+ assertNotNull(serviceRecipe);
+ assertNotNull(serviceRecipe.getServiceModelUUID());
+ assertNotNull(serviceRecipe.getAction());
+ assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
+ assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
}
@Test
public void testFindServiceRecipeByActionAndServiceModelUUIDNotFound() {
ServiceRecipe serviceRecipe =
client.findServiceRecipeByActionAndServiceModelUUID("not_found", "5df8b6de-2083-11e7-93ae-test");
- Assert.assertNull(serviceRecipe);
+ assertNull(serviceRecipe);
}
@Test
public void testFindExternalToInternalServiceByServiceName() {
ExternalServiceToInternalService externalServiceToInternalService =
client.findExternalToInternalServiceByServiceName("MySpecialServiceName");
- Assert.assertNotNull(externalServiceToInternalService);
- Assert.assertNotNull(externalServiceToInternalService.getServiceName());
- Assert.assertNotNull(externalServiceToInternalService.getServiceModelUUID());
- Assert.assertEquals("MySpecialServiceName", externalServiceToInternalService.getServiceName());
+ assertNotNull(externalServiceToInternalService);
+ assertNotNull(externalServiceToInternalService.getServiceName());
+ assertNotNull(externalServiceToInternalService.getServiceModelUUID());
+ assertEquals("MySpecialServiceName", externalServiceToInternalService.getServiceName());
}
@Test
public void testFindExternalToInternalServiceByServiceNameNotFound() {
ExternalServiceToInternalService externalServiceToInternalService =
client.findExternalToInternalServiceByServiceName("Not_Found");
- Assert.assertNull(externalServiceToInternalService);
+ assertNull(externalServiceToInternalService);
}
@Test
public void getPnfResourceByModelUUID_validUuid_expectedOutput() {
PnfResource pnfResource = client.getPnfResourceByModelUUID("ff2ae348-214a-11e7-93ae-92361f002680");
- Assert.assertNotNull(pnfResource);
+ assertNotNull(pnfResource);
assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680",
pnfResource.getModelInvariantUUID());
@@ -596,7 +591,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@Test
public void getPnfResourceByModelUUID_invalidUuid_NullOutput() {
PnfResource pnfResource = client.getPnfResourceByModelUUID(UUID.randomUUID().toString());
- Assert.assertNull(pnfResource);
+ assertNull(pnfResource);
}
@Test
@@ -620,7 +615,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
public void getPnfResourceCustomizationByModelCustomizationUUID_invalidUuid_nullOutput() {
PnfResourceCustomization pnfResourceCustomization =
client.getPnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
- Assert.assertNull(pnfResourceCustomization);
+ assertNull(pnfResourceCustomization);
}
@Test
@@ -651,6 +646,53 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
}
@Test
+ public void testGetServiceTopologyById() throws Exception {
+ org.onap.so.rest.catalog.beans.Service serviceByID =
+ client.getServiceModelInformation("5df8b6de-2083-11e7-93ae-92361f002671", "2");
+ assertNotNull(serviceByID);
+ assertEquals("MSOTADevInfra_vSAMP10a_Service", serviceByID.getModelName());
+ assertEquals("NA", serviceByID.getServiceType());
+ assertEquals("NA", serviceByID.getServiceRole());
+ }
+
+ @Test
+ public void testGetServices() throws Exception {
+ List<org.onap.so.rest.catalog.beans.Service> services = client.getServices();
+ assertEquals(false, services.isEmpty());
+ }
+
+ @Test
+ public void testVnf() throws Exception {
+ org.onap.so.rest.catalog.beans.Vnf vnf = client.getVnfModelInformation("5df8b6de-2083-11e7-93ae-92361f002671",
+ "68dc9a92-214c-11e7-93ae-92361f002671", "0");
+ assertNotNull(vnf);
+ assertEquals("vSAMP10a", vnf.getModelName());
+ assertEquals(false, vnf.getNfDataValid());
+ assertEquals("vSAMP", vnf.getNfFunction());
+ assertEquals("vSAMP", vnf.getNfNamingCode());
+ assertEquals("vSAMP", vnf.getNfRole());
+ assertEquals("vSAMP", vnf.getNfType());
+
+ vnf.setNfDataValid(true);
+ vnf.setNfFunction("nfFunction");
+ vnf.setNfRole("nfRole");
+ vnf.setNfType("nfType");
+ vnf.setNfNamingCode("nfNamingCode");
+
+ client.updateVnf("5df8b6de-2083-11e7-93ae-92361f002671", vnf);
+ vnf = client.getVnfModelInformation("5df8b6de-2083-11e7-93ae-92361f002671",
+ "68dc9a92-214c-11e7-93ae-92361f002671", "0");
+ assertEquals("vSAMP10a", vnf.getModelName());
+ assertEquals(true, vnf.getNfDataValid());
+ assertEquals("nfFunction", vnf.getNfFunction());
+ assertEquals("nfNamingCode", vnf.getNfNamingCode());
+ assertEquals("nfRole", vnf.getNfRole());
+ assertEquals("nfType", vnf.getNfType());
+
+
+ }
+
+ @Test
public void getWorkflowByArtifactUUID_validUuid_expectedOutput() {
Workflow workflow = client.findWorkflowByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName());
@@ -659,7 +701,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@Test
public void getWorkflowByArtifactUUID_invalidUuid_nullOutput() {
Workflow workflow = client.findWorkflowByArtifactUUID(UUID.randomUUID().toString());
- Assert.assertNull(workflow);
+ assertNull(workflow);
}
@Test
@@ -674,7 +716,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@Test
public void getWorkflowByModelUUID_invalidUuid_nullOutput() {
Workflow workflow = client.findWorkflowByArtifactUUID(UUID.randomUUID().toString());
- Assert.assertNull(workflow);
+ assertNull(workflow);
}
@Test
@@ -689,7 +731,15 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
@Test
public void getWorkflowBySource_invalidSource_nullOutput() {
List<Workflow> workflow = client.findWorkflowBySource("abc");
- Assert.assertNull(workflow);
+ assertNull(workflow);
}
+ @Test
+ public void getCloudSites() {
+ List<CloudSite> cloudSites = client.getCloudSites();
+ assertNotNull(cloudSites);
+ assertNotEquals(0, cloudSites.size());
+ }
+
+
}
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
index cc5145f0e3..2dc83c8963 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
@@ -23,6 +23,7 @@
"toscaNodeType": "toscaNodeType",
"nfFunction": "nfFunction",
"nfRole": "nfRole",
+ "nfType": "nfType",
"nfNamingCode": "nfNamingCode",
"multiStageDesign": "multiStageDesign",
"orchestrationMode": "orchestrationMode",
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index 7ffcd8308c..f0c066aa05 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -153,6 +153,9 @@
<executions>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
@@ -243,12 +246,12 @@
<dependency>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core</artifactId>
- <version>3.1.0</version>
+ <version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-httpclient</artifactId>
- <version>3.1.0</version>
+ <version>3.2.0</version>
</dependency>
<dependency>
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
index 8edce124ec..0c05df959f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
@@ -22,19 +22,18 @@
package org.onap.so.adapters.audit;
import java.util.Optional;
-import org.camunda.bpm.client.task.ExternalTask;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
+import org.onap.so.utils.ExternalTaskUtils;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public abstract class AbstractAuditService {
+public abstract class AbstractAuditService extends ExternalTaskUtils {
private static final Logger logger = LoggerFactory.getLogger(AbstractAuditService.class);
@@ -81,23 +80,4 @@ public abstract class AbstractAuditService {
return false;
}
}
-
- protected String[] getRetrySequence() {
- return env.getProperty("mso.workflow.topics.retrySequence", String[].class);
- }
-
- protected void setupMDC(ExternalTask externalTask) {
- logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
- String msoRequestId = externalTask.getVariable("mso-request-id");
- if (msoRequestId != null && !msoRequestId.isEmpty()) {
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
- }
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName());
- }
-
- protected long calculateRetryDelay(int currentRetries) {
- int retrySequence = getRetrySequence().length - currentRetries;
- long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000"));
- return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
- }
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index 1e5b6de857..43b362cbaf 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -30,11 +30,11 @@ import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
@@ -46,16 +46,16 @@ public class AuditCreateStackService extends AbstractAuditService {
public HeatStackAudit heatStackAudit;
@Autowired
- public Environment environment;
+ private AuditMDCSetup mdcSetup;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- setupMDC(externalTask);
+ mdcSetup.setupMDC(externalTask);
AuditInventory auditInventory = externalTask.getVariable("auditInventory");
Map<String, Object> variables = new HashMap<>();
boolean success = false;
try {
- logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,
- externalTask.getRetries());
+ Integer retryCount = externalTask.getRetries();
+ logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory, retryCount);
Optional<AAIObjectAuditList> auditListOpt = heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(),
auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
if (auditListOpt.isPresent()) {
@@ -69,29 +69,35 @@ public class AuditCreateStackService extends AbstractAuditService {
logger.error("Error during audit of stack", e);
}
variables.put("auditIsSuccessful", success);
+ mdcSetup.setElapsedTime();
+ String externalTaskId = externalTask.getId();
if (success) {
externalTaskService.complete(externalTask, variables);
- logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
+ logger.debug("The External Task Id: {} Successful", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
- if (externalTask.getRetries() == null) {
+ Integer retryCount = externalTask.getRetries();
+ if (retryCount == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
- externalTask.getId(), getRetrySequence().length);
+ externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
- logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
- externalTask.getId(), externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, retryCount - 1,
+ calculateRetryDelay(retryCount));
}
- logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ logger.debug("The External Task Id: {} Failed", externalTaskId);
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
index 0aa4f9bdc3..da5e8bb3a2 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -28,6 +28,7 @@ import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,6 +45,9 @@ public class AuditDeleteStackService extends AbstractAuditService {
protected HeatStackAudit heatStackAudit;
@Autowired
+ private AuditMDCSetup mdcSetup;
+
+ @Autowired
protected AuditVServer auditVservers;
@Autowired
@@ -53,12 +57,13 @@ public class AuditDeleteStackService extends AbstractAuditService {
protected Environment env;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- setupMDC(externalTask);
+ mdcSetup.setupMDC(externalTask);
AuditInventory auditInventory = externalTask.getVariable("auditInventory");
Map<String, Object> variables = new HashMap<>();
boolean success = false;
try {
- logger.info("Executing External Task Delete Audit Inventory. Retry Number: {}", externalTask.getRetries());
+ Integer retryCount = externalTask.getRetries();
+ logger.info("Executing External Task Delete Audit Inventory. Retry Number: {}", retryCount);
Optional<AAIObjectAuditList> auditListOpt = auditDataService.getStackDataFromRequestDb(auditInventory);
if (auditListOpt.isPresent()) {
auditVservers.auditVservers(auditListOpt.get());
@@ -77,29 +82,35 @@ public class AuditDeleteStackService extends AbstractAuditService {
logger.error("Error during audit of stack", e);
}
variables.put("auditIsSuccessful", success);
+ mdcSetup.setElapsedTime();
+ String externalTaskId = externalTask.getId();
if (success) {
externalTaskService.complete(externalTask, variables);
- logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
+ logger.debug("The External Task Id: {} Successful", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
- if (externalTask.getRetries() == null) {
+ Integer retryCount = externalTask.getRetries();
+ if (retryCount == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
- externalTask.getId(), getRetrySequence().length);
+ externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
- logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
- externalTask.getId(), externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, retryCount - 1,
+ calculateRetryDelay(retryCount));
}
- logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ logger.debug("The External Task Id: {} Failed", externalTaskId);
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
index 2ef7d5b325..8699f8b953 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
@@ -7,6 +7,7 @@ import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,47 +23,56 @@ public class AuditQueryStackService extends AbstractAuditService {
protected HeatStackAudit heatStackAudit;
@Autowired
+ private AuditMDCSetup mdcSetup;
+
+ @Autowired
protected AuditDataService auditDataService;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- setupMDC(externalTask);
+ mdcSetup.setupMDC(externalTask);
AuditInventory auditInventory = externalTask.getVariable("auditInventory");
boolean success = false;
Map<String, Object> variables = new HashMap<>();
try {
+ Integer retryCount = externalTask.getRetries();
logger.info("Executing External Task Query Audit Inventory. Audit Inventory: {} \n Retry Number: {}",
- auditInventory.toString(), externalTask.getRetries());
+ auditInventory.toString(), retryCount);
Optional<AAIObjectAuditList> auditList = heatStackAudit.queryHeatStack(auditInventory.getCloudOwner(),
auditInventory.getCloudRegion(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
if (auditList.isPresent()) {
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
success = true;
auditDataService.writeStackDataToRequestDb(auditInventory, auditList.get());
}
+ mdcSetup.setElapsedTime();
+ String externalTaskId = externalTask.getId();
if (success) {
externalTaskService.complete(externalTask, variables);
- logger.debug("The External Task {} was Successful", externalTask.getId());
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
+ logger.debug("The External Task {} was Successful", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
- if (externalTask.getRetries() == null) {
+ if (retryCount == null) {
logger.debug("The External Task {} Failed. Setting Retries to Default Start Value: {}",
- externalTask.getId(), getRetrySequence().length);
+ externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, getRetrySequence().length, 10000);
- } else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
- logger.debug("The External Task {} Failed. All Retries Exhausted", externalTask.getId());
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
+ logger.debug("The External Task {} Failed. All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else {
logger.debug("The External Task {} Failed. Decrementing Retries to {} , Retry Delay: ",
- externalTask.getId(), externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
- UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, retryCount - 1, calculateRetryDelay(retryCount));
}
- logger.debug("The External Task {} Failed", externalTask.getId());
+ logger.debug("The External Task {} Failed", externalTaskId);
}
} catch (Exception e) {
logger.error("Error during audit query of stack", e);
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index 6a42456715..fb7e925d88 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -20,13 +20,9 @@
package org.onap.so.adapters.audit;
-import java.security.GeneralSecurityException;
import javax.annotation.PostConstruct;
import org.camunda.bpm.client.ExternalTaskClient;
-import org.camunda.bpm.client.backoff.ExponentialBackoffStrategy;
-import org.camunda.bpm.client.interceptor.ClientRequestInterceptor;
-import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider;
-import org.onap.so.utils.CryptoUtils;
+import org.onap.so.utils.ExternalTaskServiceUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,10 +52,13 @@ public class AuditStackService {
@Autowired
private AuditQueryStackService auditQueryStack;
+ @Autowired
+ private ExternalTaskServiceUtils externalTaskServiceUtils;
+
@PostConstruct
- public void auditAddAAIInventory() {
- for (int i = 0; i < getMaxClients(); i++) {
- ExternalTaskClient client = createExternalTaskClient();
+ public void auditAddAAIInventory() throws Exception {
+ for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
+ ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryAddAudit")
.lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditCreateStack::executeExternalTask).open();
@@ -67,9 +66,9 @@ public class AuditStackService {
}
@PostConstruct
- public void auditDeleteAAIInventory() {
- for (int i = 0; i < getMaxClients(); i++) {
- ExternalTaskClient client = createExternalTaskClient();
+ public void auditDeleteAAIInventory() throws Exception {
+ for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
+ ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryDeleteAudit")
.lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditDeleteStack::executeExternalTask).open();
@@ -77,35 +76,13 @@ public class AuditStackService {
}
@PostConstruct
- public void auditQueryInventory() {
- for (int i = 0; i < getMaxClients(); i++) {
- ExternalTaskClient client = createExternalTaskClient();
+ public void auditQueryInventory() throws Exception {
+ for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
+ ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryQueryAudit")
.lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", DEFAULT_AUDIT_LOCK_TIME)))
.handler(auditQueryStack::executeExternalTask).open();
}
}
- protected ExternalTaskClient createExternalTaskClient() {
- ClientRequestInterceptor interceptor = createClientRequestInterceptor();
- return ExternalTaskClient.create().baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1)
- .addInterceptor(interceptor).asyncResponseTimeout(120000)
- .backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build();
- }
-
- protected ClientRequestInterceptor createClientRequestInterceptor() {
- String auth = "";
- try {
- auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
- } catch (IllegalStateException | GeneralSecurityException e) {
- logger.error("Error Decrypting Password", e);
- }
- return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth);
- }
-
- protected int getMaxClients() {
- return Integer.parseInt(env.getProperty("workflow.topics.maxClients", DEFAULT_MAX_CLIENTS_FOR_TOPIC));
- }
-
-
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
index 14d83b3b06..35008b6120 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
@@ -84,7 +84,7 @@ public class AuditVServer extends AbstractAudit {
try {
logger.debug("Vserver to Audit: {}", objectMapper.getMapper().writeValueAsString(vserver));
} catch (JsonProcessingException e) {
- logger.error("Json parse exception: {}", e.getMessage());
+ logger.error("Json parse exception: ", e);
}
});
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
index 49a9e7e171..5261f8ae19 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
@@ -20,15 +20,9 @@
package org.onap.so.adapters.inventory.create;
-import java.security.GeneralSecurityException;
import javax.annotation.PostConstruct;
import org.camunda.bpm.client.ExternalTaskClient;
-import org.camunda.bpm.client.backoff.ExponentialBackoffStrategy;
-import org.camunda.bpm.client.interceptor.ClientRequestInterceptor;
-import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider;
-import org.onap.so.utils.CryptoUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.onap.so.utils.ExternalTaskServiceUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
@@ -38,27 +32,19 @@ import org.springframework.stereotype.Component;
@Profile("!test")
public class CreateInventoryService {
- private static final Logger logger = LoggerFactory.getLogger(CreateInventoryService.class);
-
@Autowired
public Environment env;
@Autowired
private CreateInventoryTask createInventory;
+ @Autowired
+ private ExternalTaskServiceUtils externalTaskServiceUtils;
+
@PostConstruct
- public void auditAAIInventory() {
- String auth = "";
- try {
- auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
- } catch (IllegalStateException | GeneralSecurityException e) {
- logger.error("Error Decrypting Password", e);
- }
- ClientRequestInterceptor interceptor =
- new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth);
- ExternalTaskClient client = ExternalTaskClient.create()
- .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
- .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build();
+ public void auditAAIInventory() throws Exception {
+
+ ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
client.subscribe("InventoryCreate")
.lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))
.handler(createInventory::executeExternalTask).open();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
index a6c61704ad..3d2d1d2aa3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
@@ -26,16 +26,16 @@ import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAuditList;
+import org.onap.so.utils.ExternalTaskUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class CreateInventoryTask {
+public class CreateInventoryTask extends ExternalTaskUtils {
private static final String UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI = "Unable to write all inventory to A&AI";
@@ -47,24 +47,28 @@ public class CreateInventoryTask {
CreateAAIInventory createInventory;
@Autowired
- public Environment env;
+ private AuditMDCSetup mdcSetup;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- setupMDC(externalTask);
+ mdcSetup.setupMDC(externalTask);
boolean success = true;
boolean inventoryException = false;
String auditInventoryString = externalTask.getVariable("auditInventoryResult");
AAIObjectAuditList auditInventory = null;
+ String externalTaskId = externalTask.getId();
try {
GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
auditInventory = objectMapper.getMapper().readValue(auditInventoryString, AAIObjectAuditList.class);
} catch (Exception e) {
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.error("Error Parsing Audit Results", e);
}
+ mdcSetup.setElapsedTime();
if (auditInventory != null) {
+ Integer retryCount = externalTask.getRetries();
try {
logger.info("Executing External Task Create Inventory, Retry Number: {} \n {}", auditInventory,
- externalTask.getRetries());
+ retryCount);
createInventory.createInventory(auditInventory);
} catch (InventoryException e) {
logger.error("Error during inventory of stack", e);
@@ -74,58 +78,39 @@ public class CreateInventoryTask {
logger.error("Error during inventory of stack", e);
success = false;
}
+ mdcSetup.setElapsedTime();
if (success) {
externalTaskService.complete(externalTask);
- logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
+ logger.debug("The External Task Id: {} Successful", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ mdcSetup.clearClientMDCs();
} else if (inventoryException) {
- logger.debug("The External Task Id: {} Failed, Retry not needed", externalTask.getId());
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
+ logger.debug("The External Task Id: {} Failed, Retry not needed", externalTaskId);
externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
} else {
- if (externalTask.getRetries() == null) {
+ if (retryCount == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
- externalTask.getId(), getRetrySequence().length);
+ externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, getRetrySequence().length, 10000);
- } else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
- logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ } else if (retryCount != null && retryCount - 1 == 0) {
externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
- externalTask.getId(), externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
- UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, externalTask.getRetries() - 1,
- calculateRetryDelay(externalTask.getRetries()));
+ UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, retryCount - 1, calculateRetryDelay(retryCount));
}
- logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ logger.debug("The External Task Id: {} Failed", externalTaskId);
}
} else {
- logger.debug("The External Task Id: {} Failed, No Audit Results Written", externalTask.getId());
+ logger.debug("The External Task Id: {} Failed, No Audit Results Written", externalTaskId);
externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
}
}
-
- private void setupMDC(ExternalTask externalTask) {
- try {
- logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName());
- String msoRequestId = externalTask.getVariable("mso-request-id");
- if (msoRequestId != null && !msoRequestId.isEmpty())
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
- } catch (Exception e) {
- logger.error("Error in setting up MDC", e);
- }
- }
-
- protected long calculateRetryDelay(int currentRetries) {
- int retrySequence = getRetrySequence().length - currentRetries;
- long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000"));
- return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
- }
-
- public String[] getRetrySequence() {
- return env.getProperty("mso.workflow.topics.retrySequence", String[].class);
- }
}
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 4c115271f0..ef04ee9c13 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
@@ -24,8 +24,6 @@
package org.onap.so.adapters.network;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -33,7 +31,6 @@ import java.util.Map;
import java.util.Optional;
import javax.jws.WebService;
import javax.xml.ws.Holder;
-import org.onap.so.logger.LoggingAnchor;
import org.onap.so.adapters.network.beans.ContrailPolicyRef;
import org.onap.so.adapters.network.beans.ContrailPolicyRefSeq;
import org.onap.so.adapters.network.beans.ContrailSubnet;
@@ -51,6 +48,7 @@ import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
import org.onap.so.db.catalog.utils.MavenLikeVersioning;
import org.onap.so.entity.MsoRequest;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.NetworkInfo;
@@ -74,6 +72,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
@Component
@Transactional
@@ -91,6 +91,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork";
private static final String NEUTRON_MODE = "NEUTRON";
private static final String CLOUD_OWNER = "CloudOwner";
+ private static final String LOG_DEBUG_MSG = "Got Network definition from Catalog: {}";
private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class);
@@ -230,7 +231,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
} catch (MsoException me) {
logger.error(
"{} {} Exception while querying network {} for CloudSite {} from Tenant {} from OpenStack ",
- MessageEnum.RA_QUERY_NETWORK_EXC, ErrorCode.BusinessProcesssError.getValue(), networkName,
+ MessageEnum.RA_QUERY_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkName,
cloudSiteId, tenantId, me);
me.addContext(CREATE_NETWORK_CONTEXT);
throw new NetworkException(me);
@@ -292,7 +293,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
}
- logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
+ logger.debug("Got HEAT Template from DB: {}", heatTemplate);
// "Fix" the template if it has CR/LF (getting this from Oracle)
String template = heatTemplate.getHeatTemplate();
@@ -309,7 +310,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// First, look up to see if the Network already exists (by name).
// For HEAT orchestration of networks, the stack name will always match the network name
StackInfo heatStack = null;
- long queryNetworkStarttime = System.currentTimeMillis();
try {
heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName);
} catch (MsoException me) {
@@ -426,7 +426,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
if (backout == null)
backout = true;
heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template,
- stackParams, true, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue());
+ stackParams, true, 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,
@@ -462,13 +463,13 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
}
}
+ 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.setNeutronNetworkId((String) heatStack.getOutputs().get(NETWORK_ID));
networkRollback.setNetworkCreated(true);
networkRollback.setNetworkType(networkType);
@@ -562,13 +563,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Verify that the Network exists
// For Neutron-based orchestration, the networkId is the Neutron Network UUID.
NetworkInfo netInfo = null;
- long queryNetworkStarttime = System.currentTimeMillis();
try {
netInfo = neutron.queryNetwork(networkId, tenantId, cloudSiteId);
} catch (MsoException me) {
me.addContext(UPDATE_NETWORK_CONTEXT);
logger.error("{} {} Exception - queryNetwork query {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
- ErrorCode.BusinessProcesssError.getValue(), networkId, cloudSiteId, tenantId, me);
+ ErrorCode.BusinessProcessError.getValue(), networkId, cloudSiteId, tenantId, me);
throw new NetworkException(me);
}
@@ -576,7 +576,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String error = String.format("Update Nework: Network %s does not exist in %s/%s", networkId,
cloudSiteId, tenantId);
logger.error(LoggingAnchor.THREE, MessageEnum.RA_NETWORK_NOT_FOUND,
- ErrorCode.BusinessProcesssError.getValue(), error);
+ ErrorCode.BusinessProcessError.getValue(), error);
// Does not exist. Throw an exception (can't update a non-existent network)
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
@@ -606,7 +606,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// First, look up to see that the Network already exists.
// For Heat-based orchestration, the networkId is the network Stack ID.
StackInfo heatStack = null;
- long queryStackStarttime = System.currentTimeMillis();
try {
heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName);
} catch (MsoException me) {
@@ -656,7 +655,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
}
- logger.debug("Got HEAT Template from DB: {}", heatTemplate.toString());
+ logger.debug("Got HEAT Template from DB: {}", heatTemplate);
// "Fix" the template if it has CR/LF (getting this from Oracle)
String template = heatTemplate.getHeatTemplate();
@@ -726,7 +725,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Update the network stack
// Ignore MsoStackNotFound exception because we already checked.
- long updateStackStarttime = System.currentTimeMillis();
try {
heatStack = heatWithUpdate.updateStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId, template,
stackParams, true, heatTemplate.getTimeoutMinutes());
@@ -798,12 +796,11 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
}
if (networkCust != null) {
- logger.debug("Got Network Customization definition from Catalog: {}", networkCust.toString());
+ logger.debug("Got Network Customization definition from Catalog: {}", networkCust);
networkResource = networkCust.getNetworkResource();
} else if (collectionNetworkCust != null) {
- logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}",
- collectionNetworkCust.toString());
+ logger.debug("Retrieved Collection Network Resource Customization from Catalog: {}", collectionNetworkCust);
networkResource = collectionNetworkCust.getNetworkResource();
}
if (networkResource == null) {
@@ -814,7 +811,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
- logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
+ logger.debug(LOG_DEBUG_MSG, networkResource);
String mode = networkResource.getOrchestrationMode();
NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
@@ -842,8 +839,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
} else {
String error = String.format(
"Network Type:%s Version_Min:%s Version_Max:%s not supported on Cloud:%s with AIC_Version:%s",
- networkType, networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(),
- cloudSiteId, cloudSite.getCloudVersion());
+ networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(), cloudSiteId,
+ cloudSite.getCloudVersion());
logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error);
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
@@ -891,9 +888,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
-
if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId)
|| commonUtils.isNullOrEmpty(networkNameOrId)) {
@@ -915,10 +909,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Use MsoNeutronUtils for all NEUTRON commands
String mode;
- String neutronId;
+ String neutronId = null;
// Try Heat first, since networks may be named the same as the Heat stack
StackInfo heatStack = null;
- long queryStackStarttime = System.currentTimeMillis();
try {
heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkNameOrId);
} catch (MsoException me) {
@@ -931,12 +924,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// 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();
- neutronId = (String) outputs.get(NETWORK_ID);
mode = "HEAT";
-
- Map<String, String> sMap = new HashMap<>();
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
{
@@ -960,7 +953,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Query directly against the Neutron Network for the details
// no RouteTargets available for ContrailV2 in neutron net-show
// networkId is heatStackId
- long queryNetworkStarttime = System.currentTimeMillis();
try {
NetworkInfo netInfo = neutron.queryNetwork(neutronId, tenantId, cloudSiteId);
if (netInfo != null) {
@@ -1015,13 +1007,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
@Override
public void deleteNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
String networkId, MsoRequest msoRequest, Holder<Boolean> networkDeleted) throws NetworkException {
-
logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId);
-
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
-
-
if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId)
|| commonUtils.isNullOrEmpty(networkId)) {
String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
@@ -1031,7 +1017,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Retrieve the Network Resource definition
NetworkResource networkResource = null;
-
if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) {
if (!commonUtils.isNullOrEmpty(networkType)) {
networkResource = networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType);
@@ -1043,20 +1028,23 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
networkResource = nrc.getNetworkResource();
}
}
+
+ int timeoutMinutes = 118;
String mode = "";
if (networkResource != null) {
- logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
-
+ logger.debug(LOG_DEBUG_MSG, networkResource.toString());
mode = networkResource.getOrchestrationMode();
+ networkResource.getHeatTemplate().getTimeoutMinutes();
+ HeatTemplate heat = networkResource.getHeatTemplate();
+ if (heat != null && heat.getTimeoutMinutes() != null) {
+ if (heat.getTimeoutMinutes() < 118) {
+ timeoutMinutes = heat.getTimeoutMinutes();
+ }
+ }
}
if (NEUTRON_MODE.equals(mode)) {
-
- // Use MsoNeutronUtils for all NEUTRON commands
- long deleteNetworkStarttime = System.currentTimeMillis();
try {
- // The deleteNetwork function in MsoNeutronUtils returns success if the network
- // was not found. So don't bother to query first.
boolean deleted = neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
networkDeleted.value = deleted;
} catch (MsoException me) {
@@ -1065,21 +1053,10 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me);
throw new NetworkException(me);
}
- } else { // DEFAULT to ("HEAT".equals (mode))
- long deleteStackStarttime = System.currentTimeMillis();
-
+ } else {
try {
- // The deleteStack function in MsoHeatUtils returns NOTFOUND if the stack was not found or if the stack
- // was deleted.
- // So query first to report back if stack WAS deleted or just NOTOFUND
- StackInfo heatStack = null;
- heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId);
- if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) {
- heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true);
- networkDeleted.value = true;
- } else {
- networkDeleted.value = false;
- }
+ heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, timeoutMinutes);
+ networkDeleted.value = true;
} catch (MsoException me) {
me.addContext("DeleteNetwork");
logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC,
@@ -1087,10 +1064,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(me);
}
}
-
-
- // On success, nothing is returned.
- return;
}
/**
@@ -1103,9 +1076,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
*/
@Override
public void rollbackNetwork(NetworkRollback rollback) throws NetworkException {
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
-
if (rollback == null) {
logger.error("{} {} rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.DataError.getValue());
return;
@@ -1119,8 +1089,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String modelCustomizationUuid = rollback.getModelCustomizationUuid();
logger.debug("*** ROLLBACK Network {} in {}/{}", networkId, cloudSiteId, tenantId);
-
-
// Retrieve the Network Resource definition
NetworkResource networkResource = null;
if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) {
@@ -1132,44 +1100,34 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String mode = "";
if (networkResource != null) {
- logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
+ logger.debug(LOG_DEBUG_MSG, networkResource);
mode = networkResource.getOrchestrationMode();
}
if (rollback.getNetworkCreated()) {
- // Rolling back a newly created network, so delete it.
if (NEUTRON_MODE.equals(mode)) {
- // Use MsoNeutronUtils for all NEUTRON commands
- long deleteNetworkStarttime = System.currentTimeMillis();
try {
- // The deleteNetwork function in MsoNeutronUtils returns success if the network
- // was not found. So don't bother to query first.
neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
} catch (MsoException me) {
me.addContext("RollbackNetwork");
logger.error("{} {} Exception - Rollback Network (neutron): {} in {}/{} ",
- MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcesssError.getValue(), networkId,
+ MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkId,
cloudSiteId, tenantId, me);
throw new NetworkException(me);
}
- } else { // DEFAULT to if ("HEAT".equals (mode))
- long deleteStackStarttime = System.currentTimeMillis();
+ } else {
try {
- // The deleteStack function in MsoHeatUtils returns success if the stack
- // was not found. So don't bother to query first.
- heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true);
+ heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, 120);
} catch (MsoException me) {
me.addContext("RollbackNetwork");
logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ",
- MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcesssError.getValue(), networkId,
+ MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkId,
cloudSiteId, tenantId, me);
throw new NetworkException(me);
}
}
}
-
- return;
}
private String validateNetworkParams(NetworkType neutronNetworkType, String networkName, String physicalNetwork,
@@ -1312,7 +1270,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
} else {
String error = "Null pFqdns at start of mergePolicyRefs";
- logger.error(LoggingAnchor.THREE, MessageEnum.RA_MARSHING_ERROR, ErrorCode.BusinessProcesssError.getValue(),
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_MARSHING_ERROR, ErrorCode.BusinessProcessError.getValue(),
error);
throw new MsoAdapterException(error);
}
@@ -1325,7 +1283,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
logger.debug("Json PolicyRefs Data:{}", jsonString);
} catch (Exception e) {
String error = "Error creating JsonNode for policyRefs Data";
- logger.error(LoggingAnchor.THREE, MessageEnum.RA_MARSHING_ERROR, ErrorCode.BusinessProcesssError.getValue(),
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_MARSHING_ERROR, ErrorCode.BusinessProcessError.getValue(),
error, e);
throw new MsoAdapterException(error);
}
@@ -1388,9 +1346,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Resource Property
List<ContrailSubnet> cslist = new ArrayList<>();
for (Subnet subnet : subnets) {
- logger.debug("Input Subnet:{}", subnet.toString());
+ logger.debug("Input Subnet:{}", subnet);
ContrailSubnet cs = new ContrailSubnetMapper(subnet).map();
- logger.debug("Contrail Subnet:{}", cs.toString());
+ logger.debug("Contrail Subnet:{}", cs);
cslist.add(cs);
}
@@ -1430,7 +1388,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
* make these optional + " ip_version: %ipversion%\n" + " enable_dhcp: %enabledhcp%\n" +
* " gateway_ip: %gatewayip%\n" + " allocation_pools:\n" + " - start: %poolstart%\n" +
* " end: %poolend%\n";
- *
+ *
*/
String outputTempl = " subnet_id_%subnetId%:\n" + " description: Openstack subnet identifier\n"
@@ -1477,13 +1435,19 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
if (subnet.getAllocationPools() != null) {
- curR = curR + " allocation_pools:\n";
+ StringBuilder tempBuf = new StringBuilder();
+ tempBuf.append(curR);
+ tempBuf.append(" allocation_pools:\n");
for (Pool pool : subnet.getAllocationPools()) {
if (!commonUtils.isNullOrEmpty(pool.getStart()) && !commonUtils.isNullOrEmpty(pool.getEnd())) {
- curR = curR + " - start: " + pool.getStart() + "\n";
- curR = curR + " end: " + pool.getEnd() + "\n";
+ tempBuf.append(" - start: ");
+ tempBuf.append(pool.getStart());
+ tempBuf.append("\n end: ");
+ tempBuf.append(pool.getEnd());
+ tempBuf.append("\n");
}
}
+ curR = tempBuf.toString();
}
resourcesBuf.append(curR);
@@ -1492,7 +1456,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
curO = curO.replace("%subnetId%", subnet.getSubnetId());
outputsBuf.append(curO);
-
}
// append resources and outputs in heatTemplate
logger.debug("Tempate initial:{}", heatTemplate);
@@ -1516,30 +1479,34 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
logger.debug("Subnet_Ipam Output JSON String:{} {}", obj.getClass(), jStr);
JsonNode rootNode = mapper.readTree(jStr);
- for (JsonNode sNode : rootNode.path("ipam_subnets")) {
- logger.debug("Output Subnet Node {}", sNode.toString());
- String name = sNode.path("subnet_name").textValue();
- String uuid = sNode.path("subnet_uuid").textValue();
- String aaiId = name; // default
- // try to find aaiId for name in input subnetList
- if (subnets != null) {
- for (Subnet subnet : subnets) {
- if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) {
- if (subnet.getSubnetName().equals(name)) {
+ if (rootNode != null) {
+ for (JsonNode sNode : rootNode.path("ipam_subnets")) {
+ logger.debug("Output Subnet Node {}", sNode);
+ String name = sNode.path("subnet_name").textValue();
+ String uuid = sNode.path("subnet_uuid").textValue();
+ String aaiId = name; // default
+ // try to find aaiId for name in input subnetList
+ if (subnets != null) {
+ for (Subnet subnet : subnets) {
+ if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())
+ && subnet.getSubnetName().equals(name)) {
aaiId = subnet.getSubnetId();
break;
}
}
}
+ sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map
}
- sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map
+ } else {
+ logger.error("{} {} null rootNode - cannot get subnet-uuids", MessageEnum.RA_MARSHING_ERROR,
+ ErrorCode.DataError.getValue());
}
} catch (Exception e) {
logger.error("{} {} Exception getting subnet-uuids ", MessageEnum.RA_MARSHING_ERROR,
ErrorCode.DataError.getValue(), e);
}
- logger.debug("Return sMap {}", sMap.toString());
+ logger.debug("Return sMap {}", sMap);
return sMap;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
index 4eb5d5637f..0c37837880 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
@@ -124,7 +124,7 @@ public class NetworkAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception while create network ", MessageEnum.RA_CREATE_NETWORK_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -286,7 +286,7 @@ public class NetworkAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception while delete network ", MessageEnum.RA_DELETE_NETWORK_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -403,7 +403,7 @@ public class NetworkAdapterRest {
return Response.status(respStatus).entity(new GenericEntity<QueryNetworkResponse>(resp) {}).build();
} catch (NetworkException e) {
logger.error("{} {} Exception when query VNF ", MessageEnum.RA_QUERY_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
QueryNetworkError err = new QueryNetworkError();
err.setMessage(e.getMessage());
err.setCategory(MsoExceptionCategory.INTERNAL);
@@ -436,7 +436,7 @@ public class NetworkAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception in rollbackNetwork ", MessageEnum.RA_ROLLBACK_NULL,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -529,7 +529,7 @@ public class NetworkAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception in updateNetwork ", MessageEnum.RA_UPDATE_NETWORK_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/MsoOpenstackAdaptersApplication.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/MsoOpenstackAdaptersApplication.java
index 436836491d..d9a83e6a9a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/MsoOpenstackAdaptersApplication.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/MsoOpenstackAdaptersApplication.java
@@ -21,7 +21,7 @@
package org.onap.so.adapters.openstack;
import java.util.concurrent.Executor;
-import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
+import org.onap.logging.filter.spring.MDCTaskDecorator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/WebSecurityConfigImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/WebSecurityConfigImpl.java
deleted file mode 100644
index 97e43d9828..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.openstack;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
index 6a38cc60e6..c782adec64 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java
@@ -100,7 +100,7 @@ public class TenantAdapterRest {
logger.debug("createTenant enter: {}", req.toJsonString());
String newTenantId = null;
- TenantRollback tenantRollback = new TenantRollback();
+ TenantRollback tenantRollback;
try {
Holder<String> htenant = new Holder<>();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
index 3c073af6ba..d75824357f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
@@ -50,7 +50,6 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
-import org.onap.so.client.RestTemplateConfig;
import javax.inject.Provider;
@Component
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
index 62e9d562a6..662ce33022 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
@@ -216,7 +216,7 @@ public class BpelRestClient {
if (totalretries >= retryCount) {
debug("Retried " + totalretries + " times, giving up.");
logger.error("{} {} Could not deliver response to BPEL after {} tries: {}",
- MessageEnum.RA_SEND_VNF_NOTIF_ERR, ErrorCode.BusinessProcesssError.getValue(), totalretries,
+ MessageEnum.RA_SEND_VNF_NOTIF_ERR, ErrorCode.BusinessProcessError.getValue(), totalretries,
toBpelStr);
return false;
}
@@ -273,7 +273,7 @@ public class BpelRestClient {
}
} catch (Exception e) {
logger.error("{} {} Exception - Error sending Bpel notification: {} ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), toBpelStr, e);
+ ErrorCode.BusinessProcessError.getValue(), toBpelStr, e);
lastResponseCode = 900;
lastResponse = "";
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java
deleted file mode 100644
index 7786b872ef..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/CSAR.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-import org.onap.so.adapters.vdu.VduArtifact;
-import org.onap.so.adapters.vdu.VduArtifact.ArtifactType;
-import org.onap.so.adapters.vdu.VduModelInfo;
-import org.onap.so.adapters.vnf.exceptions.VnfException;
-import com.google.common.io.Files;
-
-/**
- * The purpose of this class is to create a CSAR byte array from Vdu inputs for the purpose of forwarding to a TOSCA
- * orchestrator.
- *
- * @author DeWayne
- *
- */
-public class CSAR {
- private static final String MANIFEST_FILENAME = "MANIFEST.MF";
- private VduModelInfo vduModel;
-
- public CSAR(VduModelInfo model) {
- this.vduModel = model;
- }
-
- /**
- * Creates a byte array representation of a CSAR corresponding to the VduBlueprint arg in the constructor.
- *
- * @return
- * @throws VnfException
- */
- public byte[] create() {
- File dir = Files.createTempDir();
-
- /**
- * Create subdir
- */
- File metadir = new File(dir.getAbsolutePath() + "/TOSCA-Metadata");
- if (!metadir.mkdir()) {
- throw new RuntimeException("CSAR TOSCA-Metadata directory create failed");
- }
-
- /**
- * Organize model info for consumption
- */
- VduArtifact mainTemplate = null;
- List<VduArtifact> extraFiles = new ArrayList<>();
- for (VduArtifact artifact : vduModel.getArtifacts()) {
- if (artifact.getType() == ArtifactType.MAIN_TEMPLATE) {
- mainTemplate = artifact;
- } else {
- extraFiles.add(artifact);
- }
- }
-
- if (mainTemplate == null) { // make a dummy to avoid null pointers
- mainTemplate = new VduArtifact("", new byte[0], null);
- }
-
- /**
- * Write template files
- */
- try (OutputStream ofs = new FileOutputStream(new File(dir, mainTemplate.getName()));
- PrintStream mfstream =
- new PrintStream(new File(metadir.getAbsolutePath() + '/' + MANIFEST_FILENAME));) {
- ofs.write(mainTemplate.getContent());
-
- /**
- * Write other files
- */
- if (!extraFiles.isEmpty()) {
- for (VduArtifact artifact : extraFiles) {
- try (OutputStream out = new FileOutputStream(new File(dir, artifact.getName()));) {
- out.write(artifact.getContent());
- }
- }
- }
-
-
- /**
- * Create manifest
- */
- mfstream.println("TOSCA-Meta-File-Version: 1.0");
- mfstream.println("CSAR-Version: 1.1");
- mfstream.println("Created-by: ONAP");
- mfstream.println("Entry-Definitions: " + mainTemplate.getName());
-
- /**
- * ZIP it up
- */
- ByteArrayOutputStream zipbytes = new ByteArrayOutputStream();
- ZipOutputStream zos = new ZipOutputStream(zipbytes);
- compressTree(zos, "", dir, dir);
- zos.close();
- return zipbytes.toByteArray();
-
- } catch (Exception e) {
- throw new RuntimeException("Failed to create CSAR: " + e.getMessage());
- } finally {
- /**
- * Clean up tmpdir
- */
- deleteDirectory(dir);
- }
- }
-
- /**
- * Private methods
- */
-
- /**
- * Compresses (ZIPs) a directory tree
- *
- * @param dir
- * @throws IOException
- */
- private void compressTree(ZipOutputStream zos, String path, File basedir, File dir) throws IOException {
- if (!dir.isDirectory())
- return;
-
- for (File f : dir.listFiles()) {
- if (f.isDirectory()) {
- String newpath = path + f.getName() + '/';
- ZipEntry entry = new ZipEntry(newpath);
- zos.putNextEntry(entry);
- zos.closeEntry();
- compressTree(zos, newpath, basedir, f);
- } else {
- ZipEntry ze = new ZipEntry(
- f.getAbsolutePath().substring(basedir.getAbsolutePath().length() + 1).replaceAll("\\\\", "/"));
- zos.putNextEntry(ze);
- // read the file and write to ZipOutputStream
- try (FileInputStream fis = new FileInputStream(f);) {
- byte[] buffer = new byte[1024];
- int len;
- while ((len = fis.read(buffer)) > 0) {
- zos.write(buffer, 0, len);
- }
- }
- zos.closeEntry();
- }
- }
- }
-
- private boolean deleteDirectory(File directory) {
- if (directory.exists()) {
- File[] files = directory.listFiles();
- if (null != files) {
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory()) {
- deleteDirectory(files[i]);
- } else {
- files[i].delete();
- }
- }
- }
- }
- return (directory.delete());
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
index f6ea2261d7..0074dca03c 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
@@ -121,6 +121,9 @@ public interface MsoVnfAdapter {
@WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner,
@WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
@WebParam(name = "vfName") @XmlElement(required = true) String vfName,
+ @WebParam(name = "vnfId") @XmlElement(required = true) String vnfId,
+ @WebParam(name = "vfModuleId") @XmlElement(required = true) String vfModuleId,
+ @WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid,
@WebParam(name = "request") MsoRequest msoRequest,
@WebParam(name = "vfModuleOutputs", mode = Mode.OUT) Holder<Map<String, String>> vfModuleOutputs)
throws VnfException;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
index 6713c2d069..e925e6037c 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
@@ -135,7 +135,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
vnfRollback);
} catch (VnfException e) {
logger.error("{} {} VnfException in createVnfA ", MessageEnum.RA_CREATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
String eMsg = null;
try {
@@ -144,7 +144,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
.fromValue(e.getFaultInfo().getCategory().name());
} catch (Exception e1) {
logger.error("{} {} Exception - Fault info ", MessageEnum.RA_FAULT_INFO_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
// Build and send Asynchronous error response
try {
@@ -152,7 +152,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.createVnfNotification(messageId, false, exCat, eMsg, null, null, null);
} catch (Exception e1) {
logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
logger.info(LoggingAnchor.ONE, MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
return;
@@ -165,7 +165,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
copyVrb(vnfRollback));
} catch (Exception e) {
logger.error("{} {} Exception sending createVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF_COMPLETE);
return;
@@ -191,7 +191,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback);
} catch (VnfException e) {
logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_UPDATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
String eMsg = null;
try {
@@ -200,7 +200,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
.fromValue(e.getFaultInfo().getCategory().name());
} catch (Exception e1) {
logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
// Build and send Asynchronous error response
try {
@@ -208,7 +208,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.updateVnfNotification(messageId, false, exCat, eMsg, null, null);
} catch (Exception e1) {
logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
return;
@@ -221,7 +221,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
copyVrb(vnfRollback));
} catch (Exception e) {
logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE);
return;
@@ -261,7 +261,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
outputs);
} catch (VnfException e) {
logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
String eMsg = null;
try {
@@ -270,7 +270,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
.fromValue(e.getFaultInfo().getCategory().name());
} catch (Exception e1) {
logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
// Build and send Asynchronous error response
try {
@@ -278,7 +278,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.queryVnfNotification(messageId, false, exCat, eMsg, null, null, null, null);
} catch (Exception e1) {
logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
return;
@@ -298,7 +298,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
copyQueryOutputs(outputs));
} catch (Exception e) {
logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE);
@@ -331,7 +331,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
vnfAdapter.deleteVnf(cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest);
} catch (VnfException e) {
logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
String eMsg = null;
try {
@@ -340,7 +340,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
.fromValue(e.getFaultInfo().getCategory().name());
} catch (Exception e1) {
logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
// Build and send Asynchronous error response
try {
@@ -348,7 +348,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.deleteVnfNotification(messageId, false, exCat, eMsg);
} catch (Exception e1) {
logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
return;
@@ -362,7 +362,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
} catch (Exception e) {
logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
logger.info("{} deleteVnfA", MessageEnum.RA_ASYNC_DELETE_VNF_COMPLETE);
@@ -391,7 +391,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
vnfAdapter.rollbackVnf(rollback);
} catch (VnfException e) {
logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_ROLLBACK_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
String eMsg = null;
try {
@@ -400,7 +400,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
.fromValue(e.getFaultInfo().getCategory().name());
} catch (Exception e1) {
logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
// Build and send Asynchronous error response
try {
@@ -408,7 +408,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.rollbackVnfNotification(messageId, false, exCat, eMsg);
} catch (Exception e1) {
logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
return;
@@ -421,7 +421,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
notifyPort.rollbackVnfNotification(messageId, true, null, null);
} catch (Exception e) {
logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE);
@@ -519,17 +519,17 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("VnfAdapterNotify.wsdl");
} catch (Exception e) {
logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
if (warWsdlLoc == null) {
logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND,
- ErrorCode.BusinessProcesssError.getValue());
+ ErrorCode.BusinessProcessError.getValue());
} else {
try {
logger.debug("VnfAdpaterNotify.wsdl location:{}", warWsdlLoc.toURI().toString());
} catch (Exception e) {
logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
}
@@ -545,7 +545,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
epUrl = new URL(notificationUrl);
} catch (MalformedURLException e1) {
logger.error("{} {} MalformedURLException ", MessageEnum.RA_INIT_NOTIF_EXC,
- ErrorCode.BusinessProcesssError.getValue(), e1);
+ ErrorCode.BusinessProcessError.getValue(), e1);
}
if (null != epUrl) {
@@ -567,7 +567,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
headers.put("Authorization", Collections.singletonList(basicAuth));
} catch (Exception e) {
logger.error("{} {} Exception - Unable to set authorization in callback request ",
- MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.BusinessProcesssError.getValue(), e);
+ MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.BusinessProcessError.getValue(), e);
}
return notifyPort;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index 1d73bf21c9..4b908004df 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -25,18 +25,13 @@
package org.onap.so.adapters.vnf;
-import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import java.util.concurrent.TimeUnit;
import javax.jws.WebService;
import javax.xml.ws.Holder;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.commons.collections.CollectionUtils;
import org.onap.so.adapters.valet.GenericValetResponse;
import org.onap.so.adapters.valet.ValetClient;
@@ -47,7 +42,6 @@ import org.onap.so.adapters.valet.beans.ValetDeleteResponse;
import org.onap.so.adapters.valet.beans.ValetRollbackResponse;
import org.onap.so.adapters.valet.beans.ValetStatus;
import org.onap.so.adapters.valet.beans.ValetUpdateResponse;
-import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.adapters.vnf.exceptions.VnfNotFound;
import org.onap.so.client.aai.AAIResourcesClient;
@@ -65,9 +59,11 @@ import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository;
import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
import org.onap.so.db.catalog.utils.MavenLikeVersioning;
import org.onap.so.entity.MsoRequest;
+import org.onap.so.heatbridge.HeatBridgeException;
import org.onap.so.heatbridge.HeatBridgeApi;
import org.onap.so.heatbridge.HeatBridgeImpl;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.StackInfo;
@@ -80,6 +76,10 @@ import org.onap.so.openstack.exceptions.MsoHeatNotFoundException;
import org.onap.so.openstack.utils.MsoHeatEnvironmentEntry;
import org.onap.so.openstack.utils.MsoHeatUtils;
import org.onap.so.openstack.utils.MsoHeatUtilsWithUpdate;
+import org.openstack4j.model.compute.Flavor;
+import org.openstack4j.model.compute.Image;
+import org.openstack4j.model.compute.Server;
+import org.openstack4j.model.heat.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -89,10 +89,6 @@ import org.springframework.transaction.annotation.Transactional;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openstack4j.model.compute.Flavor;
-import org.openstack4j.model.compute.Image;
-import org.openstack4j.model.compute.Server;
-import org.openstack4j.model.heat.Resource;
@WebService(serviceName = "VnfAdapter", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapter",
targetNamespace = "http://org.onap.so/vnf")
@@ -133,7 +129,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
@Autowired
private MsoHeatUtilsWithUpdate heatU;
@Autowired
- private MsoHeatUtils heat;
+ private MsoHeatUtils msoHeatUtils;
@Autowired
private ValetClient vci;
@@ -264,7 +260,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
StackInfo heatStack;
try {
- heatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, vnfName);
+ heatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, vnfName);
} catch (MsoException me) {
me.addContext("QueryVNF");
// Failed to query the Stack due to an openstack exception.
@@ -317,7 +313,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
logger.debug("Deleting VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId);
try {
- heat.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true);
+ msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, 118);
} catch (MsoException me) {
me.addContext(DELETE_VNF);
// Failed to query the Stack due to an openstack exception.
@@ -360,7 +356,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// of NOTFOUND (on success) or FAILED (on error). Also, MsoOpenstackException
// could be thrown.
try {
- heat.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfId, true);
+ msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfId, true, 118);
} catch (MsoException me) {
// Failed to rollback the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -415,34 +411,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
return new HashMap<>(stringInputs);
}
- protected boolean callHeatbridge(String heatStackId) {
- String executionDir = "/usr/local/lib/python2.7/dist-packages/heatbridge";
- String openstackIdentityUrl = "", username = "", password = "", tenant = "", region = "", owner = "";
- long waitTimeMs = 10000L;
- try {
- String[] cmdarray = {"/usr/bin/python", "HeatBridgeMain.py", openstackIdentityUrl, username, password,
- tenant, region, owner, heatStackId};
- String[] envp = null;
- File dir = new File(executionDir);
- logger.debug("Calling HeatBridgeMain.py in {} with arguments {}", dir, Arrays.toString(cmdarray));
- Runtime r = Runtime.getRuntime();
- Process p = r.exec(cmdarray, envp, dir);
- boolean wait = p.waitFor(waitTimeMs, TimeUnit.MILLISECONDS);
-
- logger.debug(" HeatBridgeMain.py returned {} with code {}", wait, p.exitValue());
- return wait && p.exitValue() == 0;
- } catch (IOException e) {
- logger.debug(" HeatBridgeMain.py failed with IO Exception! {}", e);
- return false;
- } catch (RuntimeException e) {
- logger.debug(" HeatBridgeMain.py failed during runtime! {}", e);
- return false;
- } catch (Exception e) {
- logger.debug(" HeatBridgeMain.py failed for unknown reasons! {}", e);
- return false;
- }
- }
-
private void heatbridge(StackInfo heatStack, String cloudOwner, String cloudSiteId, String tenantId,
String genericVnfName, String vfModuleId) {
try {
@@ -453,13 +421,17 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
List<String> oobMgtNetNames = new ArrayList<>();
- HeatBridgeApi heatBridgeClient =
- new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudOwner, cloudSiteId, tenantId);
+ HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudOwner,
+ cloudSiteId, cloudSite.getRegionId(), tenantId);
+
+ heatBridgeClient.authenticate();
List<Resource> stackResources = heatBridgeClient.queryNestedHeatStackResources(heatStackId);
List<Server> osServers = heatBridgeClient.getAllOpenstackServers(stackResources);
+ heatBridgeClient.createPserversAndPinterfacesIfNotPresentInAai(stackResources);
+
List<Image> osImages = heatBridgeClient.extractOpenstackImagesFromServers(osServers);
List<Flavor> osFlavors = heatBridgeClient.extractOpenstackFlavorsFromServers(osServers);
@@ -633,97 +605,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vfRollback.setIsBase(isBaseRequest);
vfRollback.setModelCustomizationUuid(mcu);
- // Put data into A&AI through Heatstack
- if (enableBridge != null && enableBridge) {
- callHeatbridge(baseVfHeatStackId);
- }
-
- StackInfo heatStack = null;
- try {
- heatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, vfModuleName);
- } catch (MsoException me) {
- String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/"
- + tenantId + ": " + me;
- logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.DataError.getValue(),
- "Exception - " + QUERY_STACK, me);
- logger.debug(error);
- // Failed to query the Stack due to an openstack exception.
- // Convert to a generic VnfException
- me.addContext(CREATE_VFM_MODULE);
- throw new VnfException(me);
- }
- // more precise handling/messaging if the stack already exists
- if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) {
- // INIT, CREATED, NOTFOUND, FAILED, BUILDING, DELETING, UNKNOWN, UPDATING, UPDATED
- HeatStatus status = heatStack.getStatus();
- if (status == HeatStatus.INIT || status == HeatStatus.BUILDING || status == HeatStatus.DELETING
- || status == HeatStatus.UPDATING) {
- // fail - it's in progress - return meaningful error
- String error = CREATE_VF_STACK + " " + vfModuleName + " already exists and has status "
- + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId
- + "; please wait for it to complete, or fix manually.";
- logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.DataError.getValue(),
- STACK + " " + vfModuleName + " already exists");
- logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId,
- heatStack.getCanonicalName());
- }
- if (status == HeatStatus.FAILED) {
- // fail - it exists and is in a FAILED state
- String error = CREATE_VF_STACK + " " + vfModuleName + " already exists and is in FAILED state in "
- + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.DataError.getValue(),
- STACK + " " + vfModuleName + " already exists and is " + "in FAILED state");
- logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId,
- heatStack.getCanonicalName());
- }
- if (status == HeatStatus.UNKNOWN || status == HeatStatus.UPDATED) {
- // fail - it exists and is in a FAILED state
- String error = CREATE_VF_STACK + " " + vfModuleName + " already exists and has status "
- + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId
- + "; requires manual intervention.";
- logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.DataError.getValue(),
- STACK + " " + vfModuleName + " already exists and is " + "in UPDATED or UNKNOWN state");
- logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId,
- heatStack.getCanonicalName());
- }
- if (status == HeatStatus.CREATED) {
- // fail - it exists
- if (failIfExists != null && failIfExists) {
- String error = CREATE_VF_STACK + " " + vfModuleName + " already exists in " + cloudOwner + "/"
- + cloudSiteId + "/" + tenantId;
- logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudOwner, cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.DataError.getValue(),
- STACK + " " + vfModuleName + " already exists");
- logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId,
- heatStack.getCanonicalName());
- } else {
- logger.debug("Found Existing stack, status={}", heatStack.getStatus());
- // Populate the outputs from the existing stack.
- vnfId.value = heatStack.getCanonicalName();
- outputs.value = copyStringOutputs(heatStack.getOutputs());
- rollback.value = vfRollback; // Default rollback - no updates performed
- }
- }
- return;
-
- }
-
// handle a nestedStackId if sent- this one would be for the volume - so applies to both Vf and Vnf
StackInfo nestedHeatStack = null;
-
Map<String, Object> nestedVolumeOutputs = null;
if (nestedStackId != null) {
try {
logger.debug("Querying for nestedStackId = {}", nestedStackId);
- nestedHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
+ nestedHeatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -731,7 +619,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String error = "Create VFModule: Attached heatStack ID Query " + nestedStackId + " in " + cloudOwner
+ "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcesssError.getValue(),
+ cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcessError.getValue(),
"MsoException trying to query nested stack", me);
logger.debug("ERROR trying to query nested stack= {}", error);
throw new VnfException(me);
@@ -740,8 +628,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String error = "Create VFModule: Attached heatStack ID DOES NOT EXIST " + nestedStackId + " in "
+ cloudOwner + "/" + cloudSiteId + "/" + tenantId + " " + USER_ERROR;
logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, error, OPENSTACK, QUERY_STACK,
- ErrorCode.BusinessProcesssError.getValue(),
+ cloudSiteId, tenantId, error, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcessError.getValue(),
"Create VFModule: Attached heatStack ID " + "DOES NOT EXIST");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -757,7 +644,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (nestedBaseStackId != null) {
try {
logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
- nestedBaseHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
+ nestedBaseHeatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -765,7 +652,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String error = "Create VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in "
+ cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcesssError.getValue(),
+ cloudSiteId, tenantId, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcessError.getValue(),
"MsoException trying to query nested base stack", me);
logger.debug("ERROR trying to query nested base stack= {}", error);
throw new VnfException(me);
@@ -774,8 +661,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String error = "Create VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId
+ " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " " + USER_ERROR;
logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner,
- cloudSiteId, tenantId, error, OPENSTACK, QUERY_STACK,
- ErrorCode.BusinessProcesssError.getValue(),
+ cloudSiteId, tenantId, error, OPENSTACK, QUERY_STACK, ErrorCode.BusinessProcessError.getValue(),
"Create VFModule: Attached base heatStack ID DOES NOT EXIST");
logger.debug("Exception occurred", error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -786,7 +672,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
try {
- // Retrieve the VF
VfModule vf = null;
VnfResource vnfResource = null;
VfModuleCustomization vfmc = null;
@@ -908,7 +793,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
+ VERSION_MAX + " :" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId
+ " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion();
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK,
- ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -981,7 +866,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
logger.debug("Contents of nestedTemplates - to be added to files: on stack:");
for (HeatTemplate entry : nestedTemplates) {
nestedTemplatesChecked.put(entry.getTemplateName(), entry.getTemplateBody());
- logger.debug(entry.getTemplateName() + " -> " + entry.getTemplateBody());
+ logger.debug("Adding Nested Template", entry.getTemplateName());
}
} else {
logger.debug("No nested templates found - nothing to do here");
@@ -1103,13 +988,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Step 1 - convert what we got as inputs (Map<String, String>) to a
// Map<String, Object> - where the object matches the param type identified in the template
// This will also not copy over params that aren't identified in the template
- goldenInputs = heat.convertInputMap(inputs, heatTemplate);
+ goldenInputs = msoHeatUtils.convertInputMap(inputs, heatTemplate);
// Step 2 - now simply add the outputs as we received them - no need to convert to string
logger.debug("Now add in the base stack outputs if applicable");
- heat.copyBaseOutputsToInputs(goldenInputs, baseStackOutputs, parameterNames, aliasToParam);
+ msoHeatUtils.copyBaseOutputsToInputs(goldenInputs, baseStackOutputs, parameterNames, aliasToParam);
// Step 3 - add the volume inputs if any
logger.debug("Now add in the volume stack outputs if applicable");
- heat.copyBaseOutputsToInputs(goldenInputs, nestedVolumeOutputs, parameterNames, aliasToParam);
+ msoHeatUtils.copyBaseOutputsToInputs(goldenInputs, nestedVolumeOutputs, parameterNames, aliasToParam);
for (HeatTemplateParam parm : heatTemplate.getParameters()) {
logger.debug("Parameter:'" + parm.getParamName() + "', isRequired=" + parm.isRequired() + ", alias="
@@ -1182,15 +1067,19 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Have the tenant. Now deploy the stack itself
// Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
// because we already checked for those.
+
+ StackInfo heatStack = null;
try {
if (backout == null) {
backout = true;
}
- if (heat != null) {
-
- heatStack = heat.createStack(cloudSiteId, cloudOwner, tenantId, vfModuleName, null, template,
- goldenInputs, true, heatTemplate.getTimeoutMinutes(), newEnvironmentString,
- nestedTemplatesChecked, heatFilesObjects, backout.booleanValue());
+ if (failIfExists == null) {
+ failIfExists = false;
+ }
+ if (msoHeatUtils != null) {
+ heatStack = msoHeatUtils.createStack(cloudSiteId, cloudOwner, tenantId, vfModuleName, null,
+ template, goldenInputs, true, heatTemplate.getTimeoutMinutes(), newEnvironmentString,
+ nestedTemplatesChecked, heatFilesObjects, backout.booleanValue(), failIfExists);
} else {
throw new MsoHeatNotFoundException();
}
@@ -1236,8 +1125,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
}
logger.debug("VF Module {} successfully created", vfModuleName);
- // call heatbridge
- heatbridge(heatStack, cloudOwner, cloudSiteId, tenantId, genericVnfName, vfModuleId);
+ if (enableBridge != null && enableBridge) {
+ // call heatbridge
+ heatbridge(heatStack, cloudOwner, cloudSiteId, tenantId, genericVnfName, vfModuleId);
+ }
} catch (Exception e) {
logger.debug("unhandled exception in create VF", e);
throw new VnfException("Exception during create VF " + e.getMessage());
@@ -1245,17 +1136,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
@Override
- public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName,
- MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException {
-
- logger.debug("Deleting VF {} in ", vnfName, cloudOwner + "/" + cloudSiteId + "/" + tenantId);
- // Will capture execution time for metrics
-
- // 1702 capture the output parameters on a delete
- // so we'll need to query first
+ public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId,
+ String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest,
+ Holder<Map<String, String>> outputs) throws VnfException {
Map<String, Object> stackOutputs;
try {
- stackOutputs = heat.queryStackForOutputs(cloudSiteId, cloudOwner, tenantId, vnfName);
+ stackOutputs = msoHeatUtils.queryStackForOutputs(cloudSiteId, cloudOwner, tenantId, vnfName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -1281,8 +1167,32 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
msoRequest, failRequestOnValetFailure);
}
+ int timeoutMinutes = 118;
+ VfModule vf = null;
+ VfModuleCustomization vfmc = null;
+ if (modelCustomizationUuid != null) {
+ vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid);
+ if (vfmc != null) {
+ vf = vfmc.getVfModule();
+ }
+ if (vf != null) {
+ logger.trace("Found vfModuleCust entry {}", vfmc.toString());
+ HeatTemplate heat = vf.getModuleHeatTemplate();
+ if (heat != null && heat.getTimeoutMinutes() != null) {
+ if (heat.getTimeoutMinutes() < 118) {
+ timeoutMinutes = heat.getTimeoutMinutes();
+ }
+ }
+
+ } else {
+ logger.debug(
+ "Unable to find vfModuleCust with modelCustomizationUuid={} . Using default timeout for polling",
+ modelCustomizationUuid);
+ }
+ }
+
try {
- heat.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true);
+ msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, timeoutMinutes);
} catch (MsoException me) {
me.addContext(DELETE_VNF);
// Failed to query the Stack due to an openstack exception.
@@ -1317,9 +1227,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
logger.error("Exception encountered while sending Confirm to Valet ", e);
}
}
-
- // On success, nothing is returned.
- return;
+ // call heatbridge delete
+ try {
+ new HeatBridgeImpl().deleteVfModuleData(vnfId, vfModuleId);
+ } catch (HeatBridgeException e) {
+ logger.error("Heatbridge failed to delete AAI data for vf-module: " + vfModuleId, e);
+ }
}
@Override
@@ -1413,7 +1326,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
StackInfo heatStack;
logger.debug("UpdateVfModule - querying for {}", vfModuleName);
try {
- heatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, vfModuleName);
+ heatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, vfModuleName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -1448,7 +1361,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (nestedStackId != null) {
try {
logger.debug("Querying for nestedStackId = {}", nestedStackId);
- nestedHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
+ nestedHeatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -1471,7 +1384,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
} else {
logger.debug("Found nested heat stack - copying values to inputs *later*");
nestedVolumeOutputs = nestedHeatStack.getOutputs();
- heat.copyStringOutputsToInputs(inputs, nestedHeatStack.getOutputs(), false);
+ msoHeatUtils.copyStringOutputsToInputs(inputs, nestedHeatStack.getOutputs(), false);
}
}
// handle a nestedBaseStackId if sent - this is the stack ID of the base.
@@ -1480,7 +1393,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (nestedBaseStackId != null) {
try {
logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
- nestedBaseHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
+ nestedBaseHeatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
@@ -1503,14 +1416,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
} else {
logger.debug("Found nested base heat stack - copying values to inputs *later*");
baseStackOutputs = nestedBaseHeatStack.getOutputs();
- heat.copyStringOutputsToInputs(inputs, nestedBaseHeatStack.getOutputs(), false);
+ msoHeatUtils.copyStringOutputsToInputs(inputs, nestedBaseHeatStack.getOutputs(), false);
}
}
- // Ready to deploy the new VNF
-
-
-
// Retrieve the VF definition
VnfResource vnfResource = null;
VfModule vf = null;
@@ -1608,7 +1517,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
+ minVersionVnf + " " + VERSION_MAX + " :" + maxVersionVnf
+ " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + aicV;
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK,
- ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -1920,9 +1829,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
parsedVfModuleName = "unknown";
}
sendResponseToValet = this.valetUpdateRequest(cloudSiteId, cloudOwner, tenantId, heatFilesObjects,
- nestedTemplatesChecked, parsedVfModuleName, false, heatTemplate, newEnvironmentString,
- (HashMap<String, Object>) goldenInputs, msoRequest, inputs, failRequestOnValetFailure,
- valetModifiedParamsHolder);
+ nestedTemplatesChecked, parsedVfModuleName, false, heatTemplate, newEnvironmentString, goldenInputs,
+ msoRequest, inputs, failRequestOnValetFailure, valetModifiedParamsHolder);
if (sendResponseToValet) {
goldenInputs = valetModifiedParamsHolder.value;
}
@@ -2060,7 +1968,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean valetSucceeded = false;
String valetErrorMessage = "more detail not available";
try {
- String keystoneUrl = heat.getCloudSiteKeystoneUrl(cloudSiteId);
+ String keystoneUrl = msoHeatUtils.getCloudSiteKeystoneUrl(cloudSiteId);
Map<String, Object> files =
this.combineGetFilesAndNestedTemplates(heatFilesObjects, nestedTemplatesChecked);
HeatRequest heatRequest = new HeatRequest(vfModuleName, backout, heatTemplate.getTimeoutMinutes(),
@@ -2122,7 +2030,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean valetSucceeded = false;
String valetErrorMessage = "more detail not available";
try {
- String keystoneUrl = heat.getCloudSiteKeystoneUrl(cloudSiteId);
+ String keystoneUrl = msoHeatUtils.getCloudSiteKeystoneUrl(cloudSiteId);
Map<String, Object> files =
this.combineGetFilesAndNestedTemplates(heatFilesObjects, nestedTemplatesChecked);
HeatRequest heatRequest = new HeatRequest(vfModuleName, false, heatTemplate.getTimeoutMinutes(),
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
index f09fa34cb9..abaf881ba5 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
@@ -601,7 +601,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
+ vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax
+ " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK,
- ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -725,7 +725,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in "
+ cloudSiteId + "/" + tenantId + " USER ERROR";
logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudSiteId, tenantId,
- error, CLOUDIFY, "queryDeployment(volume)", ErrorCode.BusinessProcesssError.getValue(),
+ error, CLOUDIFY, "queryDeployment(volume)", ErrorCode.BusinessProcessError.getValue(),
"Create VFModule: Attached Volume Group DOES NOT EXIST");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -774,7 +774,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
+ cloudSiteId + "/" + tenantId + " USER ERROR";
logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, cloudSiteId,
tenantId, error, CLOUDIFY, "queryDeployment(Base)",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create VFModule: Base " + "Module DOES NOT EXIST");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -1081,8 +1081,9 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
}
- public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName,
- MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException {
+ public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId,
+ String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest,
+ Holder<Map<String, String>> outputs) throws VnfException {
logger.debug("Deleting VF " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// 1702 capture the output parameters on a delete
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
index 41bcc8c481..b1f4055b3b 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
@@ -643,7 +643,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
+ " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: "
+ cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -773,7 +773,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
+ cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR";
logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudOwner,
cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Create VFModule: Attached Volume Group " + "DOES NOT EXIST");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
@@ -822,7 +822,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
+ "/" + cloudSiteId + "/" + tenantId + " USER ERROR";
logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, cloudOwner,
cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
- ErrorCode.BusinessProcesssError.getValue(), "Create VFModule: Base Module DOES NOT EXIST");
+ ErrorCode.BusinessProcessError.getValue(), "Create VFModule: Base Module DOES NOT EXIST");
logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
} else {
@@ -1072,8 +1072,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
- public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleId,
- MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException {
+ public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleId, String vnfId,
+ String aaiVfModuleId, String modelCustomizationUuid, MsoRequest msoRequest,
+ Holder<Map<String, String>> outputs) throws VnfException {
logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
index 8c871c742e..0fb11ebbf3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
@@ -130,7 +130,7 @@ public class VnfAdapterRest {
} catch (Exception e) {
// problem handling delete, send generic failure as sync resp to caller
logger.error("", MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in deleteVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in deleteVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -179,13 +179,14 @@ public class VnfAdapterRest {
Holder<Map<String, String>> outputs = new Holder<>();
if (cloudsite != null && !cloudsite.equals(TESTING_KEYWORD)) {
vnfAdapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(),
- req.getVfModuleStackId(), req.getMsoRequest(), outputs);
+ req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(),
+ req.getModelCustomizationUuid(), req.getMsoRequest(), outputs);
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE,
req.getMessageId(), outputs.value);
} catch (VnfException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_DELETE_VNF_ERR.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "VnfException - Delete VNF Module", e);
+ ErrorCode.BusinessProcessError.getValue(), "VnfException - Delete VNF Module", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE,
req.getMessageId());
}
@@ -243,7 +244,7 @@ public class VnfAdapterRest {
return Response.status(respStatus).entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {}).build();
} catch (VnfException e) {
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "VnfException - queryVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "VnfException - queryVfModule", e);
VfModuleExceptionResponse excResp =
new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
@@ -290,7 +291,7 @@ public class VnfAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CREATE_VNF_ERR, "createVfModule",
- ErrorCode.BusinessProcesssError, "Exception - createVfModule", e);
+ ErrorCode.BusinessProcessError, "Exception - createVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -405,7 +406,7 @@ public class VnfAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - updateVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - updateVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -509,7 +510,7 @@ public class VnfAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -560,7 +561,7 @@ public class VnfAdapterRest {
vnfAdapter.rollbackVnf(vrb);
response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId());
} catch (VnfException e) {
- logger.error(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_VNF_ERR, ErrorCode.BusinessProcesssError,
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_VNF_ERR, ErrorCode.BusinessProcessError,
"Exception" + " - " + "rollbackVfModule", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false,
req.getMessageId());
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
index 9a7354c40c..fcb570f3f5 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
@@ -140,7 +140,7 @@ public class VnfAdapterRestV2 {
} catch (Exception e) {
// problem handling delete, send generic failure as sync resp to caller
logger.error(BRACKETS, MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in deleteVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in deleteVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -195,13 +195,14 @@ public class VnfAdapterRestV2 {
// Support different Adapter Implementations
MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsite);
adapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(),
- req.getVfModuleStackId(), req.getMsoRequest(), outputs);
+ req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(),
+ req.getModelCustomizationUuid(), req.getMsoRequest(), outputs);
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE,
req.getMessageId(), outputs.value);
} catch (VnfException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_DELETE_VNF_ERR.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "VnfException - " + "Delete VNF Module", e);
+ ErrorCode.BusinessProcessError.getValue(), "VnfException - " + "Delete VNF Module", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE,
req.getMessageId());
}
@@ -271,7 +272,7 @@ public class VnfAdapterRestV2 {
return Response.status(respStatus).entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {}).build();
} catch (VnfException e) {
logger.error(LoggingAnchor.FIVE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "VnfException - queryVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "VnfException - queryVfModule", e);
VfModuleExceptionResponse excResp =
new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
@@ -320,7 +321,7 @@ public class VnfAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(BRACKETS, MessageEnum.RA_CREATE_VNF_ERR.toString(), "createVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - createVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - createVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -440,7 +441,7 @@ public class VnfAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(BRACKETS, MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - updateVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - updateVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -555,7 +556,7 @@ public class VnfAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error(BRACKETS, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule",
- ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -612,7 +613,7 @@ public class VnfAdapterRestV2 {
response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId());
} catch (VnfException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false,
req.getMessageId());
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java
index 87df7fdc37..c9e046ca43 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java
@@ -118,7 +118,7 @@ public class VolumeAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - createVNFVolumes: ", MessageEnum.RA_CREATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -270,7 +270,7 @@ public class VolumeAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - deleteVNFVolumes: ", MessageEnum.RA_DELETE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -367,7 +367,7 @@ public class VolumeAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - rollbackVNFVolumes: ", MessageEnum.RA_ROLLBACK_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -463,7 +463,7 @@ public class VolumeAdapterRest {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - updateVNFVolumes: ", MessageEnum.RA_UPDATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -607,7 +607,7 @@ public class VolumeAdapterRest {
return Response.status(respStatus).entity(new GenericEntity<QueryVolumeGroupResponse>(qryResp) {}).build();
} catch (VnfException e) {
logger.error("{} {} AaiVolumeGroupId: {} VnfException - queryVNFVolumes", MessageEnum.RA_QUERY_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), aaiVolumeGroupId, e);
+ ErrorCode.BusinessProcessError.getValue(), aaiVolumeGroupId, e);
VolumeGroupExceptionResponse excResp = new VolumeGroupExceptionResponse(e.getMessage(),
MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
logger.debug("Query queryVNFVolumes exit");
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
index 77c9b1e2f5..2b7234aca6 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
@@ -105,7 +105,6 @@ public class VolumeAdapterRestV2 {
@ApiResponse(code = 500, message = "create vnfVolume failed, examine entity object for details")})
public Response createVNFVolumes(@ApiParam(value = "mode", required = true) @QueryParam("mode") String mode,
@ApiParam(value = "CreateVolumeGroupRequest", required = true) final CreateVolumeGroupRequest req) {
- logger.debug("createVNFVolumes enter: {}", req.toJsonString());
CreateVNFVolumesTask task = new CreateVNFVolumesTask(req, mode);
if (req.isSynchronous()) {
// This is a synchronous request
@@ -119,7 +118,7 @@ public class VolumeAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - createVNFVolumes: ", MessageEnum.RA_CREATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -254,7 +253,7 @@ public class VolumeAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - deleteVNFVolumes: ", MessageEnum.RA_DELETE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -356,7 +355,7 @@ public class VolumeAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - rollbackVNFVolumes: ", MessageEnum.RA_ROLLBACK_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -456,7 +455,7 @@ public class VolumeAdapterRestV2 {
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
logger.error("{} {} Exception - updateVNFVolumes: ", MessageEnum.RA_UPDATE_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
@@ -595,7 +594,7 @@ public class VolumeAdapterRestV2 {
return Response.status(respStatus).entity(new GenericEntity<QueryVolumeGroupResponse>(qryResp) {}).build();
} catch (VnfException e) {
logger.error("{} {} AaiVolumeGroupId: {} VnfException - queryVNFVolumes: ", MessageEnum.RA_QUERY_VNF_ERR,
- ErrorCode.BusinessProcesssError.getValue(), aaiVolumeGroupId, e);
+ ErrorCode.BusinessProcessError.getValue(), aaiVolumeGroupId, e);
VolumeGroupExceptionResponse excResp = new VolumeGroupExceptionResponse(e.getMessage(),
MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
logger.debug("Query queryVNFVolumes exit");
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
index aebd04f32c..7eff09b692 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
@@ -138,9 +138,23 @@ public interface HeatBridgeApi {
void buildAddVserverLInterfacesToAaiAction(List<Resource> stackResources, List<String> oobMgtNetIds);
/**
+ * Query and build AAI actions for Openstack Compute resources to AAI's pserver and pinterface objects
+ *
+ * @param stackResources Openstack StackResources list
+ */
+ void createPserversAndPinterfacesIfNotPresentInAai(final List<Resource> stackResources) throws HeatBridgeException;
+
+ /**
* Execute AAI restful API to update the Openstack resources
*
* @throws HeatBridgeException when failing to add openstack resource PoJos to AAI
*/
void submitToAai() throws HeatBridgeException;
+
+ /**
+ * Delete heatbridge data for a given vf-module
+ *
+ * @throws HeatBridgeException when failing to remove heatbridge data from AAI for a given vf-module
+ */
+ void deleteVfModuleData(String vnfId, String vfModuleId) throws HeatBridgeException;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index ae15b70b00..e2022c9a6e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -32,6 +32,7 @@
*/
package org.onap.so.heatbridge;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -49,6 +50,7 @@ import org.onap.aai.domain.yang.Image;
import org.onap.aai.domain.yang.L3InterfaceIpv4AddressList;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.PInterface;
+import org.onap.aai.domain.yang.Pserver;
import org.onap.aai.domain.yang.SriovPf;
import org.onap.aai.domain.yang.SriovPfs;
import org.onap.aai.domain.yang.SriovVf;
@@ -56,13 +58,17 @@ import org.onap.aai.domain.yang.SriovVfs;
import org.onap.aai.domain.yang.Vlan;
import org.onap.aai.domain.yang.Vlans;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.aai.domain.yang.VfModule;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.AAISingleTransactionClient;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.Relationships;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.exceptions.BulkProcessFailed;
+import org.onap.so.client.PreconditionFailedException;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.heatbridge.constants.HeatBridgeConstants;
import org.onap.so.heatbridge.factory.MsoCloudClientFactoryImpl;
@@ -99,33 +105,39 @@ public class HeatBridgeImpl implements HeatBridgeApi {
private AAISingleTransactionClient transaction;
private String cloudOwner;
private String cloudRegionId;
+ private String regionId;
private String tenantId;
private AaiHelper aaiHelper = new AaiHelper();
private CloudIdentity cloudIdentity;
-
public HeatBridgeImpl(AAIResourcesClient resourcesClient, final CloudIdentity cloudIdentity,
- @Nonnull final String cloudOwner, @Nonnull final String cloudRegionId, @Nonnull final String tenantId) {
+ @Nonnull final String cloudOwner, @Nonnull final String cloudRegionId, @Nonnull final String regionId,
+ @Nonnull final String tenantId) {
Objects.requireNonNull(cloudOwner, "Null cloud-owner value!");
Objects.requireNonNull(cloudRegionId, "Null cloud-region identifier!");
Objects.requireNonNull(tenantId, "Null tenant identifier!");
- Objects.requireNonNull(tenantId, "Null AAI actions list!");
+ Objects.requireNonNull(regionId, "Null regionId identifier!");
this.cloudIdentity = cloudIdentity;
this.cloudOwner = cloudOwner;
this.cloudRegionId = cloudRegionId;
+ this.regionId = regionId;
this.tenantId = tenantId;
this.resourcesClient = resourcesClient;
this.transaction = resourcesClient.beginSingleTransaction();
}
+ public HeatBridgeImpl() {
+ this.resourcesClient = new AAIResourcesClient();
+ this.transaction = resourcesClient.beginSingleTransaction();
+ }
+
@Override
public OpenstackClient authenticate() throws HeatBridgeException {
this.osClient = new MsoCloudClientFactoryImpl(new OpenstackClientFactoryImpl()).getOpenstackClient(
- cloudIdentity.getIdentityUrl(), cloudIdentity.getMsoId(), cloudIdentity.getMsoPass(), cloudRegionId,
+ cloudIdentity.getIdentityUrl(), cloudIdentity.getMsoId(), cloudIdentity.getMsoPass(), regionId,
tenantId);
- logger.debug("Successfully authenticated with keystone for tenant: " + tenantId + " and cloud " + "region: "
- + cloudRegionId);
+ logger.debug("Successfully authenticated with keystone for tenant: " + tenantId + " and region: " + regionId);
return osClient;
}
@@ -263,6 +275,44 @@ public class HeatBridgeImpl implements HeatBridgeApi {
}
}
+ @Override
+ public void createPserversAndPinterfacesIfNotPresentInAai(final List<Resource> stackResources)
+ throws HeatBridgeException {
+ Map<String, Pserver> serverHostnames = getPserverMapping(stackResources);
+ createPServerIfNotExists(serverHostnames);
+ List<String> portIds =
+ extractStackResourceIdsByResourceType(stackResources, HeatBridgeConstants.OS_PORT_RESOURCE_TYPE);
+ for (String portId : portIds) {
+ Port port = osClient.getPortById(portId);
+ if (port.getvNicType().equalsIgnoreCase(HeatBridgeConstants.OS_SRIOV_PORT_TYPE)) {
+ createPServerPInterfaceIfNotExists(serverHostnames.get(port.getHostId()).getHostname(),
+ aaiHelper.buildPInterface(port));
+ }
+ }
+ }
+
+ private Map<String, Pserver> getPserverMapping(final List<Resource> stackResources) {
+ List<Server> osServers = getAllOpenstackServers(stackResources);
+ Map<String, Pserver> pserverMap = new HashMap<>();
+ for (Server server : osServers) {
+ pserverMap.put(server.getHost(), aaiHelper.buildPserver(server));
+ }
+ return pserverMap;
+ }
+
+ private void createPServerIfNotExists(Map<String, Pserver> serverHostnames) {
+ for (Pserver pserver : serverHostnames.values()) {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, pserver.getHostname());
+ resourcesClient.createIfNotExists(uri, Optional.of(pserver));
+ }
+ }
+
+ private void createPServerPInterfaceIfNotExists(String pserverHostname, PInterface pInterface) {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.P_INTERFACE, pserverHostname,
+ pInterface.getInterfaceName());
+ resourcesClient.createIfNotExists(uri, Optional.of(pInterface));
+ }
+
private void updateLInterfaceVlan(final Port port, final LInterface lIf) {
Vlan vlan = new Vlan();
Network network = osClient.getNetworkById(port.getNetworkId());
@@ -377,6 +427,78 @@ public class HeatBridgeImpl implements HeatBridgeApi {
}
}
+ @Override
+ public void deleteVfModuleData(@Nonnull final String vnfId, @Nonnull final String vfModuleId)
+ throws HeatBridgeException {
+ Objects.requireNonNull(vnfId, "Null vnf-id!");
+ Objects.requireNonNull(vfModuleId, "Null vf-module-id!");
+ try {
+ Optional<VfModule> vfModule = resourcesClient.get(VfModule.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId).depth(Depth.ONE));
+ if (vfModule.isPresent()) {
+
+ AAIResultWrapper resultWrapper = new AAIResultWrapper(vfModule);
+ Optional<Relationships> relationships = resultWrapper.getRelationships();
+ if (relationships.isPresent()) {
+ List<AAIResourceUri> vserverUris = relationships.get().getRelatedUris(AAIObjectType.VSERVER);
+ createTransactionToDeleteSriovPfFromPserver(vserverUris);
+ if (!vserverUris.isEmpty()) {
+ for (AAIResourceUri vserverUri : vserverUris) {
+ resourcesClient.delete(vserverUri);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ String msg = "Failed to commit delete heatbridge data transaction";
+ logger.debug(msg + " with error: " + e);
+ throw new HeatBridgeException(msg, e);
+ }
+ }
+
+ private void createTransactionToDeleteSriovPfFromPserver(List<AAIResourceUri> vserverUris) {
+ Map<String, List<String>> pserverToPciIdMap = getPserverToPciIdMap(vserverUris);
+ for (Map.Entry<String, List<String>> entry : pserverToPciIdMap.entrySet()) {
+ String pserverName = entry.getKey();
+ List<String> pciIds = entry.getValue();
+ Optional<Pserver> pserver = resourcesClient.get(Pserver.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, pserverName).depth(Depth.TWO));
+ if (pserver.isPresent()) {
+ // For each pserver/p-interface match sriov-vfs by pic-id and delete them.
+ pserver.get().getPInterfaces().getPInterface().stream().filter(
+ pIf -> pIf.getSriovPfs() != null && CollectionUtils.isNotEmpty(pIf.getSriovPfs().getSriovPf()))
+ .forEach(pIf -> pIf.getSriovPfs().getSriovPf().forEach(sriovPf -> {
+ if (pciIds.contains(sriovPf.getPfPciId())) {
+ logger.debug("creating transaction to delete SR-IOV PF: " + pIf.getInterfaceName()
+ + " from PServer: " + pserverName);
+ resourcesClient.delete(AAIUriFactory.createResourceUri(AAIObjectType.SRIOV_PF,
+ pserverName, pIf.getInterfaceName(), sriovPf.getPfPciId()));
+ }
+ }));
+ }
+ }
+ }
+
+ private Map<String, List<String>> getPserverToPciIdMap(List<AAIResourceUri> vserverUris) {
+ Map<String, List<String>> pserverToPciIdMap = new HashMap<>();
+ for (AAIResourceUri vserverUri : vserverUris) {
+ AAIResultWrapper vserverWrapper = resourcesClient.get(vserverUri.depth(Depth.TWO));
+ Optional<Relationships> vserverRelationships = vserverWrapper.getRelationships();
+ if (vserverRelationships.isPresent()
+ && CollectionUtils.isNotEmpty(vserverRelationships.get().getRelatedLinks(AAIObjectType.PSERVER))) {
+ Vserver vserver = vserverWrapper.asBean(Vserver.class).get();
+ List<String> pciIds = HeatBridgeUtils.extractPciIdsFromVServer(vserver);
+ if (CollectionUtils.isNotEmpty(pciIds)) {
+ List<String> matchingPservers = vserverRelationships.get().getRelatedLinks(AAIObjectType.PSERVER);
+ if (matchingPservers != null && matchingPservers.size() == 1) {
+ pserverToPciIdMap.put(matchingPservers.get(0), pciIds);
+ }
+ }
+ }
+ }
+ return pserverToPciIdMap;
+ }
+
private <T> Predicate<T> distinctByProperty(Function<? super T, Object> keyExtractor) {
Map<Object, Boolean> map = new ConcurrentHashMap<>();
return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java
index f2d61d2587..0e87e1fb31 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/constants/HeatBridgeConstants.java
@@ -43,6 +43,7 @@ public class HeatBridgeConstants {
public static final String OS_SRIOV_PORT_TYPE = "direct";
public static final String OS_PCI_SLOT_KEY = "pci_slot";
public static final String OS_PHYSICAL_NETWORK_KEY = "physical_network";
+ public static final String OS_PHYSICAL_INTERFACE_KEY = "physical-interface";
public static final String OS_VLAN_NETWORK_KEY = "vlan";
public static final String OS_UNKNOWN_KEY = "unknown";
public static final String OS_RESOURCES_SELF_LINK_KEY = "self";
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
index 018a4eac8d..e1f363ca05 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
@@ -47,13 +47,13 @@ public interface MsoCloudClientFactory {
* @param url openstack url
* @param msoId openstack user for mso
* @param msoPass openstack password for mso user
- * @param cloudRegionId cloud-region identifier
+ * @param regionId region identifier
* @param tenantId tenant identifier
* @return Openstack Client for the keystone version requested
* @throws HeatBridgeException if any errors when reading cloud configuration or getting openstack client
*/
- OpenstackClient getOpenstackClient(String url, String msoId, String msoPass, String cloudRegionId, String tenantId)
+ OpenstackClient getOpenstackClient(String url, String msoId, String msoPass, String regionId, String tenantId)
throws HeatBridgeException;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
index f0c5a0b434..04245899aa 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
@@ -61,17 +61,17 @@ public class MsoCloudClientFactoryImpl implements MsoCloudClientFactory {
@Override
public OpenstackClient getOpenstackClient(@Nonnull String url, @Nonnull String msoId, @Nonnull String msoPass,
- @Nonnull String cloudRegionId, @Nonnull String tenantId) throws HeatBridgeException {
+ @Nonnull String regionId, @Nonnull String tenantId) throws HeatBridgeException {
Objects.requireNonNull(url, "Null openstack url!");
Objects.requireNonNull(msoId, "Null openstack user id!");
Objects.requireNonNull(msoPass, "Null openstack password!");
- Objects.requireNonNull(cloudRegionId, "Null cloud-region ID!");
+ Objects.requireNonNull(regionId, "Null regionId ID!");
Objects.requireNonNull(tenantId, "Null tenant ID!");
try {
final OpenstackAccess osAccess = new OpenstackAccessBuilder().setBaseUrl(url) // keystone URL
.setUser(msoId) // keystone username
.setPassword(CryptoUtils.decryptCloudConfigPassword(msoPass)) // keystone decrypted password
- .setRegion(cloudRegionId) // openstack region
+ .setRegion(regionId) // openstack region
.setDomainName(HeatBridgeConstants.OS_DEFAULT_DOMAIN_NAME) // hardcode to "default"
.setTenantId(tenantId) // tenantId
.build();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index 137aaa9f41..c578b29664 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -43,6 +43,8 @@ import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.onap.aai.domain.yang.Flavor;
import org.onap.aai.domain.yang.Image;
+import org.onap.aai.domain.yang.PInterface;
+import org.onap.aai.domain.yang.Pserver;
import org.onap.aai.domain.yang.Relationship;
import org.onap.aai.domain.yang.RelationshipData;
import org.onap.aai.domain.yang.RelationshipList;
@@ -50,6 +52,7 @@ import org.onap.aai.domain.yang.SriovVf;
import org.onap.aai.domain.yang.Vserver;
import org.onap.so.heatbridge.constants.HeatBridgeConstants;
import org.openstack4j.model.compute.Server;
+import org.openstack4j.model.network.Port;
/**
* This class provides wrapper methods to manage creation of AAI objects and extracting objects from AAI and
@@ -84,11 +87,13 @@ public class AaiHelper {
relationships.add(vfModuleRelationship);
// vserver to image relationship
- Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
- ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
- .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
- .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
- relationships.add(imageRel);
+ if (server.getImage() != null) {
+ Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
+ ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
+ .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
+ .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
+ relationships.add(imageRel);
+ }
// vserver to flavor relationship
Relationship flavorRel = buildRelationship(HeatBridgeConstants.AAI_FLAVOR,
@@ -135,6 +140,37 @@ public class AaiHelper {
}
/**
+ * Transform Openstack Server object to AAI Pserver object
+ *
+ * @param server Openstack server object
+ * @return AAI Pserver object
+ */
+ public Pserver buildPserver(final Server server) {
+ Pserver pserver = new Pserver();
+ pserver.setInMaint(false);
+ pserver.setPserverId(server.getId());
+ pserver.setHostname(server.getHypervisorHostname());
+ pserver.setPserverName2(server.getHost());
+ pserver.setProvStatus(server.getStatus().value());
+ return pserver;
+ }
+
+ /**
+ * Transform Openstack Server object to AAI PInterface object
+ *
+ * @param port Openstack port object
+ * @return AAI PInterface object
+ */
+ public PInterface buildPInterface(Port port) {
+ Map<String, Object> portProfile = port.getProfile();
+ PInterface pInterface = new PInterface();
+ pInterface.setInterfaceName(portProfile.get(HeatBridgeConstants.OS_PHYSICAL_NETWORK_KEY).toString());
+ pInterface.setInMaint(false);
+ pInterface.setInterfaceRole(HeatBridgeConstants.OS_PHYSICAL_INTERFACE_KEY);
+ return pInterface;
+ }
+
+ /**
* Transform Openstack Image object to AAI Image object
*
* @param image Openstack Image object
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
index be086677db..1667f980e1 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/utils/HeatBridgeUtils.java
@@ -35,10 +35,15 @@ package org.onap.so.heatbridge.utils;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
+import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
import javax.annotation.Nonnull;
+import org.apache.commons.collections.CollectionUtils;
+import org.onap.aai.domain.yang.SriovVf;
+import org.onap.aai.domain.yang.Vserver;
-public class HeatBridgeUtils {
+public final class HeatBridgeUtils {
/**
* IaaS naming convention for compute/p-interface to openstack/physical-network name mapping
@@ -64,4 +69,13 @@ public class HeatBridgeUtils {
}
return Optional.empty();
}
+
+ public static List<String> extractPciIdsFromVServer(Vserver vserver) {
+ return vserver.getLInterfaces().getLInterface().stream()
+ .filter(lInterface -> lInterface.getSriovVfs() != null
+ && CollectionUtils.isNotEmpty(lInterface.getSriovVfs().getSriovVf()))
+ .flatMap(lInterface -> lInterface.getSriovVfs().getSriovVf().stream()).map(SriovVf::getPciId)
+ .collect(Collectors.toList());
+ }
+
}
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application-aaf.yaml b/adapters/mso-openstack-adapters/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application-basic.yaml b/adapters/mso-openstack-adapters/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/resources/application-basic.yaml
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
index 3432e4a8b6..cff4d5f994 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
@@ -37,6 +37,7 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.springframework.core.env.Environment;
import com.fasterxml.jackson.core.JsonParseException;
@@ -67,6 +68,9 @@ public class AuditStackServiceDataTest extends AuditCreateStackService {
@Mock
private AuditDataService auditDataService;
+ @Mock
+ private AuditMDCSetup mdcSetup;
+
private ObjectMapper objectMapper = new ObjectMapper();
private AuditInventory auditInventory = new AuditInventory();
@@ -170,47 +174,6 @@ public class AuditStackServiceDataTest extends AuditCreateStackService {
}
@Test
- public void retry_sequence_calculation_Test() {
- long firstRetry = auditStackService.calculateRetryDelay(8);
- assertEquals(6000L, firstRetry);
- long secondRetry = auditStackService.calculateRetryDelay(7);
- assertEquals(6000L, secondRetry);
- long thirdRetry = auditStackService.calculateRetryDelay(6);
- assertEquals(12000L, thirdRetry);
- long fourthRetry = auditStackService.calculateRetryDelay(5);
- assertEquals(18000L, fourthRetry);
- long fifthRetry = auditStackService.calculateRetryDelay(4);
- assertEquals(30000L, fifthRetry);
- long sixRetry = auditStackService.calculateRetryDelay(3);
- assertEquals(48000L, sixRetry);
- long seventhRetry = auditStackService.calculateRetryDelay(2);
- assertEquals(78000L, seventhRetry);
- long eigthRetry = auditStackService.calculateRetryDelay(1);
- assertEquals(120000L, eigthRetry);
- }
-
- @Test
- public void retry_sequence_Test() {
- long firstRetry = auditStackService.calculateRetryDelay(8);
- assertEquals(6000L, firstRetry);
- long secondRetry = auditStackService.calculateRetryDelay(7);
- assertEquals(6000L, secondRetry);
- long thirdRetry = auditStackService.calculateRetryDelay(6);
- assertEquals(12000L, thirdRetry);
- long fourthRetry = auditStackService.calculateRetryDelay(5);
- assertEquals(18000L, fourthRetry);
- long fifthRetry = auditStackService.calculateRetryDelay(4);
- assertEquals(30000L, fifthRetry);
- long sixRetry = auditStackService.calculateRetryDelay(3);
- assertEquals(48000L, sixRetry);
- long seventhRetry = auditStackService.calculateRetryDelay(2);
- assertEquals(78000L, seventhRetry);
- long eigthRetry = auditStackService.calculateRetryDelay(1);
- assertEquals(120000L, eigthRetry);
- }
-
-
- @Test
public void determineAuditResult_Test() throws Exception {
boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess);
assertEquals(false, actual);
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java
deleted file mode 100644
index c9aef950f7..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.audit;
-
-import static com.shazam.shazamcrest.MatcherAssert.assertThat;
-import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import org.camunda.bpm.client.ExternalTaskClient;
-import org.camunda.bpm.client.interceptor.ClientRequestInterceptor;
-import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.utils.CryptoUtils;
-import org.springframework.core.env.Environment;
-
-@RunWith(MockitoJUnitRunner.class)
-public class AuditStackServiceTest {
-
- @Spy
- @InjectMocks
- AuditStackService auditStackService;
-
- @Mock
- Environment mockEnvironment;
-
-
- @Before
- public void before() {
- Mockito.doReturn("5").when(mockEnvironment).getProperty("workflow.topics.maxClients", "10");
- Mockito.doReturn("6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436")
- .when(mockEnvironment).getRequiredProperty("mso.auth");
- Mockito.doReturn("07a7159d3bf51a0e53be7a8f89699be7").when(mockEnvironment).getRequiredProperty("mso.msoKey");
- Mockito.doReturn("something").when(mockEnvironment).getRequiredProperty("mso.config.cadi.aafId");
- Mockito.doReturn("host.com").when(mockEnvironment).getRequiredProperty("mso.workflow.endpoint");
- }
-
- @Test
- public void testGetMaxClients() throws Exception {
- int actual = auditStackService.getMaxClients();
- assertEquals(5, actual);
- }
-
- @Test
- public void testCreateClientRequestInterceptor() throws Exception {
- String auth = CryptoUtils.decrypt(
- "6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436",
- "07a7159d3bf51a0e53be7a8f89699be7");
- ClientRequestInterceptor expected = new BasicAuthProvider("something", auth);
- ClientRequestInterceptor actual = auditStackService.createClientRequestInterceptor();
- assertThat(actual, sameBeanAs(expected));
-
- }
-
- @Test
- public void testCreateExternalTaskClient() throws Exception {
- String auth = CryptoUtils.decrypt(
- "6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436",
- "07a7159d3bf51a0e53be7a8f89699be7");
- ClientRequestInterceptor inter = new BasicAuthProvider("something", auth);
- Mockito.doReturn(inter).when(auditStackService).createClientRequestInterceptor();
- ExternalTaskClient actual = auditStackService.createExternalTaskClient();
- assertNotNull(actual);
- Mockito.verify(auditStackService, Mockito.times(1)).createClientRequestInterceptor();
-
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java
index 8dc9d7fe5c..c4fa9ee2c5 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java
@@ -31,6 +31,7 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -46,6 +47,9 @@ public class CreateInventoryTaskTest {
@Mock
ExternalTaskService externalTaskService;
+ @Mock
+ private AuditMDCSetup mdcSetup;
+
@InjectMocks
CreateInventoryTask inventoryTask;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
index 1f4c205e7a..412abeab3b 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
@@ -194,9 +194,7 @@ public class NetworkAdapterRestTest extends BaseRestTestUtils {
public void testRollbackNetwork() throws IOException {
RollbackNetworkRequest request = new RollbackNetworkRequest();
-
MsoRequest msoReq = new MsoRequest();
-
msoReq.setRequestId(MSO_REQUEST_ID);
msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID);
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
index 651e2c9a73..a058378425 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -40,7 +40,6 @@ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.adapters.vnf.exceptions.VnfNotFound;
import org.onap.so.db.catalog.beans.HeatEnvironment;
@@ -50,15 +49,15 @@ import org.onap.so.db.catalog.beans.VfModule;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResource;
import org.onap.so.entity.MsoRequest;
-import org.onap.so.openstack.beans.HeatStatus;
-import org.onap.so.openstack.beans.StackInfo;
import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.utils.MsoHeatUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import com.github.tomakehurst.wiremock.stubbing.Scenario;
public class MsoVnfAdapterImplTest extends BaseRestTestUtils {
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
@@ -71,17 +70,7 @@ public class MsoVnfAdapterImplTest extends BaseRestTestUtils {
String vnfName = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId";
@Test
- @Ignore
- public void healthCheckVNFTest() {
- MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();
- instance.healthCheck();
- }
-
- @Test
public void createVnfTest() throws Exception {
- StackInfo info = new StackInfo();
- info.setStatus(HeatStatus.CREATED);
-
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackVfModule_200(wireMockServer);
@@ -90,105 +79,71 @@ public class MsoVnfAdapterImplTest extends BaseRestTestUtils {
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
+ "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, Boolean.TRUE, Boolean.TRUE,
+ Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
+ new Holder<VnfRollback>());
}
@Test
- public void createVnfTest_HeatStatusUpdating() throws Exception {
- expectedException.expect(VnfAlreadyExists.class);
+ public void createVnfTest_NullFailIfExists() throws Exception {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
-
- wireMockServer.stubFor(get(
- urlPathEqualTo("/mockPublicUrl/stacks/DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBodyFile("OpenstackResponse_Stack_Updating_VfModule.json")
- .withStatus(HttpStatus.SC_OK)));
+ mockOpenStackGetStackVfModule_200(wireMockServer);
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
+ "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, null, Boolean.TRUE, Boolean.FALSE,
+ msoRequest, new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>());
}
@Test
- public void createVnfTest_HeatStatusUpdated() throws Exception {
- expectedException.expect(VnfAlreadyExists.class);
+ public void createVnfTest_HeatStatusFailed() throws Exception {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
-
wireMockServer.stubFor(get(
urlPathEqualTo("/mockPublicUrl/stacks/DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBodyFile("OpenstackResponse_StackId.json").withStatus(HttpStatus.SC_OK)));
-
- MsoRequest msoRequest = getMsoRequest();
-
- Map<String, Object> map = new HashMap<>();
- map.put("key1", "value1");
- instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
- }
-
- @Test
- public void createVnfTest_HeatStatusFailed() throws Exception {
- expectedException.expect(VnfAlreadyExists.class);
- mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ .withBodyFile("OpenstackResponse_Stack_Failed_VfModule.json")
+ .withStatus(HttpStatus.SC_OK))
+ .inScenario("HeatStatusFailure").whenScenarioStateIs(Scenario.STARTED)
+ .willSetStateTo("HeatStackFailed"));
wireMockServer.stubFor(get(
urlPathEqualTo("/mockPublicUrl/stacks/DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBodyFile("OpenstackResponse_Stack_Failed_VfModule.json")
- .withStatus(HttpStatus.SC_OK)));
+ .withBodyFile("OpenstackResponse_Stack_Created_VfModule.json")
+ .withStatus(HttpStatus.SC_OK))
+ .inScenario("HeatStatusFailure").whenScenarioStateIs("HeatStackFailed")
+ .willSetStateTo("HeatStackSuccess"));
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
+ "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, Boolean.FALSE, Boolean.TRUE,
+ Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
+ new Holder<VnfRollback>());
}
+
+
@Test
public void createVnfTest_HeatStatusCreated() throws Exception {
- expectedException.expect(VnfAlreadyExists.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
-
mockOpenStackGetStackVfModule_200(wireMockServer);
-
MsoRequest msoRequest = getMsoRequest();
-
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
+ "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, Boolean.TRUE, Boolean.TRUE,
+ Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
+ new Holder<VnfRollback>());
}
@Test
- public void createVnfTest_ExceptionInGettingHeat() throws Exception {
- expectedException.expect(VnfException.class);
- MsoRequest msoRequest = getMsoRequest();
-
- Map<String, Object> map = new HashMap<>();
- map.put("key1", "value1");
- instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
- "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
- Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(),
- new Holder<Map<String, String>>(), new Holder<VnfRollback>());
- }
-
- @Test
public void createVnfTest_NestedHeatStatusNotFound() throws Exception {
expectedException.expect(VnfException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -529,7 +484,8 @@ public class MsoVnfAdapterImplTest extends BaseRestTestUtils {
MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();
MsoRequest msoRequest = getMsoRequest();
try {
- instance.deleteVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
+ instance.deleteVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12",
+ "5aae1e49-805c-4f9f-bd78-055bf7451157", "11420693-3f69-4c61-b3ee-9787c744e760", null, msoRequest,
new Holder<Map<String, String>>());
} catch (Exception e) {
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
index 16cc2c34de..45504fcab5 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
@@ -8,9 +8,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -67,30 +67,30 @@ public class MsoVnfCloudifyAdapterImplTest extends BaseRestTestUtils {
* msoRequest.setRequestId("12345"); msoRequest.setServiceInstanceId("12345"); Holder<Map<String, String>> outputs =
* new Holder<>(); instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new
* Holder<>(), new Holder<>(), outputs);
- *
+ *
* assertTrue(outputs.value.isEmpty()); }
*/
/*
* @Test public void queryVnfTest() throws Exception {
- *
- *
+ *
+ *
* MsoRequest msoRequest = new MsoRequest(); msoRequest.setRequestId("12345");
* msoRequest.setServiceInstanceId("12345");
* wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname"))
* .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK)));
- *
+ *
* wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs"))
* .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }")
* .withStatus(HttpStatus.SC_OK)));
- *
+ *
* wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse()
* .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ")
* .withStatus(HttpStatus.SC_OK)));
- *
+ *
* instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(), new
* Holder<>(), new Holder<>());
- *
+ *
* }
*/
@@ -101,7 +101,8 @@ public class MsoVnfCloudifyAdapterImplTest extends BaseRestTestUtils {
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>());
+ instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", "5aae1e49-805c-4f9f-bd78-055bf7451157",
+ "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>());
}
@Test
@@ -124,7 +125,8 @@ public class MsoVnfCloudifyAdapterImplTest extends BaseRestTestUtils {
wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/tokens"))
.willReturn(aResponse().withBodyFile("OpenstackResponse_Access.json").withStatus(HttpStatus.SC_OK)));
- instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>());
+ instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", "5aae1e49-805c-4f9f-bd78-055bf7451157",
+ "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>());
}
@Test
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
index 48ca0fd79c..3bf784c50b 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
@@ -210,7 +210,8 @@ public class MsoVnfMulticloudAdapterImplTest extends BaseRestTestUtils {
wireMockServer.stubFor(delete(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id"))
.willReturn(aResponse().withStatus(HttpStatus.SC_NO_CONTENT)));
- instance.deleteVfModule("MTN13", "CloudOwner", "123", "workload-id", msoRequest, new Holder<>());
+ instance.deleteVfModule("MTN13", "CloudOwner", "123", "workload-id", "5aae1e49-805c-4f9f-bd78-055bf7451157",
+ "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>());
}
@Test
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java
index 7ec8e51892..a68efbe130 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java
@@ -134,6 +134,7 @@ public class MsoVnfPluginAdapterImplTest extends BaseRestTestUtils {
expectedException.expect(VnfException.class);
MsoRequest msoRequest = getMsoRequest();
msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12",
+ "5aae1e49-805c-4f9f-bd78-055bf7451157", "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId",
msoRequest, new Holder<Map<String, String>>());
}
@@ -151,6 +152,7 @@ public class MsoVnfPluginAdapterImplTest extends BaseRestTestUtils {
.withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
MsoRequest msoRequest = getMsoRequest();
msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12",
+ "5aae1e49-805c-4f9f-bd78-055bf7451157", "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId",
msoRequest, new Holder<Map<String, String>>());
}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java
index 89adafd280..5a8524fd73 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java
@@ -98,7 +98,6 @@ public class VnfAdapterRestTest extends BaseRestTestUtils {
private static final String EXN_HSL_NET_FQDN = "hsl";
private static final String AVAILABILITY_ZONE_0 = "nova";
private static final String VF_MODULE_INDEX = "0";
- private static final String REQUEST_TYPE = "";
@Test
public void testCreateVfModule() throws JSONException, JsonParseException, JsonMappingException, IOException {
@@ -188,7 +187,6 @@ public class VnfAdapterRestTest extends BaseRestTestUtils {
msoReq.setRequestId(MSO_REQUEST_ID);
msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID);
request.setMsoRequest(msoReq);
- request.setRequestType(REQUEST_TYPE);
request.setCloudSiteId(CLOUDSITE_ID);
request.setTenantId(TENANT_ID);
request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID);
@@ -254,7 +252,6 @@ public class VnfAdapterRestTest extends BaseRestTestUtils {
msoReq.setRequestId(MSO_REQUEST_ID);
msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID);
request.setMsoRequest(msoReq);
- request.setRequestType(REQUEST_TYPE);
request.setCloudSiteId(CLOUDSITE_ID);
request.setTenantId(TENANT_ID);
request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID);
@@ -394,7 +391,6 @@ public class VnfAdapterRestTest extends BaseRestTestUtils {
request.setFailIfExists(failIfExists);
request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID);
request.setMsoRequest(msoRequest);
- request.setRequestType(REQUEST_TYPE);
request.setTenantId(TENANT_ID);
request.setVfModuleId(VF_MODULE_ID);
request.setVfModuleName(VF_MODULE_NAME);
@@ -526,7 +522,6 @@ public class VnfAdapterRestTest extends BaseRestTestUtils {
msoReq.setRequestId(MSO_REQUEST_ID);
msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID);
request.setMsoRequest(msoReq);
- request.setRequestType(REQUEST_TYPE);
request.setCloudSiteId(CLOUDSITE_ID);
request.setTenantId(TENANT_ID);
request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID);
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index d611322c02..e2f5531280 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -112,7 +112,7 @@ public class HeatBridgeImplTest {
public void setUp() throws HeatBridgeException, OpenstackClientException, BulkProcessFailed {
when(resourcesClient.beginSingleTransaction()).thenReturn(transaction);
- heatbridge = new HeatBridgeImpl(resourcesClient, cloudIdentity, CLOUD_OWNER, REGION_ID, TENANT_ID);
+ heatbridge = new HeatBridgeImpl(resourcesClient, cloudIdentity, CLOUD_OWNER, REGION_ID, REGION_ID, TENANT_ID);
}
@Ignore
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImplTest.java
index 701ed65d19..4eeb1c03a3 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImplTest.java
@@ -38,7 +38,7 @@ public class MsoCloudClientFactoryImplTest {
private static final String MSO_ID = "testMsoId";
private static final String ENCRYPTED_PASSWORD = CryptoUtils.encryptCloudConfigPassword("testPassword");
- private static final String CLOUD_REGION_ID = "testCloudRegionId";
+ private static final String REGION_ID = "testCloudRegionId";
private static final String TENANT_ID = "testTenantId";
private MsoCloudClientFactoryImpl testedObject;
@@ -52,20 +52,19 @@ public class MsoCloudClientFactoryImplTest {
@Test
public void getOpenstackClientWithVersion2() throws Exception {
- testedObject.getOpenstackClient(URL_V2, MSO_ID, ENCRYPTED_PASSWORD, CLOUD_REGION_ID, TENANT_ID);
+ testedObject.getOpenstackClient(URL_V2, MSO_ID, ENCRYPTED_PASSWORD, REGION_ID, TENANT_ID);
verify(openstackClientFactoryMock).createOpenstackV2Client(any(OpenstackAccess.class));
}
@Test
public void getOpenstackClientWithVersion3() throws Exception {
- testedObject.getOpenstackClient(URL_V3, MSO_ID, ENCRYPTED_PASSWORD, CLOUD_REGION_ID, TENANT_ID);
+ testedObject.getOpenstackClient(URL_V3, MSO_ID, ENCRYPTED_PASSWORD, REGION_ID, TENANT_ID);
verify(openstackClientFactoryMock).createOpenstackV3Client(any(OpenstackAccess.class));
}
@Test(expected = HeatBridgeException.class)
public void getOpenstackClient_unsupportedVersion() throws Exception {
- testedObject.getOpenstackClient(URL_WITH_UNSUPPORTED_VERSION, MSO_ID, ENCRYPTED_PASSWORD, CLOUD_REGION_ID,
- TENANT_ID);
+ testedObject.getOpenstackClient(URL_WITH_UNSUPPORTED_VERSION, MSO_ID, ENCRYPTED_PASSWORD, REGION_ID, TENANT_ID);
}
}
diff --git a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
index 7cc7697129..20fd812ab9 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
+++ b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
@@ -1,5 +1,3 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-# MSO Properties go here
org:
onap:
so:
@@ -41,7 +39,7 @@ org:
default_keystone_reg_ex: "/[vV][0-9]"
default_tenant_description: ECOMP Tenant
default_region_type: single
- default_user_role: admin
+ default_user_role: adminev
default_success_status_string: Success
default_no_regions_status_string: no regions
default_orm_request_path: /v1/orm/customers/
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index 7b3ffd7d30..6b791e789c 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -735,6 +735,8 @@ CREATE TABLE `orchestration_flow_reference` (
`SEQ_NO` int(11) NOT NULL,
`FLOW_NAME` varchar(200) NOT NULL,
`FLOW_VERSION` double NOT NULL,
+ `SCOPE` varchar(200) DEFAULT NULL,
+ `ACTION` varchar(200) DEFAULT NULL,
`NB_REQ_REF_LOOKUP_ID` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_orchestration_flow_reference` (`COMPOSITE_ACTION`,`FLOW_NAME`,`SEQ_NO`,`NB_REQ_REF_LOOKUP_ID`),
@@ -806,6 +808,10 @@ CREATE TABLE `service` (
`OVERALL_DISTRIBUTION_STATUS` varchar(45),
`ONAP_GENERATED_NAMING` TINYINT(1) DEFAULT NULL,
`NAMING_POLICY` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -960,6 +966,7 @@ CREATE TABLE `vf_module_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VF_MODULE_MODEL_UUID` varchar(200) NOT NULL,
`VNF_RESOURCE_CUSTOMIZATION_ID` int(13) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`ID`),
KEY `fk_vf_module_customization__vf_module1_idx` (`VF_MODULE_MODEL_UUID`),
KEY `fk_vf_module_customization__heat_env__heat_environment1_idx` (`HEAT_ENVIRONMENT_ARTIFACT_UUID`),
@@ -1109,7 +1116,9 @@ CREATE TABLE `vnf_resource_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_MODEL_UUID` varchar(200) NOT NULL,
+ `NF_DATA_VALID` tinyint(1) DEFAULT '0',
`VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`),
KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`),
@@ -1191,6 +1200,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
`CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
`CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
`SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
diff --git a/adapters/mso-requests-db-adapter/pom.xml b/adapters/mso-requests-db-adapter/pom.xml
index a02ebbe75d..366a207d60 100644
--- a/adapters/mso-requests-db-adapter/pom.xml
+++ b/adapters/mso-requests-db-adapter/pom.xml
@@ -169,6 +169,9 @@
<executions>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
index 8c4150cd50..3deabb3ce1 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
@@ -27,15 +27,19 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
-import org.onap.so.logger.LoggingAnchor;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.db.request.beans.ArchivedInfraRequests;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.data.repository.ArchivedInfraRequestsRepository;
import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
+import org.onap.so.logger.ScheduledTasksMDCSetup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
@@ -52,6 +56,9 @@ public class ArchiveInfraRequestsScheduler {
private InfraActiveRequestsRepository infraActiveRepo;
@Autowired
private ArchivedInfraRequestsRepository archivedInfraRepo;
+ @Autowired
+ private ScheduledTasksMDCSetup scheduledMDCSetup;
+
@Value("${mso.infra-requests.archived.period}")
private int archivedPeriod;
@@ -62,6 +69,7 @@ public class ArchiveInfraRequestsScheduler {
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "archiveInfraRequestsScheduler")
public void infraRequestsScheduledTask() {
+ scheduledMDCSetup.mdcSetup(ONAPComponents.REQUEST_DB, "infraRequestsScheduledTask");
logger.debug("Start of archiveInfraRequestsScheduler");
Date currentDate = new Date();
@@ -89,6 +97,7 @@ public class ArchiveInfraRequestsScheduler {
} while (!requestsByStartTime.isEmpty());
logger.debug("End of archiveInfraRequestsScheduler");
+ scheduledMDCSetup.exitAndClearMDC();
}
protected void archiveInfraRequests(List<InfraActiveRequests> requests) {
@@ -98,12 +107,8 @@ public class ArchiveInfraRequestsScheduler {
for (InfraActiveRequests iar : requests) {
ArchivedInfraRequests archivedInfra = new ArchivedInfraRequests();
try {
- archivedInfra.setAaiServiceId(iar.getAaiServiceId());
- archivedInfra.setAction(iar.getAction());
- archivedInfra.setAicCloudRegion(iar.getAicCloudRegion());
- archivedInfra.setAicNodeClli(iar.getAicNodeClli());
+ archivedInfra.setCloudRegion(iar.getCloudRegion());
archivedInfra.setCallBackUrl(iar.getCallBackUrl());
- archivedInfra.setClientRequestId(iar.getClientRequestId());
archivedInfra.setConfigurationId(iar.getConfigurationId());
archivedInfra.setConfigurationName(iar.getConfigurationName());
archivedInfra.setCorrelator(iar.getCorrelator());
@@ -116,14 +121,12 @@ public class ArchiveInfraRequestsScheduler {
archivedInfra.setOperationalEnvName(iar.getOperationalEnvName());
archivedInfra.setRequestUrl(iar.getRequestUrl());
archivedInfra.setProgress(iar.getProgress());
- archivedInfra.setProvStatus(iar.getProvStatus());
archivedInfra.setRequestAction(iar.getRequestAction());
archivedInfra.setRequestBody(iar.getRequestBody());
archivedInfra.setRequestId(iar.getRequestId());
archivedInfra.setRequestorId(iar.getRequestorId());
archivedInfra.setRequestScope(iar.getRequestScope());
archivedInfra.setRequestStatus(iar.getRequestStatus());
- archivedInfra.setRequestType(iar.getRequestType());
archivedInfra.setResponseBody(iar.getResponseBody());
archivedInfra.setServiceInstanceId(iar.getServiceInstanceId());
archivedInfra.setServiceInstanceName(iar.getServiceInstanceName());
@@ -146,6 +149,8 @@ public class ArchiveInfraRequestsScheduler {
newArchivedReqs.add(archivedInfra);
oldInfraReqs.add(iar);
} catch (Exception e) {
+ scheduledMDCSetup.errorMDCSetup(ErrorCode.UnknownError, e.getMessage());
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.error(LoggingAnchor.TWO, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
ErrorCode.UnknownError.getValue(), e);
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
index f6a0aec86f..28e931a3e1 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java
@@ -74,4 +74,9 @@ public class InfraActiveRequestsRepositoryCustomController {
@RequestParam(value = "maxResult", required = false) Integer maxResult) {
return infraActiveRequestsRepository.getInfraActiveRequests(filters, startTime, endTime, maxResult);
}
+
+ @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules")
+ public List<InfraActiveRequests> getInProgressVolumeGroupsAndVfModules() {
+ return infraActiveRequestsRepository.getInProgressVolumeGroupsAndVfModules();
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
index f4a9f711fd..110fc6c03e 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -31,6 +31,7 @@ import org.onap.so.db.request.beans.ResourceOperationStatus;
/**
* MSO Request DB Adapter Web Service
*/
+@Deprecated
@WebService(name = "RequestsDbAdapter", targetNamespace = "http://org.onap.so/requestsdb")
public interface MsoRequestsDbAdapter {
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index 9d6a8b0529..085a255948 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -10,9 +10,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -45,6 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
+@Deprecated
@WebService(serviceName = "RequestsDbAdapter",
endpointInterface = "org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter",
targetNamespace = "http://org.onap.so/requestsdb")
@@ -73,7 +74,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
String networkId, String vnfId, String vfModuleId, String volumeGroupId, String serviceInstanceName,
String configurationId, String configurationName, String vfModuleName) throws MsoRequestsDbException {
try {
- InfraActiveRequests request = infraActive.findOneByRequestIdOrClientRequestId(requestId, requestId);
+ InfraActiveRequests request = infraActive.findOneByRequestId(requestId);
if (request == null) {
String error = "Entity not found. Unable to retrieve MSO Infra Requests DB for Request ID " + requestId;
throw new MsoRequestsDbException(error);
@@ -129,7 +130,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
} catch (Exception e) {
String error = "Error retrieving MSO Infra Requests DB for Request ID " + requestId;
logger.error(error, e);
- throw new MsoRequestsDbException(error, ErrorCode.BusinessProcesssError, e);
+ throw new MsoRequestsDbException(error, ErrorCode.BusinessProcessError, e);
}
}
@@ -147,7 +148,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
logger.debug("Call to MSO Infra RequestsDb adapter get method with request Id: {}", requestId);
InfraActiveRequests request = null;
try {
- request = infraActive.findOneByRequestIdOrClientRequestId(requestId, requestId);
+ request = infraActive.findOneByRequestId(requestId);
if (request == null) {
String error = "Entity not found. Unable to retrieve MSO Infra Requests DB for Request ID " + requestId;
throw new MsoRequestsDbException(error);
@@ -155,7 +156,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
} catch (Exception e) {
String error = "Error retrieving MSO Infra Requests DB for Request ID " + requestId;
logger.error(error, e);
- throw new MsoRequestsDbException(error, ErrorCode.BusinessProcesssError, e);
+ throw new MsoRequestsDbException(error, ErrorCode.BusinessProcessError, e);
}
return request;
}
@@ -183,7 +184,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
/**
* update operation status <br>
- *
+ *
* @param serviceId
* @param operationId
* @param operationType
@@ -253,7 +254,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
/**
* init the operation status of all the resources <br>
- *
+ *
* @param serviceId the service Id
* @param operationId the operation Id
* @param operationType the operationType
@@ -284,7 +285,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
/**
* get resource operation status <br>
- *
+ *
* @param serviceId
* @param operationId
* @param resourceTemplateUUID
@@ -304,7 +305,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
/**
* update resource operation status <br>
- *
+ *
* @param serviceId
* @param operationId
* @param resourceTemplateUUID
@@ -340,7 +341,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
/**
* update service operation status when a operation resource status updated <br>
- *
+ *
* @param operStatus the resource operation status
* @since ONAP Amsterdam Release
*/
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/MSORequestDBApplication.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/MSORequestDBApplication.java
index 85c05decb1..0272bab1a1 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/MSORequestDBApplication.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/MSORequestDBApplication.java
@@ -22,8 +22,9 @@
package org.onap.so.adapters.requestsdb.application;
-import java.time.Duration;
import javax.sql.DataSource;
+import org.onap.logging.filter.base.Constants;
+import org.onap.logging.filter.base.ONAPComponents;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@@ -32,16 +33,15 @@ import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.scheduling.annotation.EnableScheduling;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
-import net.javacrumbs.shedlock.spring.ScheduledLockConfiguration;
-import net.javacrumbs.shedlock.spring.ScheduledLockConfigurationBuilder;
+import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
/**
* @since Version 1.0
*
*/
-
-@SpringBootApplication(scanBasePackages = {"org.onap.so"})
+@SpringBootApplication(scanBasePackages = {"org.onap.so", "org.onap.logging.filter"})
@EnableScheduling
+@EnableSchedulerLock(defaultLockAtMostFor = "120s")
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class MSORequestDBApplication {
@@ -54,6 +54,7 @@ public class MSORequestDBApplication {
}
public static void main(String... args) {
+ System.setProperty(Constants.Property.PARTNER_NAME, ONAPComponents.REQUEST_DB.toString());
SpringApplication.run(MSORequestDBApplication.class, args);
java.security.Security.setProperty("networkaddress.cache.ttl", "10");
setLogsDir();
@@ -64,10 +65,5 @@ public class MSORequestDBApplication {
return new JdbcTemplateLockProvider(dataSource);
}
- @Bean
- public ScheduledLockConfiguration taskScheduler(LockProvider lockProvider) {
- return ScheduledLockConfigurationBuilder.withLockProvider(lockProvider).withPoolSize(10)
- .withDefaultLockAtMostFor(Duration.ofMinutes(10)).build();
- }
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java
index 579afe9243..9135d31ac3 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java
@@ -21,22 +21,32 @@
package org.onap.so.adapters.requestsdb.application;
-import org.onap.so.logging.spring.interceptor.LoggingInterceptor;
+import org.onap.logging.filter.spring.LoggingInterceptor;
+import org.onap.logging.filter.spring.StatusLoggingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.handler.MappedInterceptor;
@Configuration
+@ComponentScan(basePackages = {"org.onap.logging.filter"})
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Autowired
- LoggingInterceptor loggingInterceptor;
+ private LoggingInterceptor loggingInterceptor;
+
+ @Autowired
+ private StatusLoggingInterceptor statusLoggingInterceptor;
@Bean
public MappedInterceptor mappedLoggingInterceptor() {
return new MappedInterceptor(new String[] {"/**"}, loggingInterceptor);
}
+ @Bean
+ public MappedInterceptor mappedStatusLoggingInterceptor() {
+ return new MappedInterceptor(new String[] {"/**"}, statusLoggingInterceptor);
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-aaf.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-basic.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application-basic.yaml
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql
new file mode 100644
index 0000000000..eac9a65f65
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4.1__Rename_Infra_active_requests_AIC_CLOUD_REGION_Column.sql
@@ -0,0 +1,12 @@
+use requestdb;
+
+DROP INDEX `infra_active_requests__aic_cloud_region_idx` on `infra_active_requests`;
+
+ALTER TABLE
+ `infra_active_requests` CHANGE AIC_CLOUD_REGION CLOUD_REGION varchar(50) DEFAULT NULL;
+
+ALTER TABLE
+ `archived_infra_requests` CHANGE AIC_CLOUD_REGION CLOUD_REGION VARCHAR(50) NULL DEFAULT NULL;
+
+ALTER TABLE `infra_active_requests`
+ ADD INDEX IF NOT EXISTS `infra_active_requests__cloud_region_idx` (`CLOUD_REGION` ASC);
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql
new file mode 100644
index 0000000000..2f7438c1d3
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.4__Add_Indexes_to_Infra_Active_Requests_Table.sql
@@ -0,0 +1,21 @@
+ALTER TABLE `requestdb`.`infra_active_requests`
+ADD INDEX IF NOT EXISTS `infra_active_requests__service_instance_id_idx` (`SERVICE_INSTANCE_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__service_instance_name_idx` (`SERVICE_INSTANCE_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__vnf_id_idx` (`VNF_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__vnf_name_name_idx` (`VNF_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__vf_module_id_idx` (`VF_MODULE_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__vf_module_name_idx` (`VF_MODULE_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__volume_group_id_idx` (`VOLUME_GROUP_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__volume_group_name_idx` (`VOLUME_GROUP_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__network_id_idx` (`NETWORK_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__network_name_idx` (`NETWORK_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__configuration_id_idx` (`CONFIGURATION_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__configuration_name_idx` (`CONFIGURATION_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__instance_group_id_idx` (`INSTANCE_GROUP_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__instance_group_name_idx` (`INSTANCE_GROUP_NAME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__aic_cloud_region_idx` (`AIC_CLOUD_REGION` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__tenant_id_idx` (`TENANT_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__request_scope_idx` (`REQUEST_SCOPE` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__requestor_id_idx` (`REQUESTOR_ID` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__start_time_idx` (`START_TIME` ASC),
+ADD INDEX IF NOT EXISTS `infra_active_requests__end_time_idx` (`END_TIME` ASC); \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.5__Drop_Table_Active_Requests.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.5__Drop_Table_Active_Requests.sql
new file mode 100644
index 0000000000..c3d385ccc2
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.5__Drop_Table_Active_Requests.sql
@@ -0,0 +1,4 @@
+
+use requestdb;
+
+DROP TABLE IF EXISTS active_requests; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.6__UpdateRequestProcessingData.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.6__UpdateRequestProcessingData.sql
new file mode 100644
index 0000000000..70d1d3fd46
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.6__UpdateRequestProcessingData.sql
@@ -0,0 +1,9 @@
+use requestdb;
+
+UPDATE request_processing_data
+SET IS_DATA_INTERNAL = 1
+WHERE TAG = 'BPMNExecutionData';
+
+UPDATE request_processing_data
+SET IS_DATA_INTERNAL = 0
+WHERE TAG = 'StackInformation' OR TAG = 'pincFabricConfigRequest'; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.1__Drop_Columns_from_Infra_requests_archive_tables.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.1__Drop_Columns_from_Infra_requests_archive_tables.sql
new file mode 100644
index 0000000000..352fbfda21
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.1__Drop_Columns_from_Infra_requests_archive_tables.sql
@@ -0,0 +1,17 @@
+use requestdb;
+
+ALTER TABLE `infra_active_requests` DROP IF EXISTS `PROV_STATUS`;
+
+ALTER TABLE `archived_infra_requests` DROP IF EXISTS `PROV_STATUS`;
+
+ALTER TABLE `infra_active_requests` DROP IF EXISTS `ACTION`;
+
+ALTER TABLE `archived_infra_requests` DROP IF EXISTS `ACTION`;
+
+ALTER TABLE `infra_active_requests` DROP IF EXISTS `AAI_SERVICE_ID`;
+
+ALTER TABLE `archived_infra_requests` DROP IF EXISTS `AAI_SERVICE_ID`;
+
+ALTER TABLE `infra_active_requests` DROP IF EXISTS `REQUEST_TYPE`;
+
+ALTER TABLE `archived_infra_requests` DROP IF EXISTS `REQUEST_TYPE`;
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.2__Add_PNF_Column_Infra_Requests_archive_tables.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.2__Add_PNF_Column_Infra_Requests_archive_tables.sql
new file mode 100644
index 0000000000..dbdc925dae
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V7.2__Add_PNF_Column_Infra_Requests_archive_tables.sql
@@ -0,0 +1,4 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests ADD COLUMN IF NOT EXISTS PNF_ID varchar(45);
+ALTER TABLE archived_infra_requests ADD COLUMN IF NOT EXISTS PNF_ID varchar(45); \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
index abc70ed6bf..9641cb8004 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -86,4 +86,28 @@ public class RequestProcessingDataRequestDbQueryTest {
assertEquals(dataFound.get(1).getValue(), secondEntry.getValue());
assertEquals(dataFound.get(1).getTag(), secondEntry.getTag());
}
+
+ @Test
+ @Transactional
+ public void testGetRequestProcessingDataBySoRequestIdAndIsInternalData() {
+ String soRequestId = "00032ab7-na18-42e5-965d-8ea592502018";
+ String tag = "pincFabricConfigRequest";
+ RequestProcessingData firstEntry = new RequestProcessingData();
+ List<RequestProcessingData> expectedList = new ArrayList<>();
+ firstEntry.setSoRequestId(soRequestId);
+ firstEntry.setGroupingId("7d2e8c07-4d10-456d-bddc-37abf38ca715");
+ firstEntry.setName("configurationId");
+ firstEntry.setValue("52234bc0-d6a6-41d4-a901-79015e4877e2");
+ firstEntry.setTag(tag);
+ expectedList.add(firstEntry);
+
+ List<RequestProcessingData> dataFound = client.getExternalRequestProcessingDataBySoRequestId(soRequestId);
+
+ assertEquals(1, dataFound.size());
+ assertEquals(dataFound.get(0).getSoRequestId(), firstEntry.getSoRequestId());
+ assertEquals(dataFound.get(0).getGroupingId(), firstEntry.getGroupingId());
+ assertEquals(dataFound.get(0).getName(), firstEntry.getName());
+ assertEquals(dataFound.get(0).getValue(), firstEntry.getValue());
+ assertEquals(dataFound.get(0).getTag(), firstEntry.getTag());
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
index 663be24318..3ac5c28c34 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
@@ -53,11 +53,9 @@ public class ArchiveInfraRequestsSchedulerTest extends RequestsAdapterBase {
InfraActiveRequests iar1 = new InfraActiveRequests();
iar1.setRequestId(requestId1);
- iar1.setAction("action1");
InfraActiveRequests iar2 = new InfraActiveRequests();
iar2.setRequestId(requestId2);
- iar2.setAction("action2");
List<InfraActiveRequests> requests = new ArrayList<>();
requests.add(iar1);
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
index 4ed3285a70..a7f21334ed 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
@@ -21,8 +21,13 @@
package org.onap.so.adapters.requestsdb;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -33,6 +38,7 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
+import org.onap.so.serviceinstancebeans.ModelType;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
@@ -77,7 +83,6 @@ public class InfraActiveRequestsRepositoryCustomControllerTest extends RequestsA
assertEquals(infraActiveRequests.getNetworkName(), infraActiveRequestsResponse.getNetworkName());
assertEquals(infraActiveRequests.getConfigurationId(), infraActiveRequestsResponse.getConfigurationId());
assertEquals(infraActiveRequests.getConfigurationName(), infraActiveRequestsResponse.getConfigurationName());
- assertEquals(infraActiveRequests.getAaiServiceId(), infraActiveRequestsResponse.getAaiServiceId());
assertEquals(infraActiveRequests.getTenantId(), infraActiveRequestsResponse.getTenantId());
assertEquals(infraActiveRequests.getRequestScope(), infraActiveRequestsResponse.getRequestScope());
assertEquals(infraActiveRequests.getRequestorId(), infraActiveRequestsResponse.getRequestorId());
@@ -85,20 +90,11 @@ public class InfraActiveRequestsRepositoryCustomControllerTest extends RequestsA
assertEquals(infraActiveRequests.getOperationalEnvId(), infraActiveRequestsResponse.getOperationalEnvId());
assertEquals(infraActiveRequests.getOperationalEnvName(), infraActiveRequestsResponse.getOperationalEnvName());
assertEquals(infraActiveRequests.getRequestStatus(), infraActiveRequestsResponse.getRequestStatus());
- assertEquals(infraActiveRequests.getAction(), infraActiveRequestsResponse.getAction());
assertEquals(infraActiveRequests.getRequestUrl(), infraActiveRequestsResponse.getRequestUrl());
}
@Before
public void setup() {
-
- headers = new HttpHeaders();
- restTemplate = new TestRestTemplate("test", "test");
-
- headers.set("Accept", MediaType.APPLICATION_JSON);
- headers.set("Content-Type", MediaType.APPLICATION_JSON);
- headers.set("Authorization", msoAdaptersAuth);
-
infraActiveRequests = new InfraActiveRequests();
infraActiveRequests.setRequestId(UUID.randomUUID().toString());
@@ -115,23 +111,32 @@ public class InfraActiveRequestsRepositoryCustomControllerTest extends RequestsA
infraActiveRequests.setNetworkName("networkInstanceNameTest");
infraActiveRequests.setConfigurationId(UUID.randomUUID().toString());
infraActiveRequests.setConfigurationName("configurationInstanceNameTest");
- infraActiveRequests.setAicCloudRegion("1");
+ infraActiveRequests.setCloudRegion("1");
infraActiveRequests.setTenantId(UUID.randomUUID().toString());
infraActiveRequests.setRequestScope("operationalEnvironment");
infraActiveRequests.setRequestorId(UUID.randomUUID().toString());
infraActiveRequests.setSource("sourceTest");
infraActiveRequests.setOperationalEnvName(UUID.randomUUID().toString());
infraActiveRequests.setRequestStatus("IN_PROGRESS");
- infraActiveRequests.setAction("create");
infraActiveRequests
.setRequestUrl("http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances");
- HttpEntity<String> entity = new HttpEntity(infraActiveRequests, headers);
+ saveInfraActiveRequest(infraActiveRequests);
+ }
+
+ public void saveInfraActiveRequest(InfraActiveRequests request) {
+ headers = new HttpHeaders();
+ restTemplate = new TestRestTemplate("test", "test");
+
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ headers.set("Authorization", msoAdaptersAuth);
+
+ HttpEntity<String> entity = new HttpEntity(request, headers);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests"));
ResponseEntity<String> response =
restTemplate.exchange(builder.toUriString(), HttpMethod.POST, entity, String.class);
-
assertEquals(201, response.getStatusCodeValue());
}
@@ -297,4 +302,38 @@ public class InfraActiveRequestsRepositoryCustomControllerTest extends RequestsA
assertEquals(200, response.getStatusCodeValue());
assertEquals(null, response.getBody());
}
+
+ @Test
+ public void getInProgressVolumeGroupsAndVfModulesTest() {
+ boolean expectedReturned = false;
+ InfraActiveRequests request = new InfraActiveRequests();
+ request.setRequestId(UUID.randomUUID().toString());
+ request.setVfModuleId(UUID.randomUUID().toString());
+ request.setRequestStatus("IN_PROGRESS");
+ request.setRequestScope(ModelType.vfModule.toString());
+ Instant startInstant = Instant.now().minus(3, ChronoUnit.MINUTES);
+ request.setStartTime(Timestamp.from(startInstant));
+ request.setRequestAction("create");
+ saveInfraActiveRequest(request);
+
+ UriComponentsBuilder builder = UriComponentsBuilder
+ .fromHttpUrl(createURLWithPort("/infraActiveRequests/getInProgressVolumeGroupsAndVfModules"));
+
+ HttpEntity<String> entity = new HttpEntity<String>(headers);
+
+ ResponseEntity<List<InfraActiveRequests>> response = restTemplate.exchange(builder.toUriString(),
+ HttpMethod.GET, entity, new ParameterizedTypeReference<List<InfraActiveRequests>>() {});
+
+ List<InfraActiveRequests> responseList = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ for (InfraActiveRequests result : responseList) {
+ if (result.getRequestId().equals(request.getRequestId())) {
+ assertThat(request, sameBeanAs(result).ignoring("modifyTime"));
+ expectedReturned = true;
+ }
+ }
+ assertTrue(expectedReturned);
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
index e53b957210..fef9dbc22c 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
@@ -23,17 +23,14 @@ package org.onap.so.adapters.requestsdb.adapters;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter;
import org.onap.so.adapters.requestsdb.RequestStatusType;
import org.onap.so.adapters.requestsdb.RequestsAdapterBase;
@@ -47,7 +44,6 @@ import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
import org.onap.so.requestsdb.RequestsDbConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class MSORequestDBImplTest extends RequestsAdapterBase {
@@ -94,7 +90,6 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
private InfraActiveRequests buildTestRequest() {
InfraActiveRequests testRequest = new InfraActiveRequests();
testRequest.setRequestId("00032ab7-3fb3-42e5-965d-8ea592502017");
- testRequest.setClientRequestId("00032ab7-3fb3-42e5-965d-8ea592502016");
testRequest.setRequestStatus("COMPLETE");
testRequest.setStatusMessage("Vf Module has been deleted successfully.");
testRequest.setProgress((long) 100);
@@ -103,8 +98,7 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
testRequest.setServiceInstanceId("e3b5744d-2ad1-4cdd-8390-c999a38829bc");
testRequest.setRequestAction("deleteInstance");
testRequest.setRequestScope("vfModule");
- testRequest.setAction("deleteInstance");
- testRequest.setAicCloudRegion("mtn6");
+ testRequest.setCloudRegion("mtn6");
testRequest.setLastModifiedBy("BPMN");
testRequest.setVfModuleId("c7d527b1-7a91-49fd-b97d-1c8c0f4a7992");
testRequest.setVfModuleModelName("vSAMP10aDEV::base::module-0");
@@ -153,26 +147,10 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
}
@Test
- public void getByClientRequestId() throws MsoRequestsDbException {
- InfraActiveRequests testRequest = setupTestEntities();
- // Given
- String clientRequestId = "00032ab7-3fb3-42e5-965d-8ea592502016";
-
- // When
- InfraActiveRequests infraRequest = dbAdapter.getInfraRequest(clientRequestId);
- if (infraRequest == null)
- fail("Null infraRequest");
-
- // Then
- assertEquals(clientRequestId, infraRequest.getClientRequestId());
- }
-
-
- @Test
public void updateInfraRequest() throws MsoRequestsDbException {
InfraActiveRequests testRequest = setupTestEntities();
// Given
- String clientRequestId = "00032ab7-3fb3-42e5-965d-8ea592502016";
+ String requestId = "00032ab7-3fb3-42e5-965d-8ea592502017";
// When
@@ -214,7 +192,7 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
dbAdapter.updateInfraRequest(testRequest.getRequestId(), lastModifiedBy, statusMessage, responseBody,
requestStatus, progress, vnfOutputs, serviceInstanceId, networkId, vnfId, vfModuleId, volumeGroupId,
serviceInstanceName, configurationId, configurationName, vfModuleName);
- InfraActiveRequests infraRequest = dbAdapter.getInfraRequest(clientRequestId);
+ InfraActiveRequests infraRequest = dbAdapter.getInfraRequest(requestId);
// Then
assertThat(infraRequest, sameBeanAs(testRequest).ignoring("requestBody").ignoring("endTime")
.ignoring("startTime").ignoring("modifyTime"));
@@ -241,12 +219,12 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
public void updateInfraRequestNulls() throws MsoRequestsDbException {
InfraActiveRequests testRequest = setupTestEntities();
// Given
- String clientRequestId = "00032ab7-3fb3-42e5-965d-8ea592502016";
+ String requestId = "00032ab7-3fb3-42e5-965d-8ea592502017";
// When
dbAdapter.updateInfraRequest(testRequest.getRequestId(), testRequest.getLastModifiedBy(), null, null, null,
null, null, null, null, null, null, null, null, null, null, null);
- InfraActiveRequests infraRequest = dbAdapter.getInfraRequest(clientRequestId);
+ InfraActiveRequests infraRequest = dbAdapter.getInfraRequest(requestId);
// Then
assertThat(infraRequest, sameBeanAs(testRequest).ignoring("requestBody").ignoring("endTime")
.ignoring("startTime").ignoring("modifyTime"));
@@ -441,28 +419,5 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
ResourceOperationStatus actualResource =
dbAdapter.getResourceOperationStatus(serviceId, operationId, "template1");
assertThat(actualResource, sameBeanAs(expectedResource));
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor")
- && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/services/RequestsDbAdapter", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor")
- && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals(null, mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/services/RequestsDbAdapter", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("COMPLETED", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- }
}
-
-
}
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 49291b6863..09fea0644e 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
@@ -27,6 +27,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -41,6 +43,7 @@ import org.onap.so.db.request.beans.OperationStatus;
import org.onap.so.db.request.beans.OperationalEnvDistributionStatus;
import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus;
import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.serviceinstancebeans.ModelType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
@@ -73,14 +76,13 @@ public class RequestsDbClientTest extends RequestsAdapterBase {
infraActiveRequests.setNetworkName("networkInstanceNameTest");
infraActiveRequests.setConfigurationId(UUID.randomUUID().toString());
infraActiveRequests.setConfigurationName("configurationInstanceNameTest");
- infraActiveRequests.setAicCloudRegion("1");
+ infraActiveRequests.setCloudRegion("1");
infraActiveRequests.setTenantId(UUID.randomUUID().toString());
infraActiveRequests.setRequestScope("operationalEnvironment");
infraActiveRequests.setRequestorId(UUID.randomUUID().toString());
infraActiveRequests.setSource("sourceTest");
infraActiveRequests.setOperationalEnvName(UUID.randomUUID().toString());
infraActiveRequests.setRequestStatus("IN_PROGRESS");
- infraActiveRequests.setAction("create");
infraActiveRequests.setRequestAction("someaction");
infraActiveRequests.setStartTime(new Timestamp(System.currentTimeMillis()));
infraActiveRequests
@@ -110,14 +112,13 @@ public class RequestsDbClientTest extends RequestsAdapterBase {
infraActiveRequests2.setNetworkName("networkInstanceNameTest");
infraActiveRequests2.setConfigurationId(UUID.randomUUID().toString());
infraActiveRequests2.setConfigurationName("configurationInstanceNameTest");
- infraActiveRequests2.setAicCloudRegion("1");
+ infraActiveRequests2.setCloudRegion("1");
infraActiveRequests2.setTenantId(UUID.randomUUID().toString());
infraActiveRequests2.setRequestScope("operationalEnvironment");
infraActiveRequests2.setRequestorId(UUID.randomUUID().toString());
infraActiveRequests2.setSource("sourceTest");
infraActiveRequests2.setOperationalEnvName(UUID.randomUUID().toString());
infraActiveRequests2.setRequestStatus("IN_PROGRESS");
- infraActiveRequests2.setAction("create");
infraActiveRequests2.setRequestAction("someaction");
infraActiveRequests2.setStartTime(new Timestamp(System.currentTimeMillis()));
infraActiveRequests
@@ -314,4 +315,20 @@ public class RequestsDbClientTest extends RequestsAdapterBase {
verifyInfraActiveRequests(infraActiveRequestsResponse.get(0));
}
+
+ @Test
+ public void getInProgressVolumeGroupsAndVfModulesTest() {
+ InfraActiveRequests request = new InfraActiveRequests();
+ request.setRequestId(UUID.randomUUID().toString());
+ request.setVfModuleId(UUID.randomUUID().toString());
+ request.setRequestStatus("IN_PROGRESS");
+ request.setRequestScope(ModelType.vfModule.toString());
+ Instant startInstant = Instant.now().minus(3, ChronoUnit.MINUTES);
+ request.setStartTime(Timestamp.from(startInstant));
+ request.setRequestAction("create");
+ requestsDbClient.save(request);
+
+ List<InfraActiveRequests> infraActiveRequests = requestsDbClient.getInProgressVolumeGroupsAndVfModules();
+ assertThat(request, sameBeanAs(infraActiveRequests.get(0)).ignoring("modifyTime"));
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index 9c2ea6d3bf..b34b272b51 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -4,13 +4,13 @@ insert into operation_status(service_id, operation_id, service_name, user_id, re
('serviceid', 'operationid', 'servicename', 'userid', 'result', 'operationcontent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10');
-insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+insert into infra_active_requests(request_id, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, tenant_id, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values
+('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00164b9e-784d-48a8-8973-bbad6ef818ed', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
insert into watchdog_distributionid_status(distribution_id, distribution_id_status, lock_version, create_time, modify_time) values
('1533c4bd-a3e3-493f-a16d-28c20614415e', '', 0, '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
@@ -31,11 +31,11 @@ insert into watchdog_service_mod_ver_id_lookup(distribution_id, service_model_ve
insert into site_status(site_name, status, creation_timestamp) values
('testsite', 0, '2017-11-30 15:48:09');
-INSERT INTO requestdb.request_processing_data (ID, SO_REQUEST_ID, GROUPING_ID, NAME, VALUE, TAG)
+INSERT INTO requestdb.request_processing_data (ID, SO_REQUEST_ID, GROUPING_ID, NAME, VALUE, TAG, IS_DATA_INTERNAL)
VALUES
-(1, '00032ab7-na18-42e5-965d-8ea592502018', '7d2e8c07-4d10-456d-bddc-37abf38ca714', 'requestAction', 'assign', 'pincFabricConfigRequest'),
-(2, '00032ab7-na18-42e5-965d-8ea592502018', '7d2e8c07-4d10-456d-bddc-37abf38ca715', 'configurationId', '52234bc0-d6a6-41d4-a901-79015e4877e2', 'pincFabricConfigRequest'),
-(3, '5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'configId', '52234bc0-d6a6-41d4-a901-79015e4877e2', 'pincFabricConfig');
+(1, '00032ab7-na18-42e5-965d-8ea592502018', '7d2e8c07-4d10-456d-bddc-37abf38ca714', 'requestAction', 'assign', 'pincFabricConfigRequest', 1),
+(2, '00032ab7-na18-42e5-965d-8ea592502018', '7d2e8c07-4d10-456d-bddc-37abf38ca715', 'configurationId', '52234bc0-d6a6-41d4-a901-79015e4877e2', 'pincFabricConfigRequest', 0),
+(3, '5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'configId', '52234bc0-d6a6-41d4-a901-79015e4877e2', 'pincFabricConfig', 1);
INSERT INTO activate_operational_env_service_model_distribution_status (OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID,SERVICE_MOD_VER_FINAL_DISTR_STATUS,RECOVERY_ACTION,RETRY_COUNT_LEFT,WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME, VNF_OPERATIONAL_ENV_ID)
VALUES
diff --git a/adapters/mso-sdnc-adapter/pom.xml b/adapters/mso-sdnc-adapter/pom.xml
index fc577a52e3..07c8ed5eab 100644
--- a/adapters/mso-sdnc-adapter/pom.xml
+++ b/adapters/mso-sdnc-adapter/pom.xml
@@ -42,6 +42,9 @@
<executions>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
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 6149f7ed25..dd1da98dd8 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
@@ -32,7 +32,7 @@ import org.apache.cxf.transport.servlet.CXFServlet;
import org.onap.so.adapters.sdnc.sdncrest.SNIROResponse;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
-import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -51,7 +51,7 @@ public class CXFConfiguration {
private Bus bus;
@Autowired
- private JaxRsFilterLogging jaxRsFilterLogging;
+ private SOAuditLogContainerFilter soAuditLogContainerFilter;
@Autowired
private SDNCAdapterPortType sdncAdapterPortImpl;
@@ -70,7 +70,7 @@ public class CXFConfiguration {
endpoint.setServiceBeans(Arrays.<Object>asList(sniroResponse));
endpoint.setAddress("/rest");
endpoint.setFeatures(Arrays.asList(createSwaggerFeature(), new LoggingFeature()));
- endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), jaxRsFilterLogging));
+ endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), soAuditLogContainerFilter));
return endpoint.create();
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
index 55023088bc..55a05436f0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
@@ -23,7 +23,9 @@
package org.onap.so.adapters.sdnc;
import java.util.concurrent.Executor;
-import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
+import org.onap.logging.filter.base.Constants;
+import org.onap.logging.filter.spring.MDCTaskDecorator;
+import org.onap.so.utils.Components;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -52,6 +54,7 @@ public class SDNCAdapterApplication {
}
public static void main(String[] args) {
+ System.setProperty(Constants.Property.PARTNER_NAME, Components.SDNC_ADAPTER.toString());
SpringApplication.run(SDNCAdapterApplication.class, args);
System.getProperties().setProperty("server.name", "Springboot");
setLogsDir();
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/WebSecurityConfigImpl.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/WebSecurityConfigImpl.java
deleted file mode 100644
index 232381385f..0000000000
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.sdnc;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info", "/services").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
index 012a19f1a9..a8418ea901 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
@@ -178,7 +178,7 @@ public class SDNCRestClient {
return (sdncResp);
} catch (Exception e) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
- ErrorCode.BusinessProcesssError.getValue(), "Exception processing request to SDNC", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception processing request to SDNC", e);
// default
sdncResp.setRespCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
String respMsg = "Error processing request to SDNC. ";
@@ -246,7 +246,7 @@ public class SDNCRestClient {
} // is != null
} catch (Exception e1) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ERROR_GET_RESPONSE_SDNC.toString(), "SDNC",
- ErrorCode.BusinessProcesssError.getValue(), "Exception while get SDNC response", e1);
+ ErrorCode.BusinessProcessError.getValue(), "Exception while get SDNC response", e1);
}
} // con != null
@@ -312,7 +312,7 @@ public class SDNCRestClient {
headers.put("Authorization", Collections.singletonList(basicAuth));
} catch (Exception e2) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcesssError.getValue(),
+ ErrorCode.BusinessProcessError.getValue(),
"Exception - Unable to set authorization in callback request", e2);
}
@@ -322,7 +322,7 @@ public class SDNCRestClient {
} catch (Exception e) {
error = "Error sending BpelCallback request" + e.getMessage();
- logger.error("Error {} - {} - {}", ErrorCode.BusinessProcesssError.getValue(),
+ logger.error("Error {} - {} - {}", ErrorCode.BusinessProcessError.getValue(),
MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), error, e);
}
logger.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE.name(), CAMUNDA);
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java
index 1c47a2d6b0..f710988886 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java
@@ -99,7 +99,7 @@ public class Utils {
} catch (Exception e) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST.toString(), "SDNC",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in genSdncReq", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in genSdncReq", e);
}
return null;
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index b50662a832..631be2f9ff 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -24,27 +24,30 @@
package org.onap.so.adapters.sdnc.sdncrest;
+import java.net.URI;
import javax.xml.bind.DatatypeConverter;
-import org.onap.so.logger.LoggingAnchor;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
import org.onap.so.adapters.sdnc.impl.Constants;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
+import org.onap.so.utils.CryptoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.onap.so.utils.CryptoUtils;
-import org.slf4j.MDC;
import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.HttpStatusCodeException;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.UriComponentsBuilder;
/**
* Sends asynchronous messages to the BPMN WorkflowMessage service.
@@ -95,81 +98,72 @@ public class BPRestCallback {
logger.info(LoggingAnchor.THREE, MessageEnum.RA_CALLBACK_BPEL.toString(),
message == null ? "[no content]" : message, CAMUNDA);
-
- HttpPost method = null;
- HttpResponse httpResponse = null;
-
try {
int timeout = 60 * 1000;
+ RestTemplate restTemplate = setRestTemplate(timeout);
- RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
- .setConnectionRequestTimeout(timeout).build();
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
- HttpClient client = HttpClientBuilder.create().build();
- method = new HttpPost(url);
- method.setConfig(requestConfig);
-
- if (message != null) {
- method.setEntity(new StringEntity(message, ContentType.APPLICATION_JSON));
- }
-
- boolean error = false;
-
- try {
- String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
- env.getProperty(Constants.ENCRYPTION_KEY_PROP));
- String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
- method.setHeader("Authorization", authorization);
- method.setHeader(ONAPLogConstants.Headers.REQUEST_ID, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
- method.setHeader(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- method.setHeader(ONAPLogConstants.Headers.PARTNER_NAME, "SO-SDNCAdapter");
- } catch (Exception e) {
- logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcesssError.getValue(), "Unable to set authorization in callback request",
- e);
- error = true;
- }
+ boolean error = setAuthorizationHeader(headers);
+ HttpEntity<String> requestEntity = new HttpEntity<>(message, headers);
if (!error) {
- httpResponse = client.execute(method);
-
- @SuppressWarnings("unused")
- String responseContent = null;
-
- if (httpResponse.getEntity() != null) {
- responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
- }
-
- if (httpResponse.getStatusLine().getStatusCode() >= 300) {
- String msg = "Received error response to callback request: " + httpResponse.getStatusLine();
- logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcesssError.getValue(), msg);
-
- }
+ postRequest(restTemplate, url, requestEntity);
}
+ logger.info(LoggingAnchor.TWO, MessageEnum.RA_CALLBACK_BPEL_COMPLETE.toString(), CAMUNDA);
return true;
} catch (Exception e) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcesssError.getValue(), "Error sending callback request", e);
+ ErrorCode.BusinessProcessError.getValue(), "Error sending callback request", e);
return false;
- } finally {
- if (httpResponse != null) {
- try {
- EntityUtils.consume(httpResponse.getEntity());
- httpResponse = null;
- } catch (Exception e) {
- logger.debug("Exception:", e);
- }
- }
+ }
+ }
- if (method != null) {
- try {
- method.reset();
- } catch (Exception e) {
- logger.debug("Exception:", e);
- }
- }
- logger.info(LoggingAnchor.TWO, MessageEnum.RA_CALLBACK_BPEL_COMPLETE.toString(), CAMUNDA);
+ protected boolean setAuthorizationHeader(HttpHeaders headers) {
+ boolean error = false;
+ try {
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
+ String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+ headers.set("Authorization", authorization);
+ } catch (Exception e) {
+ logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
+ ErrorCode.BusinessProcessError.getValue(), "Unable to set authorization in callback request", e);
+ error = true;
+ }
+ return error;
+ }
+
+ private void postRequest(RestTemplate restTemplate, String url, HttpEntity<String> requestEntity) {
+ ResponseEntity<String> response = null;
+ try {
+ UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url);
+ URI uri = builder.build(true).toUri();
+ response = restTemplate.postForEntity(uri, requestEntity, String.class);
+ } catch (HttpStatusCodeException e) {
+ logResponseError(e.getStatusCode());
+ }
+ if (response != null && response.getStatusCode().is3xxRedirection()) {
+ logResponseError(response.getStatusCode());
}
}
+
+ private void logResponseError(HttpStatus statusCode) {
+ String msg = "Received error response to callback request: " + statusCode;
+ logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
+ ErrorCode.BusinessProcessError.getValue(), msg);
+ }
+
+ protected RestTemplate setRestTemplate(int timeout) {
+ RestTemplate restTemplate = new RestTemplate();
+ HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
+ factory.setConnectionRequestTimeout(timeout);
+ factory.setReadTimeout(timeout);
+ factory.setConnectTimeout(timeout);
+ restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory));
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
+ return restTemplate;
+ }
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
index 5697ed56a5..50c8a089df 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
@@ -185,7 +185,7 @@ public class SDNCServiceRequestTask {
addTextChild(agnosticServiceInformation, "anydata", anydata);
} catch (Exception e) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST.toString(), "SDNC",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in genSdncReq", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in genSdncReq", e);
return null;
}
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application-aaf.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application-basic.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application-basic.yaml
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java
new file mode 100644
index 0000000000..09089890ab
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java
@@ -0,0 +1,142 @@
+package org.onap.so.adapters.sdnc.sdncrest;
+
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.adapters.sdnc.impl.Constants;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpServerErrorException;
+import org.springframework.web.client.ResourceAccessException;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.UriComponentsBuilder;
+
+@RunWith(MockitoJUnitRunner.class)
+public class BPRestCallbackUnitTest {
+ @Mock
+ private Environment env;
+
+ @Mock
+ private RestTemplate restTemplate;
+
+ @Spy
+ @InjectMocks
+ private BPRestCallback bpRestCallback;
+
+ private HttpEntity<String> requestEntity;
+ private String message;
+ private HttpHeaders headers;
+ private URI uri;
+
+ @Before
+ public void setUp() throws IOException {
+ headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ message = input("BPRestCallbackRequest.json");
+ requestEntity = new HttpEntity<>(message, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("http://localhost:8000/sdnc");
+ uri = builder.build(true).toUri();
+ }
+
+ public String input(String JsonInput) throws IOException {
+ JsonInput = "src/test/resources/" + JsonInput;
+ return new String(Files.readAllBytes(Paths.get(JsonInput)));
+ }
+
+ @Test
+ public void sendTest() throws IOException {
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.OK);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendNoAuthHeaderTest() throws IOException {
+ doReturn(true).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendErrorTest() throws IOException {
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class))
+ .thenThrow(new HttpServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR, null, null, null));
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendResponse3xxTest() throws IOException {
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.MULTIPLE_CHOICES);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendResponseNullMessageTest() throws IOException {
+ HttpHeaders httpHeaders = new HttpHeaders();
+ httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+ HttpEntity<String> requestEntityNoMessage = new HttpEntity<>(null, httpHeaders);
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.OK);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(httpHeaders);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntityNoMessage, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", null);
+ assertTrue(response);
+ }
+
+ @Test
+ public void postThrowsExceptionTest() throws IOException {
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class))
+ .thenThrow(new ResourceAccessException("ResourceAccessException"));
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertFalse(response);
+ }
+
+ @Test
+ public void setAuthorizationHeaderTest() {
+ HttpHeaders authHeaders = new HttpHeaders();
+ when(env.getProperty(Constants.BPEL_AUTH_PROP))
+ .thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C");
+ when(env.getProperty(Constants.ENCRYPTION_KEY_PROP)).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
+ boolean result = bpRestCallback.setAuthorizationHeader(authHeaders);
+ assertFalse(result);
+ }
+
+ @Test
+ public void setAuthorizationHeaderErrorTest() {
+ HttpHeaders authHeaders = new HttpHeaders();
+ when(env.getProperty(Constants.BPEL_AUTH_PROP)).thenReturn("test");
+ when(env.getProperty(Constants.ENCRYPTION_KEY_PROP)).thenReturn("test");
+ boolean result = bpRestCallback.setAuthorizationHeader(authHeaders);
+ assertTrue(result);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json b/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json
new file mode 100644
index 0000000000..21f3dab7e0
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json
@@ -0,0 +1 @@
+{"SDNCServiceResponse":{"sdncRequestId":"b5b763aa-0d8a-4438-b900-83af45d21d10","responseCode":"200","ackFinalIndicator":"N"}} \ No newline at end of file
diff --git a/adapters/mso-ve-vnfm-adapter/pom.xml b/adapters/mso-ve-vnfm-adapter/pom.xml
new file mode 100644
index 0000000000..d157466c67
--- /dev/null
+++ b/adapters/mso-ve-vnfm-adapter/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.2.2.RELEASE</version>
+ </parent>
+
+ <groupId>org.onap.so.adapters</groupId>
+ <artifactId>mso-ve-vnfm-adapter</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>mso-ve-vnfm-adapter</name>
+ <description>Ve-Vnfm (SOL002) Adapter</description>
+
+ <properties>
+ <java.version>1.8</java.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so.adapters</groupId>
+ <artifactId>mso-vnfm-adapter-ext-clients</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/ICryptoHandler.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/Application.java
index 479d2e82bd..0e62a372b3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/ICryptoHandler.java
+++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/Application.java
@@ -1,15 +1,15 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP - SO
+ * SO
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019 Samsung. 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.
@@ -18,12 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.common.util;
+package org.onap.so.adapters.vevnfm;
-public interface ICryptoHandler {
- public String getMsoAaiPassword();
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
- public String encryptMsoPassword(String plainPwd);
-
- public String decryptMsoPassword(String encryptedPwd);
+@SpringBootApplication
+public class Application {
+ public static void main(String... args) {
+ SpringApplication.run(Application.class, args);
+ }
}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java
index 39de3444db..2e5a00ad02 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfmAdapterCreationNotification.java
+++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java
@@ -1,8 +1,8 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * SO
* ================================================================================
- * Modifications Copyright (c) 2019 Samsung
+ * Copyright (C) 2019 Samsung. 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.
@@ -15,34 +15,27 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.svnfm.simulator.notifications;
+package org.onap.so.adapters.vevnfm.controller;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-public class VnfmAdapterCreationNotification implements Runnable {
+@RestController
+public class NotificationController {
- private static final Logger logger = LoggerFactory.getLogger(VnfmAdapterCreationNotification.class);
+ private static final Logger logger = LoggerFactory.getLogger(NotificationController.class);
- @Override
- public void run() {
- try {
- Thread.sleep(10000);
- } catch (final InterruptedException e) {
- logger.error("Error occured while simulating creation ", e);
- Thread.currentThread().interrupt();
- }
- logger.info("Call to VNFM Adapter-Create");
+ @PostMapping("${notification.url}")
+ public ResponseEntity receiveNotification(@RequestBody final VnfLcmOperationOccurrenceNotification notification) {
+ logger.info("Notification received {}", notification);
+ return ResponseEntity.ok().build();
}
-
}
diff --git a/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml
new file mode 100644
index 0000000000..30b3955821
--- /dev/null
+++ b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# Copyright © 2019 Samsung.
+# 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.
+
+notification:
+ url: /lcm/v1/vnf/instances/notifications
+
+spring:
+ http:
+ converters:
+ preferred-json-mapper: gson
diff --git a/adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/WMAdapterRestTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java
index 08728fa339..d31c6f2ea5 100644
--- a/adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/WMAdapterRestTest.java
+++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java
@@ -1,15 +1,15 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP - SO
+ * SO
* ================================================================================
- * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (C) 2019 Samsung. 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
- *l
+ *
* 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.
@@ -18,28 +18,24 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.workflowmessage;
+package org.onap.so.adapters.vevnfm.controller;
-import org.junit.Assert;
import org.junit.Test;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
-public class WMAdapterRestTest {
+import static org.junit.Assert.assertEquals;
- @Test(expected = ClassFormatError.class)
- public void testHealthCheckException() throws Exception {
+public class NotificationControllerTest {
- WMAdapterRest test = new WMAdapterRest();
- test.healthcheck("34388737-cdad-4d96-ae6f-39d08024b495");
- Assert.assertFalse(true);
-
- }
-
- @Test(expected = ClassFormatError.class)
- public void testReceiveWorkflowMsgException() throws Exception {
- WMAdapterRest test = new WMAdapterRest();
- test.receiveWorkflowMessage("contentTypeHeader", "messageType", "correlator", "content");
- Assert.assertFalse(true);
+ private final NotificationController controller = new NotificationController();
+ @Test
+ public void testReceiveNotification() {
+ final VnfLcmOperationOccurrenceNotification notification
+ = new VnfLcmOperationOccurrenceNotification();
+ final ResponseEntity response = controller.receiveNotification(notification);
+ assertEquals(HttpStatus.OK, response.getStatusCode());
}
}
-
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
index 5ea68f08a2..dd875c573e 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
@@ -28,7 +28,7 @@ import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.onap.so.adapters.vfc.rest.VfcAdapterRest;
-import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -47,7 +47,7 @@ public class CXFConfiguration {
private VfcAdapterRest vfcAdapterRest;
@Autowired
- private JaxRsFilterLogging jaxRsFilterLogging;
+ private SOAuditLogContainerFilter soAuditLogContainerFilter;
@Autowired
private ObjectMapper mapper;
@@ -64,7 +64,7 @@ public class CXFConfiguration {
endpoint.setServiceBeans(Arrays.<Object>asList(vfcAdapterRest));
endpoint.setAddress("/");
endpoint.setFeatures(Arrays.asList(createSwaggerFeature(), new LoggingFeature()));
- endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), jaxRsFilterLogging));
+ endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), soAuditLogContainerFilter));
return endpoint.create();
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java
deleted file mode 100644
index e94e34d87c..0000000000
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.vfc;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info", "/services").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
index e8b4cfd997..5b50f776cc 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
@@ -85,7 +85,7 @@ public class JsonUtil {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), UNMARSHAL_FAIL_MSG, e);
+ ErrorCode.BusinessProcessError.getValue(), UNMARSHAL_FAIL_MSG, e);
throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
}
@@ -103,7 +103,7 @@ public class JsonUtil {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), UNMARSHAL_FAIL_MSG, e);
+ ErrorCode.BusinessProcessError.getValue(), UNMARSHAL_FAIL_MSG, e);
throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
}
@@ -120,7 +120,7 @@ public class JsonUtil {
return MAPPER.writeValueAsString(srcObj);
} catch (IOException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "fail to marshal json", e);
+ ErrorCode.BusinessProcessError.getValue(), "fail to marshal json", e);
throw new ApplicationException(HttpCode.BAD_REQUEST, "srcObj marshal failed!");
}
}
diff --git a/adapters/mso-vfc-adapter/src/main/resources/application-aaf.yaml b/adapters/mso-vfc-adapter/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-vfc-adapter/src/main/resources/application-basic.yaml b/adapters/mso-vfc-adapter/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/resources/application-basic.yaml
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
index 9d9e33a524..e874c4b8b3 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
@@ -15,6 +15,8 @@
<threetenbp-version>1.3.5</threetenbp-version>
<oltu-version>1.0.1</oltu-version>
<swagger-core-version>1.5.15</swagger-core-version>
+ <okhttp3-version>3.14.0</okhttp3-version>
+ <okhttp-version>2.7.5</okhttp-version>
</properties>
<name>mso-vnfm-adapter-api</name>
<description>MSO VNFM adapter API</description>
@@ -47,6 +49,27 @@
</configOptions>
</configuration>
</execution>
+
+ <execution>
+ <id>etsicatalog-notification-api</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-Notification-API.json</inputSpec>
+ <language>java</language>
+ <library>okhttp-gson</library>
+ <output>${project.build.directory}/generated-sources/etsicatalog/notification</output>
+ <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.api</apiPackage>
+ <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model</modelPackage>
+ <configOptions>
+ <sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
+ <serializableModel>true</serializableModel>
+ </configOptions>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
@@ -105,5 +128,34 @@
<artifactId>okio</artifactId>
<version>1.13.0</version>
</dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp3</groupId>
+ <artifactId>okhttp</artifactId>
+ <version>${okhttp3-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp3</groupId>
+ <artifactId>logging-interceptor</artifactId>
+ <version>${okhttp3-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp</groupId>
+ <artifactId>logging-interceptor</artifactId>
+ <version>${okhttp-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp</groupId>
+ <artifactId>okhttp</artifactId>
+ <version>${okhttp-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup.okhttp</groupId>
+ <artifactId>logging-interceptor</artifactId>
+ <version>${okhttp-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json
new file mode 100644
index 0000000000..6f9b2c3bbe
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json
@@ -0,0 +1,230 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "Modeling etsicatalog API",
+ "description": "\n\nThe `swagger-ui` view can be found [here](/api/catalog/v1/swagger).\nThe `ReDoc` view can be found [here](/api/catalog/v1/redoc).\nThe swagger YAML document can be found [here](/api/catalog/v1/swagger.yaml).\nThe swagger JSON document can be found [here](/api/catalog/v1/swagger.json).",
+ "version": "v1"
+ },
+ "host": "127.0.0.1:8000",
+ "schemes": ["http"],
+ "basePath": "/",
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "securityDefinitions": {
+ "Basic": {
+ "type": "basic"
+ }
+ },
+ "security": [{
+ "Basic": []
+ }],
+ "paths": {
+ "/URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageChangeNotification": {
+ "get": {
+ "operationId": "URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageChangeNotification_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": ""
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "post": {
+ "operationId": "URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageChangeNotification_create",
+ "description": "",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/PkgChangeNotification"
+ }
+ }],
+ "responses": {
+ "204": {
+ "description": ""
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": []
+ },
+ "/URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageOnboardingNotification": {
+ "get": {
+ "operationId": "URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageOnboardingNotification_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": ""
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "post": {
+ "operationId": "URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageOnboardingNotification_create",
+ "description": "",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/PkgOnboardingNotification"
+ }
+ }],
+ "responses": {
+ "204": {
+ "description": ""
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": []
+ }
+ },
+ "definitions": {
+ "NOTIFICATION_LINKSERIALIZER": {
+ "title": "Vnfpackage",
+ "description": "Link to the resource representing the VNF package to which the notified change applies.",
+ "required": ["href"],
+ "type": "object",
+ "properties": {
+ "href": {
+ "title": "Href",
+ "description": "URI of the referenced resource.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "PkgmLinks": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "type": "object",
+ "properties": {
+ "vnfPackage": {
+ "$ref": "#/definitions/NOTIFICATION_LINKSERIALIZER"
+ },
+ "subscription": {
+ "$ref": "#/definitions/NOTIFICATION_LINKSERIALIZER"
+ }
+ }
+ },
+ "PkgChangeNotification": {
+ "required": ["id", "notificationType", "timeStamp", "subscriptionId", "vnfPkgId", "changeType", "vnfdId", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of this notification.",
+ "type": "string",
+ "minLength": 1
+ },
+ "notificationType": {
+ "title": "Notificationtype",
+ "description": "Discriminator for the different notification types.",
+ "type": "string",
+ "enum": ["VnfPackageChangeNotification"]
+ },
+ "timeStamp": {
+ "title": "Timestamp",
+ "description": "Date-time of the generation of the notification.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "subscriptionId": {
+ "title": "Subscriptionid",
+ "description": "Identifier of the subscription that this notification relates to.",
+ "type": "string",
+ "minLength": 1
+ },
+ "vnfPkgId": {
+ "title": "Vnfpkgid",
+ "description": "Identifier of the VNF package.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "changeType": {
+ "title": "Changetype",
+ "description": "The type of change of the VNF package.",
+ "type": "string",
+ "enum": ["OP_STATE_CHANGE", "PKG_DELETE"]
+ },
+ "operationalState": {
+ "title": "Operationalstate",
+ "description": "New operational state of the VNF package.",
+ "type": "string",
+ "enum": ["ENABLED", "DISABLED"]
+ },
+ "vnfdId": {
+ "title": "Vnfdid",
+ "description": "This identifier, which is managed by the VNF provider, identifies the VNF package and the VNFD in a globally unique way.",
+ "type": "string",
+ "minLength": 1
+ },
+ "_links": {
+ "$ref": "#/definitions/PkgmLinks"
+ }
+ }
+ },
+ "PkgOnboardingNotification": {
+ "required": ["id", "notificationType", "subscriptionId", "timeStamp", "vnfPkgId", "vnfdId", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of this notification.",
+ "type": "string",
+ "minLength": 1
+ },
+ "notificationType": {
+ "title": "Notificationtype",
+ "description": "Discriminator for the different notification types.",
+ "type": "string",
+ "enum": ["VnfPackageOnboardingNotification"]
+ },
+ "subscriptionId": {
+ "title": "Subscriptionid",
+ "description": "Identifier of the subscription that this notification relates to.",
+ "type": "string",
+ "minLength": 1
+ },
+ "timeStamp": {
+ "title": "Timestamp",
+ "description": "Date-time of the generation of the notification.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "vnfPkgId": {
+ "title": "Vnfpkgid",
+ "description": "Identifier of the VNF package.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "vnfdId": {
+ "title": "Vnfdid",
+ "description": "This identifier, which is managed by the VNF provider, identifies the VNF package and the VNFD in a globally unique way.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "_links": {
+ "$ref": "#/definitions/PkgmLinks"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
index 91478e1f8e..8e2cfd2be4 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml
@@ -75,8 +75,7 @@
<goal>generate</goal>
</goals>
<configuration>
- <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json
- </inputSpec>
+ <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json</inputSpec>
<language>java</language>
<library>okhttp-gson</library>
<output>${project.build.directory}/generated-sources/sol003-vnf-grant</output>
@@ -91,6 +90,46 @@
</configOptions>
</configuration>
</execution>
+ <execution>
+ <id>sol003-vnf-packagemanagement-api</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${basedir}/src/main/resources/SOL003-VNFPackageManagement-API.json</inputSpec>
+ <language>java</language>
+ <library>okhttp-gson</library>
+ <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement</output>
+ <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.api</apiPackage>
+ <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model</modelPackage>
+ <configOptions>
+ <sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
+ <serializableModel>true</serializableModel>
+ </configOptions>
+ </configuration>
+ </execution>
+ <execution>
+ <id>etsicatalog-api</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-API.json</inputSpec>
+ <language>java</language>
+ <library>okhttp-gson</library>
+ <output>${project.build.directory}/generated-sources/etsicatalog</output>
+ <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.api</apiPackage>
+ <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model</modelPackage>
+ <configOptions>
+ <sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
+ <serializableModel>true</serializableModel>
+ </configOptions>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json
new file mode 100644
index 0000000000..efd427009d
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json
@@ -0,0 +1,3117 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "Modeling etsicatalog API",
+ "description": "\n\nThe `swagger-ui` view can be found [here](/api/catalog/v1/swagger).\nThe `ReDoc` view can be found [here](/api/catalog/v1/redoc).\nThe swagger YAML document can be found [here](/api/catalog/v1/swagger.yaml).\nThe swagger JSON document can be found [here](/api/catalog/v1/swagger.json).",
+ "version": "v1"
+ },
+ "host": "127.0.0.1:8000",
+ "schemes": ["http"],
+ "basePath": "/",
+ "consumes": ["application/json"],
+ "produces": ["application/json"],
+ "securityDefinitions": {
+ "Basic": {
+ "type": "basic"
+ }
+ },
+ "security": [{
+ "Basic": []
+ }],
+ "paths": {
+ "/api/catalog/v1/callback_sample": {
+ "get": {
+ "operationId": "api_catalog_v1_callback_sample_list",
+ "description": "Callback Sample.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": ""
+ }
+ },
+ "tags": ["Sample interface"]
+ },
+ "parameters": []
+ },
+ "/api/catalog/v1/health_check": {
+ "get": {
+ "operationId": "api_catalog_v1_health_check_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Active"
+ }
+ },
+ "tags": ["Health Check interface"]
+ },
+ "parameters": []
+ },
+ "/api/catalog/v1/jobs/{job_id}": {
+ "get": {
+ "operationId": "api_catalog_v1_jobs_read",
+ "description": "Get job status",
+ "parameters": [{
+ "name": "job_id",
+ "in": "query",
+ "description": "job id",
+ "type": "string"
+ }, {
+ "name": "responseId",
+ "in": "query",
+ "description": "response id",
+ "type": "string"
+ }],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/GetJobResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PostJobResponseResult"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "post": {
+ "operationId": "api_catalog_v1_jobs_create",
+ "description": "Update job status",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/PostJobRequest"
+ }
+ }, {
+ "name": "job_id",
+ "in": "query",
+ "description": "job id",
+ "type": "string"
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PostJobResponseResult"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PostJobResponseResult"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": [{
+ "name": "job_id",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/catalog/v1/mandb/{modelName}": {
+ "get": {
+ "operationId": "api_catalog_v1_mandb_read",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": ""
+ }
+ },
+ "tags": ["Sample interface"]
+ },
+ "delete": {
+ "operationId": "api_catalog_v1_mandb_delete",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": ""
+ }
+ },
+ "tags": ["Sample interface"]
+ },
+ "parameters": [{
+ "name": "modelName",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/catalog/v1/nspackages": {
+ "get": {
+ "operationId": "api_catalog_v1_nspackages_list",
+ "description": "Query NS packages",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/NsPackage"
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "post": {
+ "operationId": "api_catalog_v1_nspackages_create",
+ "description": "On distribute NS package",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/NsPackageDistributeRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsPackageDistributeResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": []
+ },
+ "/api/catalog/v1/nspackages/{csarId}": {
+ "get": {
+ "operationId": "api_catalog_v1_nspackages_read",
+ "description": "Query one NS package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsPackage"
+ }
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "delete": {
+ "operationId": "api_catalog_v1_nspackages_delete",
+ "description": "Delete one NS package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsPackageDistributeResponse"
+ }
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": [{
+ "name": "csarId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/catalog/v1/service_packages": {
+ "get": {
+ "operationId": "api_catalog_v1_service_packages_list",
+ "description": "Query Service packages",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ServicePackage"
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "post": {
+ "operationId": "api_catalog_v1_service_packages_create",
+ "description": "On distribute Service package",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/ServicePackageDistributeRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": ""
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": []
+ },
+ "/api/catalog/v1/service_packages/{csarId}": {
+ "get": {
+ "operationId": "api_catalog_v1_service_packages_read",
+ "description": "Query one Service package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ServicePackage"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "delete": {
+ "operationId": "api_catalog_v1_service_packages_delete",
+ "description": "Delete one Service package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "204": {
+ "description": ""
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": [{
+ "name": "csarId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/catalog/v1/vnfpackages": {
+ "get": {
+ "operationId": "api_catalog_v1_vnfpackages_list",
+ "description": "Query Nf packages",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/NfPackage"
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "post": {
+ "operationId": "api_catalog_v1_vnfpackages_create",
+ "description": "On distribute Nf package",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/NfPackageDistributeRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PostJobResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": []
+ },
+ "/api/catalog/v1/vnfpackages/{csarId}": {
+ "get": {
+ "operationId": "api_catalog_v1_vnfpackages_read",
+ "description": "Query one Nf package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NfPackage"
+ }
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "delete": {
+ "operationId": "api_catalog_v1_vnfpackages_delete",
+ "description": "Delete one Nf package",
+ "parameters": [{
+ "name": "csarId",
+ "in": "query",
+ "description": "csarId",
+ "type": "string"
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PostJobResponse"
+ }
+ },
+ "500": {
+ "description": "error message",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["Catalog interface"]
+ },
+ "parameters": [{
+ "name": "csarId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/nsd/v1/health_check": {
+ "get": {
+ "operationId": "api_nsd_v1_health_check_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Active"
+ }
+ },
+ "tags": ["Health Check interface"]
+ },
+ "parameters": []
+ },
+ "/api/nsd/v1/ns_descriptors": {
+ "get": {
+ "operationId": "api_nsd_v1_ns_descriptors_list",
+ "description": "Query multiple NSDs",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/NsdInfo"
+ }
+ }
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "post": {
+ "operationId": "api_nsd_v1_ns_descriptors_create",
+ "description": "Create a NSD",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/CreateNsdInfoRequest"
+ }
+ }],
+ "responses": {
+ "201": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsdInfo"
+ }
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": []
+ },
+ "/api/nsd/v1/ns_descriptors/{nsdInfoId}": {
+ "get": {
+ "operationId": "api_nsd_v1_ns_descriptors_read",
+ "description": "Query a NSD",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsdInfo"
+ }
+ },
+ "404": {
+ "description": "NSDs do not exist"
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "delete": {
+ "operationId": "api_nsd_v1_ns_descriptors_delete",
+ "description": "Delete a NSD",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No content"
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": [{
+ "name": "nsdInfoId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content": {
+ "get": {
+ "operationId": "api_nsd_v1_ns_descriptors_nsd_content_list",
+ "description": "Download NSD content",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No content"
+ },
+ "404": {
+ "description": "NSD does not exist."
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "put": {
+ "operationId": "api_nsd_v1_ns_descriptors_nsd_content_update",
+ "description": "Upload NSD content",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "PNFD file"
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": [{
+ "name": "nsdInfoId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/nsd/v1/pnf_descriptors": {
+ "get": {
+ "operationId": "api_nsd_v1_pnf_descriptors_list",
+ "description": "Query multiple PNFDs",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PnfdInfo"
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "post": {
+ "operationId": "api_nsd_v1_pnf_descriptors_create",
+ "description": "Create a PNFD",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/CreatePnfdInfoRequest"
+ }
+ }],
+ "responses": {
+ "201": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PnfdInfo"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": []
+ },
+ "/api/nsd/v1/pnf_descriptors/{pnfdInfoId}": {
+ "get": {
+ "operationId": "api_nsd_v1_pnf_descriptors_read",
+ "description": "Query a PNFD",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PnfdInfo"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "delete": {
+ "operationId": "api_nsd_v1_pnf_descriptors_delete",
+ "description": "Delete a PNFD",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No content"
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": [{
+ "name": "pnfdInfoId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/nsd/v1/pnf_descriptors/{pnfdInfoId}/pnfd_content": {
+ "get": {
+ "operationId": "Fetch PNFD content",
+ "description": "Fetch PNFD content",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "PNFD file",
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "produces": ["application/octet-stream", "application/json"],
+ "tags": ["NSD Management interface"]
+ },
+ "put": {
+ "operationId": "api_nsd_v1_pnf_descriptors_pnfd_content_update",
+ "description": "Upload PNFD content",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No content"
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": [{
+ "name": "pnfdInfoId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/nsd/v1/subscriptions": {
+ "get": {
+ "operationId": "api_nsd_v1_subscriptions_list",
+ "description": "Query subscriptions for Nsd Management",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/NsdmSubscription"
+ }
+ }
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "post": {
+ "operationId": "api_nsd_v1_subscriptions_create",
+ "description": "Create Subscription for NSD Management",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/NsdmSubscriptionRequest"
+ }
+ }],
+ "responses": {
+ "201": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsdmSubscription"
+ }
+ },
+ "303": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": []
+ },
+ "/api/nsd/v1/subscriptions/{subscriptionId}": {
+ "get": {
+ "operationId": "api_nsd_v1_subscriptions_read",
+ "description": "Query subscriptions for Nsd Management",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/NsdmSubscription"
+ }
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "delete": {
+ "operationId": "api_nsd_v1_subscriptions_delete",
+ "description": "Delete subscription for Nsd Management",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No_Content"
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["NSD Management interface"]
+ },
+ "parameters": [{
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/parser/v1/health_check": {
+ "get": {
+ "operationId": "api_parser_v1_health_check_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Active"
+ }
+ },
+ "tags": ["Health Check interface"]
+ },
+ "parameters": []
+ },
+ "/api/parser/v1/parser": {
+ "post": {
+ "operationId": "api_parser_v1_parser_create",
+ "description": "Parse model(NS, Service, VNF, PNF)",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/ParseModelRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ParseModelResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Parser interface"]
+ },
+ "parameters": []
+ },
+ "/api/parser/v1/parsernsd": {
+ "post": {
+ "operationId": "api_parser_v1_parsernsd_create",
+ "description": "Parse NS model",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/ParseModelRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ParseModelResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Parser interface"]
+ },
+ "parameters": []
+ },
+ "/api/parser/v1/parserpnfd": {
+ "post": {
+ "operationId": "api_parser_v1_parserpnfd_create",
+ "description": "Parse PNF model",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/ParseModelRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ParseModelResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Parser interface"]
+ },
+ "parameters": []
+ },
+ "/api/parser/v1/parservnfd": {
+ "post": {
+ "operationId": "api_parser_v1_parservnfd_create",
+ "description": "Parse NF model",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/ParseModelRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ParseModelResponse"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/InternalErrorRequest"
+ }
+ }
+ },
+ "tags": ["Parser interface"]
+ },
+ "parameters": []
+ },
+ "/api/vnfpkgm/v1/health_check": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_health_check_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Active"
+ }
+ },
+ "tags": ["Health Check interface"]
+ },
+ "parameters": []
+ },
+ "/api/vnfpkgm/v1/subscriptions": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_subscriptions_list",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PkgmSubscription"
+ }
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "post": {
+ "operationId": "api_vnfpkgm_v1_subscriptions_create",
+ "description": "",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/PkgmSubscriptionRequest"
+ }
+ }],
+ "responses": {
+ "201": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PkgmSubscription"
+ }
+ },
+ "400": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": []
+ },
+ "/api/vnfpkgm/v1/subscriptions/{subscriptionId}": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_subscriptions_read",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/PkgmSubscription"
+ }
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "delete": {
+ "operationId": "api_vnfpkgm_v1_subscriptions_delete",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": ""
+ },
+ "404": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ },
+ "500": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/SUBSCRIPTION_ProblemDetailsSerializer"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "subscriptionId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/vnfpkgm/v1/vnf_packages": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_list",
+ "description": "Query multiple VNF package resource",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/VnfPkgInfo"
+ }
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "post": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_create",
+ "description": "Create an individual VNF package resource",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/CreateVnfPkgInfoRequest"
+ }
+ }],
+ "responses": {
+ "201": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/VnfPkgInfo"
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": []
+ },
+ "/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_read",
+ "description": "Query an individual VNF package resource",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/VnfPkgInfo"
+ }
+ },
+ "404": {
+ "description": "VNF package does not exist",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "delete": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_delete",
+ "description": "Delete an individual VNF package resource",
+ "parameters": [],
+ "responses": {
+ "204": {
+ "description": "No content"
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "vnfPkgId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}/artifacts/{artifactPath}": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_artifacts_read",
+ "description": "",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "Return the artifact file",
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ },
+ "404": {
+ "description": "Artifact not found",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "produces": ["application/octet-stream", "application/json"],
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "artifactPath",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }, {
+ "name": "vnfPkgId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content": {
+ "get": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_package_content_list",
+ "description": "Fetch VNF package content",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "VNF package file",
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ },
+ "404": {
+ "description": "VNF package does not exist",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "produces": ["application/octet-stream", "application/json"],
+ "tags": ["VNF Package Management interface"]
+ },
+ "put": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_package_content_update",
+ "description": "Upload VNF package content",
+ "parameters": [],
+ "responses": {
+ "202": {
+ "description": "Successfully"
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "vnfPkgId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content/upload_from_uri": {
+ "post": {
+ "operationId": "api_vnfpkgm_v1_vnf_packages_package_content_upload_from_uri_create",
+ "description": "Upload VNF package content from uri",
+ "parameters": [{
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/UploadVnfPackageFromUriRequest"
+ }
+ }],
+ "responses": {
+ "202": {
+ "description": "Successfully"
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "vnfPkgId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}/vnfd": {
+ "get": {
+ "operationId": "VNFD of an on-boarded VNF package",
+ "description": "Read VNFD of an on-boarded VNF package",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "VNFD of an on-boarded VNF package",
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ },
+ "404": {
+ "description": "VNF package does not exist",
+ "schema": {
+ "type": "string"
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "produces": ["application/octet-stream", "application/json"],
+ "tags": ["VNF Package Management interface"]
+ },
+ "parameters": [{
+ "name": "vnfPkgId",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }]
+ },
+ "/samples/": {
+ "get": {
+ "operationId": "samples_list",
+ "description": "List all samples.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": ""
+ }
+ },
+ "tags": ["Sample interface"]
+ },
+ "parameters": []
+ }
+ },
+ "definitions": {
+ "JobResponseHistoryList": {
+ "description": "Response History List",
+ "type": "object",
+ "properties": {
+ "status": {
+ "title": "Status",
+ "description": "Status",
+ "type": "string",
+ "minLength": 1
+ },
+ "progress": {
+ "title": "Progress",
+ "description": "Job Progress",
+ "type": "string",
+ "minLength": 1
+ },
+ "statusDescription": {
+ "title": "Statusdescription",
+ "description": "Status Description",
+ "type": "string",
+ "minLength": 1
+ },
+ "errorCode": {
+ "title": "Errorcode",
+ "description": "Error Code",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "responseId": {
+ "title": "Responseid",
+ "description": "Response Id",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "JobResponseDescriptor": {
+ "title": "Responsedescriptor",
+ "description": "Job Response Descriptor",
+ "type": "object",
+ "properties": {
+ "status": {
+ "title": "Status",
+ "description": "Status",
+ "type": "string",
+ "minLength": 1
+ },
+ "progress": {
+ "title": "Progress",
+ "description": "Job Progress",
+ "type": "string",
+ "minLength": 1
+ },
+ "statusDescription": {
+ "title": "Statusdescription",
+ "description": "Status Description",
+ "type": "string",
+ "minLength": 1
+ },
+ "errorCode": {
+ "title": "Errorcode",
+ "description": "Error Code",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "responseId": {
+ "title": "Responseid",
+ "description": "Response Id",
+ "type": "string",
+ "minLength": 1
+ },
+ "responseHistoryList": {
+ "description": "Response History List",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/JobResponseHistoryList"
+ }
+ }
+ }
+ },
+ "GetJobResponse": {
+ "type": "object",
+ "properties": {
+ "jobId": {
+ "title": "Jobid",
+ "description": "Job Id",
+ "type": "string",
+ "minLength": 1
+ },
+ "responseDescriptor": {
+ "$ref": "#/definitions/JobResponseDescriptor"
+ }
+ }
+ },
+ "PostJobResponseResult": {
+ "required": ["result"],
+ "type": "object",
+ "properties": {
+ "result": {
+ "title": "Result",
+ "description": "Result",
+ "type": "string",
+ "minLength": 1
+ },
+ "msg": {
+ "title": "Msg",
+ "description": "Message",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "PostJobRequest": {
+ "type": "object",
+ "properties": {
+ "progress": {
+ "title": "Progress",
+ "description": "Job Progress",
+ "type": "string",
+ "minLength": 1
+ },
+ "desc": {
+ "title": "Desc",
+ "description": "Description",
+ "type": "string",
+ "minLength": 1
+ },
+ "errcode": {
+ "title": "Errcode",
+ "description": "Error Code",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NsPackageInfo": {
+ "title": "Packageinfo",
+ "description": "NS Package Info",
+ "type": "object",
+ "properties": {
+ "nsdId": {
+ "title": "Nsdid",
+ "description": "NSD ID",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "nsPackageId": {
+ "title": "Nspackageid",
+ "description": "NS Package ID",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdProvider": {
+ "title": "Nsdprovider",
+ "description": "NSD Provider",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdVersion": {
+ "title": "Nsdversion",
+ "description": "NSD Version",
+ "type": "string",
+ "x-nullable": true
+ },
+ "csarName": {
+ "title": "Csarname",
+ "description": "CSAR name",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdModel": {
+ "title": "Nsdmodel",
+ "description": "NSD Model",
+ "type": "string",
+ "x-nullable": true
+ },
+ "downloadUrl": {
+ "title": "Downloadurl",
+ "description": "URL to download NSD Model",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ }
+ },
+ "x-nullable": true
+ },
+ "NsPackage": {
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "CSAR ID",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "packageInfo": {
+ "$ref": "#/definitions/NsPackageInfo"
+ }
+ }
+ },
+ "InternalErrorRequest": {
+ "required": ["error"],
+ "type": "object",
+ "properties": {
+ "error": {
+ "title": "Error",
+ "description": "Error",
+ "type": "string",
+ "minLength": 1
+ },
+ "errorMessage": {
+ "title": "Errormessage",
+ "description": "Error Message",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NsPackageDistributeRequest": {
+ "required": ["csarId"],
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "csarId",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NsPackageDistributeResponse": {
+ "required": ["status", "statusDescription", "errorCode"],
+ "type": "object",
+ "properties": {
+ "status": {
+ "title": "Status",
+ "description": "status",
+ "type": "string",
+ "minLength": 1
+ },
+ "statusDescription": {
+ "title": "Statusdescription",
+ "description": "statusDescription",
+ "type": "string",
+ "minLength": 1
+ },
+ "errorCode": {
+ "title": "Errorcode",
+ "description": "errorCode",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "ServicePackageInfo": {
+ "title": "Packageinfo",
+ "description": "Service Package Info",
+ "type": "object",
+ "properties": {
+ "servicedId": {
+ "title": "Servicedid",
+ "description": "ServiceD ID",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "servicePackageId": {
+ "title": "Servicepackageid",
+ "description": "Service Package ID",
+ "type": "string",
+ "x-nullable": true
+ },
+ "servicedProvider": {
+ "title": "Servicedprovider",
+ "description": "ServiceD Provider",
+ "type": "string",
+ "x-nullable": true
+ },
+ "servicedVersion": {
+ "title": "Servicedversion",
+ "description": "ServiceD Version",
+ "type": "string",
+ "x-nullable": true
+ },
+ "csarName": {
+ "title": "Csarname",
+ "description": "CSAR name",
+ "type": "string",
+ "x-nullable": true
+ },
+ "servicedModel": {
+ "title": "Servicedmodel",
+ "description": "ServiceD Model",
+ "type": "string",
+ "x-nullable": true
+ },
+ "downloadUrl": {
+ "title": "Downloadurl",
+ "description": "URL to download ServiceD Model",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ }
+ },
+ "x-nullable": true
+ },
+ "ServicePackage": {
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "CSAR ID",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "packageInfo": {
+ "$ref": "#/definitions/ServicePackageInfo"
+ }
+ }
+ },
+ "ServicePackageDistributeRequest": {
+ "required": ["csarId"],
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "csarId",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NfPackageInfo": {
+ "title": "Packageinfo",
+ "description": "VNF Package Info",
+ "required": ["vnfPackageId"],
+ "type": "object",
+ "properties": {
+ "vnfdId": {
+ "title": "Vnfdid",
+ "description": "VNFD ID",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfPackageId": {
+ "title": "Vnfpackageid",
+ "description": "VNF Package ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "vnfdProvider": {
+ "title": "Vnfdprovider",
+ "description": "VNFD Provider",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfdVersion": {
+ "title": "Vnfdversion",
+ "description": "VNFD Version",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfVersion": {
+ "title": "Vnfversion",
+ "description": "VNF Version",
+ "type": "string",
+ "x-nullable": true
+ },
+ "csarName": {
+ "title": "Csarname",
+ "description": "CSAR Name",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfdModel": {
+ "title": "Vnfdmodel",
+ "description": "VNFD Model",
+ "type": "string",
+ "x-nullable": true
+ },
+ "downloadUrl": {
+ "title": "Downloadurl",
+ "description": "URL to download VNFD Model",
+ "type": "string",
+ "x-nullable": true
+ }
+ }
+ },
+ "NfImageInfo": {
+ "description": "Image Info",
+ "required": ["index", "fileName", "imageId", "vimId", "vimUser", "tenant", "status"],
+ "type": "object",
+ "properties": {
+ "index": {
+ "title": "Index",
+ "description": "Index of VNF Image",
+ "type": "string",
+ "minLength": 1
+ },
+ "fileName": {
+ "title": "Filename",
+ "description": "Image file name",
+ "type": "string",
+ "minLength": 1
+ },
+ "imageId": {
+ "title": "Imageid",
+ "description": "Image ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "vimId": {
+ "title": "Vimid",
+ "description": "VIM ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "vimUser": {
+ "title": "Vimuser",
+ "description": "User of VIM",
+ "type": "string",
+ "minLength": 1
+ },
+ "tenant": {
+ "title": "Tenant",
+ "description": "Tenant",
+ "type": "string",
+ "minLength": 1
+ },
+ "status": {
+ "title": "Status",
+ "description": "Status",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NfPackage": {
+ "required": ["csarId", "packageInfo"],
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "CSAR ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "packageInfo": {
+ "$ref": "#/definitions/NfPackageInfo"
+ },
+ "imageInfo": {
+ "description": "Image Info",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/NfImageInfo"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "NfPackageDistributeRequest": {
+ "required": ["csarId"],
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "CSAR ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "vimIds": {
+ "description": "A string for vimIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "labVimId": {
+ "title": "Labvimid",
+ "description": "A list of VIM IDs.",
+ "type": "string"
+ }
+ }
+ },
+ "PostJobResponse": {
+ "required": ["jobId"],
+ "type": "object",
+ "properties": {
+ "jobId": {
+ "title": "Jobid",
+ "description": "jobId",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "ProblemDetails": {
+ "title": "Onboardingfailuredetails",
+ "description": "Failure details of current onboarding procedure.It shall be present when the nsdOnboardingState attribute is CREATED and the uploading or processing fails in NFVO.",
+ "required": ["title", "detail"],
+ "type": "object",
+ "properties": {
+ "type": {
+ "title": "Type",
+ "description": "A URI reference according to IETF RFC 3986 [10] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".",
+ "type": "string",
+ "x-nullable": true
+ },
+ "title": {
+ "title": "Title",
+ "description": "The HTTP status code for this occurrence of the problem.",
+ "type": "integer"
+ },
+ "detail": {
+ "title": "Detail",
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
+ "type": "string",
+ "minLength": 1
+ },
+ "instance": {
+ "title": "Instance",
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "additional_attributes": {
+ "title": "Additional attributes",
+ "description": "Any number of additional attributes, as defined in a specification or by an implementation.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "Additional attribute",
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "UriLink": {
+ "title": "Self",
+ "description": "URI of this resource.",
+ "required": ["href"],
+ "type": "object",
+ "properties": {
+ "href": {
+ "title": "Href",
+ "description": "URI of the referenced resource",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "NSD_LinkSerializer": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "required": ["self", "nsd_content"],
+ "type": "object",
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/UriLink"
+ },
+ "nsd_content": {
+ "$ref": "#/definitions/UriLink"
+ }
+ }
+ },
+ "NsdInfo": {
+ "required": ["id", "nsdOnboardingState", "nsdOperationalState", "nsdUsageState", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of the onboarded individual NS descriptor resource.This identifier is allocated by the NFVO.",
+ "type": "string",
+ "minLength": 1
+ },
+ "nsdId": {
+ "title": "Nsdid",
+ "description": "This identifier, which is allocated by the NSD designer,identifies the NSD in a globally unique way.It is copied from the NSD content and shall be present after the NSD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdName": {
+ "title": "Nsdname",
+ "description": "Name of the onboarded NSD.This information is copied from the NSD content and shall be present after the NSD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdVersion": {
+ "title": "Nsdversion",
+ "description": "Version of the on-boarded NSD.This information is copied from the NSD content and shall be present after the NSD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdDesigner": {
+ "title": "Nsddesigner",
+ "description": "Designer of the on-boarded NSD.This information is copied from the NSD content and shall be present after the NSD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "nsdInvariantId": {
+ "title": "Nsdinvariantid",
+ "description": "This identifier, which is allocated by the NSD designer,identifies an NSD in a version independent manner.This information is copied from the NSD content and shall be present after the NSD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfPkgIds": {
+ "description": "Identifies the VNF package for the VNFD referenced by the on-boarded NS descriptor resource.",
+ "type": "array",
+ "items": {
+ "description": "Identifier of the VNF package",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "pnfdInfoIds": {
+ "description": "Identifies the PnfdInfo element for the PNFD referenced by the on-boarded NS descriptor resource.",
+ "type": "array",
+ "items": {
+ "description": "Identifier of the PnfdInfo element",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "nestedNsdInfoIds": {
+ "description": "Identifies the NsdInfo element for the nested NSD referenced by the on-boarded NS descriptor resource.",
+ "type": "array",
+ "items": {
+ "description": "Identifier of the NsdInfo element",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "nsdOnboardingState": {
+ "title": "Nsdonboardingstate",
+ "description": "Onboarding state of the individual NS descriptor resource.",
+ "type": "string",
+ "enum": ["CREATED", "UPLOADING", "PROCESSING", "ONBOARDED"]
+ },
+ "onboardingFailureDetails": {
+ "$ref": "#/definitions/ProblemDetails"
+ },
+ "nsdOperationalState": {
+ "title": "Nsdoperationalstate",
+ "description": "Operational state of the individual NS descriptor resource.This attribute can be modified with the PATCH method.",
+ "type": "string",
+ "enum": ["ENABLED", "DISABLED"]
+ },
+ "nsdUsageState": {
+ "title": "Nsdusagestate",
+ "description": "Usage state of the individual NS descriptor resource.",
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ },
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User defined data for the individual NS descriptor resource.This attribute can be modified with the PATCH method.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "Key Value Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "_links": {
+ "$ref": "#/definitions/NSD_LinkSerializer"
+ }
+ }
+ },
+ "CreateNsdInfoRequest": {
+ "type": "object",
+ "properties": {
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User-defined data for the NS descriptor resource to be created.It shall be present when the user defined data is set for the individual NS descriptor resource to be created.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "Key Value Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "PNFD_LinkSerializer": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "required": ["self", "pnfd_content"],
+ "type": "object",
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/UriLink"
+ },
+ "pnfd_content": {
+ "$ref": "#/definitions/UriLink"
+ }
+ }
+ },
+ "PnfdInfo": {
+ "required": ["id", "pnfdOnboardingState", "pnfdUsageState", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of the onboarded individual PNF descriptor resource. This identifier is allocated by the NFVO.",
+ "type": "string",
+ "minLength": 1
+ },
+ "pnfdId": {
+ "title": "Pnfdid",
+ "description": "This identifier, which is allocated by the PNFD designer, identifies the PNFD in a globally unique way. It is copied from the PNFD content and shall be present after the PNFD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "pnfdName": {
+ "title": "Pnfdname",
+ "description": "Name of the onboarded PNFD. This information is copied from the PNFD content and shall be present after the PNFD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "pnfdVersion": {
+ "title": "Pnfdversion",
+ "description": "Version of the on-boarded PNFD. This information is copied from the PNFD content and shall be present after the PNFD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "pnfdProvider": {
+ "title": "Pnfdprovider",
+ "description": "Provider of the on-boarded PNFD. This information is copied from the PNFD content and shall be present after the PNFD content is on-boarded.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "pnfdInvariantId": {
+ "title": "Pnfdinvariantid",
+ "description": "Identifies a PNFD in a version independent manner. This attribute is invariant across versions of PNFD.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "pnfdOnboardingState": {
+ "title": "Pnfdonboardingstate",
+ "description": "Onboarding state of the individual PNF descriptor resource.",
+ "type": "string",
+ "enum": ["CREATED", "UPLOADING", "PROCESSING", "ONBOARDED"]
+ },
+ "onboardingFailureDetails": {
+ "$ref": "#/definitions/ProblemDetails"
+ },
+ "pnfdUsageState": {
+ "title": "Pnfdusagestate",
+ "description": "Usage state of the individual PNF descriptor resource.",
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ },
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User defined data for the individual PNF descriptor resource. This attribute can be modified with the PATCH method.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "Key Value Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "_links": {
+ "$ref": "#/definitions/PNFD_LinkSerializer"
+ }
+ }
+ },
+ "SUBSCRIPTION_ProblemDetailsSerializer": {
+ "required": ["status", "detail"],
+ "type": "object",
+ "properties": {
+ "type": {
+ "title": "Type",
+ "description": "Type",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "title": {
+ "title": "Title",
+ "description": "Title",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "status": {
+ "title": "Status",
+ "description": "Status",
+ "type": "integer"
+ },
+ "detail": {
+ "title": "Detail",
+ "description": "Detail",
+ "type": "string",
+ "minLength": 1
+ },
+ "instance": {
+ "title": "Instance",
+ "description": "Instance",
+ "type": "string",
+ "minLength": 1,
+ "x-nullable": true
+ },
+ "additional_details": {
+ "description": "Any number of additional attributes, as defined in a specification or by an implementation.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "CreatePnfdInfoRequest": {
+ "type": "object",
+ "properties": {
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User-defined data for the PNF descriptor resource to be created.It shall be present when the user defined data is set for the individual PNF descriptor resource to be created.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "Key Value Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "NsdmNotificationsFilter": {
+ "title": "Filter",
+ "description": "Filter settings for this subscription, to define the of all notifications this subscription relates to.",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["NsdOnBoardingNotification", "NsdOnboardingFailureNotification", "NsdChangeNotification", "NsdDeletionNotification", "PnfdOnBoardingNotification", "PnfdOnBoardingFailureNotification", "PnfdDeletionNotification"]
+ }
+ },
+ "nsdInfoId": {
+ "description": "Match NS packages with particular nsdInfoIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "nsdId": {
+ "description": "Match NS Packages with particular nsdIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "nsdName": {
+ "description": "Match NS Packages with particular nsdNames",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ },
+ "nsdVersion": {
+ "description": "match NS packages that belong to certain nsdversion",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ },
+ "nsdInvariantId": {
+ "description": "Match NS Packages with particular nsdInvariantIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "vnfPkgIds": {
+ "description": "Match NS Packages that has VNF PackageIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "nestedNsdInfoIds": {
+ "description": "Match NS Packages with particular nsdInvariantIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "nsdOnboardingState": {
+ "description": "Match NS Packages with particular NS Onboarding State",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["CREATED", "UPLOADING", "PROCESSING", "ONBOARDED"]
+ }
+ },
+ "nsdOperationalState": {
+ "description": "Match NS Packages with particular NS Operational State",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["ENABLED", "DISABLED"]
+ }
+ },
+ "nsdUsageState": {
+ "description": "Match NS Packages with particular NS Usage State",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ }
+ },
+ "pnfdInfoIds": {
+ "description": "Match PF packages with particular pnfdInfoIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "pnfdId": {
+ "description": "Match PF packages with particular pnfdInfoIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "pnfdName": {
+ "description": "Match PF Packages with particular pnfdNames",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ },
+ "pnfdVersion": {
+ "description": "match PF packages that belong to certain pnfd version",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ },
+ "pnfdProvider": {
+ "description": "Match PF Packages with particular pnfdProvider",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ },
+ "pnfdInvariantId": {
+ "description": "Match PF Packages with particular pnfdInvariantIds",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "pnfdOnboardingState": {
+ "description": "Match PF Packages with particular PNF Onboarding State ",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["CREATED", "UPLOADING", "PROCESSING", "ONBOARDED"]
+ }
+ },
+ "pnfdUsageState": {
+ "description": "Match PF Packages with particular PNF usage State",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ }
+ }
+ }
+ },
+ "NSDM_SUB_LinkSerializer": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "required": ["self"],
+ "type": "object",
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/UriLink"
+ }
+ }
+ },
+ "NsdmSubscription": {
+ "required": ["id", "callbackUri", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of this subscription resource.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "callbackUri": {
+ "title": "Callbackuri",
+ "description": "The URI of the endpoint to send the notification to.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "filter": {
+ "$ref": "#/definitions/NsdmNotificationsFilter"
+ },
+ "_links": {
+ "$ref": "#/definitions/NSDM_SUB_LinkSerializer"
+ }
+ }
+ },
+ "BasicAuth": {
+ "title": "Paramsbasic",
+ "description": "Parameters for authentication/authorization using BASIC.",
+ "type": "object",
+ "properties": {
+ "userName": {
+ "title": "Username",
+ "description": "Username to be used in HTTP Basic authentication.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "password": {
+ "title": "Password",
+ "description": "Password to be used in HTTP Basic authentication.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ }
+ },
+ "OAuthCredentials": {
+ "title": "Paramsoauth2clientcredentials",
+ "description": "Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS.",
+ "type": "object",
+ "properties": {
+ "clientId": {
+ "title": "Clientid",
+ "description": "Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "clientPassword": {
+ "title": "Clientpassword",
+ "description": "Client password to be used in the access token request of the OAuth 2.0 client credentials grant type.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "tokenEndpoint": {
+ "title": "Tokenendpoint",
+ "description": "The token endpoint from which the access token can be obtained.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ }
+ }
+ },
+ "SubscriptionAuthentication": {
+ "title": "Authentication",
+ "description": "Authentication parameters to configure the use of Authorization when sending notifications corresponding to this subscription.",
+ "required": ["authType"],
+ "type": "object",
+ "properties": {
+ "authType": {
+ "description": "Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification.",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["BASIC", "OAUTH2_CLIENT_CREDENTIALS", "TLS_CERT"]
+ }
+ },
+ "paramsBasic": {
+ "$ref": "#/definitions/BasicAuth"
+ },
+ "paramsOauth2ClientCredentials": {
+ "$ref": "#/definitions/OAuthCredentials"
+ }
+ }
+ },
+ "NsdmSubscriptionRequest": {
+ "required": ["callbackUri"],
+ "type": "object",
+ "properties": {
+ "callbackUri": {
+ "title": "Callbackuri",
+ "description": "The URI of the endpoint to send the notification to.",
+ "type": "string",
+ "minLength": 1
+ },
+ "filter": {
+ "$ref": "#/definitions/NsdmNotificationsFilter"
+ },
+ "authentication": {
+ "$ref": "#/definitions/SubscriptionAuthentication"
+ }
+ }
+ },
+ "ParseModelRequest": {
+ "required": ["csarId"],
+ "type": "object",
+ "properties": {
+ "csarId": {
+ "title": "Csarid",
+ "description": "CSAR ID",
+ "type": "string",
+ "minLength": 1
+ },
+ "packageType": {
+ "title": "Packagetype",
+ "description": "Package type: VNF, PNF, NS, Service",
+ "type": "string",
+ "minLength": 1
+ },
+ "inputs": {
+ "title": "Inputs",
+ "description": "Inputs",
+ "type": "string"
+ }
+ }
+ },
+ "ParseModelResponse": {
+ "required": ["model"],
+ "type": "object",
+ "properties": {
+ "model": {
+ "title": "Model",
+ "description": "Model",
+ "type": "string"
+ }
+ }
+ },
+ "VNF_SUBSCRIPTION_LINKSERIALIZER": {
+ "title": "Self",
+ "description": "URI of this resource.",
+ "required": ["href"],
+ "type": "object",
+ "properties": {
+ "href": {
+ "title": "Href",
+ "description": "URI of the referenced resource.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "LinkSelf": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "required": ["self"],
+ "type": "object",
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/VNF_SUBSCRIPTION_LINKSERIALIZER"
+ }
+ }
+ },
+ "Version": {
+ "title": "Versions",
+ "description": "match VNF packages that contain VNF products with certain versions",
+ "required": ["vnfSoftwareVersion"],
+ "type": "object",
+ "properties": {
+ "vnfSoftwareVersion": {
+ "title": "Vnfsoftwareversion",
+ "description": "VNF software version to match.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "vnfdVersions": {
+ "description": "Match VNF packages that contain VNF products with certain VNFD versions",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ }
+ },
+ "vnfProducts": {
+ "title": "Vnfproducts",
+ "description": "match VNF packages that contain VNF products with certain product names, from one particular provider",
+ "required": ["vnfProductName"],
+ "type": "object",
+ "properties": {
+ "vnfProductName": {
+ "title": "Vnfproductname",
+ "description": "Name of the VNF product to match.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "versions": {
+ "$ref": "#/definitions/Version"
+ }
+ }
+ },
+ "vnfProductsProviders": {
+ "required": ["vnfProvider"],
+ "type": "object",
+ "properties": {
+ "vnfProvider": {
+ "title": "Vnfprovider",
+ "description": "Name of the VNFprovider to match.",
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
+ },
+ "vnfProducts": {
+ "$ref": "#/definitions/vnfProducts"
+ }
+ }
+ },
+ "PkgmNotificationsFilter": {
+ "title": "Filter",
+ "description": "Filter settings for this subscription, to define the subset of all notifications this subscription relates to",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["VnfPackageOnboardingNotification", "VnfPackageChangeNotification"]
+ }
+ },
+ "vnfProductsFromProviders": {
+ "description": "Match VNF packages that contain VNF products from certain providers.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/vnfProductsProviders"
+ }
+ },
+ "vnfdId": {
+ "description": "Match VNF packages with a VNFD identifierlisted in the attribute",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "vnfPkgId": {
+ "description": "Match VNF packages with a VNFD identifierlisted in the attribute",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "uuid"
+ }
+ },
+ "operationalState": {
+ "description": "Operational state of the VNF package.",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["ENABLED", "DISABLED"]
+ }
+ },
+ "usageState": {
+ "description": "Operational state of the VNF package.",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ }
+ }
+ }
+ },
+ "PkgmSubscription": {
+ "required": ["id", "callbackUri", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of this subscription resource.",
+ "type": "string",
+ "format": "uuid"
+ },
+ "callbackUri": {
+ "title": "Callbackuri",
+ "description": "The URI of the endpoint to send the notification to.",
+ "type": "string",
+ "format": "uri",
+ "minLength": 1
+ },
+ "_links": {
+ "$ref": "#/definitions/LinkSelf"
+ },
+ "filter": {
+ "$ref": "#/definitions/PkgmNotificationsFilter"
+ }
+ }
+ },
+ "PkgmSubscriptionRequest": {
+ "required": ["callbackUri"],
+ "type": "object",
+ "properties": {
+ "filters": {
+ "$ref": "#/definitions/PkgmNotificationsFilter"
+ },
+ "callbackUri": {
+ "title": "Callbackuri",
+ "description": "Callback URI to sendthe notification",
+ "type": "string",
+ "format": "uri",
+ "minLength": 1
+ },
+ "authentication": {
+ "$ref": "#/definitions/SubscriptionAuthentication"
+ }
+ }
+ },
+ "Checksum": {
+ "title": "Checksum",
+ "description": "Checksum of the on-boarded VNF package.",
+ "required": ["algorithm", "hash"],
+ "type": "object",
+ "properties": {
+ "algorithm": {
+ "title": "Algorithm",
+ "description": "Name of the algorithm used to generate the checksum.",
+ "type": "string",
+ "minLength": 1
+ },
+ "hash": {
+ "title": "Hash",
+ "description": "The hexadecimal value of the checksum.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "VnfPackageSoftwareImageInfo": {
+ "description": "Information about VNF package artifacts that are software images.",
+ "required": ["id", "name", "provider", "version", "checksum", "containerFormat", "diskFormat", "createdAt", "minDisk", "minRam", "size", "imagePath"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of the software image.",
+ "type": "string",
+ "minLength": 1
+ },
+ "name": {
+ "title": "Name",
+ "description": "Name of the software image.",
+ "type": "string",
+ "minLength": 1
+ },
+ "provider": {
+ "title": "Provider",
+ "description": "Provider of the software image.",
+ "type": "string",
+ "minLength": 1
+ },
+ "version": {
+ "title": "Version",
+ "description": "Version of the software image.",
+ "type": "string",
+ "minLength": 1
+ },
+ "checksum": {
+ "$ref": "#/definitions/Checksum"
+ },
+ "containerFormat": {
+ "title": "Containerformat",
+ "description": "terminationType: Indicates whether forceful or graceful termination is requested.",
+ "type": "string",
+ "enum": ["AKI", "AMI", "ARI", "BARE", "DOCKER", "OVA", "OVF"]
+ },
+ "diskFormat": {
+ "title": "Diskformat",
+ "description": "Disk format of a software image is the format of the underlying disk image.",
+ "type": "string",
+ "enum": ["AKI", "AMI", "ARI", "ISO", "QCOW2", "RAW", "VDI", "VHD", "VHDX", "VMDK"]
+ },
+ "createdAt": {
+ "title": "Createdat",
+ "description": "Time when this software image was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "minDisk": {
+ "title": "Mindisk",
+ "description": "The minimal disk for this software image in bytes.",
+ "type": "integer"
+ },
+ "minRam": {
+ "title": "Minram",
+ "description": "The minimal RAM for this software image in bytes.",
+ "type": "integer"
+ },
+ "size": {
+ "title": "Size",
+ "description": "Size of this software image in bytes.",
+ "type": "integer"
+ },
+ "userMetadata": {
+ "title": "Usermetadata",
+ "description": "User-defined data.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "KeyValue Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "imagePath": {
+ "title": "Imagepath",
+ "description": "Path in the VNF package.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ },
+ "VnfPackageArtifactInfo": {
+ "description": "Information about VNF package artifacts contained in the VNF package that are not software images.",
+ "required": ["artifactPath", "checksum"],
+ "type": "object",
+ "properties": {
+ "artifactPath": {
+ "title": "Artifactpath",
+ "description": "Path in the VNF package.",
+ "type": "string",
+ "minLength": 1
+ },
+ "checksum": {
+ "$ref": "#/definitions/Checksum"
+ },
+ "metadata": {
+ "title": "Metadata",
+ "description": "The metadata of the artifact that are available in the VNF package",
+ "type": "object",
+ "additionalProperties": {
+ "description": "KeyValue Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "VNF_PKGM_Link_Serializer": {
+ "title": " links",
+ "description": "Links to resources related to this resource.",
+ "required": ["self", "packageContent"],
+ "type": "object",
+ "properties": {
+ "self": {
+ "$ref": "#/definitions/UriLink"
+ },
+ "vnfd": {
+ "$ref": "#/definitions/UriLink"
+ },
+ "packageContent": {
+ "$ref": "#/definitions/UriLink"
+ }
+ }
+ },
+ "VnfPkgInfo": {
+ "required": ["id", "onboardingState", "operationalState", "usageState", "_links"],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "description": "Identifier of the on-boarded VNF package.",
+ "type": "string",
+ "minLength": 1
+ },
+ "vnfdId": {
+ "title": "Vnfdid",
+ "description": "This identifier, which is managed by the VNF provider, identifies the VNF package and the VNFD in a globally unique way.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfProvider": {
+ "title": "Vnfprovider",
+ "description": "Provider of the VNF package and the VNFD.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfProductName": {
+ "title": "Vnfproductname",
+ "description": "Name to identify the VNF product.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfSoftwareVersion": {
+ "title": "Vnfsoftwareversion",
+ "description": "Software version of the VNF.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "vnfdVersion": {
+ "title": "Vnfdversion",
+ "description": "The version of the VNvFD.",
+ "type": "string",
+ "x-nullable": true
+ },
+ "checksum": {
+ "$ref": "#/definitions/Checksum"
+ },
+ "softwareImages": {
+ "description": "Information about VNF package artifacts that are software images.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/VnfPackageSoftwareImageInfo"
+ },
+ "x-nullable": true
+ },
+ "additionalArtifacts": {
+ "description": "Information about VNF package artifacts contained in the VNF package that are not software images.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/VnfPackageArtifactInfo"
+ },
+ "x-nullable": true
+ },
+ "onboardingState": {
+ "title": "Onboardingstate",
+ "description": "On-boarding state of the VNF package.",
+ "type": "string",
+ "enum": ["CREATED", "UPLOADING", "PROCESSING", "ONBOARDED"]
+ },
+ "operationalState": {
+ "title": "Operationalstate",
+ "description": "Operational state of the VNF package.",
+ "type": "string",
+ "enum": ["ENABLED", "DISABLED"]
+ },
+ "usageState": {
+ "title": "Usagestate",
+ "description": "Usage state of the VNF package.",
+ "type": "string",
+ "enum": ["IN_USE", "NOT_IN_USE"]
+ },
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User defined data for the VNF package.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "KeyValue Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ },
+ "_links": {
+ "$ref": "#/definitions/VNF_PKGM_Link_Serializer"
+ }
+ }
+ },
+ "CreateVnfPkgInfoRequest": {
+ "type": "object",
+ "properties": {
+ "userDefinedData": {
+ "title": "Userdefineddata",
+ "description": "User defined data for the VNF package.",
+ "type": "object",
+ "additionalProperties": {
+ "description": "KeyValue Pairs",
+ "type": "string"
+ },
+ "x-nullable": true
+ }
+ }
+ },
+ "UploadVnfPackageFromUriRequest": {
+ "required": ["addressInformation"],
+ "type": "object",
+ "properties": {
+ "addressInformation": {
+ "title": "Addressinformation",
+ "description": "Address information of the VNF package content.",
+ "type": "string",
+ "minLength": 1
+ },
+ "userName": {
+ "title": "Username",
+ "description": "User name to be used for authentication.",
+ "type": "string",
+ "minLength": 1
+ },
+ "password": {
+ "title": "Password",
+ "description": "Password to be used for authentication.",
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json
new file mode 100644
index 0000000000..1f4a8ac306
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json
@@ -0,0 +1,7311 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "version": "1.2.0-impl:etsi.org:ETSI_NFV_OpenAPI:1",
+ "title": "SOL003 - VNF Package Management interface",
+ "description": "SOL003 - VNF Package Management interface\n\nIMPORTANT: Please note that this file might be not aligned to the current version of the ETSI Group Specification it refers to. In case of discrepancies the published ETSI Group Specification takes precedence.\n\nIn clause 4.3.2 of ETSI GS NFV-SOL 003 v2.4.1, an attribute-based filtering mechanism is defined. This mechanism is currently not included in the corresponding OpenAPI design for this GS version. Changes to the attribute-based filtering mechanism are being considered in v2.5.1 of this GS for inclusion in the corresponding future ETSI NFV OpenAPI design.\nPlease report bugs to https://forge.etsi.org/bugzilla/buglist.cgi?component=Nfv-Openapis&list_id=61&product=NFV&resolution=\n",
+ "license": {
+ "name": "ETSI Forge copyright notice",
+ "url": "https://forge.etsi.org/etsi-forge-copyright-notice.txt"
+ }
+ },
+ "externalDocs": {
+ "description": "ETSI GS NFV-SOL 003 V2.5.1",
+ "url": "https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_nfv-sol003v020501p.pdf"
+ },
+ "basePath": "/vnfpkgm/v1",
+ "schemes": [
+ "https"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "paths": {
+ "/api-versions": {
+ "parameters": [
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ }
+ ],
+ "get": {
+ "summary": "Retrieve API version information",
+ "description": "The GET method reads API version information. This method shall follow the provisions specified in table 4.6.3.3.3.2-1 for request and response data structures, and response codes. URI query parameters are not supported.\n",
+ "responses": {
+ "200": {
+ "description": "200 OK\nAPI version information was read successfully. The response body shall contain 4.4 API version information, as defined in clause 4.4.1.13.\n",
+ "schema": {
+ "description": "This type represents API version information. It shall comply with the provisions defined in table 4.4.1.13-1 (SOL003).\n",
+ "type": "object",
+ "required": [
+ "uriPrefix",
+ "apiVersions"
+ ],
+ "properties": {
+ "uriPrefix": {
+ "description": "Specifies the URI prefix for the API, in the following form {apiRoot}/{apiName}/{apiMajorVersion}/\n",
+ "type": "string"
+ },
+ "apiVersions": {
+ "description": "Version(s) supported for the API signaled by the uriPrefix attribute.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "version"
+ ],
+ "properties": {
+ "version": {
+ "description": "Identifies a supported version. The value of the version attribute shall be a version identifier as specified in clause 4.6.1.\n",
+ "type": "string"
+ },
+ "isDeprecated": {
+ "description": "If such information is available, this attribute indicates whether use of the version signaled by the version attribute is deprecated (true) or not (false). A deprecated version is still supported by the API producer but is recommended not to be used any longer. When a version is no longer supported, it does not appear in the response body.\n",
+ "type": "boolean"
+ },
+ "retirementDate": {
+ "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ }
+ }
+ }
+ },
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Version": {
+ "description": "The used API version.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "405 METHOD NOT ALLOWED\nIf a particular HTTP method is not supported for a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "413": {
+ "description": "413 PAYLOAD TOO LARGE\nIf the payload body of a request is larger than the amount of data the API producer is willing or able to process, it shall respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for closing the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "414": {
+ "description": "414 URI TOO LONG\nIf the request URI of a request is longer than the API producer is willing or able to process, it shall respond with this response code. This condition can e.g. be caused by passing long queries in the request URI of a GET request. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "422 UNPROCESSABLE ENTITY\nIf the payload body of a request contains syntactically correct data (e.g. well-formed JSON) but the data cannot be processed (e.g. because it fails validation against a schema), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nThis error response code is only applicable for methods that have a request body.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "429 TOO MANY REQUESTS\nIf the API consumer has sent too many requests in a defined period of time and the API producer is able to detect that condition (\"rate limiting\"), the API producer shall respond with this response code, following the provisions in IETF RFC 6585 [17] for the use of the \"Retry-After\" HTTP header. The \"ProblemDetails\" structure shall be provided and shall include in the \"detail\" attribute more information about the source of the problem.\nThe period of time and allowed number of requests are configured within the API producer by means outside the scope of the present document.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "504": {
+ "description": "504 GATEWAY TIMEOUT\nIf the API producer encounters a timeout while waiting for a response from an upstream server (i.e. a server that the API producer communicates with when fulfilling a request), it should respond with this response code.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/vnf_packages": {
+ "get": {
+ "description": "Query VNF Package Info\n\nThe GET method queries the information of the VNF packages matching the filter.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "filter",
+ "description": "Attribute-based filtering expression according to clause 4.3.2. The VNFM shall support receiving this parameter as part of the URI query string. The NFVO may supply this parameter. All attribute names that appear in the VnfPkgInfo and in data types referenced from it shall be supported by the VNFM in the filter expression.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "all_fields",
+ "description": "Include all complex attributes in the response. See clause 4.3.3 for details. The VNFM shall support this parameter.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "fields",
+ "description": "Complex attributes to be included into the response. See clause 4.3.3 for details. The VNFM should support this parameter.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "exclude_fields",
+ "description": "Complex attributes to be excluded from the response. See clause 4.3.3 for details. The VNFM should support this parameter.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "exclude_default",
+ "description": "Indicates to exclude the following complex attributes from the response. See clause 4.3.3 for details. The VNFM shall support this parameter. The following attributes shall be excluded from the VnfPkgInfo structure in the response body if this parameter is provided, or none of the parameters \"all_fields,\" \"fields\", \"exclude_fields\", \"exclude_default\" are provided: -\tsoftwareImages -\tadditionalArtifacts -\tuserDefinedData.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "nextpage_opaque_marker",
+ "description": "Marker to obtain the next page of a paged response. Shall be supported by the VNFM if the VNFM supports alternative 2 (paging) according to clause 4.7.2.1 for this resource.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nInformation about zero or more VNF packages was queried successfully. The response body shall contain in an array the VNF package info representations that match the attribute filter, i.e. zero or more VNF package representations as defined in clause 10.5.2.2. If the VNFM supports alternative 2 (paging) according to clause 4.7.2.1 for this resource, inclusion of the Link HTTP header in this response shall follow the provisions in clause 4.7.2.3.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Link": {
+ "description": "Reference to other resources. Used for paging in the present document, see clause 4.7.2.1.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "description": "This type represents the information of an VNF package.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "operationalState",
+ "usageState",
+ "_links"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "vnfdId": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "vnfProvider": {
+ "description": "Provider of the VNF package and the VNFD. This information is copied from the VNFD.\n",
+ "type": "string"
+ },
+ "vnfProductName": {
+ "description": "Name to identify the VNF product. Invariant for the VNF product lifetime. This information is copied from the VNFD. It shall be present after the VNF package content has been on-boarded and absent otherwise.\n",
+ "type": "string"
+ },
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "softwareImages": {
+ "description": "Information about VNF package artifacts that are software images. This attribute shall not be present before the VNF package content is on-boarded. Otherwise, this attribute shall be present unless it has been requested to be excluded per attribute selector.\n",
+ "type": "array",
+ "items": {
+ "description": "This type represents an artifact contained in a VNF package which represents a software image.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "provider",
+ "version",
+ "checksum",
+ "containerFormat",
+ "diskFormat",
+ "createdAt",
+ "minDisk",
+ "minRam",
+ "size",
+ "imagePath"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier that is unique within a VNF descriptor.\n",
+ "type": "string"
+ },
+ "name": {
+ "description": "Name of the software image.\n",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider of the software image.\n",
+ "type": "string"
+ },
+ "version": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "containerFormat": {
+ "description": "Container format indicates whether the software image is in a file format that also contains metadata about the actual software. Permitted values: - AKI: a kernel image format - AMI: a machine image format - ARI: a ramdisk image format - BARE: the image does not have a container or metadata envelope - DOCKER: docker container format - OVA: OVF package in a tarfile - OVF: OVF container format The list of permitted values was taken from \"Container formats\" in http://docs.openstack.org/image-guide/image-formats.html\n",
+ "type": "string",
+ "enum": [
+ "AKI",
+ "AMI",
+ "ARI",
+ "BARE",
+ "DOCKER",
+ "OVA",
+ "OVF"
+ ]
+ },
+ "diskFormat": {
+ "description": "Disk format of a software image is the format of the underlying disk image. Permitted values: - AKI: a kernel image format - AMI: a machine image format - ARI: a ramdisk image format - ISO: an archive format for the data contents of an optical disc, such as CD-ROM\n- QCOW2: a common disk image format, which can expand dynamically and supports copy on write\n- RAW: an unstructured disk image format - VDI: a common disk image format - VHD: a common disk image format - VHDX: enhanced version of VHD format - VMDK: a common disk image format The list of permitted values was adapted from \"Disk formats\" in http://docs.openstack.org/image-guide/image-formats.html\n",
+ "type": "string",
+ "enum": [
+ "AKI",
+ "AMI",
+ "ISO",
+ "QCOW2",
+ "RAW",
+ "VDI",
+ "VHD",
+ "VHDX",
+ "VMDK"
+ ]
+ },
+ "createdAt": {
+ "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
+ "type": "string",
+ "format": "date-time"
+ },
+ "minDisk": {
+ "description": "The minimal disk for this software image in bytes.\n",
+ "type": "integer"
+ },
+ "minRam": {
+ "description": "The minimal RAM for this software image in bytes.\n",
+ "type": "integer"
+ },
+ "size": {
+ "description": "Size of this software image in bytes.\n",
+ "type": "integer"
+ },
+ "userMetadata": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ },
+ "imagePath": {
+ "description": "Path in the VNF package, which identifies the image artifact and also allows to access a copy of the image artifact.\n",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "additionalArtifacts": {
+ "description": "Information about VNF package artifacts contained in the VNF package that are not software images. This attribute shall not be present before the VNF package content is on-boarded. Otherwise, this attribute shall be present if the VNF package contains additional artifacts.\n",
+ "type": "array",
+ "items": {
+ "description": "This type represents an artifact other than a software image which is contained in a VNF package.\n",
+ "type": "object",
+ "required": [
+ "artifactPath",
+ "checksum"
+ ],
+ "properties": {
+ "artifactPath": {
+ "description": "Path in the VNF package, which identifies the artifact and also allows to access a copy of the artifact.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "metadata": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ }
+ }
+ }
+ },
+ "onboardingState": {
+ "description": "CREATED: The VNF package resource has been created. UPLOADING: The associated VNF package content is being uploaded. PROCESSING: The associated VNF package content is being processed, e.g., validation.\nONBOARDED: The associated VNF package content has been successfully on-boarded.\n",
+ "type": "string",
+ "enum": [
+ "CREATED",
+ "UPLOADING",
+ "PROCESSING",
+ "ONBOARDED"
+ ]
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ },
+ "userDefinedData": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ },
+ "_links": {
+ "description": "Links to resources related to this resource.\n",
+ "type": "object",
+ "required": [
+ "self",
+ "packageContent"
+ ],
+ "properties": {
+ "self": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ },
+ "vnfd": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ },
+ "packageContent": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/vnf_packages/{vnfPkgId}": {
+ "parameters": [
+ {
+ "name": "vnfPkgId",
+ "description": "Identifier of the VNF package. The identifier is allocated by the NFVO. This identifier can be retrieved from the \"vnfPkgId\" attribute in the VnfPackageOnboardingNotification or VnfPackageChangeNotification.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "get": {
+ "description": "Query VNF Package Info\n\nThe GET method reads the information of an individual VNF package.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nInformation of the selected VNF packages.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "This type represents the information of an VNF package.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "operationalState",
+ "usageState",
+ "_links"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "vnfdId": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "vnfProvider": {
+ "description": "Provider of the VNF package and the VNFD. This information is copied from the VNFD.\n",
+ "type": "string"
+ },
+ "vnfProductName": {
+ "description": "Name to identify the VNF product. Invariant for the VNF product lifetime. This information is copied from the VNFD. It shall be present after the VNF package content has been on-boarded and absent otherwise.\n",
+ "type": "string"
+ },
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "softwareImages": {
+ "description": "Information about VNF package artifacts that are software images. This attribute shall not be present before the VNF package content is on-boarded. Otherwise, this attribute shall be present unless it has been requested to be excluded per attribute selector.\n",
+ "type": "array",
+ "items": {
+ "description": "This type represents an artifact contained in a VNF package which represents a software image.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "provider",
+ "version",
+ "checksum",
+ "containerFormat",
+ "diskFormat",
+ "createdAt",
+ "minDisk",
+ "minRam",
+ "size",
+ "imagePath"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier that is unique within a VNF descriptor.\n",
+ "type": "string"
+ },
+ "name": {
+ "description": "Name of the software image.\n",
+ "type": "string"
+ },
+ "provider": {
+ "description": "Provider of the software image.\n",
+ "type": "string"
+ },
+ "version": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "containerFormat": {
+ "description": "Container format indicates whether the software image is in a file format that also contains metadata about the actual software. Permitted values: - AKI: a kernel image format - AMI: a machine image format - ARI: a ramdisk image format - BARE: the image does not have a container or metadata envelope - DOCKER: docker container format - OVA: OVF package in a tarfile - OVF: OVF container format The list of permitted values was taken from \"Container formats\" in http://docs.openstack.org/image-guide/image-formats.html\n",
+ "type": "string",
+ "enum": [
+ "AKI",
+ "AMI",
+ "ARI",
+ "BARE",
+ "DOCKER",
+ "OVA",
+ "OVF"
+ ]
+ },
+ "diskFormat": {
+ "description": "Disk format of a software image is the format of the underlying disk image. Permitted values: - AKI: a kernel image format - AMI: a machine image format - ARI: a ramdisk image format - ISO: an archive format for the data contents of an optical disc, such as CD-ROM\n- QCOW2: a common disk image format, which can expand dynamically and supports copy on write\n- RAW: an unstructured disk image format - VDI: a common disk image format - VHD: a common disk image format - VHDX: enhanced version of VHD format - VMDK: a common disk image format The list of permitted values was adapted from \"Disk formats\" in http://docs.openstack.org/image-guide/image-formats.html\n",
+ "type": "string",
+ "enum": [
+ "AKI",
+ "AMI",
+ "ISO",
+ "QCOW2",
+ "RAW",
+ "VDI",
+ "VHD",
+ "VHDX",
+ "VMDK"
+ ]
+ },
+ "createdAt": {
+ "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
+ "type": "string",
+ "format": "date-time"
+ },
+ "minDisk": {
+ "description": "The minimal disk for this software image in bytes.\n",
+ "type": "integer"
+ },
+ "minRam": {
+ "description": "The minimal RAM for this software image in bytes.\n",
+ "type": "integer"
+ },
+ "size": {
+ "description": "Size of this software image in bytes.\n",
+ "type": "integer"
+ },
+ "userMetadata": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ },
+ "imagePath": {
+ "description": "Path in the VNF package, which identifies the image artifact and also allows to access a copy of the image artifact.\n",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "additionalArtifacts": {
+ "description": "Information about VNF package artifacts contained in the VNF package that are not software images. This attribute shall not be present before the VNF package content is on-boarded. Otherwise, this attribute shall be present if the VNF package contains additional artifacts.\n",
+ "type": "array",
+ "items": {
+ "description": "This type represents an artifact other than a software image which is contained in a VNF package.\n",
+ "type": "object",
+ "required": [
+ "artifactPath",
+ "checksum"
+ ],
+ "properties": {
+ "artifactPath": {
+ "description": "Path in the VNF package, which identifies the artifact and also allows to access a copy of the artifact.\n",
+ "type": "string"
+ },
+ "checksum": {
+ "description": "This type represents the checksum of a VNF package or an artifact file.\n",
+ "type": "object",
+ "required": [
+ "algorithm",
+ "hash"
+ ],
+ "properties": {
+ "algorithm": {
+ "description": "Name of the algorithm used to generate the checksum, as defined in ETSI GS NFV-SOL 004. For example, SHA-256, SHA-512.\n",
+ "type": "string"
+ },
+ "hash": {
+ "description": "The hexadecimal value of the checksum.\n",
+ "type": "string"
+ }
+ }
+ },
+ "metadata": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ }
+ }
+ }
+ },
+ "onboardingState": {
+ "description": "CREATED: The VNF package resource has been created. UPLOADING: The associated VNF package content is being uploaded. PROCESSING: The associated VNF package content is being processed, e.g., validation.\nONBOARDED: The associated VNF package content has been successfully on-boarded.\n",
+ "type": "string",
+ "enum": [
+ "CREATED",
+ "UPLOADING",
+ "PROCESSING",
+ "ONBOARDED"
+ ]
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ },
+ "userDefinedData": {
+ "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
+ "type": "object"
+ },
+ "_links": {
+ "description": "Links to resources related to this resource.\n",
+ "type": "object",
+ "required": [
+ "self",
+ "packageContent"
+ ],
+ "properties": {
+ "self": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ },
+ "vnfd": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ },
+ "packageContent": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/vnf_packages/{vnfPkgId}/vnfd": {
+ "parameters": [
+ {
+ "name": "vnfPkgId",
+ "description": "Identifier of the on-boarded VNF package. The identifier is allocated by the NFVO. This identifier can be retrieved from the \"vnfPkgId\" attribute in the VnfPackageOnboardingNotification or VnfPackageChangeNotification.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "get": {
+ "description": "Query VNF Package Info\n\nThe GET method reads the content of the VNFD within a VNF package. The VNFD can be implemented as a single file or as a collection of multiple files. If the VNFD is implemented in the form of multiple files, a ZIP file embedding these files shall be returned. If the VNFD is implemented as a single file, either that file or a ZIP file embedding that file shall be returned. The selection of the format is controlled by the \"Accept\" HTTP header passed in the GET request. * If the \"Accept\" header contains only \"text/plain\" and the VNFD is implemented as a single file, the file shall be returned;\n otherwise, an error message shall be returned.\n* If the \"Accept\" header contains only \"application/zip\", the single file or the multiple files that make up the VNFD shall be returned\n embedded in a ZIP file.\n* If the \"Accept\" header contains both \"text/plain\" and \"application/zip\", it is up to the NFVO to choose the format to\n return for a single-file VNFD; for a multi-file VNFD, a ZIP file\n shall be returned.\nThe default format of the ZIP file shall be the one specified in ETSI GS NFV-SOL 004 where only the YAML files representing the VNFD, and information needed to navigate the ZIP file and to identify the file that is the entry point for parsing the VNFD (such as TOSCA-meta or manifest files or naming conventions) are included.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Permitted values: \"text/plain\" and/or \"application/zip\" Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "text/plain",
+ "application/zip",
+ "text/plain+application/zip"
+ ]
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nOn success, the content of the VNFD is returned. The payload body shall contain a copy of the file representing the VNFD or a ZIP file that contains the file or multiple files representing the VNFD, as specified above. The \"Content-Type\" HTTP header shall be set according to the format of the returned file, i.e. to \"text/plain\" for a YAML file or to \"application/zip\" for a ZIP file.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "enum": [
+ "text/plain",
+ "application/zip"
+ ],
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "Not Acceptable\nIf the \"Accept\" header does not contain at least one name of a content type for which the NFVO can provide a representation of the VNFD, the NFVO shall respond with this response code. The \"ProblemDetails\" structure may be included with the \"detail\" attribute providing more information about the error.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict\nError: The operation cannot be executed currently, due to a conflict with the state of the resource. Typically, this is due to the fact that \"onboardingState\" of the VNF package has a value different from \"ONBOARDED\". The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute shall convey more information about the error.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/vnf_packages/{vnfPkgId}/package_content": {
+ "parameters": [
+ {
+ "name": "vnfPkgId",
+ "description": "Identifier of the VNF package. The identifier is allocated by the NFVO. This identifier can be retrieved from the \"vnfPkgId\" attribute in the VnfPackageOnboardingNotification or VnfPackageChangeNotification.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "get": {
+ "description": "Fetch VNF Package\n\nThe GET method fetches the content of a VNF package identified by the VNF package identifier allocated by the NFVO.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response.\n",
+ "in": "header",
+ "required": true,
+ "type": "string",
+ "enum": [
+ "text/plain",
+ "application/zip"
+ ]
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Range",
+ "description": "The request may contain a \"Range\" HTTP header to obtain single range of bytes from the VNF package file. This can be used to continue an aborted transmission. If the NFVO does not support range requests, it should return the whole file with a 200 OK response instead.\n",
+ "in": "header",
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nOn success, a copy of the VNF package file is returned. The response body shall include a copy of the VNF package file. The \"Content-Type HTTP\" header shall be set according to the type of the file, i.e. to \"application/zip\" for a VNF Package as defined in ETSI GS NFV-SOL 004.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "206": {
+ "description": "206 PARTIAL CONTENT\nOn success, if the NFVO supports range requests, a single consecutive byte range from the content of the VNF package file is returned. The response body shall contain the requested part of the VNF package file. The \"Content-Range\" HTTP header shall be provided according to IETF RFC 7233. The \"Content-Type\" HTTP header shall be set as defined above for the \"200 OK\" response.\n",
+ "headers": {
+ "Content-Range": {
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict\nError: The operation cannot be executed currently, due to a conflict with the state of the resource. Typically, this is due to the fact that \"onboardingState\" of the VNF package has a value different from \"ONBOARDED\". The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute shall convey more information about the error.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "Requested Range Not Satisfiable\nThe byte range passed in the \"Range\" header did not match any available byte range in the VNF package file (e.g. \"access after end of file\"). The response body may contain a ProblemDetails structure.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/vnf_packages/{vnfPkgId}/artifacts/{artifactPath}": {
+ "parameters": [
+ {
+ "name": "artifactPath",
+ "description": "Sequence of one or more path segments representing the path of the artifact within the VNF package. EXAMPLE: foo/bar/run.sh This identifier can be retrieved from the \"artifactPath\" attribute of the applicable \"additionalArtifacts\" entry in the body of the response to a GET request querying the \"Individual VNF package\" or the \"VNF packages\" resource.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ },
+ {
+ "name": "vnfPkgId",
+ "description": "Identifier of the VNF package. The identifier is allocated by the NFVO. This identifier can be retrieved from the \"vnfPkgId\" attribute in the VnfPackageOnboardingNotification or VnfPackageChangeNotification.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "get": {
+ "description": "Fetch VNF Package Artifacts\n\nThe GET method fetches the content of an artifact within a VNF package.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Range",
+ "description": "The request may contain a \"Range\" HTTP header to obtain single range of bytes from the VNF package file. This can be used to continue an aborted transmission. If the NFVO does not support range requests, it should return the whole file with a 200 OK response instead.\n",
+ "in": "header",
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nOn success, the content of the artifact is returned. The payload body shall contain a copy of the artifact file from the VNF package, as defined by ETSI GS NFV-SOL 004. The \"Content-Type\" HTTP header shall be set according to the content type of the artifact file. If the content type cannot be determined, the header shall be set to the value \"application/octet-stream\".\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response. The \"Content-Type\" HTTP header shall be set according to the content type of the artifact file. If the content type cannot be determined, the header shall be set to the value \"application/octet-stream\".\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "206": {
+ "description": "206 PARTIAL CONTENT\nOn success, if the NFVO supports range requests, a single consecutive byte range from the content of the VNF package file is returned. The response body shall contain the requested part of the VNF package file. The \"Content-Range\" HTTP header shall be provided according to IETF RFC 7233. The \"Content-Type\" HTTP header shall be set as defined above for the \"200 OK\" response.\n",
+ "headers": {
+ "Content-Range": {
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict\nError: The operation cannot be executed currently, due to a conflict with the state of the resource. Typically, this is due to the fact that \"onboardingState\" of the VNF package has a value different from \"ONBOARDED\". The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute shall convey more information about the error.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "Requested Range Not Satisfiable\nThe byte range passed in the \"Range\" header did not match any available byte range in the VNF package file (e.g. \"access after end of file\"). The response body may contain a ProblemDetails structure.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/subscriptions": {
+ "post": {
+ "description": "Subscribe\n\nThe POST method creates a new subscription. Creation of two subscription resources with the same callbackURI and the same filter can result in performance degradation and will provide duplicates of notifications to the VNFM, and might make sense only in very rare use cases. Consequently, the NFVO may either allow creating a subscription resource if another subscription resource with the same filter and callbackUri already exists (in which case it shall return the “201 Created” response code), or may decide to not create a duplicate subscription resource (in which case it shall return a “303 See Other” response code referencing the existing subscription resource with the same filter and callbackUri).\n",
+ "parameters": [
+ {
+ "name": "PkgmSubscriptionRequest",
+ "description": "Representation of the created subscription resource. The HTTP response shall include a \"Location\" HTTP header that points to the created subscription resource.\n",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "description": "This type represents a subscription request related to VNF package management notifications about VNF package on-boarding or changes.\n",
+ "type": "object",
+ "required": [
+ "callbackUri"
+ ],
+ "properties": {
+ "filter": {
+ "description": "This type represents a subscription filter related to notifications related to VNF package management. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types. Permitted values: - VnfPackageOnboardingNotification - VnfPackageChangeNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "VnfPackageOnboardingNotification",
+ "VnfPackageChangeNotification"
+ ]
+ }
+ },
+ "vnfProductsFromProviders": {
+ "description": "If present, match VNF packages that contain VNF products from certain providers. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProvider"
+ ],
+ "properties": {
+ "vnfProvider": {
+ "description": "Name of the VNF provider to match.\n",
+ "type": "string"
+ },
+ "vnfProducts": {
+ "description": "If present, match VNF packages that contain VNF products with certain product names, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProductName"
+ ],
+ "properties": {
+ "vnfProductName": {
+ "description": "Name of the VNF product to match.\n",
+ "type": "string"
+ },
+ "versions": {
+ "description": "If present, match VNF packages that contain VNF products with certain versions and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfSoftwareVersion"
+ ],
+ "properties": {
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersions": {
+ "description": "If present, match VNF packages that contain VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "description": "A Version.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "vnfdId": {
+ "description": "Match VNF packages with a VNFD identifier listed in the attribute. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "vnfPkgId": {
+ "description": "Match VNF packages with a package identifier listed in the attribute. May be present if the \"notificationTypes\" attribute contains the value \"VnfPackageChangeNotification\", and shall be absent otherwise. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ }
+ }
+ },
+ "callbackUri": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ },
+ "authentication": {
+ "type": "object",
+ "required": [
+ "authType"
+ ],
+ "properties": {
+ "authType": {
+ "description": "Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification. Permitted values: * BASIC: In every HTTP request to the notification endpoint, use HTTP Basic authentication with the client credentials. \n* OAUTH2_CLIENT_CREDENTIALS: In every HTTP request to the notification endpoint, use an OAuth 2.0 Bearer token, obtained\n using the client credentials grant type.\n* TLS_CERT: Every HTTP request to the notification endpoint is sent over a mutually authenticated TLS session, i.e. not only the\n server is authenticated, but also the client is authenticated\n during the TLS tunnel setup.\n",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "BASIC",
+ "OAUTH2_CLIENT_CREDENTIALS",
+ "TLS_CERT"
+ ]
+ }
+ },
+ "paramsBasic": {
+ "description": "Parameters for authentication/authorization using BASIC. Shall be present if authType is \"BASIC\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n",
+ "type": "object",
+ "properties": {
+ "userName": {
+ "description": "Username to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n",
+ "type": "string"
+ },
+ "password": {
+ "description": "Password to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n",
+ "type": "string"
+ }
+ }
+ },
+ "paramsOauth2ClientCredentials": {
+ "description": "Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS. Shall be present if authType is \"OAUTH2_CLIENT_CREDENTIALS\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n",
+ "type": "object",
+ "properties": {
+ "clientId": {
+ "description": "Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n",
+ "type": "string"
+ },
+ "clientPassword": {
+ "description": "Client password to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n",
+ "type": "string"
+ },
+ "tokenEndpoint": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Content-Type",
+ "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "201 CREATED\nRepresentation of the created subscription resource. The HTTP response shall include a \"Location\" HTTP header that points to the created subscription resource.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Location": {
+ "description": "The resource URI of the created VNF instance",
+ "type": "string",
+ "format": "url"
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "description": "This type represents a subscription related to notifications about VNF package management.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "callbackUri",
+ "_links"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "filter": {
+ "description": "This type represents a subscription filter related to notifications related to VNF package management. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types. Permitted values: - VnfPackageOnboardingNotification - VnfPackageChangeNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "VnfPackageOnboardingNotification",
+ "VnfPackageChangeNotification"
+ ]
+ }
+ },
+ "vnfProductsFromProviders": {
+ "description": "If present, match VNF packages that contain VNF products from certain providers. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProvider"
+ ],
+ "properties": {
+ "vnfProvider": {
+ "description": "Name of the VNF provider to match.\n",
+ "type": "string"
+ },
+ "vnfProducts": {
+ "description": "If present, match VNF packages that contain VNF products with certain product names, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProductName"
+ ],
+ "properties": {
+ "vnfProductName": {
+ "description": "Name of the VNF product to match.\n",
+ "type": "string"
+ },
+ "versions": {
+ "description": "If present, match VNF packages that contain VNF products with certain versions and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfSoftwareVersion"
+ ],
+ "properties": {
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersions": {
+ "description": "If present, match VNF packages that contain VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "description": "A Version.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "vnfdId": {
+ "description": "Match VNF packages with a VNFD identifier listed in the attribute. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "vnfPkgId": {
+ "description": "Match VNF packages with a package identifier listed in the attribute. May be present if the \"notificationTypes\" attribute contains the value \"VnfPackageChangeNotification\", and shall be absent otherwise. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ }
+ }
+ },
+ "callbackUri": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ },
+ "_links": {
+ "description": "Links to resources related to this resource.\n",
+ "type": "object",
+ "required": [
+ "self"
+ ],
+ "properties": {
+ "self": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "303": {
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "description": "Query Subscription Information\n\nThe GET method queries the list of active subscriptions of the functional block that invokes the method. It can be used e.g. for resynchronization after error situations.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "filter",
+ "description": "Attribute-based filtering expression according to clause 4.3.2. The VNFM shall support receiving this parameter as part of the URI query string. The NFVO may supply this parameter. All attribute names that appear in the PkgmSubscription and in data types referenced from it shall be supported by the VNFM in the filter expression.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "nextpage_opaque_marker",
+ "description": "Marker to obtain the next page of a paged response. Shall be supported by the VNFM if the VNFM supports alternative 2 (paging) according to clause 4.7.2.1 for this resource.\n",
+ "in": "query",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nThe list of subscriptions was queried successfully. The representations body shall contain in an array the representations of all active subscriptions of the functional block that invokes the method , i.e. zero or more representations of VNF package Management subscriptions as defined in clause 10.5.2.4. If the VNFM supports alternative 2 (paging) according to clause 4.7.2.1 for this resource, inclusion of the Link HTTP header in this response shall follow the provisions in clause 4.7.2.3.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "Link": {
+ "description": "Reference to other resources. Used for paging in the present document, see clause 4.7.2.1.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ }
+ },
+ "schema": {
+ "type": "array",
+ "items": {
+ "description": "This type represents a subscription related to notifications about VNF package management.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "callbackUri",
+ "_links"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "filter": {
+ "description": "This type represents a subscription filter related to notifications related to VNF package management. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types. Permitted values: - VnfPackageOnboardingNotification - VnfPackageChangeNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "VnfPackageOnboardingNotification",
+ "VnfPackageChangeNotification"
+ ]
+ }
+ },
+ "vnfProductsFromProviders": {
+ "description": "If present, match VNF packages that contain VNF products from certain providers. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProvider"
+ ],
+ "properties": {
+ "vnfProvider": {
+ "description": "Name of the VNF provider to match.\n",
+ "type": "string"
+ },
+ "vnfProducts": {
+ "description": "If present, match VNF packages that contain VNF products with certain product names, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProductName"
+ ],
+ "properties": {
+ "vnfProductName": {
+ "description": "Name of the VNF product to match.\n",
+ "type": "string"
+ },
+ "versions": {
+ "description": "If present, match VNF packages that contain VNF products with certain versions and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfSoftwareVersion"
+ ],
+ "properties": {
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersions": {
+ "description": "If present, match VNF packages that contain VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "description": "A Version.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "vnfdId": {
+ "description": "Match VNF packages with a VNFD identifier listed in the attribute. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "vnfPkgId": {
+ "description": "Match VNF packages with a package identifier listed in the attribute. May be present if the \"notificationTypes\" attribute contains the value \"VnfPackageChangeNotification\", and shall be absent otherwise. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ }
+ }
+ },
+ "callbackUri": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ },
+ "_links": {
+ "description": "Links to resources related to this resource.\n",
+ "type": "object",
+ "required": [
+ "self"
+ ],
+ "properties": {
+ "self": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}": {
+ "parameters": [
+ {
+ "name": "subscriptionId",
+ "description": "Identifier of this subscription. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a POST request creating a new subscription resource. It can also be retrieved from the \"id\" attribute in the payload body of that response.\n",
+ "in": "path",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "get": {
+ "description": "Query Subscription Information\n\nThe GET method reads an individual subscription.\n",
+ "parameters": [
+ {
+ "name": "Accept",
+ "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "200 OK\nRepresentation of the subscription resource.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "This type represents a subscription related to notifications about VNF package management.\n",
+ "type": "object",
+ "required": [
+ "id",
+ "callbackUri",
+ "_links"
+ ],
+ "properties": {
+ "id": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ },
+ "filter": {
+ "description": "This type represents a subscription filter related to notifications related to VNF package management. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
+ "type": "object",
+ "properties": {
+ "notificationTypes": {
+ "description": "Match particular notification types. Permitted values: - VnfPackageOnboardingNotification - VnfPackageChangeNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "VnfPackageOnboardingNotification",
+ "VnfPackageChangeNotification"
+ ]
+ }
+ },
+ "vnfProductsFromProviders": {
+ "description": "If present, match VNF packages that contain VNF products from certain providers. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProvider"
+ ],
+ "properties": {
+ "vnfProvider": {
+ "description": "Name of the VNF provider to match.\n",
+ "type": "string"
+ },
+ "vnfProducts": {
+ "description": "If present, match VNF packages that contain VNF products with certain product names, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfProductName"
+ ],
+ "properties": {
+ "vnfProductName": {
+ "description": "Name of the VNF product to match.\n",
+ "type": "string"
+ },
+ "versions": {
+ "description": "If present, match VNF packages that contain VNF products with certain versions and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "vnfSoftwareVersion"
+ ],
+ "properties": {
+ "vnfSoftwareVersion": {
+ "description": "A Version.\n",
+ "type": "string"
+ },
+ "vnfdVersions": {
+ "description": "If present, match VNF packages that contain VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
+ "type": "array",
+ "items": {
+ "description": "A Version.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "vnfdId": {
+ "description": "Match VNF packages with a VNFD identifier listed in the attribute. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "vnfPkgId": {
+ "description": "Match VNF packages with a package identifier listed in the attribute. May be present if the \"notificationTypes\" attribute contains the value \"VnfPackageChangeNotification\", and shall be absent otherwise. The attributes \"vnfProductsFromProviders\", \"vnfdId\" and \"vnfPkgId\" are alternatives to reference to particular VNF packages in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
+ "type": "array",
+ "items": {
+ "description": "An identifier with the intention of being globally unique.\n",
+ "type": "string"
+ }
+ },
+ "operationalState": {
+ "description": "- ENABLED: The VNF package is enabled, i.e. it can be used for instantiation of new VNF instances.\n- DISABLED: The VNF package is disabled, i.e. it cannot be used for further VNF instantiation requests (unless and until the VNF package\n is re-enabled).\n",
+ "type": "string",
+ "enum": [
+ "ENABLED",
+ "DISABLED"
+ ]
+ },
+ "usageState": {
+ "description": "- IN_USE: VNF instances instantiated from this VNF package exist. - NOT_IN_USE: No existing VNF instance is instantiated from this VNF package.\n"
+ }
+ }
+ },
+ "callbackUri": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ },
+ "_links": {
+ "description": "Links to resources related to this resource.\n",
+ "type": "object",
+ "required": [
+ "self"
+ ],
+ "properties": {
+ "self": {
+ "description": "This type represents a link to a resource using an absolute URI. It shall comply with the provisions defined in table 4.4.1.3-1.\n",
+ "type": "object",
+ "required": [
+ "href"
+ ],
+ "properties": {
+ "href": {
+ "description": "String formatted according to IETF RFC 3986.\n",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "Terminate subscription\n\nThe DELETE method terminates an individual subscription.\n",
+ "parameters": [
+ {
+ "name": "Authorization",
+ "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
+ "in": "header",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "Version",
+ "description": "Version of the API requested to use when responding to this request.\n",
+ "in": "header",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "204 NO CONTENT\nThe subscription resource was deleted successfully.\n",
+ "headers": {
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ }
+ },
+ "400": {
+ "description": "400 BAD REQUEST\n400 code can be returned in the following specified cases, the specific cause has to be proper specified in the \"ProblemDetails\" structure to be returned.\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or the payload body contains a syntactically incorrect data structure), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf the response to a GET request which queries a container resource would be so big that the performance of the API producer is adversely affected, and the API producer does not support paging for the affected resource, it shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\nThe use of this HTTP error response code described above is applicable to the use of the OAuth 2.0 for the authorization of API requests and notifications, as defined in clauses 4.5.3.3 and 4.5.3.4.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "401 UNAUTHORIZED\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "403 FORBIDDEN\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "405": {
+ "description": "404 NOT FOUND\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\nThis response code is not appropriate in case the resource addressed by the URI is a container resource which is designed to contain child resources, but does not contain any child resource at the time the request is received. For a GET request to an existing empty container resource, a typical response contains a 200 OK response code and a payload body with an empty array.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "406": {
+ "description": "406 NOT ACCEPTABLE\nIf the \"Accept\" header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "416": {
+ "description": "416 RANGE NOT SATISFIABLE\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "500 INTERNAL SERVER ERROR\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503 SERVICE UNAVAILABLE\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
+ "headers": {
+ "Content-Type": {
+ "description": "The MIME type of the body of the response.",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ },
+ "WWW-Authenticate": {
+ "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "Version": {
+ "description": "Version of the API used in the response.\n",
+ "type": "string",
+ "maximum": 1,
+ "minimum": 1
+ }
+ },
+ "schema": {
+ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
+ "type": "object",
+ "required": [
+ "status",
+ "detail"
+ ],
+ "properties": {
+ "type": {
+ "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
+ "type": "string",
+ "format": "URI"
+ },
+ "title": {
+ "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
+ "type": "string"
+ },
+ "status": {
+ "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
+ "type": "integer"
+ },
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.\n",
+ "type": "string"
+ },
+ "instance": {
+ "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
+ "type": "string",
+ "format": "URI"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt
index 66876311db..aaad60320d 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt
@@ -1,5 +1,9 @@
The following describes how to configure authentication for the VNFM adapter.
+TLS should always be configured to ensure secure communication between the VNFM-adapter <-> BPMN infra and VNFM-adapter <-> VNFM
+If two-way TLS is configured then there is no need for any further authentication (i.e. no need for token or basic auth).
+If two-way TLS is NOT configured then authentication is REQUIRED. Oauth token based authentication must be used for requests, while for notifications either oauth tokens or basic auth can be used.
+
==========================================
To confgure TLS
@@ -12,8 +16,8 @@ The following parameters can be set to configure the certificate for the VNFM ad
server:
ssl:
key-alias: so@so.onap.org
- key--store-password: 'I,re7WWEJR$e]x370wRgx?qE'
- key-store: classpath:org.onap.so.p12
+ key--store-password: 'ywsqCy:EEo#j}HJHM7z^Rk[L'
+ key-store: classpath:so-vnfm-adapter.p12
key-store-type: PKCS12
The values shown above relate to the certificate included in the VNFM adapter jar which has been generated from AAF. If a different certificate is to be used then these values should be changed accordingly.
@@ -21,8 +25,8 @@ The following paramters can be set to configure the trust store for the VNFM ada
http:
client:
ssl:
- trust-store: org.onap.so.trust.jks
- trust-store-password: NyRD](z:EJJNIt?},QgM3o7H
+ trust-store: classpath:org.onap.so.trust.jks
+ trust-store-password: ',sx#.C*W)]wVgJC6ccFHI#:H'
The values shown above relate to the trust store included in the VNFM adapter jar which has been generated from AAI. If a different trust store is to be used then these values should be changed accordingly.
Ensure the value for the below parameter uses https instead of http
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java
index 1695b39c85..40be4411c8 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java
@@ -28,6 +28,8 @@ public class Constants {
public static final String SERVICE_NAME = "vnfm-adapter";
public static final String SERVICE_VERSION = "v1";
public static final String BASE_URL = "/so/" + SERVICE_NAME + "/" + SERVICE_VERSION;
+ public static final String PACKAGE_MANAGEMENT_BASE_URL = BASE_URL + "/vnfpkgm/v1";
+ public static final String APPLICATION_ZIP = "application/zip";
public static final String OPERATION_NOTIFICATION_ENDPOINT = "/lcn/VnfLcmOperationOccurrenceNotification";
private Constants() {}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
index 32c22356b3..84282e0c7f 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
@@ -23,10 +23,13 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import java.util.Collection;
+import org.onap.so.adapters.vnfmadapter.converters.Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter;
import org.onap.so.adapters.vnfmadapter.oauth.OAuth2AccessTokenAdapter;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.core.convert.ConversionService;
+import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
@@ -38,6 +41,13 @@ import org.springframework.security.oauth2.common.OAuth2AccessToken;
public class MessageConverterConfiguration {
@Bean
+ public ConversionService conversionService() {
+ final DefaultConversionService service = new DefaultConversionService();
+ service.addConverter(new Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter());
+ return service;
+ }
+
+ @Bean
public HttpMessageConverters customConverters() {
final Collection<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
final Gson gson = new GsonBuilder()
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/WebSecurityConfigImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicWebSecurityConfigurerAdapter.java
index b8bada298e..4f3bbe6c5b 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/WebSecurityConfigImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicWebSecurityConfigurerAdapter.java
@@ -20,31 +20,34 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.requestsdb;
+package org.onap.so.adapters.vnfmadapter;
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
+import org.onap.so.security.SoBasicWebSecurityConfigurerAdapter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
+@Configuration
+public class VnfmBasicWebSecurityConfigurerAdapter extends SoBasicWebSecurityConfigurerAdapter {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
+ @Value("${server.ssl.client-auth:none}")
+ private String clientAuth;
@Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
+ protected void configure(final HttpSecurity http) throws Exception {
+ if (("need").equalsIgnoreCase(clientAuth)) {
+ http.csrf().disable().authorizeRequests().anyRequest().permitAll();
+ } else {
+ super.configure(http);
+ }
}
}
+
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter.java
new file mode 100644
index 0000000000..de18ecc43e
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter.java
@@ -0,0 +1,180 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.converters;
+
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.*;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.convert.converter.Converter;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Converter to convert from an Etsi Catalog Model {@link VnfPkgInfo} Object to a PackageManagement Model
+ * {@link InlineResponse2001} Object
+ *
+ * @author andrew.a.lamb@est.tech
+ */
+@Service
+public class Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter
+ implements Converter<VnfPkgInfo, InlineResponse2001> {
+ private static final Logger logger =
+ LoggerFactory.getLogger(Sol003EtsiVnfPkgInfoToPkgmInlineResponse2001Converter.class);
+
+ /**
+ * Convert a {@link VnfPkgInfo} Object to an {@link InlineResponse2001} Object
+ *
+ * @param vnfPkgInfo The VnfPkgInfo Object to Convert
+ * @return The Converted InlineResponse2001 Object
+ */
+ @Override
+ public InlineResponse2001 convert(final VnfPkgInfo vnfPkgInfo) {
+ if (vnfPkgInfo == null) {
+ logger.info("No VnfPkgInfo Object Provided for Conversion. (Null object received, returning Null)");
+ return null;
+ }
+ final InlineResponse2001 response = new InlineResponse2001();
+ response.setId(vnfPkgInfo.getId());
+ response.setVnfdId(vnfPkgInfo.getVnfdId());
+ response.setVnfProvider(vnfPkgInfo.getVnfProvider());
+ response.setVnfProductName(vnfPkgInfo.getVnfProductName());
+ response.setVnfSoftwareVersion(vnfPkgInfo.getVnfSoftwareVersion());
+ response.setVnfdVersion(vnfPkgInfo.getVnfdVersion());
+ response.setChecksum(convertChecksumToVnfPackagesChecksum(vnfPkgInfo.getChecksum()));
+ response.setSoftwareImages(
+ convertVnfPackageSoftwareImageInfoListToVnfPackagesSoftwareImagesList(vnfPkgInfo.getSoftwareImages()));
+ response.setAdditionalArtifacts(convertVnfPackageArtifactInfoListToVnfPackagesAdditionalArtifactsList(
+ vnfPkgInfo.getAdditionalArtifacts()));
+
+ if (vnfPkgInfo.getOnboardingState() != null) {
+ response.setOnboardingState(
+ InlineResponse2001.OnboardingStateEnum.fromValue(vnfPkgInfo.getOnboardingState().getValue()));
+ }
+
+ if (vnfPkgInfo.getOperationalState() != null) {
+ response.setOperationalState(
+ InlineResponse2001.OperationalStateEnum.fromValue(vnfPkgInfo.getOperationalState().getValue()));
+ }
+
+ response.setUserDefinedData((vnfPkgInfo.getUserDefinedData()));
+
+ if (vnfPkgInfo.getLinks() != null) {
+ response.setLinks(convertVNFPKGMLinkSerializerToVnfPackagesLinks(vnfPkgInfo.getLinks()));
+ }
+
+ return response;
+ }
+
+ private VnfPackagesChecksum convertChecksumToVnfPackagesChecksum(final Checksum checksum) {
+ final VnfPackagesChecksum vnfPackagesChecksum = new VnfPackagesChecksum();
+ if (checksum != null) {
+ vnfPackagesChecksum.setAlgorithm(checksum.getAlgorithm());
+ vnfPackagesChecksum.setHash(checksum.getHash());
+ }
+ return vnfPackagesChecksum;
+ }
+
+ private List<VnfPackagesSoftwareImages> convertVnfPackageSoftwareImageInfoListToVnfPackagesSoftwareImagesList(
+ final List<VnfPackageSoftwareImageInfo> vnfPackageSoftwareImageInfoList) {
+ final List<VnfPackagesSoftwareImages> vnfPackagesSoftwareImages = new ArrayList<>();
+ if (vnfPackageSoftwareImageInfoList != null) {
+ for (final VnfPackageSoftwareImageInfo vnfPackageSoftwareImageInfo : vnfPackageSoftwareImageInfoList) {
+ final VnfPackagesSoftwareImages softwareImage =
+ convertVnfPackageSoftwareImageInfoToVnfPackagesSoftwareImages(vnfPackageSoftwareImageInfo);
+ vnfPackagesSoftwareImages.add(softwareImage);
+ }
+ }
+ return vnfPackagesSoftwareImages;
+ }
+
+ private VnfPackagesSoftwareImages convertVnfPackageSoftwareImageInfoToVnfPackagesSoftwareImages(
+ final VnfPackageSoftwareImageInfo vnfPackageSoftwareImageInfo) {
+ final VnfPackagesSoftwareImages vnfPackagesSoftwareImages = new VnfPackagesSoftwareImages();
+ vnfPackagesSoftwareImages.setId(vnfPackageSoftwareImageInfo.getId());
+ vnfPackagesSoftwareImages.setName(vnfPackageSoftwareImageInfo.getName());
+ vnfPackagesSoftwareImages.setProvider(vnfPackageSoftwareImageInfo.getProvider());
+ vnfPackagesSoftwareImages.setVersion(vnfPackageSoftwareImageInfo.getVersion());
+ vnfPackagesSoftwareImages
+ .setChecksum(convertChecksumToVnfPackagesChecksum(vnfPackageSoftwareImageInfo.getChecksum()));
+ if (vnfPackageSoftwareImageInfo.getContainerFormat() != null) {
+ vnfPackagesSoftwareImages.setContainerFormat(VnfPackagesSoftwareImages.ContainerFormatEnum
+ .fromValue(vnfPackageSoftwareImageInfo.getContainerFormat().getValue()));
+ }
+
+ if (vnfPackageSoftwareImageInfo.getDiskFormat() != null) {
+ vnfPackagesSoftwareImages.setDiskFormat(VnfPackagesSoftwareImages.DiskFormatEnum
+ .fromValue(vnfPackageSoftwareImageInfo.getDiskFormat().getValue()));
+ }
+
+ vnfPackagesSoftwareImages.setCreatedAt(vnfPackageSoftwareImageInfo.getCreatedAt());
+ vnfPackagesSoftwareImages.setMinDisk(vnfPackageSoftwareImageInfo.getMinDisk());
+ vnfPackagesSoftwareImages.setMinRam(vnfPackageSoftwareImageInfo.getMinRam());
+ vnfPackagesSoftwareImages.setSize(vnfPackageSoftwareImageInfo.getSize());
+ vnfPackagesSoftwareImages.setUserMetadata(vnfPackageSoftwareImageInfo.getUserMetadata());
+ vnfPackagesSoftwareImages.setImagePath(vnfPackageSoftwareImageInfo.getImagePath());
+ return vnfPackagesSoftwareImages;
+ }
+
+ private List<VnfPackagesAdditionalArtifacts> convertVnfPackageArtifactInfoListToVnfPackagesAdditionalArtifactsList(
+ final List<VnfPackageArtifactInfo> vnfPackageArtifactInfoList) {
+ if (vnfPackageArtifactInfoList != null) {
+ final List<VnfPackagesAdditionalArtifacts> additionalArtifacts = new ArrayList<>();
+ for (final VnfPackageArtifactInfo artifactInfo : vnfPackageArtifactInfoList) {
+ final VnfPackagesAdditionalArtifacts artifact =
+ convertVnfPackageArtifactInfoToVnfPackagesAdditionalArtifacts(artifactInfo);
+ additionalArtifacts.add(artifact);
+ }
+ return additionalArtifacts;
+ }
+ return null;
+ }
+
+ private VnfPackagesAdditionalArtifacts convertVnfPackageArtifactInfoToVnfPackagesAdditionalArtifacts(
+ final VnfPackageArtifactInfo vnfPackageArtifactInfo) {
+ final VnfPackagesAdditionalArtifacts vnfPackagesAdditionalArtifacts = new VnfPackagesAdditionalArtifacts();
+ vnfPackagesAdditionalArtifacts.setArtifactPath(vnfPackageArtifactInfo.getArtifactPath());
+ vnfPackagesAdditionalArtifacts
+ .setChecksum(convertChecksumToVnfPackagesChecksum(vnfPackageArtifactInfo.getChecksum()));
+ vnfPackagesAdditionalArtifacts.setMetadata(vnfPackageArtifactInfo.getMetadata());
+ return vnfPackagesAdditionalArtifacts;
+ }
+
+ private VnfPackagesLinks convertVNFPKGMLinkSerializerToVnfPackagesLinks(
+ final VNFPKGMLinkSerializer vnfpkgmLinkSerializer) {
+ final VnfPackagesLinks vnfPackagesLinks = new VnfPackagesLinks();
+ vnfPackagesLinks.setSelf(convertUriLinkToVnfPackagesLinksSelf(vnfpkgmLinkSerializer.getSelf()));
+ vnfPackagesLinks.setVnfd(convertUriLinkToVnfPackagesLinksSelf(vnfpkgmLinkSerializer.getVnfd()));
+ vnfPackagesLinks
+ .setPackageContent(convertUriLinkToVnfPackagesLinksSelf(vnfpkgmLinkSerializer.getPackageContent()));
+ return vnfPackagesLinks;
+ }
+
+ private VnfPackagesLinksSelf convertUriLinkToVnfPackagesLinksSelf(final UriLink uriLink) {
+ final VnfPackagesLinksSelf vnfPackagesLinksSelf = new VnfPackagesLinksSelf();
+ if (uriLink != null) {
+ vnfPackagesLinksSelf.setHref(uriLink.getHref());
+ }
+ return vnfPackagesLinksSelf;
+ }
+
+}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/JsonSerializerConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java
index d6eda28eb6..8f6d853997 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/JsonSerializerConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java
@@ -17,33 +17,33 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.svnfm.simulator.oauth;
+
+package org.onap.so.adapters.vnfmadapter.extclients;
import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import java.util.ArrayList;
-import java.util.Collection;
-import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
+import java.util.Iterator;
+import org.onap.vnfmadapter.v1.JSON;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
/**
- * Configures message converter
+ * A base class that can be extended by classes for configuring HttpRestServiceProvider classes. Provides common methods
+ * that will be useful to some such classes.
+ *
+ * @author gareth.roper@est.tech
*/
-@Configuration
-public class JsonSerializerConfiguration {
-
- @Bean
- public HttpMessageConverters customConverters() {
- final Collection<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
+public abstract class AbstractServiceProviderConfiguration {
- final Gson gson = new GsonBuilder()
- .registerTypeHierarchyAdapter(OAuth2AccessToken.class, new OAuth2AccessTokenAdapter()).create();
- final GsonHttpMessageConverter gsonHttpMessageConverter = new GsonHttpMessageConverter(gson);
- messageConverters.add(gsonHttpMessageConverter);
- return new HttpMessageConverters(true, messageConverters);
+ public void setGsonMessageConverter(final RestTemplate restTemplate) {
+ final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator();
+ while (iterator.hasNext()) {
+ if (iterator.next() instanceof MappingJackson2HttpMessageConverter) {
+ iterator.remove();
+ }
+ }
+ final Gson gson = new JSON().getGson();
+ restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
}
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
index 110bbabdb2..fc9efef947 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java
@@ -31,14 +31,10 @@ import org.onap.aai.domain.yang.EsrVnfmList;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.Relationship;
import org.onap.aai.domain.yang.RelationshipData;
-import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.Vserver;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.TenantNotFoundException;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException;
-import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.AAIVersion;
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.vnfmadapter.v1.model.Tenant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -61,38 +57,6 @@ public class AaiHelper {
}
/**
- * Add a relationship to the given generic VNF to the given VNFM.
- *
- * @param vnf the generic VNF
- * @param vnfmId the ID of the VNFM
- */
- public void addRelationshipFromGenericVnfToVnfm(final GenericVnf vnf, final String vnfmId) {
- if (vnf.getRelationshipList() == null) {
- vnf.setRelationshipList(new RelationshipList());
- }
- final RelationshipList vnfmRelationshiplist = vnf.getRelationshipList();
- vnfmRelationshiplist.getRelationship().add(createRelationshipToVnfm(vnfmId));
-
- }
-
- private Relationship createRelationshipToVnfm(final String vnfmId) {
- final Relationship relationship = new Relationship();
- relationship.setRelatedTo("esr-vnfm");
- relationship.setRelationshipLabel("tosca.relationships.DependsOn");
- relationship.setRelatedLink("/aai/" + AAIVersion.LATEST
- + AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId).build().toString());
- relationship.getRelationshipData().add(createRelationshipData("esr-vnfm.vnfm-id", vnfmId));
- return relationship;
- }
-
- private RelationshipData createRelationshipData(final String key, final String value) {
- final RelationshipData data = new RelationshipData();
- data.setRelationshipKey(key);
- data.setRelationshipValue(value);
- return data;
- }
-
- /**
* Get the VNFM assigned for use for the given generic VNF.
*
* @param vnf the generic VNF
@@ -242,30 +206,6 @@ public class AaiHelper {
return vserver;
}
- /**
- * Add a relationship to the given vserver to the given VNF.
- *
- * @param vnf the vserver
- * @param vnfmId the ID of the VNF
- */
- public void addRelationshipFromVserverVnfToGenericVnf(final Vserver vserver, final String vnfId) {
- if (vserver.getRelationshipList() == null) {
- vserver.setRelationshipList(new RelationshipList());
- }
- final RelationshipList vserverRelationshiplist = vserver.getRelationshipList();
- vserverRelationshiplist.getRelationship().add(createRelationshipToGenericVnf(vnfId));
- }
-
- private Relationship createRelationshipToGenericVnf(final String vnfId) {
- final Relationship relationship = new Relationship();
- relationship.setRelatedTo("generic-vnf");
- relationship.setRelationshipLabel("tosca.relationships.HostedOn");
- relationship.setRelatedLink("/aai/" + AAIVersion.LATEST
- + AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).build().toString());
- relationship.getRelationshipData().add(createRelationshipData("generic-vnf.vnf-id", vnfId));
- return relationship;
- }
-
public void setOamIpAddressSource(final String vnfId, final OamIpAddressSource oamIpAddressSource) {
mapOfVnfIdToOamIpAddressHolder.put(vnfId, oamIpAddressSource);
}
@@ -274,32 +214,4 @@ public class AaiHelper {
return mapOfVnfIdToOamIpAddressHolder.get(vnfId);
}
- /**
- * Add a relationship to the given tenant to the given VNF.
- *
- * @param vnf the generic vnf
- * @param tenant the Tenant
- */
-
- public void addRelationshipFromGenericVnfToTenant(final GenericVnf vnf, final Tenant tenant) {
- if (vnf.getRelationshipList() == null) {
- vnf.setRelationshipList(new RelationshipList());
- }
- final RelationshipList vnfmRelationshiplist = vnf.getRelationshipList();
- vnfmRelationshiplist.getRelationship().add(createRelationshipToTenant(tenant));
- }
-
- private Relationship createRelationshipToTenant(final Tenant tenant) {
- final Relationship relationship = new Relationship();
- relationship.setRelatedTo("tenant");
- relationship.setRelatedLink("/aai/" + AAIVersion.LATEST + AAIUriFactory.createResourceUri(AAIObjectType.TENANT,
- tenant.getCloudOwner(), tenant.getRegionName(), tenant.getTenantId()).build().toString());
- relationship.getRelationshipData()
- .add(createRelationshipData("cloud-region.cloud-owner", tenant.getCloudOwner()));
- relationship.getRelationshipData()
- .add(createRelationshipData("cloud-region.cloud-region-id", tenant.getRegionName()));
- relationship.getRelationshipData().add(createRelationshipData("tenant.tenant-id", tenant.getTenantId()));
- return relationship;
- }
-
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
index 7021c02511..d19190d88e 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java
@@ -72,12 +72,22 @@ public interface AaiServiceProvider {
EsrVnfm invokeGetVnfm(final String vnfmId);
/**
- * Invoke a PUT request for a generic vnf.
+ * Invoke a PATCH request for a generic vnf.
*
* @param vnf the generic vnf
* @return
*/
- void invokePutGenericVnf(GenericVnf vnf);
+ void invokePatchGenericVnf(GenericVnf vnf);
+
+ /**
+ * Invoke a PUT request for a relationship from a generic vnf to a VNFM.
+ *
+ * @param vnf the generic vnf
+ * @param vnfmId the ID of the VNFM
+ * @return
+ */
+ void invokePutGenericVnfToVnfmRelationship(GenericVnf vnf, final String vnfmId);
+
/**
* Invoke a PUT request for a vserver.
@@ -92,6 +102,19 @@ public interface AaiServiceProvider {
final Vserver vserver);
/**
+ * Invoke a PUT request for a relationship from a vserver to a generic vnf.
+ *
+ * @param cloudOwner the cloud owner
+ * @param cloudRegion the cloud region the vserver is deployed on
+ * @param tenantId the ID of the tenant the vserver is deployed on
+ * @param vserver the vserver
+ * @param vnfId the ID of the generic vnf
+ * @return
+ */
+ void invokePutVserverToVnfRelationship(final String cloudOwner, final String cloudRegion, final String tenantId,
+ final Vserver vserver, final String vnfId);
+
+ /**
* Invoke a DELETE request for a vserver.
*
* @param cloudOwner the cloud owner
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
index 019a08af78..6dc6020834 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
@@ -98,12 +98,18 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
}
@Override
- public void invokePutGenericVnf(final GenericVnf vnf) {
+ public void invokePatchGenericVnf(final GenericVnf vnf) {
aaiClientProvider.getAaiClient()
.update(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()), vnf);
}
@Override
+ public void invokePutGenericVnfToVnfmRelationship(final GenericVnf vnf, final String vnfmId) {
+ aaiClientProvider.getAaiClient().connect(AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId),
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()));
+ }
+
+ @Override
public void invokePutVserver(final String cloudOwner, final String cloudRegion, final String tenant,
final Vserver vserver) {
aaiClientProvider.getAaiClient().create(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner,
@@ -111,6 +117,16 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
}
@Override
+ public void invokePutVserverToVnfRelationship(final String cloudOwner, final String cloudRegion,
+ final String tenant, final Vserver vserver, final String vnfId) {
+ aaiClientProvider.getAaiClient()
+ .connect(
+ AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion, tenant,
+ vserver.getVserverId()),
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId));
+ }
+
+ @Override
public void invokeDeleteVserver(final String cloudOwner, final String cloudRegion, final String tenant,
final String vserverId) {
aaiClientProvider.getAaiClient().delete(
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java
new file mode 100644
index 0000000000..34fc2645a2
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
+
+import java.util.Optional;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001;
+
+/**
+ * Provides methods for invoking REST calls to the ETSI Catalog Manager.
+ *
+ * @author gareth.roper@est.tech
+ */
+public interface EtsiCatalogServiceProvider {
+
+ /**
+ * GET Package Content, from VNF Package.
+ *
+ * @param vnfPkgId The ID of the VNF Package from which the "package_content" will be retrieved.
+ * @return The Package Content of a VNF Package ("vnfPkgId").
+ */
+ Optional<byte[]> getVnfPackageContent(final String vnfPkgId);
+
+ /**
+ * GET VNF packages information from ETSI Catalog. Will return zero or more VNF package representations.
+ *
+ * @return An Array of all VNF packages retrieved from the ETSI Catalog.
+ */
+ Optional<InlineResponse2001[]> getVnfPackages();
+
+ /**
+ * GET specific VNF package information from ETSI Catalog.
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to query.
+ * @return The VNF package retrieved from the ETSI Catalog
+ */
+ Optional<InlineResponse2001> getVnfPackage(final String vnfPkgId);
+
+ /**
+ * GET specific VNF package VNFD from ETSI Catalog.
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to query.
+ * @return The VNF package retrieved from the ETSI Catalog
+ */
+ Optional<byte[]> getVnfPackageVnfd(final String vnfPkgId);
+
+ /**
+ * GET Package Artifact, from VNF Package.
+ *
+ * @param vnfPkgId The ID of the VNF Package from which the artifact will be retrieved.
+ * @param artifactPath Sequence of one or more path segments representing the path of the artifact within the VNF
+ * Package, e.g., foo/bar/run.sh
+ * @return The Package Artifact of a VNF Package ("vnfPkgId", "artifactPath").
+ */
+ Optional<byte[]> getVnfPackageArtifact(final String vnfPkgId, final String artifactPath);
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java
new file mode 100644
index 0000000000..6840dd388b
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
+
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration;
+import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
+import org.onap.so.configuration.rest.HttpHeadersProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProviderImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * Configures the HttpRestServiceProvider to make REST calls to the ETSI Catalog Manager
+ *
+ * @author gareth.roper@est.tech
+ */
+
+@Configuration
+public class EtsiCatalogServiceProviderConfiguration extends AbstractServiceProviderConfiguration {
+
+ @Bean(name = "etsiCatalogServiceProvider")
+ public HttpRestServiceProvider httpRestServiceProvider(
+ @Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate) {
+ return getHttpRestServiceProvider(restTemplate, new BasicHttpHeadersProvider());
+ }
+
+ private HttpRestServiceProvider getHttpRestServiceProvider(final RestTemplate restTemplate,
+ final HttpHeadersProvider httpHeadersProvider) {
+ setGsonMessageConverter(restTemplate);
+ return new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
+ }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java
new file mode 100644
index 0000000000..779cb2a7a6
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java
@@ -0,0 +1,195 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
+
+import java.util.Optional;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.*;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
+import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.RestProcessingException;
+import org.onap.so.rest.service.HttpRestServiceProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.core.convert.ConversionService;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+/**
+ * Provides the implementations of the REST Requests to the ETSI Catalog Manager.
+ *
+ * @author gareth.roper@est.tech
+ */
+@Service
+public class EtsiCatalogServiceProviderImpl implements EtsiCatalogServiceProvider {
+ private static final Logger logger = LoggerFactory.getLogger(EtsiCatalogServiceProviderImpl.class);
+
+ @Qualifier("etsiCatalogServiceProvider")
+ private final HttpRestServiceProvider httpServiceProvider;
+ private final EtsiCatalogUrlProvider etsiCatalogUrlProvider;
+ private final ConversionService conversionService;
+
+ @Autowired
+ public EtsiCatalogServiceProviderImpl(final EtsiCatalogUrlProvider etsiCatalogUrlProvider,
+ final HttpRestServiceProvider httpServiceProvider, final ConversionService conversionService) {
+ this.etsiCatalogUrlProvider = etsiCatalogUrlProvider;
+ this.httpServiceProvider = httpServiceProvider;
+ this.conversionService = conversionService;
+ }
+
+ @Override
+ public Optional<byte[]> getVnfPackageContent(final String vnfPkgId)
+ throws EtsiCatalogManagerRequestFailureException {
+ final String vnfRequestUrl = etsiCatalogUrlProvider.getVnfPackageContentUrl(vnfPkgId);
+ final String vnfRequestName = "getVnfPackageContent";
+ return requestVnfElement(vnfPkgId, vnfRequestUrl, vnfRequestName);
+ }
+
+ @Override
+ public Optional<byte[]> getVnfPackageArtifact(final String vnfPkgId, final String artifactPath) {
+ try {
+ final ResponseEntity<byte[]> response = httpServiceProvider.getHttpResponse(
+ etsiCatalogUrlProvider.getVnfPackageArtifactUrl(vnfPkgId, artifactPath), byte[].class);
+ logger.info("getVnfPackageArtifact Request to ETSI Catalog Manager Status Code: {}",
+ response.getStatusCodeValue());
+ if (response.getStatusCode() == HttpStatus.OK) {
+ return Optional.ofNullable(response.getBody());
+ }
+ } catch (final HttpResouceNotFoundException httpResouceNotFoundException) {
+ logger.error("Caught HttpResouceNotFoundException", httpResouceNotFoundException);
+ throw new VnfPkgNotFoundException("No Vnf Package Artifact found with vnfPkgId: \"" + vnfPkgId
+ + "\" and artifactPath: \"" + artifactPath + "\".");
+ } catch (final RestProcessingException restProcessingException) {
+ logger.error("Caught RestProcessingException with Status Code: {}", restProcessingException.getStatusCode(),
+ restProcessingException);
+ if (restProcessingException.getStatusCode() == HttpStatus.CONFLICT.value()) {
+ throw new VnfPkgConflictException("A conflict occurred with the state of the resource,\n"
+ + "due to the attribute: onboardingState not being set to ONBOARDED.");
+ }
+ }
+ throw new EtsiCatalogManagerRequestFailureException("Internal Server Error Occurred.");
+ }
+
+ @Override
+ public Optional<InlineResponse2001[]> getVnfPackages() {
+ try {
+ final ResponseEntity<VnfPkgInfo[]> response =
+ httpServiceProvider.getHttpResponse(etsiCatalogUrlProvider.getVnfPackagesUrl(), VnfPkgInfo[].class);
+ logger.info("getVnfPackages Request to ETSI Catalog Manager Status Code: {}",
+ response.getStatusCodeValue());
+ if (response.getStatusCode() == HttpStatus.OK) {
+ if (response.hasBody()) {
+ final VnfPkgInfo[] vnfPackages = response.getBody();
+ final InlineResponse2001[] responses = new InlineResponse2001[vnfPackages.length];
+ for (int index = 0; index < vnfPackages.length; index++) {
+ if (conversionService.canConvert(vnfPackages[index].getClass(), InlineResponse2001.class)) {
+ final InlineResponse2001 inlineResponse2001 =
+ conversionService.convert(vnfPackages[index], InlineResponse2001.class);
+ if (inlineResponse2001 != null) {
+ responses[index] = inlineResponse2001;
+ }
+ }
+ logger.error("Unable to find Converter for response class: {}", vnfPackages[index].getClass());
+ }
+ return Optional.ofNullable(responses);
+ }
+ logger.error("Received response without body ...");
+ }
+ logger.error("Unexpected status code received {}", response.getStatusCode());
+ return Optional.empty();
+ } catch (final InvalidRestRequestException invalidRestRequestException) {
+ logger.error("Caught InvalidRestRequestException", invalidRestRequestException);
+ throw new VnfPkgBadRequestException("Error: Bad Request Received");
+ } catch (final HttpResouceNotFoundException httpResouceNotFoundException) {
+ logger.error("Caught HttpResouceNotFoundException", httpResouceNotFoundException);
+ throw new VnfPkgNotFoundException("No Vnf Packages found");
+ } catch (final RestProcessingException restProcessingException) {
+ logger.error("Caught RestProcessingException with Status Code: {}", restProcessingException.getStatusCode(),
+ restProcessingException);
+ throw new EtsiCatalogManagerRequestFailureException("Internal Server Error Occurred.");
+ }
+ }
+
+ @Override
+ public Optional<InlineResponse2001> getVnfPackage(final String vnfPkgId) {
+ try {
+ final ResponseEntity<VnfPkgInfo> response = httpServiceProvider
+ .getHttpResponse(etsiCatalogUrlProvider.getVnfPackageUrl(vnfPkgId), VnfPkgInfo.class);
+ logger.info("getVnfPackage Request for vnfPkgId {} to ETSI Catalog Manager Status Code: {}", vnfPkgId,
+ response.getStatusCodeValue());
+ if (response.getStatusCode() == HttpStatus.OK) {
+ if (response.hasBody()) {
+ final VnfPkgInfo vnfPkgInfo = response.getBody();
+ if (conversionService.canConvert(vnfPkgInfo.getClass(), InlineResponse2001.class)) {
+ return Optional.ofNullable(conversionService.convert(vnfPkgInfo, InlineResponse2001.class));
+ }
+ logger.error("Unable to find Converter for response class: {}", vnfPkgInfo.getClass());
+ }
+ logger.error("Received response without body ....");
+ }
+ return Optional.empty();
+ } catch (final InvalidRestRequestException invalidRestRequestException) {
+ logger.error("Caught InvalidRestRequestException", invalidRestRequestException);
+ throw new VnfPkgBadRequestException("Error: Bad Request Received");
+ } catch (final HttpResouceNotFoundException httpResouceNotFoundException) {
+ logger.error("Caught HttpResouceNotFoundException", httpResouceNotFoundException);
+ throw new VnfPkgNotFoundException("No Vnf Package found with vnfPkgId: " + vnfPkgId);
+ } catch (final RestProcessingException restProcessingException) {
+ logger.error("Caught RestProcessingException with Status Code: {}", restProcessingException.getStatusCode(),
+ restProcessingException);
+ throw new EtsiCatalogManagerRequestFailureException("Internal Server Error Occurred.");
+ }
+ }
+
+ @Override
+ public Optional<byte[]> getVnfPackageVnfd(final String vnfPkgId) {
+ final String vnfRequestUrl = etsiCatalogUrlProvider.getVnfPackageVnfdUrl(vnfPkgId);
+ final String vnfRequestName = "getVnfPackageVnfd";
+ return requestVnfElement(vnfPkgId, vnfRequestUrl, vnfRequestName);
+ }
+
+ private Optional<byte[]> requestVnfElement(final String vnfPkgId, final String vnfRequestUrl,
+ final String vnfRequestName) {
+ try {
+ final ResponseEntity<byte[]> response = httpServiceProvider.getHttpResponse(vnfRequestUrl, byte[].class);
+ logger.info("{} Request to ETSI Catalog Manager Status Code: {}", vnfRequestName,
+ response.getStatusCodeValue());
+ if (response.getStatusCode() == HttpStatus.OK) {
+ return Optional.ofNullable(response.getBody());
+ }
+ } catch (final HttpResouceNotFoundException httpResouceNotFoundException) {
+ logger.error("Caught HttpResouceNotFoundException", httpResouceNotFoundException);
+ throw new VnfPkgNotFoundException("No Vnf Package found with vnfPkgId: " + vnfPkgId);
+ } catch (final RestProcessingException restProcessingException) {
+ logger.error("Caught RestProcessingException with Status Code: {}", restProcessingException.getStatusCode(),
+ restProcessingException);
+ if (restProcessingException.getStatusCode() == HttpStatus.CONFLICT.value()) {
+ throw new VnfPkgConflictException("A conflict occurred with the state of the resource,\n"
+ + "due to the attribute: onboardingState not being set to ONBOARDED.");
+ }
+ }
+ throw new EtsiCatalogManagerRequestFailureException("Internal Server Error Occurred.");
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java
new file mode 100644
index 0000000000..8382212d51
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java
@@ -0,0 +1,102 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
+
+import static org.slf4j.LoggerFactory.getLogger;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+/**
+ * Provides the URLs for the REST Requests to the ETSI Catalog Manager.
+ *
+ * @author gareth.roper@est.tech
+ */
+@Service
+public class EtsiCatalogUrlProvider {
+
+ private static final Logger logger = getLogger(EtsiCatalogUrlProvider.class);
+
+ @Value("${etsi-catalog-manager.vnfpkgm.endpoint}")
+ private String etsiCatalogManagerEndpoint;
+
+ public EtsiCatalogUrlProvider() {}
+
+ /**
+ * Get the URL for retrieving the Package Content from the ETSI Catalog.".
+ *
+ * @param vnfPkgId The ID of the VNF Package
+ * @return the URL for the GET operation
+ */
+ public String getVnfPackageContentUrl(final String vnfPkgId) {
+ final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/package_content";
+ logger.info("getEtsiCatalogVnfPackageContentUrl: {}", url);
+ return url;
+ }
+
+ /**
+ * Get the URL for retrieving VNF packages information from ETSI Catalog.".
+ *
+ * @return the URL for the GET operation
+ */
+ public String getVnfPackagesUrl() {
+ final String url = etsiCatalogManagerEndpoint + "/vnf_packages";
+ logger.info("getEtsiCatalogVnfPackagesEndpoint: {}", url);
+ return url;
+ }
+
+ /**
+ * Get the URL for retrieving specific VNF package information from the ETSI Catalog.".
+ *
+ * @param vnfPkgId The ID of the VNF Package
+ * @return the URL for the GET operation
+ */
+ public String getVnfPackageUrl(final String vnfPkgId) {
+ final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId;
+ logger.info("getEtsiCatalogVnfPackageEndpoint: {}", url);
+ return url;
+ }
+
+ /**
+ * Get the URL for retrieving VNF Package Artifacts
+ *
+ * @param vnfPkgId The ID of the VNF Package
+ * @param artifactPath The path to the Artifact
+ * @return the URL for the GET operation
+ */
+ public String getVnfPackageArtifactUrl(final String vnfPkgId, final String artifactPath) {
+ final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/artifacts/" + artifactPath;
+ logger.info("getVnfPackageArtifactUrl: {}", url);
+ return url;
+ }
+
+ /**
+ * Get the URL for retrieving VNF packages vnfd from ETSI Catalog.
+ *
+ * @param vnfPkgId The ID of the VNF Package
+ * @return the URL for the GET operation
+ */
+ public String getVnfPackageVnfdUrl(final String vnfPkgId) {
+ final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/vnfd";
+ logger.info("getEtsiCatalogVnfPackageVnfd: {}", url);
+ return url;
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
index 93312cfa64..073fc93107 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
@@ -21,7 +21,6 @@
package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
-import com.google.gson.Gson;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStore;
@@ -29,7 +28,7 @@ import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
-import java.util.Iterator;
+import java.util.ListIterator;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -41,8 +40,10 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
import org.onap.aai.domain.yang.EsrSystemInfo;
import org.onap.aai.domain.yang.EsrVnfm;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
+import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration;
import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.so.rest.service.HttpRestServiceProviderImpl;
import org.slf4j.Logger;
@@ -53,10 +54,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.json.GsonHttpMessageConverter;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.web.client.RestTemplate;
@@ -65,7 +64,7 @@ import org.springframework.web.client.RestTemplate;
* Configures the HttpRestServiceProvider for REST call to a VNFM.
*/
@Configuration
-public class VnfmServiceProviderConfiguration {
+public class VnfmServiceProviderConfiguration extends AbstractServiceProviderConfiguration {
private static final Logger logger = LoggerFactory.getLogger(VnfmServiceProviderConfiguration.class);
private Map<String, HttpRestServiceProvider> mapOfVnfmIdToHttpRestServiceProvider = new ConcurrentHashMap<>();
@@ -131,17 +130,6 @@ public class VnfmServiceProviderConfiguration {
return new OAuth2RestTemplate(resourceDetails);
}
- private void setGsonMessageConverter(final RestTemplate restTemplate) {
- final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator();
- while (iterator.hasNext()) {
- if (iterator.next() instanceof MappingJackson2HttpMessageConverter) {
- iterator.remove();
- }
- }
- final Gson gson = new JSON().getGson();
- restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
- }
-
private void setTrustStore(final RestTemplate restTemplate) {
SSLContext sslContext;
try {
@@ -167,4 +155,14 @@ public class VnfmServiceProviderConfiguration {
}
}
+ private void removeSpringClientFilter(final RestTemplate restTemplate) {
+ ListIterator<ClientHttpRequestInterceptor> interceptorIterator = restTemplate.getInterceptors().listIterator();
+ while (interceptorIterator.hasNext()) {
+ ClientHttpRequestInterceptor interceptor = interceptorIterator.next();
+ if (interceptor instanceof SOSpringClientFilter || interceptor instanceof SpringClientPayloadFilter) {
+ interceptorIterator.remove();
+ }
+ }
+ }
+
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
index 948f5fc269..d898de3ad0 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
@@ -26,10 +26,13 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest;
+import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException;
+import org.onap.so.rest.exceptions.RestProcessingException;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -115,21 +118,27 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider {
try {
response = getHttpServiceProvider(vnfm).postHttpRequest(terminateVnfRequest, vnfSelfLink + "/terminate",
Void.class);
+ } catch (final RestProcessingException restProcessingException) {
+ if (restProcessingException.getStatusCode() == HttpStatus.CONFLICT.value()) {
+ InlineResponse201 vnf = getVnf(vnfm, vnfSelfLink).get();
+ if (vnf.getInstantiationState().equals(InstantiationStateEnum.NOT_INSTANTIATED)) {
+ return JobManager.ALREADY_COMPLETED_OPERATION_ID;
+ } else {
+ final String errorMessage =
+ "Terminate request to " + vnfSelfLink + " resulted in exception" + terminateVnfRequest;
+ logger.error(errorMessage, restProcessingException);
+ throw new VnfmRequestFailureException(errorMessage, restProcessingException);
+ }
+ }
} catch (final Exception exception) {
final String errorMessage =
"Terminate request to " + vnfSelfLink + " resulted in exception" + terminateVnfRequest;
logger.error(errorMessage, exception);
throw new VnfmRequestFailureException(errorMessage, exception);
}
- if (response.getStatusCode() != HttpStatus.ACCEPTED) {
- final String errorMessage = "Terminate request to " + vnfSelfLink + " returned status code: "
- + response.getStatusCode() + ", request: " + terminateVnfRequest;
- logger.error(errorMessage);
- throw new VnfmRequestFailureException(errorMessage);
- }
+ checkIfResponseIsAcceptable(response, vnfSelfLink, terminateVnfRequest);
final String locationHeader = response.getHeaders().get("Location").iterator().next();
return locationHeader.substring(locationHeader.lastIndexOf("/") + 1);
-
}
@Override
@@ -162,6 +171,22 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider {
}
}
+ private void checkIfResponseIsAcceptable(ResponseEntity<Void> response, String vnfSelfLink,
+ TerminateVnfRequest terminateVnfRequest) {
+ if (response == null) {
+ final String errorMessage =
+ "Terminate request to " + vnfSelfLink + ", response is null, " + "request: " + terminateVnfRequest;
+ logger.error(errorMessage);
+ throw new VnfmRequestFailureException(errorMessage);
+ }
+ if (response.getStatusCode() != HttpStatus.ACCEPTED) {
+ final String errorMessage = "Terminate request to " + vnfSelfLink + ", returned status code: "
+ + response.getStatusCode() + ", request: " + terminateVnfRequest;
+ logger.error(errorMessage);
+ throw new VnfmRequestFailureException(errorMessage);
+ }
+ }
+
private HttpRestServiceProvider getHttpServiceProvider(final EsrVnfm vnfm) {
return vnfmServiceProviderConfiguration.getHttpRestServiceProvider(vnfm);
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
index 68fdb79444..3de94ebe05 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
@@ -29,6 +29,7 @@ import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.JobNotFoundException;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.vnfmadapter.v1.model.OperationEnum;
import org.onap.vnfmadapter.v1.model.OperationStateEnum;
import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum;
@@ -42,6 +43,7 @@ import org.springframework.stereotype.Component;
*/
@Component
public class JobManager {
+ public static final String ALREADY_COMPLETED_OPERATION_ID = "alreadyCompleted";
private static final String SEPARATOR = "_";
private static Logger logger = getLogger(JobManager.class);
private final Map<String, VnfmOperation> mapOfJobIdToVnfmOperation = Maps.newConcurrentMap();
@@ -87,6 +89,11 @@ public class JobManager {
throw new JobNotFoundException("No job found with ID: " + jobId);
}
+ if (vnfmOperation.getOperationId().equals(ALREADY_COMPLETED_OPERATION_ID)) {
+ response.setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
+ return response.operationState(OperationStateEnum.COMPLETED);
+ }
+
if (vnfmOperation.isVnfDeleted()) {
response.setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
return response.operationState(getOperationState(vnfmOperation, null));
@@ -116,7 +123,7 @@ public class JobManager {
response.setVnfInstanceId(operation.getVnfInstanceId());
return response;
- } catch (final Exception exception) {
+ } catch (final HttpResouceNotFoundException exception) {
logger.error("Exception encountered trying to get operation status for operation id "
+ vnfmOperation.getOperationId(), exception);
return response.operationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.WAITING_FOR_STATUS);
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
index 0aad91e5be..a885721b76 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
@@ -24,6 +24,7 @@ import com.google.common.base.Optional;
import java.util.Map;
import org.onap.aai.domain.yang.EsrVnfm;
import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.Relationship;
import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider;
import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper;
import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider;
@@ -81,21 +82,25 @@ public class LifecycleManager {
* @return the response to the request
*/
public CreateVnfResponse createVnf(final String vnfIdInAai, final CreateVnfRequest request) {
- final GenericVnf genericVnf = getGenericVnfFromAai(vnfIdInAai);
+ GenericVnf genericVnf = getGenericVnfFromAai(vnfIdInAai);
EsrVnfm vnfm = aaiHelper.getAssignedVnfm(genericVnf);
checkIfVnfAlreadyExistsInVnfm(vnfm, genericVnf);
if (vnfm == null) {
vnfm = aaiHelper.selectVnfm(genericVnf);
- aaiHelper.addRelationshipFromGenericVnfToVnfm(genericVnf, vnfm.getVnfmId());
+ aaiServiceProvider.invokePutGenericVnfToVnfmRelationship(genericVnf, vnfm.getVnfmId());
}
- aaiHelper.addRelationshipFromGenericVnfToTenant(genericVnf, request.getTenant());
final InlineResponse201 vnfmResponse = sendCreateRequestToVnfm(request, genericVnf, vnfIdInAai, vnfm);
logger.info("Create response: {}", vnfmResponse);
genericVnf.setSelflink(getSelfLink(vnfmResponse, vnfm));
- aaiServiceProvider.invokePutGenericVnf(genericVnf);
+
+ GenericVnf genericVnfPatch = new GenericVnf();
+ genericVnfPatch.setVnfId(genericVnf.getVnfId());
+ genericVnfPatch.setSelflink(genericVnf.getSelflink());
+ aaiServiceProvider.invokePatchGenericVnf(genericVnfPatch);
+
final String vnfIdInVnfm = vnfmResponse.getId();
final OamIpAddressSource oamIpAddressSource = extractOamIpAddressSource(request);
@@ -203,6 +208,10 @@ public class LifecycleManager {
final EsrVnfm vnfm = getAssignedVnfm(genericVnf);
final String operationId = sendTerminateRequestToVnfm(vnfm, genericVnf);
+
+ if (operationId.equals(JobManager.ALREADY_COMPLETED_OPERATION_ID)) {
+ sendDeleteRequestToVnfm(genericVnf);
+ }
final String jobId = jobManager.createJob(vnfm.getVnfmId(), operationId, true);
return new DeleteVnfResponse().jobId(jobId);
@@ -230,4 +239,27 @@ public class LifecycleManager {
}
return vnfm;
}
+
+ private void sendDeleteRequestToVnfm(final GenericVnf genericVnf) {
+
+ vnfmServiceProvider.deleteVnf(aaiHelper.getAssignedVnfm(genericVnf), genericVnf.getSelflink());
+
+ final GenericVnf genericVnfPatch = new GenericVnf();
+ genericVnfPatch.setVnfId(genericVnf.getVnfId());
+ genericVnfPatch.setOrchestrationStatus("Assigned");
+ genericVnfPatch.setSelflink("");
+ aaiServiceProvider.invokePatchGenericVnf(genericVnfPatch);
+
+ for (final Relationship relationship : genericVnf.getRelationshipList().getRelationship()) {
+ if (relationship.getRelatedTo().equals("vserver")) {
+ aaiServiceProvider.invokeDeleteVserver(
+ aaiHelper.getRelationshipData(relationship, "cloud-region.cloud-owner"),
+ aaiHelper.getRelationshipData(relationship, "cloud-region.cloud-region-id"),
+ aaiHelper.getRelationshipData(relationship, "tenant.tenant-id"),
+ aaiHelper.getRelationshipData(relationship, "vserver.vserver-id"));
+ }
+ }
+
+
+ }
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java
index eb912c8775..63ec4ccc57 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java
@@ -97,10 +97,12 @@ public class NotificationHandler implements Runnable {
private void handleVnfInstantiateCompleted() {
final GenericVnf genericVnf = aaiServiceProvider
.invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref()).getGenericVnf().get(0);
- setOamIpAddress(genericVnf, vnfInstance);
- genericVnf.setOrchestrationStatus("Created");
- aaiServiceProvider.invokePutGenericVnf(genericVnf);
+ final GenericVnf genericVnfPatch = new GenericVnf();
+ genericVnfPatch.setVnfId(genericVnf.getVnfId());
+ setOamIpAddress(genericVnfPatch, vnfInstance);
+ genericVnfPatch.setOrchestrationStatus("Created");
+ aaiServiceProvider.invokePatchGenericVnf(genericVnfPatch);
addVservers(vnfLcmOperationOccurrenceNotification, genericVnf.getVnfId(), vnfInstance.getVimConnectionInfo());
@@ -143,28 +145,31 @@ public class NotificationHandler implements Runnable {
}
private void handleVnfTerminateFailed() {
- final GenericVnf genericVnf = aaiServiceProvider
- .invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref()).getGenericVnf().get(0);
- deleteVservers(vnfLcmOperationOccurrenceNotification, genericVnf);
- jobManager.notificationProcessedForOperation(vnfLcmOperationOccurrenceNotification.getVnfLcmOpOccId(), false);
+ try {
+ final GenericVnf genericVnf = aaiServiceProvider
+ .invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref()).getGenericVnf().get(0);
+ deleteVserversFromAai(vnfLcmOperationOccurrenceNotification, genericVnf);
+ } finally {
+ jobManager.notificationProcessedForOperation(vnfLcmOperationOccurrenceNotification.getVnfLcmOpOccId(),
+ false);
+ }
}
private void handleVnfTerminateCompleted() {
- final GenericVnf genericVnf = aaiServiceProvider
- .invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref()).getGenericVnf().get(0);
- deleteVservers(vnfLcmOperationOccurrenceNotification, genericVnf);
-
- boolean deleteSuccessful = false;
+ GenericVnf genericVnf = null;
+ boolean vServersDeletedFromAai = false;
+ boolean identifierDeletedFromVnfm = false;
+ boolean genericVnfUpdated = false;
try {
- vnfmServiceProvider.deleteVnf(aaiHelper.getAssignedVnfm(genericVnf), genericVnf.getSelflink());
- deleteSuccessful = true;
+ genericVnf = aaiServiceProvider.invokeQueryGenericVnf(vnfInstance.getLinks().getSelf().getHref())
+ .getGenericVnf().get(0);
+ vServersDeletedFromAai = deleteVserversFromAai(vnfLcmOperationOccurrenceNotification, genericVnf);
+ identifierDeletedFromVnfm = deleteVnfIdentifierOnVnfm(genericVnf);
+ genericVnfUpdated = patchVnfInAai(genericVnf.getVnfId(), "Assigned", identifierDeletedFromVnfm ? "" : null);
} finally {
jobManager.notificationProcessedForOperation(vnfLcmOperationOccurrenceNotification.getVnfLcmOpOccId(),
- deleteSuccessful);
+ vServersDeletedFromAai && identifierDeletedFromVnfm && genericVnfUpdated);
jobManager.vnfDeleted(vnfLcmOperationOccurrenceNotification.getVnfLcmOpOccId());
- genericVnf.setOrchestrationStatus("Assigned");
- genericVnf.setSelflink("");
- aaiServiceProvider.invokePutGenericVnf(genericVnf);
}
}
@@ -180,27 +185,69 @@ public class NotificationHandler implements Runnable {
getVimConnectionInfo(vimConnectionIdToVimConnectionInfo, vnfc);
if (ChangeTypeEnum.ADDED.equals(vnfc.getChangeType())) {
final Vserver vserver = aaiHelper.createVserver(vnfc);
- aaiHelper.addRelationshipFromVserverVnfToGenericVnf(vserver, vnfId);
-
aaiServiceProvider.invokePutVserver(getCloudOwner(vimConnectionInfo), getCloudRegion(vimConnectionInfo),
getTenant(vimConnectionInfo), vserver);
+
+ aaiServiceProvider.invokePutVserverToVnfRelationship(getCloudOwner(vimConnectionInfo),
+ getCloudRegion(vimConnectionInfo), getTenant(vimConnectionInfo), vserver, vnfId);
}
}
}
- private void deleteVservers(final VnfLcmOperationOccurrenceNotification notification, final GenericVnf vnf) {
- for (final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc : notification.getAffectedVnfcs()) {
- if (ChangeTypeEnum.REMOVED.equals(vnfc.getChangeType())) {
+ private boolean deleteVserversFromAai(final VnfLcmOperationOccurrenceNotification notification,
+ final GenericVnf vnf) {
+ try {
+ for (final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc : notification.getAffectedVnfcs()) {
+ if (ChangeTypeEnum.REMOVED.equals(vnfc.getChangeType())) {
- final Relationship relationshipToVserver = aaiHelper.deleteRelationshipWithDataValue(vnf, "vserver",
- "vserver.vserver-id", vnfc.getComputeResource().getResourceId());
+ final Relationship relationshipToVserver = aaiHelper.deleteRelationshipWithDataValue(vnf, "vserver",
+ "vserver.vserver-id", vnfc.getComputeResource().getResourceId());
- aaiServiceProvider.invokeDeleteVserver(
- aaiHelper.getRelationshipData(relationshipToVserver, "cloud-region.cloud-owner"),
- aaiHelper.getRelationshipData(relationshipToVserver, "cloud-region.cloud-region-id"),
- aaiHelper.getRelationshipData(relationshipToVserver, "tenant.tenant-id"),
- vnfc.getComputeResource().getResourceId());
+ aaiServiceProvider.invokeDeleteVserver(
+ aaiHelper.getRelationshipData(relationshipToVserver, "cloud-region.cloud-owner"),
+ aaiHelper.getRelationshipData(relationshipToVserver, "cloud-region.cloud-region-id"),
+ aaiHelper.getRelationshipData(relationshipToVserver, "tenant.tenant-id"),
+ vnfc.getComputeResource().getResourceId());
+ }
}
+ return true;
+ } catch (final Exception exception) {
+ logger.error(
+ "Error encountered deleting vservers based on received notification, AAI may not be updated correctly "
+ + vnfLcmOperationOccurrenceNotification,
+ exception);
+ return false;
+ }
+ }
+
+ private boolean deleteVnfIdentifierOnVnfm(GenericVnf genericVnf) {
+ try {
+ vnfmServiceProvider.deleteVnf(aaiHelper.getAssignedVnfm(genericVnf), genericVnf.getSelflink());
+ return true;
+ } catch (Exception exception) {
+ logger.error("Exception deleting the identifier " + genericVnf.getSelflink()
+ + " from the VNFM. The VNF has been terminated successfully but the identifier will remain on the VNFM.",
+ exception);
+ return false;
+ }
+ }
+
+ private boolean patchVnfInAai(final String vnfId, final String orchestrationStatus, final String selfLink) {
+ try {
+ final GenericVnf genericVnfPatch = new GenericVnf();
+ genericVnfPatch.setVnfId(vnfId);
+ genericVnfPatch.setOrchestrationStatus(orchestrationStatus);
+ if (selfLink != null) {
+ genericVnfPatch.setSelflink(selfLink);
+ }
+ aaiServiceProvider.invokePatchGenericVnf(genericVnfPatch);
+ return true;
+ } catch (final Exception exception) {
+ logger.error(
+ "Error encountered setting orchestration status and/or self link based on received notification, AAI may not be updated correctly "
+ + vnfLcmOperationOccurrenceNotification,
+ exception);
+ return false;
}
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java
new file mode 100644
index 0000000000..9d8e29b3f9
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java
@@ -0,0 +1,188 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.onap.so.adapters.vnfmadapter.Constants.APPLICATION_ZIP;
+import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL;
+import static org.slf4j.LoggerFactory.getLogger;
+import java.util.Optional;
+import javax.ws.rs.core.MediaType;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * Controller for handling the VNF Package Management. For further information please read:
+ * https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_nfv-sol003v020501p.pdf Use the section number
+ * above each endpoint to find the corresponding section in the above document.
+ *
+ * @author gareth.roper@est.tech
+ */
+@Controller
+@RequestMapping(value = PACKAGE_MANAGEMENT_BASE_URL, consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+public class Sol003PackageManagementController {
+
+ private final EtsiCatalogServiceProvider etsiCatalogServiceProvider;
+ private static final String LOG_REQUEST_RECEIVED = "VNF PackageManagement Controller: {} {} {} {}";
+ private static final Logger logger = getLogger(Sol003PackageManagementController.class);
+
+ @Autowired
+ Sol003PackageManagementController(final EtsiCatalogServiceProvider etsiCatalogServiceProvider) {
+ this.etsiCatalogServiceProvider = etsiCatalogServiceProvider;
+ }
+
+ /**
+ * GET VNF packages information. Will return zero or more VNF package representations that match the attribute
+ * filter. These representations will be in a list. Section Number: 10.4.2
+ *
+ * @return An Array of all VNF packages. Object: InlineResponse2001[] Response Code: 200 OK
+ */
+ @GetMapping(value = "/vnf_packages", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<?> getVnfPackages() {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackages.");
+ final Optional<InlineResponse2001[]> response = etsiCatalogServiceProvider.getVnfPackages();
+ if (response.isPresent()) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackages Response: ", HttpStatus.OK);
+ return ResponseEntity.ok().body(response.get());
+ }
+ final String errorMessage = "An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"vnf_packages\" \n"
+ + "endpoint.";
+ logger.error(errorMessage);
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(buildProblemDetails(errorMessage));
+ }
+
+ /**
+ * GET VNF package information. Will return a specific VNF package representation that match the attribute filter.
+ * Section Number: 10.4.3
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to query.
+ * @return A VNF package based on vnfPkgId. Object: VnfPkgInfo Response Code: 200 OK
+ */
+ @GetMapping(value = "/vnf_packages/{vnfPkgId}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<?> getVnfPackage(@PathVariable("vnfPkgId") final String vnfPkgId) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackage: ", vnfPkgId);
+ final Optional<InlineResponse2001> response = etsiCatalogServiceProvider.getVnfPackage(vnfPkgId);
+ if (response.isPresent()) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackage Response: ", HttpStatus.OK);
+ return ResponseEntity.ok().body(response.get());
+ }
+ final String errorMessage = "An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"vnf_packages\" by vnfPkgId: \""
+ + vnfPkgId + "\" \n" + "endpoint.";
+ logger.error(errorMessage);
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(buildProblemDetails(errorMessage));
+ }
+
+ /**
+ * GET VNFD, from VNF package. Will return a copy of the file representing the VNFD or a ZIP file that contains the
+ * file/multiple files representing the VNFD specified. Section Number: 10.4.4
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to retrieve the VNFD from.
+ * @return The VNFD of a VNF Package as a single file or within a ZIP file. Object: byte[] Response Code: 200 OK
+ */
+ @GetMapping(value = "/vnf_packages/{vnfPkgId}/vnfd",
+ produces = {MediaType.TEXT_PLAIN, APPLICATION_ZIP, MediaType.APPLICATION_JSON})
+ public ResponseEntity<byte[]> getVnfPackageVnfd(@PathVariable("vnfPkgId") final String vnfPkgId) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageVnfd Endpoint Invoked with VNF Package ID: ", vnfPkgId);
+ final Optional<byte[]> response = etsiCatalogServiceProvider.getVnfPackageVnfd(vnfPkgId);
+ if (response.isPresent()) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageVnfd Response: ", HttpStatus.OK);
+ return new ResponseEntity(response.get(), HttpStatus.OK);
+ }
+ final String errorMessage = "An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"vnfd\" \n"
+ + "endpoint.";
+
+ logger.error(errorMessage);
+ return new ResponseEntity(buildProblemDetails(errorMessage), HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+ /**
+ * GET Package Content, from VNF Package. Will return a copy of the VNF package file that you specified. Section
+ * Number: 10.4.5
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to retrieve the "package_content" from.
+ * @return The Package Content of a VNF Package. Object: byte[] Response Code: 200 OK
+ */
+ @GetMapping(value = "/vnf_packages/{vnfPkgId}/package_content",
+ produces = {MediaType.APPLICATION_JSON, APPLICATION_ZIP, MediaType.APPLICATION_OCTET_STREAM})
+ public ResponseEntity<?> getVnfPackageContent(@PathVariable("vnfPkgId") final String vnfPkgId) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageContent Endpoint Invoked with VNF Package ID: ", vnfPkgId);
+ final Optional<byte[]> response = etsiCatalogServiceProvider.getVnfPackageContent(vnfPkgId);
+ if (response.isPresent()) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageContent Response: ", HttpStatus.OK);
+ return ResponseEntity.ok().body(response.get());
+ }
+ final String errorMessage = "An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"package_content\" \n"
+ + "endpoint.";
+ logger.error(errorMessage);
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(buildProblemDetails(errorMessage));
+ }
+
+ /**
+ * GET Artifact, from VNF Package Will return a the content of the artifact that you specified. Section Number:
+ * 10.4.6
+ *
+ * @param vnfPkgId The ID of the VNF Package that you want to retrieve an artifact from.
+ * @param artifactPath The path of the artifact that you want to retrieve.
+ * @return An Artifact from a VNF Package. Object: byte[] Response Code: 200 OK
+ */
+ @GetMapping(value = "/vnf_packages/{vnfPkgId}/artifacts/{artifactPath}",
+ produces = {MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
+ public ResponseEntity<?> getVnfPackageArtifact(@PathVariable("vnfPkgId") final String vnfPkgId,
+ @PathVariable("artifactPath") final String artifactPath) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageArtifact: vnfPkgId= ", vnfPkgId, " artifactPath=",
+ artifactPath);
+ final Optional<byte[]> response = etsiCatalogServiceProvider.getVnfPackageArtifact(vnfPkgId, artifactPath);
+ if (response.isPresent()) {
+ logger.info(LOG_REQUEST_RECEIVED, "getVnfPackageArtifact Response: ", HttpStatus.OK);
+ return ResponseEntity.ok().body(response.get());
+ }
+ final String errorMessage = "An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the\n GET \"vnf_packages\" by vnfPkgId: \""
+ + vnfPkgId + "\" for artifactPath: \"" + artifactPath + "\"\n" + "endpoint.";
+ logger.error(errorMessage);
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(buildProblemDetails(errorMessage));
+ }
+
+ /**
+ * Builds the ProblemDetails Object, using the provided error message.
+ *
+ * @param detail The error message retrieved from the exception thrown.
+ * @return ProblemDetails Object, containing error information.
+ */
+ private ProblemDetails buildProblemDetails(final String detail) {
+ final ProblemDetails problemDetails = new ProblemDetails();
+ problemDetails.setDetail(detail);
+ return problemDetails;
+ }
+
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementController.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementController.java
new file mode 100644
index 0000000000..16650d4a3d
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementController.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL;
+import static org.slf4j.LoggerFactory.getLogger;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2002;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest;
+import org.slf4j.Logger;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * Controller for handling the Subscription Management. For further information please read:
+ * https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_nfv-sol003v020501p.pdf Use the section number
+ * above each endpoint to find the corresponding section in the above document.
+ *
+ * @author gareth.roper@est.tech
+ */
+@Controller
+@RequestMapping(value = PACKAGE_MANAGEMENT_BASE_URL, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML},
+ consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+public class Sol003SubscriptionManagementController {
+
+ private static final String LOG_REQUEST_RECEIVED = "Subscription Management Controller: {} {}";
+ private static final Logger logger = getLogger(Sol003SubscriptionManagementController.class);
+
+ /**
+ * POST Subscribe request. Will send request and respond with the subscription that you subscribed to, if
+ * successful. Section Number: 10.4.7
+ *
+ * @param pkgmSubscriptionRequest This includes the details of the subscription to be created.
+ * @return The subscription requested, if successful. Object: InlineRespone2002 Response Code: 201 Created Response
+ * Code: 303 Duplicate Subscription
+ */
+ @PostMapping(value = "/subscriptions")
+ public ResponseEntity<InlineResponse2002> postSubscriptionRequest(
+ @RequestBody final PkgmSubscriptionRequest pkgmSubscriptionRequest) {
+ logger.info(LOG_REQUEST_RECEIVED, " postSubscriptionRequest: ", pkgmSubscriptionRequest);
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * GET all subscriptions. Will return a list of all subscriptions currently active. Section Number: 10.4.7
+ *
+ * @return All of the current active subscriptions. Object: List<InlineResponse2002> Response Code: 200 OK
+ */
+ @GetMapping(value = "/subscriptions")
+ public ResponseEntity<List<InlineResponse2002>> getSubscriptions() {
+ logger.info(LOG_REQUEST_RECEIVED, " getSubscriptions.");
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * GET a specific subscription, by subscriptionId. Section Number: 10.4.8
+ *
+ * @param subscriptionId The ID of the subscription that you wish to retrieve.
+ * @return A subscription based on subscriptionId. Object: InlineResponse2002 Response Code: 200 OK
+ */
+ @GetMapping(value = "/subscriptions/{subscriptionId}")
+ public ResponseEntity<InlineResponse2002> getSubscription(
+ @PathVariable("subscriptionId") final String subscriptionId) {
+ logger.info(LOG_REQUEST_RECEIVED, " Getting Subscription: ", subscriptionId);
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * DELETE a specific subscription, by subscriptionId. Section Number: 10.4.7
+ *
+ * @param subscriptionId The ID of the subscription that you wish to delete.
+ * @return Empty response if successful. Object: Void Response Code: 204 No Content
+ */
+ @DeleteMapping(value = "/subscriptions/{subscriptionId}")
+ public ResponseEntity<Void> deleteSubscription(@PathVariable("subscriptionId") final String subscriptionId) {
+ logger.info(LOG_REQUEST_RECEIVED, " Deleting Subscription: ", subscriptionId);
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+
+}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/exception/GlobalExceptionHandler.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java
index 1ea92b39ad..dbdc354f4e 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/exception/GlobalExceptionHandler.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java
@@ -17,31 +17,27 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
-package org.onap.svnfm.simulator.exception;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
-import org.springframework.web.HttpMediaTypeNotSupportedException;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
+ * Exception for an ETSI Catalog Manager Request Failure
*
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author ronan.kenny@est.tech
+ * @author gareth.roper@est.tech
*/
-@ControllerAdvice
-public class GlobalExceptionHandler {
+@ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR)
+public class EtsiCatalogManagerRequestFailureException extends RuntimeException {
+
+ private static final long serialVersionUID = 66862444537194516L;
- private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
+ public EtsiCatalogManagerRequestFailureException(final String message) {
+ super(message);
+ }
- @ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)
- @ExceptionHandler(HttpMediaTypeNotSupportedException.class)
- public void handleConflict() {
- final String error = "Media type Not Supported";
- logger.error(error);
+ @Override
+ public synchronized Throwable fillInStackTrace() {
+ return this;
}
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java
new file mode 100644
index 0000000000..a49063a72f
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
+
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails;
+import org.onap.so.adapters.vnfmadapter.rest.Sol003PackageManagementController;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.EtsiCatalogManagerRequestFailureException;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgBadRequestException;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgConflictException;
+import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgNotFoundException;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+
+/**
+ * Exception Handler for the Package Management Controller {@link Sol003PackageManagementController Sol003Controller}
+ *
+ * @author gareth.roper@est.tech
+ */
+@ControllerAdvice(assignableTypes = Sol003PackageManagementController.class)
+
+public class Sol003PackageManagementControllerExceptionHandler {
+
+ @ExceptionHandler(EtsiCatalogManagerRequestFailureException.class)
+ public ResponseEntity<ProblemDetails> handleEtsiCatalogManagerRequestFailureException(
+ final EtsiCatalogManagerRequestFailureException etsiCatalogManagerRequestFailureException) {
+ final ProblemDetails problemDetails = new ProblemDetails();
+ problemDetails.setDetail(etsiCatalogManagerRequestFailureException.getMessage());
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(problemDetails);
+ }
+
+ @ExceptionHandler(VnfPkgConflictException.class)
+ public ResponseEntity<ProblemDetails> handleVnfPkgConflictException(
+ final VnfPkgConflictException vnfPkgConflictException) {
+ final ProblemDetails problemDetails = new ProblemDetails();
+ problemDetails.setDetail(vnfPkgConflictException.getMessage());
+ return ResponseEntity.status(HttpStatus.CONFLICT).body(problemDetails);
+ }
+
+ @ExceptionHandler(VnfPkgNotFoundException.class)
+ public ResponseEntity<ProblemDetails> handleVnfPkgNotFoundException(
+ final VnfPkgNotFoundException vnfPkgNotFoundException) {
+ final ProblemDetails problemDetails = new ProblemDetails();
+ problemDetails.setDetail(vnfPkgNotFoundException.getMessage());
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(problemDetails);
+ }
+
+ @ExceptionHandler(VnfPkgBadRequestException.class)
+ public ResponseEntity<ProblemDetails> handleVnfPkgBadRequestException(
+ final VnfPkgBadRequestException vnfPkgBadRequestException) {
+ final ProblemDetails problemDetails = new ProblemDetails();
+ problemDetails.setDetail(vnfPkgBadRequestException.getMessage());
+ return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(problemDetails);
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java
new file mode 100644
index 0000000000..211131c2a4
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+/**
+ * Exception for a Vnfpkg Bad Request failure, due to state of resource.
+ *
+ * @author andrew.a.lamb@est.tech
+ */
+@ResponseStatus(code = HttpStatus.BAD_REQUEST)
+public class VnfPkgBadRequestException extends RuntimeException {
+
+ private static final long serialVersionUID = 3301317418914258411L;
+
+ public VnfPkgBadRequestException(final String message) {
+ super(message);
+ }
+
+ @Override
+ public synchronized Throwable fillInStackTrace() {
+ return this;
+ }
+}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2ResourceServer.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java
index 18fb1a9461..f9aa2a0e21 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2ResourceServer.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java
@@ -17,20 +17,27 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
-package org.onap.svnfm.simulator.oauth;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
-
-@Configuration
-@EnableResourceServer
-@Profile("oauth-authentication")
/**
- * Enforces oauth token based authentication when the spring profile "oauth-authentication" is active
+ * Exception for a VnfPkg Conflict failures, due to state of resource.
+ *
+ * @author gareth.roper@est.tech
*/
-public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
+@ResponseStatus(code = HttpStatus.CONFLICT)
+public class VnfPkgConflictException extends RuntimeException {
+
+ private static final long serialVersionUID = 26862444537198441L;
+
+ public VnfPkgConflictException(final String message) {
+ super(message);
+ }
+ @Override
+ public synchronized Throwable fillInStackTrace() {
+ return this;
+ }
}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmRepository.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java
index f28b54a137..c15e7052ab 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmRepository.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java
@@ -17,19 +17,27 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.adapters.vnfmadapter.rest.exceptions;
-package org.onap.svnfm.simulator.repository;
-
-import java.util.Optional;
-import org.onap.svnfm.simulator.model.VnfInstance;
-import org.springframework.data.repository.CrudRepository;
-import org.springframework.data.repository.query.Param;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
/**
+ * Exception for VnfPkg Not Found Failures
*
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
+ * @author gareth.roper@est.tech
*/
-public interface VnfmRepository extends CrudRepository<VnfInstance, String> {
- public Optional<VnfInstance> findById(@Param("id") String id);
+@ResponseStatus(code = HttpStatus.NOT_FOUND)
+public class VnfPkgNotFoundException extends RuntimeException {
+
+ private static final long serialVersionUID = 26862444537198441L;
+
+ public VnfPkgNotFoundException(final String message) {
+ super(message);
+ }
+
+ @Override
+ public synchronized Throwable fillInStackTrace() {
+ return this;
+ }
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
index 4434d2edd9..57dc08f3b5 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
@@ -23,22 +23,13 @@ spring:
http:
converters:
preferred-json-mapper: gson
-
-http:
- client:
- ssl:
- trust-store: classpath:org.onap.so.trust.jks
- trust-store-password: ',sx#.C*W)]wVgJC6ccFHI#:H'
-
+ main:
+ allow-bean-definition-overriding: true
+
server:
port: 9092
tomcat:
max-threads: 50
- ssl:
- key-alias: so@so.onap.org
- key--store-password: 'ywsqCy:EEo#j}HJHM7z^Rk[L'
- key-store: classpath:so-vnfm-adapter.p12
- key-store-type: PKCS12
mso:
key: 07a7159d3bf51a0e53be7a8f89699be7
@@ -55,7 +46,7 @@ sdc:
endpoint: http://sdc.onap/1234A
vnfmadapter:
- endpoint: https://so-vnfm-adapter.onap:9092
+ endpoint: http://so-vnfm-adapter.onap:9092
#Actuator
management:
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
index 89a2c102f4..cd92d987d7 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
@@ -73,6 +73,7 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201L
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIVersion;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -212,12 +213,16 @@ public class Sol003LcnControllerTest {
final Vserver vserver = (Vserver) bodyArgument2.getAllValues().get(0);
assertEquals("myVnfc1", vserver.getVserverId());
- final Relationship relationship = vserver.getRelationshipList().getRelationship().get(0);
- assertEquals("generic-vnf", relationship.getRelatedTo());
- assertEquals("tosca.relationships.HostedOn", relationship.getRelationshipLabel());
- assertEquals("/aai/v15/network/generic-vnfs/generic-vnf/myTestVnfId", relationship.getRelatedLink());
- assertEquals("generic-vnf.vnf-id", relationship.getRelationshipData().get(0).getRelationshipKey());
- assertEquals("myTestVnfId", relationship.getRelationshipData().get(0).getRelationshipValue());
+
+ final ArgumentCaptor<AAIResourceUri> uriArgument1Connect = ArgumentCaptor.forClass(AAIResourceUri.class);
+ final ArgumentCaptor<AAIResourceUri> uriArgument2Connect = ArgumentCaptor.forClass(AAIResourceUri.class);
+ verify(aaiResourcesClient, timeout(1000)).connect(uriArgument1Connect.capture(), uriArgument2Connect.capture());
+ assertEquals(
+ "/cloud-infrastructure/cloud-regions/cloud-region/" + CLOUD_OWNER + "/" + REGION + "/tenants/tenant/"
+ + TENANT_ID + "/vservers/vserver/myVnfc1",
+ uriArgument1Connect.getAllValues().get(0).build().toString());
+ assertEquals("/network/generic-vnfs/generic-vnf/myTestVnfId",
+ uriArgument2Connect.getAllValues().get(0).build().toString());
}
@Test
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
new file mode 100644
index 0000000000..c5194cf27e
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
@@ -0,0 +1,655 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Checksum;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.UriLink;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VNFPKGMLinkSerializer;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageArtifactInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001;
+import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.client.MockRestServiceServer;
+import org.springframework.web.client.RestTemplate;
+import com.google.gson.Gson;
+
+/**
+ * @author gareth.roper@est.tech
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class Sol003PackageManagementControllerTest {
+
+ @LocalServerPort
+ private int port;
+
+ @Autowired
+ @Qualifier(CONFIGURABLE_REST_TEMPLATE)
+ private RestTemplate testRestTemplate;
+
+ @Autowired
+ private TestRestTemplate restTemplate;
+
+ private static final String VNF_PACKAGE_ID = "myVnfPackageId";
+ private static final String ARTIFACT_PATH = "myArtifactPath";
+ private static final String MSB_BASE_URL = "http://msb-iag.onap:80/api/vnfpkgm/v1/vnf_packages";
+ private static final String VNFPKGM_BASE_URL = PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages";
+ private static final String localhostUrl = "http://localhost:";
+ private static final String GET_VNF_PACKAGES_URL = "";
+ private static final String GET_VNF_PACKAGE_BY_ID_URL = "/" + VNF_PACKAGE_ID;
+ private static final String VNFD_ID = "vnfdId";
+ private static final String VNF_PROVIDER = "vnfProvider";
+ private static final String VNF_PRODUCT_NAME = "vnfProductName";
+ private static final String VNF_SOFTWARE_VERSION = "vnfSoftwareVersion";
+ private static final String VNFD_VERSION = "vnfdVersion";
+ private static final String ALGORITHM = "algorithm";
+ private static final String HASH = "hash";
+ private static final String URI_HREF = "uriHref";
+
+ private MockRestServiceServer mockRestServer;
+ private BasicHttpHeadersProvider basicHttpHeadersProvider;
+ private final Gson gson = new Gson();
+
+ public Sol003PackageManagementControllerTest() {}
+
+ @Before
+ public void setUp() {
+ final MockRestServiceServer.MockRestServiceServerBuilder builder =
+ MockRestServiceServer.bindTo(testRestTemplate);
+ builder.ignoreExpectOrder(true);
+ mockRestServer = builder.build();
+ basicHttpHeadersProvider = new BasicHttpHeadersProvider();
+ }
+
+ @Test
+ public void testGetPackageContent_ValidArray_Success() {
+ final byte[] responseArray = buildByteArrayWithRandomData(10);
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM));
+
+ final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/"
+ + VNF_PACKAGE_ID + "/package_content";
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ final ResponseEntity<byte[]> responseEntity =
+ restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+
+ assertEquals(byte[].class, responseEntity.getBody().getClass());
+ assertArrayEquals(responseEntity.getBody(), responseArray);
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_Conflict_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.CONFLICT, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_NotFound_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_UnauthorizedClient_Fail() {
+ final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/"
+ + VNF_PACKAGE_ID + "/package_content";
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ restTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_InternalServerError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_BadRequest_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageContent_UnauthorizedServer_InternalError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testGetPackageContent_SuccessResponseFromServerWithNullPackage_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withSuccess());
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content");
+
+ assertEquals(ProblemDetails.class, responseEntity.getBody().getClass());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testGetPackageArtifact_ValidArray_Success() {
+ final byte[] responseArray = buildByteArrayWithRandomData(10);
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM));
+
+ final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/"
+ + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH;
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ final ResponseEntity<byte[]> responseEntity =
+ restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+
+ assertEquals(byte[].class, responseEntity.getBody().getClass());
+ assertArrayEquals(responseEntity.getBody(), responseArray);
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_Conflict_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT));
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.CONFLICT, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_NotFound_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND));
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_UnauthorizedClient_Fail() {
+ final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/"
+ + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH;
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ final ResponseEntity<ProblemDetails> responseEntity =
+ restTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_InternalServerError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_BadRequest_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST));
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageArtifact_UnauthorizedServer_InternalError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testGetPackageArtifact_SuccessResponseFromServerWithNullPackage_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH))
+ .andExpect(method(HttpMethod.GET)).andRespond(withSuccess());
+
+ final ResponseEntity<ProblemDetails> responseEntity =
+ sendHttpRequest(VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH);
+
+ assertNotNull(responseEntity.getBody());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testVnfPackagesReceivedAsInlineResponse2001ListIfGetVnfPackagesSuccessful() {
+ final VnfPkgInfo[] responses = createVnfPkgArray();
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(gson.toJson(responses), MediaType.APPLICATION_JSON));
+
+ final String testURL = localhostUrl + port + VNFPKGM_BASE_URL;
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+
+ final ResponseEntity<InlineResponse2001[]> responseEntity = restTemplate.withBasicAuth("test", "test")
+ .exchange(testURL, HttpMethod.GET, request, InlineResponse2001[].class);
+
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ assertNotNull(responseEntity.getBody());
+ final InlineResponse2001[] inlineResponse2001array = responseEntity.getBody();
+ final InlineResponse2001 inlineResponse2001 = inlineResponse2001array[0];
+ assertEquals(VNF_PACKAGE_ID, inlineResponse2001.getId());
+ assertEquals(VNFD_ID, inlineResponse2001.getVnfdId());
+ assertEquals(VNFD_ID, inlineResponse2001.getSoftwareImages().get(0).getId());
+ assertEquals(VNF_PRODUCT_NAME, inlineResponse2001.getSoftwareImages().get(0).getName());
+ assertEquals(ALGORITHM, inlineResponse2001.getChecksum().getAlgorithm());
+ assertEquals(HASH, inlineResponse2001.getChecksum().getHash());
+ assertEquals(ARTIFACT_PATH, inlineResponse2001.getAdditionalArtifacts().get(0).getArtifactPath());
+ assertEquals(ALGORITHM, inlineResponse2001.getAdditionalArtifacts().get(0).getChecksum().getAlgorithm());
+ assertEquals(HASH, inlineResponse2001.getAdditionalArtifacts().get(0).getChecksum().getHash());
+ assertEquals(URI_HREF, inlineResponse2001.getLinks().getSelf().getHref());
+ }
+
+ @Test
+ public void test400BadRequestInfoReceivedAsProblemDetailsIfGetVnfPackagesIs400BadRequest() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.BAD_REQUEST));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL);
+ assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
+
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("Error: Bad Request Received", problemDetails.getDetail());
+ }
+
+ @Test
+ public void test404NotFoundInfoReceivedAsProblemDetailsIfGetVnfPackagesIs404NotFound() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.NOT_FOUND));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL);
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("No Vnf Packages found", problemDetails.getDetail());
+ }
+
+ @Test
+ public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackagesReturns500InternalServerError() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("Internal Server Error Occurred.", problemDetails.getDetail());
+ }
+
+ @Test
+ public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackagesReturnsANullPackage() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)).andRespond(withSuccess());
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"vnf_packages\" \n"
+ + "endpoint.", problemDetails.getDetail());
+ }
+
+ @Test
+ public void testVnfPackageReceivedAsInlineResponse2001IfGetVnfPackageByIdSuccessful() {
+ final VnfPkgInfo response = createVnfPkgInfo(VNF_PACKAGE_ID);
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(gson.toJson(response), MediaType.APPLICATION_JSON));
+
+ final String testURL = localhostUrl + port + VNFPKGM_BASE_URL + "/" + VNF_PACKAGE_ID;
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ final ResponseEntity<InlineResponse2001> responseEntity = restTemplate.withBasicAuth("test", "test")
+ .exchange(testURL, HttpMethod.GET, request, InlineResponse2001.class);
+
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ assertNotNull(responseEntity.getBody());
+ final InlineResponse2001 inlineResponse2001 = responseEntity.getBody();
+ assertEquals(VNF_PACKAGE_ID, inlineResponse2001.getId());
+ assertEquals(VNFD_ID, inlineResponse2001.getVnfdId());
+ assertEquals(VNFD_ID, inlineResponse2001.getSoftwareImages().get(0).getId());
+ assertEquals(VNF_PRODUCT_NAME, inlineResponse2001.getSoftwareImages().get(0).getName());
+ assertEquals(ALGORITHM, inlineResponse2001.getChecksum().getAlgorithm());
+ assertEquals(HASH, inlineResponse2001.getChecksum().getHash());
+ assertEquals(ARTIFACT_PATH, inlineResponse2001.getAdditionalArtifacts().get(0).getArtifactPath());
+ assertEquals(ALGORITHM, inlineResponse2001.getAdditionalArtifacts().get(0).getChecksum().getAlgorithm());
+ assertEquals(HASH, inlineResponse2001.getAdditionalArtifacts().get(0).getChecksum().getHash());
+ assertEquals(URI_HREF, inlineResponse2001.getLinks().getSelf().getHref());
+ }
+
+ @Test
+ public void test400BadRequestInfoReceivedAsProblemDetailsIfGetVnfPackageByIdIs400BadRequest() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.BAD_REQUEST));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL);
+
+ assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("Error: Bad Request Received", problemDetails.getDetail());
+ }
+
+ @Test
+ public void test404NotFoundInfoReceivedAsProblemDetailsIfGetVnfPackageByIdIs404NotFound() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.NOT_FOUND));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL);
+
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("No Vnf Package found with vnfPkgId: " + VNF_PACKAGE_ID, problemDetails.getDetail());
+ }
+
+ @Test
+ public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackageByIdReturns500InternalServerError() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET))
+ .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL);
+
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("Internal Server Error Occurred.", problemDetails.getDetail());
+ }
+
+ @Test
+ public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackageByIdReturnsANullPackage() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess());
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+
+ assertNotNull(responseEntity.getBody());
+ final ProblemDetails problemDetails = responseEntity.getBody();
+ assertEquals("An error occurred, a null response was received by the\n"
+ + " Sol003PackageManagementController from the EtsiCatalogManager using the GET \"vnf_packages\" by vnfPkgId: \""
+ + VNF_PACKAGE_ID + "\" \n" + "endpoint.", problemDetails.getDetail());
+ }
+
+ // The below test method is here to improve code coverage and provide a foundation for writing future tests
+ @Test
+ public void testGetPackageVnfd_ValidArray_Success() {
+ final byte[] responseArray = buildByteArrayWithRandomData(10);
+
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET))
+ .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM));
+
+ final String testURL =
+ "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/" + VNF_PACKAGE_ID + "/vnfd";
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ final ResponseEntity<byte[]> responseEntity =
+ restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request, byte[].class);
+
+ assertEquals(byte[].class, responseEntity.getBody().getClass());
+ assertArrayEquals(responseEntity.getBody(), responseArray);
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_Conflict_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.CONFLICT, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_NotFound_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_UnauthorizedClient_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_InternalServerError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_BadRequest_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testOnGetPackageVnfd_UnauthorizedServer_InternalError_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertTrue(responseEntity.getBody() instanceof ProblemDetails);
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ @Test
+ public void testGetPackageVnfd_SuccessResponseFromServerWithNullPackage_Fail() {
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withSuccess());
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
+
+ assertEquals(ProblemDetails.class, responseEntity.getBody().getClass());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
+ }
+
+ // Simply returns a byte array filled with random data, for use in the tests.
+ private byte[] buildByteArrayWithRandomData(final int sizeInKb) {
+ final Random rnd = new Random();
+ final byte[] b = new byte[sizeInKb * 1024]; // converting kb to byte
+ rnd.nextBytes(b);
+ return b;
+ }
+
+ private ResponseEntity<ProblemDetails> sendHttpRequest(final String url) {
+ final String testURL = localhostUrl + port + VNFPKGM_BASE_URL + "/" + url;
+ final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
+ return restTemplate.withBasicAuth("test", "test").exchange(testURL, HttpMethod.GET, request,
+ ProblemDetails.class);
+ }
+
+ private VnfPkgInfo[] createVnfPkgArray() {
+ final VnfPkgInfo[] vnfPkgInfoArray = new VnfPkgInfo[1];
+ final VnfPkgInfo vnfPkgInfo = createVnfPkgInfo(VNF_PACKAGE_ID);
+ vnfPkgInfoArray[0] = vnfPkgInfo;
+ return vnfPkgInfoArray;
+ }
+
+ private VnfPkgInfo createVnfPkgInfo(final String vnfPackageId) {
+ final VnfPkgInfo vnfPkgInfo = new VnfPkgInfo();
+ vnfPkgInfo.setId(vnfPackageId);
+ vnfPkgInfo.setVnfdId(VNFD_ID);
+ vnfPkgInfo.setVnfProvider(VNF_PROVIDER);
+ vnfPkgInfo.setVnfProductName(VNF_PRODUCT_NAME);
+ vnfPkgInfo.setVnfSoftwareVersion(VNF_SOFTWARE_VERSION);
+ vnfPkgInfo.setVnfdVersion(VNFD_VERSION);
+ vnfPkgInfo.setChecksum(createVnfPkgChecksum());
+ vnfPkgInfo.setSoftwareImages(createSoftwareImages());
+ vnfPkgInfo.setAdditionalArtifacts(createAdditionalArtifacts());
+ vnfPkgInfo.setLinks(createVNFPKGMLinkSerializerLinks());
+ return vnfPkgInfo;
+ }
+
+ private Checksum createVnfPkgChecksum() {
+ final Checksum checksum = new Checksum();
+ checksum.setAlgorithm(ALGORITHM);
+ checksum.setHash(HASH);
+ return checksum;
+ }
+
+ private List<VnfPackageSoftwareImageInfo> createSoftwareImages() {
+ final List<VnfPackageSoftwareImageInfo> softwareImages = new ArrayList<>();
+ final VnfPackageSoftwareImageInfo vnfPackageSoftwareImageInfo = new VnfPackageSoftwareImageInfo();
+ vnfPackageSoftwareImageInfo.setId(VNFD_ID);
+ vnfPackageSoftwareImageInfo.setName(VNF_PRODUCT_NAME);
+ vnfPackageSoftwareImageInfo.setProvider("");
+ vnfPackageSoftwareImageInfo.setVersion("");
+ vnfPackageSoftwareImageInfo.setChecksum(createVnfPkgChecksum());
+ vnfPackageSoftwareImageInfo
+ .setContainerFormat(VnfPackageSoftwareImageInfo.ContainerFormatEnum.fromValue("AKI"));
+ softwareImages.add(vnfPackageSoftwareImageInfo);
+ return softwareImages;
+ }
+
+ private List<VnfPackageArtifactInfo> createAdditionalArtifacts() {
+ final List<VnfPackageArtifactInfo> vnfPackageArtifactInfos = new ArrayList<>();
+ final VnfPackageArtifactInfo vnfPackageArtifactInfo =
+ new VnfPackageArtifactInfo().artifactPath(ARTIFACT_PATH).checksum(createVnfPkgChecksum());
+ vnfPackageArtifactInfos.add(vnfPackageArtifactInfo);
+ return vnfPackageArtifactInfos;
+ }
+
+ private VNFPKGMLinkSerializer createVNFPKGMLinkSerializerLinks() {
+ final UriLink uriLink = new UriLink().href(URI_HREF);
+ final VNFPKGMLinkSerializer vnfpkgmLinkSerializer = new VNFPKGMLinkSerializer().self(uriLink);
+ return vnfpkgmLinkSerializer;
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementControllerTest.java
new file mode 100644
index 0000000000..ed1880035a
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003SubscriptionManagementControllerTest.java
@@ -0,0 +1,70 @@
+package org.onap.so.adapters.vnfmadapter.rest;
+
+import static org.junit.Assert.assertEquals;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import java.net.URISyntaxException;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2002;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.client.MockRestServiceServer;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author gareth.roper@est.tech
+ */
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class Sol003SubscriptionManagementControllerTest {
+
+ private static final String subscriptionId = "mySubscriptionId";
+
+ @Autowired
+ @Qualifier(CONFIGURABLE_REST_TEMPLATE)
+ private RestTemplate testRestTemplate;
+
+ @Autowired
+ private Sol003SubscriptionManagementController controller;
+
+ @Before
+ public void setUp() throws Exception {
+ MockRestServiceServer.bindTo(testRestTemplate).build();
+ }
+
+ @Test
+ public void postSubscriptionRequest() throws URISyntaxException, InterruptedException {
+ final PkgmSubscriptionRequest pkgmSubscriptionRequest = new PkgmSubscriptionRequest();
+ final ResponseEntity<InlineResponse2002> response = controller.postSubscriptionRequest(pkgmSubscriptionRequest);
+ assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
+ }
+
+ @Test
+ public void getSubscriptions() throws URISyntaxException, InterruptedException {
+ final ResponseEntity<List<InlineResponse2002>> response = controller.getSubscriptions();
+ assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
+ }
+
+ @Test
+ public void deleteSubscription() throws URISyntaxException, InterruptedException {
+ final ResponseEntity<Void> response = controller.deleteSubscription(subscriptionId);
+ assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
+ }
+
+ @Test
+ public void getSubscription() throws URISyntaxException, InterruptedException {
+ final ResponseEntity<InlineResponse2002> response = controller.getSubscription(subscriptionId);
+ assertEquals(HttpStatus.NOT_IMPLEMENTED, response.getStatusCode());
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
index fe55907420..fca50ea6f2 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.content;
@@ -38,6 +39,7 @@ import java.util.Optional;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -56,10 +58,12 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIVersion;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
@@ -175,20 +179,14 @@ public class VnfmAdapterControllerTest {
assertEquals("/network/generic-vnfs/generic-vnf/myTestVnfId", uriArgument.getValue().build().toString());
assertEquals("myTestVnfId", genericVnfArgument.getValue().getVnfId());
- assertEquals(2, genericVnfArgument.getValue().getRelationshipList().getRelationship().size());
- final Relationship vnfmRelationship =
- genericVnfArgument.getValue().getRelationshipList().getRelationship().get(0);
- assertEquals("esr-vnfm", vnfmRelationship.getRelatedTo());
- assertEquals("tosca.relationships.DependsOn", vnfmRelationship.getRelationshipLabel());
- assertEquals("/aai/v15/external-system/esr-vnfm-list/esr-vnfm/vnfm2", vnfmRelationship.getRelatedLink());
-
- final Relationship tenantRelationship =
- genericVnfArgument.getValue().getRelationshipList().getRelationship().get(1);
- assertEquals("tenant", tenantRelationship.getRelatedTo());
- assertEquals(
- "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/myTestCloudOwner/myTestRegion/tenants/tenant/myTestTenantId",
- tenantRelationship.getRelatedLink());
+ final ArgumentCaptor<AAIResourceUri> uriArgument1Connect = ArgumentCaptor.forClass(AAIResourceUri.class);
+ final ArgumentCaptor<AAIResourceUri> uriArgument2Connect = ArgumentCaptor.forClass(AAIResourceUri.class);
+ verify(aaiResourcesClient, timeout(1000)).connect(uriArgument1Connect.capture(), uriArgument2Connect.capture());
+ assertEquals("/external-system/esr-vnfm-list/esr-vnfm/vnfm2",
+ uriArgument1Connect.getAllValues().get(0).build().toString());
+ assertEquals("/network/generic-vnfs/generic-vnf/myTestVnfId",
+ uriArgument2Connect.getAllValues().get(0).build().toString());
// check the job status
@@ -262,6 +260,7 @@ public class VnfmAdapterControllerTest {
}
@Test
+ @Ignore
public void createVnf_UnauthorizedUser_Returns401() throws Exception {
final TestRestTemplate restTemplateWrongPassword = new TestRestTemplate("test", "wrongPassword");
final Tenant tenant = new Tenant().cloudOwner(CLOUD_OWNER).regionName(REGION).tenantId(TENANT_ID);
@@ -327,6 +326,40 @@ public class VnfmAdapterControllerTest {
}
@Test
+ public void deleteVnf_VnfAlreadyTerminated_Returns202AndJobId() throws Exception {
+ final TestRestTemplate restTemplate = new TestRestTemplate("test", "test");
+
+ final GenericVnf genericVnf = setUpGenericVnfInMockAai("vnfmType1");
+ addSelfLinkToGenericVnf(genericVnf);
+ addRelationshipFromGenericVnfToVnfm(genericVnf, "vnfm1");
+ setUpVnfmsInMockAai();
+
+ mockRestServer.expect(requestTo("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm/terminate"))
+ .andRespond(withStatus(HttpStatus.CONFLICT).contentType(MediaType.APPLICATION_JSON));
+
+ final InlineResponse201 reponse = new InlineResponse201();
+ reponse.setInstantiationState(InstantiationStateEnum.NOT_INSTANTIATED);
+ mockRestServer.expect(requestTo(new URI("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm")))
+ .andRespond(withSuccess(gson.toJson(reponse), MediaType.APPLICATION_JSON));
+
+ mockRestServer.expect(requestTo("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm"))
+ .andRespond(withStatus(HttpStatus.NO_CONTENT).contentType(MediaType.APPLICATION_JSON));
+
+ final RequestEntity<Void> request = RequestEntity
+ .delete(new URI("http://localhost:" + port + "/so/vnfm-adapter/v1/vnfs/myTestVnfId"))
+ .accept(MediaType.APPLICATION_JSON).header("X-ONAP-RequestId", "myRequestId")
+ .header("X-ONAP-InvocationID", "myInvocationId").header("Content-Type", "application/json").build();
+ final ResponseEntity<DeleteVnfResponse> deleteVnfResponse =
+ restTemplate.exchange(request, DeleteVnfResponse.class);
+ assertEquals(202, deleteVnfResponse.getStatusCode().value());
+ assertNotNull(deleteVnfResponse.getBody().getJobId());
+
+ final ResponseEntity<QueryJobResponse> jobQueryResponse =
+ controller.jobQuery(deleteVnfResponse.getBody().getJobId(), "", "so", "1213");
+ assertEquals(OperationStateEnum.COMPLETED, jobQueryResponse.getBody().getOperationState());
+ }
+
+ @Test
public void deleteVnf_GenericVnfNotFound_Returns404() throws Exception {
final TestRestTemplate restTemplate = new TestRestTemplate("test", "test");
@@ -413,7 +446,8 @@ public class VnfmAdapterControllerTest {
private void addRelationshipFromGenericVnfToVnfm(final GenericVnf genericVnf, final String vnfmId) {
final Relationship relationshipToVnfm = new Relationship();
- relationshipToVnfm.setRelatedLink("/aai/v15/external-system/esr-vnfm-list/esr-vnfm/" + vnfmId);
+ relationshipToVnfm
+ .setRelatedLink("/aai/" + AAIVersion.LATEST + "/external-system/esr-vnfm-list/esr-vnfm/" + vnfmId);
relationshipToVnfm.setRelatedTo("esr-vnfm");
final RelationshipData relationshipData = new RelationshipData();
relationshipData.setRelationshipKey("esr-vnfm.vnfm-id");
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml
index 8cf8b51b9f..ae66464f29 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml
@@ -20,6 +20,8 @@ spring:
- username: vnfm
password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
role: BPEL-Client
+ main:
+ allow-bean-definition-overriding: true
mso:
key: 07a7159d3bf51a0e53be7a8f89699be7
@@ -52,3 +54,7 @@ management:
prometheus:
enabled: true # Whether exporting of metrics to Prometheus is enabled.
step: 1m # Step size (i.e. reporting frequency) to use.
+
+etsi-catalog-manager:
+ vnfpkgm:
+ endpoint: http://msb-iag.onap:80/api/vnfpkgm/v1
diff --git a/adapters/pom.xml b/adapters/pom.xml
index bd7bebafa0..b96c3744c3 100644
--- a/adapters/pom.xml
+++ b/adapters/pom.xml
@@ -22,6 +22,8 @@
<module>mso-vfc-adapter</module>
<module>mso-openstack-adapters</module>
<module>mso-vnfm-adapter</module>
+ <module>mso-ve-vnfm-adapter</module>
+ <module>so-appc-orchestrator</module>
</modules>
<dependencies>
diff --git a/adapters/so-appc-orchestrator/pom.xml b/adapters/so-appc-orchestrator/pom.xml
new file mode 100644
index 0000000000..717bcee3fc
--- /dev/null
+++ b/adapters/so-appc-orchestrator/pom.xml
@@ -0,0 +1,221 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>adapters</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.onap.so.adapters</groupId>
+ <artifactId>so-appc-orchestrator</artifactId>
+ <packaging>jar</packaging>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>1.8</java.version>
+ <appc.client.version>1.6.0-SNAPSHOT</appc.client.version>
+ </properties>
+ <name>so-appc-orchestrator</name>
+ <description>MSO APPC-C Orchestrator</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${springboot.version}</version>
+ <configuration>
+ <mainClass>org.onap.so.adapters.appc.orchestrator.AppcOrchestratorApplication</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>extract-docker-file</id>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>fabric8-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>start</id>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-parameters</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/AllTestsTestSuite.java</include>
+ </includes>
+ <parallel>suites</parallel>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.jvnet.jax-ws-commons
+ </groupId>
+ <artifactId>
+ jaxws-maven-plugin
+ </artifactId>
+ <versionRange>
+ [2.3,)
+ </versionRange>
+ <goals>
+ <goal>wsgen</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore>
+ </ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-registry-prometheus</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-external-task-client</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>MSOCommonBPMN</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so.adapters</groupId>
+ <artifactId>mso-adapter-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>pl.pragmatists</groupId>
+ <artifactId>JUnitParams</artifactId>
+ <version>1.0.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/AppcOrchestratorApplication.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/AppcOrchestratorApplication.java
new file mode 100644
index 0000000000..258c95ac89
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/AppcOrchestratorApplication.java
@@ -0,0 +1,46 @@
+/*-
+ * ============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.appc.orchestrator;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @since Version 1.0
+ *
+ */
+
+@SpringBootApplication(scanBasePackages = {"org.onap"})
+public class AppcOrchestratorApplication {
+
+ private static final String LOGS_DIR = "logs_dir";
+
+ private static void setLogsDir() {
+ if (System.getProperty(LOGS_DIR) == null) {
+ System.getProperties().setProperty(LOGS_DIR, "./logs/appcorch/");
+ }
+ }
+
+ public static void main(String... args) {
+ SpringApplication.run(AppcOrchestratorApplication.class, args);
+ setLogsDir();
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallback.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallback.java
new file mode 100644
index 0000000000..1f73000299
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallback.java
@@ -0,0 +1,84 @@
+/*-
+ * ============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.appc.orchestrator.client;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.appc.client.lcm.api.ResponseHandler;
+import org.onap.appc.client.lcm.exceptions.AppcClientException;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.so.adapters.appc.orchestrator.client.StatusCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ApplicationControllerCallback<T> implements ResponseHandler<T> {
+
+ private static final Logger logger = LoggerFactory.getLogger(ApplicationControllerCallback.class);
+
+ private final ExternalTask externalTask;
+ private final ExternalTaskService externalTaskService;
+ private final ApplicationControllerSupport appCSupport;
+
+ public ApplicationControllerCallback(ExternalTask externalTask, ExternalTaskService externalTaskService,
+ ApplicationControllerSupport appCSupport) {
+ this.externalTask = externalTask;
+ this.externalTaskService = externalTaskService;
+ this.appCSupport = appCSupport;
+ }
+
+ @Override
+ public void onResponse(T response) {
+ logger.info("ON RESPONSE IN CALLBACK");
+
+ Status status = appCSupport.getStatusFromGenericResponse(response);
+
+ logger.info("Status code is: " + status.getCode());
+ logger.info("Status message is: " + status.getMessage());
+
+ if (appCSupport.getFinalityOf(status)) {
+ logger.debug("Obtained final status, complete the task");
+ completeExternalTask(externalTask, externalTaskService, status);
+ } else {
+ logger.debug("Intermediate status, continue the task");
+ }
+ }
+
+ @Override
+ public void onException(AppcClientException exception) {
+
+ logger.info("ON EXCEPTION IN CALLBACK");
+ logger.info("Exception from APPC: " + exception.getMessage());
+ Status exceptionStatus = appCSupport.buildStatusFromAppcException(exception);
+ completeExternalTask(externalTask, externalTaskService, exceptionStatus);
+ }
+
+ private void completeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService,
+ Status status) {
+
+ if (appCSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) {
+ externalTaskService.complete(externalTask);
+ logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ } else {
+ logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage());
+ }
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerClient.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerClient.java
new file mode 100644
index 0000000000..20093be6a4
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerClient.java
@@ -0,0 +1,244 @@
+/*-
+ * ============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.appc.orchestrator.client;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.time.Instant;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+import org.onap.appc.client.lcm.api.AppcClientServiceFactoryProvider;
+import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory;
+import org.onap.appc.client.lcm.api.ApplicationContext;
+import org.onap.appc.client.lcm.api.LifeCycleManagerStateful;
+import org.onap.appc.client.lcm.exceptions.AppcClientException;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.appc.client.lcm.model.ActionIdentifiers;
+import org.onap.appc.client.lcm.model.CommonHeader;
+import org.onap.appc.client.lcm.model.Flags;
+import org.onap.appc.client.lcm.model.Flags.Force;
+import org.onap.appc.client.lcm.model.Flags.Mode;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.so.adapters.appc.orchestrator.client.StatusCategory;
+import org.onap.appc.client.lcm.model.Payload;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.appc.client.lcm.model.ZULU;
+
+@Component
+public class ApplicationControllerClient {
+
+ @Autowired
+ public Environment env;
+
+ public static final String DEFAULT_CONTROLLER_TYPE = "APPC";
+
+ private static final String CLIENT_NAME = "MSO";
+
+ private static final String API_VER = "2.00";
+ private static final String ORIGINATOR_ID = "MSO";
+ private static final int FLAGS_TTL = 65000;
+ private static Logger logger = LoggerFactory.getLogger(ApplicationControllerClient.class);
+
+ @Autowired
+ private ApplicationControllerSupport appCSupport;
+
+ // APPC gave us an API where the controllerType is configured in the
+ // client object, which is not what we asked for. We asked for an API
+ // in which the client would have additional methods that could take
+ // the controllerType as a parameter, so that we would not need to
+ // maintain multiple client objects. This map should be removed when
+ // the (hopefully short-term) controllerType becomes obsolete.
+
+ private String controllerType = DEFAULT_CONTROLLER_TYPE;
+
+ private static ConcurrentHashMap<String, LifeCycleManagerStateful> appCClients = new ConcurrentHashMap<>();
+
+ /**
+ * Creates an ApplicationControllerClient for the specified controller type.
+ *
+ * @param controllerType the controller type: "appc" or "sdnc".
+ */
+ public void setControllerType(String controllerType) {
+ if (controllerType == null) {
+ controllerType = DEFAULT_CONTROLLER_TYPE;
+ }
+ this.controllerType = controllerType.toUpperCase();
+ }
+
+ /**
+ * Gets the controller type.
+ *
+ * @return the controllertype
+ */
+ public String getControllerType() {
+ return controllerType;
+ }
+
+ /**
+ * Returns the AppC client object associated with this ApplicationControllerClient. AppC client objects are shared
+ * objects. One is created if it does not exist.
+ *
+ * @return the client object, or null if creation failed
+ */
+ public LifeCycleManagerStateful getAppCClient() {
+ return appCClients.computeIfAbsent(controllerType, k -> createAppCClient(k));
+ }
+
+ protected LifeCycleManagerStateful createAppCClient(String controllerType) {
+
+ try {
+ if (controllerType == null) {
+ controllerType = DEFAULT_CONTROLLER_TYPE;
+ }
+ controllerType = controllerType.toUpperCase();
+ return AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class)
+ .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties(controllerType));
+ } catch (AppcClientException e) {
+ logger.error("Error in getting LifeCycleManagerStateful: {}", e.getMessage(), e);
+ // This null value will cause NullPointerException when used later.
+ // Error handling could certainly be improved here.
+ return null;
+ }
+ }
+
+ public Status vnfCommand(Action action, String requestId, String vnfId, Optional<String> vserverId,
+ Optional<String> request, String controllerType, ApplicationControllerCallback listener)
+ throws ApplicationControllerOrchestratorException {
+ this.setControllerType(controllerType);
+ Status status;
+ ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
+ actionIdentifiers.setVnfId(vnfId);
+ if (vserverId.isPresent()) {
+ actionIdentifiers.setVserverId(vserverId.get());
+ }
+ Payload payload = null;
+ if (request.isPresent()) {
+ payload = new Payload(request.get());
+
+ }
+ status = runCommand(action, actionIdentifiers, payload, requestId, listener);
+ if (appCSupport.getCategoryOf(status).equals(StatusCategory.ERROR)) {
+ throw new ApplicationControllerOrchestratorException(status.getMessage(), status.getCode());
+ } else {
+ return status;
+ }
+ }
+
+
+ public Status runCommand(Action action, org.onap.appc.client.lcm.model.ActionIdentifiers actionIdentifiers,
+ org.onap.appc.client.lcm.model.Payload payload, String requestID, ApplicationControllerCallback listener)
+ throws ApplicationControllerOrchestratorException {
+ Status status;
+ Object requestObject;
+ requestObject = createRequest(action, actionIdentifiers, payload, requestID);
+ appCSupport.logLCMMessage(requestObject);
+ LifeCycleManagerStateful client = getAppCClient();
+ Method lcmMethod = appCSupport.getAPIMethod(action.name(), client, true);
+ try {
+ Object response = lcmMethod.invoke(client, requestObject, listener);
+ if (response != null) {
+ return appCSupport.getStatusFromGenericResponse(response);
+ } else {
+ return new Status();
+ }
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ throw new RuntimeException(String.format("%s : %s", "Unable to invoke action", action.toString()), e);
+ }
+ }
+
+ protected Properties getLCMProperties() {
+ return getLCMProperties("appc");
+ }
+
+ protected Properties getLCMProperties(String controllerType) {
+ Properties properties = new Properties();
+
+ properties.put("topic.read", this.env.getProperty("appc.client.topic.read.name"));
+ properties.put("topic.write", this.env.getProperty("appc.client.topic.write"));
+ properties.put("SDNC-topic.read", this.env.getProperty("appc.client.topic.sdnc.read"));
+ properties.put("SDNC-topic.write", this.env.getProperty("appc.client.topic.sdnc.write"));
+ properties.put("topic.read.timeout", this.env.getProperty("appc.client.topic.read.timeout"));
+ properties.put("client.response.timeout", this.env.getProperty("appc.client.response.timeout"));
+ properties.put("poolMembers", this.env.getProperty("appc.client.poolMembers"));
+ properties.put("controllerType", controllerType);
+ properties.put("client.key", this.env.getProperty("appc.client.key"));
+ properties.put("client.secret", this.env.getProperty("appc.client.secret"));
+ properties.put("client.name", CLIENT_NAME);
+ properties.put("service", this.env.getProperty("appc.client.service"));
+ return properties;
+ }
+
+ public Object createRequest(Action action, ActionIdentifiers identifier, Payload payload, String requestId) {
+ Object requestObject = appCSupport.getInput(action.name());
+
+
+ try {
+ CommonHeader commonHeader = buildCommonHeader(requestId);
+ requestObject.getClass().getDeclaredMethod("setCommonHeader", CommonHeader.class).invoke(requestObject,
+ commonHeader);
+ requestObject.getClass().getDeclaredMethod("setAction", Action.class).invoke(requestObject, action);
+ requestObject.getClass().getDeclaredMethod("setActionIdentifiers", ActionIdentifiers.class)
+ .invoke(requestObject, identifier);
+ if (payload != null) {
+ logger.info("payload in RunCommand: " + payload.getValue());
+ requestObject.getClass().getDeclaredMethod("setPayload", Payload.class).invoke(requestObject, payload);
+ }
+ } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
+ logger.error("Error building Appc request", e);
+ }
+ return requestObject;
+ }
+
+ private CommonHeader buildCommonHeader(String requestId) {
+ CommonHeader commonHeader = new CommonHeader();
+ commonHeader.setApiVer(API_VER);
+ commonHeader.setOriginatorId(ORIGINATOR_ID);
+ commonHeader.setRequestId(requestId == null ? UUID.randomUUID().toString() : requestId);
+ commonHeader.setSubRequestId(UUID.randomUUID().toString());
+ Flags flags = new Flags();
+ String flagsMode = "NORMAL";
+ Mode mode = Mode.valueOf(flagsMode);
+ flags.setMode(mode);
+ String flagsForce = "FALSE";
+ Force force = Force.valueOf(flagsForce);
+ flags.setForce(force);
+ flags.setTtl(FLAGS_TTL);
+ commonHeader.setFlags(flags);
+ Instant timestamp = Instant.now();
+ ZULU zulu = new ZULU(timestamp.toString());
+ commonHeader.setTimestamp(zulu);
+ return commonHeader;
+ }
+
+ public Flags createRequestFlags() {
+ Flags flags = new Flags();
+ flags.setTtl(6000);
+ return flags;
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerOrchestratorException.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerOrchestratorException.java
new file mode 100644
index 0000000000..cc980a489d
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerOrchestratorException.java
@@ -0,0 +1,37 @@
+/*-
+ * ============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.appc.orchestrator.client;
+
+
+public class ApplicationControllerOrchestratorException extends Exception {
+
+ private static final long serialVersionUID = 2594894543585595494L;
+ private final int appcCode;
+
+ public ApplicationControllerOrchestratorException(String message, int code) {
+ super(message);
+ appcCode = code;
+ }
+
+ public int getAppcCode() {
+ return appcCode;
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupport.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupport.java
new file mode 100644
index 0000000000..90ab24cb86
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupport.java
@@ -0,0 +1,207 @@
+/*-
+ * ============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.appc.orchestrator.client;
+
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import org.onap.appc.client.lcm.api.LifeCycleManagerStateful;
+import org.onap.appc.client.lcm.api.ResponseHandler;
+import org.onap.appc.client.lcm.exceptions.AppcClientException;
+import org.onap.appc.client.lcm.model.Status;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+
+
+@Component
+public class ApplicationControllerSupport {
+
+ private static final int ACCEPT_SERIES = 100;
+ private static final int ERROR_SERIES = 200;
+ private static final int REJECT_SERIES = 300;
+ private static final int SUCCESS_SERIES = 400;
+ private static final int SUCCESS_STATUS = SUCCESS_SERIES;
+ private static final int PARTIAL_SERIES = 500;
+ private static final int PARTIAL_SUCCESS_STATUS = PARTIAL_SERIES;
+ private static final int PARTIAL_FAILURE_STATUS = PARTIAL_SERIES + 1;
+
+ private static Logger logger = LoggerFactory.getLogger(ApplicationControllerSupport.class);
+ private String lcmModelPackage = "org.onap.appc.client.lcm.model";
+
+ /**
+ * @param action
+ * @return
+ * @throws ClassNotFoundException
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ */
+ public Object getInput(String action) {
+ try {
+ return getInputClass(action).newInstance();
+ } catch (IllegalAccessException | InstantiationException e) {
+ throw new RuntimeException(
+ String.format("%s : %s", "Unable to instantiate viable LCM Kit input class for action", action), e);
+ }
+ }
+
+ /**
+ * @param action
+ * @return
+ * @throws ClassNotFoundException
+ */
+ public Method getAPIMethod(String action, LifeCycleManagerStateful lcmStateful, boolean async) {
+ Method[] methods = lcmStateful.getClass().getMethods();
+ for (Method method : methods) {
+ if (method.getName().equalsIgnoreCase(action)) {
+ Class<?>[] methodParameterTypes = method.getParameterTypes();
+ if (methodParameterTypes.length > 0) {
+ if (getInputClass(action).equals(methodParameterTypes[0])) {
+ if (async) {
+ if (methodParameterTypes.length == 2
+ && ResponseHandler.class.isAssignableFrom(methodParameterTypes[1])) {
+ return method;
+ }
+ } else if (methodParameterTypes.length == 1) {
+ return method;
+ }
+ }
+ }
+ }
+ }
+ throw new RuntimeException(String.format("%s : %s, async=%b",
+ "Unable to derive viable LCM Kit API method for action", action, async));
+ }
+
+ public Status getStatusFromGenericResponse(Object response) {
+ Method statusReader = getBeanPropertyMethodFor(response.getClass(), "status", false);
+ if (statusReader != null) {
+ try {
+ return (Status) statusReader.invoke(response);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ logger.error("Unable to obtain status from LCM Kit response", e);
+ }
+ }
+ return new Status();
+ }
+
+ public StatusCategory getCategoryOf(Status status) {
+ int codeSeries = status.getCode() - (status.getCode() % 100);
+ switch (codeSeries) {
+ case ACCEPT_SERIES:
+ return StatusCategory.NORMAL;
+ case ERROR_SERIES:
+ case REJECT_SERIES:
+ return StatusCategory.ERROR;
+ case SUCCESS_SERIES:
+ return status.getCode() == SUCCESS_STATUS ? StatusCategory.NORMAL : StatusCategory.ERROR;
+ case PARTIAL_SERIES:
+ switch (status.getCode()) {
+ case PARTIAL_SUCCESS_STATUS:
+ return StatusCategory.NORMAL;
+ case PARTIAL_FAILURE_STATUS:
+ return StatusCategory.ERROR;
+ default:
+ return StatusCategory.WARNING;
+ }
+ default:
+ return StatusCategory.WARNING;
+ }
+ }
+
+ public boolean getFinalityOf(Status status) {
+ int codeSeries = status.getCode() - (status.getCode() % 100);
+ switch (codeSeries) {
+ case ACCEPT_SERIES:
+ case PARTIAL_SERIES:
+ return false;
+ case ERROR_SERIES:
+ case REJECT_SERIES:
+ case SUCCESS_SERIES:
+ return true;
+ default:
+ return true;
+ }
+ }
+
+ private Method getBeanPropertyMethodFor(Class<?> clazz, String propertyName, boolean isWriter) {
+ BeanInfo beanInfo;
+ try {
+ beanInfo = Introspector.getBeanInfo(clazz, Object.class);
+ } catch (IntrospectionException e) {
+ throw new RuntimeException(
+ String.format("Unable to produce bean property method for class : %s, property : %s, writer=%b",
+ clazz.getName(), propertyName, isWriter),
+ e);
+ }
+ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ if (propertyDescriptor.getName().equals(propertyName)) {
+ return isWriter ? propertyDescriptor.getWriteMethod() : propertyDescriptor.getReadMethod();
+ }
+ }
+ throw new RuntimeException(
+ String.format("Unable to produce bean property method for class : %s, property : %s, writer=%b",
+ clazz.getName(), propertyName, isWriter));
+ }
+
+ /**
+ * @param action
+ * @return
+ * @throws ClassNotFoundException
+ */
+ private Class<?> getInputClass(String action) {
+ try {
+ return Class.forName(lcmModelPackage + '.' + action + "Input");
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(String.format("%s : %s using package : %s",
+ "Unable to identify viable LCM Kit input class for action", action, lcmModelPackage), e);
+ }
+ }
+
+
+ public void logLCMMessage(Object message) {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.setSerializationInclusion(Include.NON_NULL);
+ ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter();
+ String inputAsJSON;
+ try {
+ inputAsJSON = writer.writeValueAsString(message);
+ logger.info("LCM Kit input message follows: {}", inputAsJSON);
+ } catch (JsonProcessingException e) {
+ logger.error("Error in logging LCM Message", e);
+ }
+ }
+
+ public Status buildStatusFromAppcException(AppcClientException exception) {
+ Status exceptionStatus = new Status();
+ exceptionStatus.setCode(200);
+ exceptionStatus.setMessage("Exception on APPC request: " + exception.getMessage());
+ return exceptionStatus;
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/StatusCategory.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/StatusCategory.java
new file mode 100644
index 0000000000..27160ef981
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/StatusCategory.java
@@ -0,0 +1,16 @@
+package org.onap.so.adapters.appc.orchestrator.client;
+
+public enum StatusCategory {
+ NORMAL("normal"), WARNING("warning"), ERROR("error");
+
+ private final String category;
+
+ private StatusCategory(final String category) {
+ this.category = category;
+ }
+
+ @Override
+ public String toString() {
+ return category;
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/ConfigurationParameters.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/ConfigurationParameters.java
new file mode 100644
index 0000000000..b065e9a0c3
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/ConfigurationParameters.java
@@ -0,0 +1,53 @@
+package org.onap.so.adapters.appc.orchestrator.client.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ConfigurationParameters {
+
+ @JsonProperty("vnf_name")
+ private String vnfName;
+ @JsonProperty("book_name")
+ private String bookName;
+ @JsonProperty("node_list")
+ private String nodeList;
+ @JsonProperty("file_parameter_content")
+ private String fileParameterContent;
+
+
+ @JsonProperty("vnf_name")
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ @JsonProperty("vnf_name")
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getBookName() {
+ return bookName;
+ }
+
+ public void setBookName(String bookName) {
+ this.bookName = bookName;
+ }
+
+ public String getNodeList() {
+ return nodeList;
+ }
+
+ public void setNodeList(String nodeList) {
+ this.nodeList = nodeList;
+ }
+
+ public String getFileParameterContent() {
+ return fileParameterContent;
+ }
+
+ public void setFileParameterContent(String fileParameterContent) {
+ this.fileParameterContent = fileParameterContent;
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Identity.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Identity.java
new file mode 100644
index 0000000000..912441ad9a
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Identity.java
@@ -0,0 +1,24 @@
+package org.onap.so.adapters.appc.orchestrator.client.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"identity-url"})
+public class Identity {
+
+ @JsonProperty("identity-url")
+ private String identityUrl;
+
+ @JsonProperty("identity-url")
+ public String getIdentityUrl() {
+ return identityUrl;
+ }
+
+ @JsonProperty("identity-url")
+ public void setIdentityUrl(String identityUrl) {
+ this.identityUrl = identityUrl;
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Parameters.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Parameters.java
new file mode 100644
index 0000000000..9b0385bd7a
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/Parameters.java
@@ -0,0 +1,99 @@
+package org.onap.so.adapters.appc.orchestrator.client.beans;
+
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"vm-id", "identity-url", "old_software_version", "new_software_version", "operations_timeout",
+ "request-parameters", "configuration-parameters"})
+public class Parameters {
+
+ @JsonProperty("vm-id")
+ private String vmId;
+ @JsonProperty("identity-url")
+ private String identityUrl;
+ @JsonProperty("operations_timeout")
+ private String operationsTimeout;
+ @JsonProperty("existing_software_version")
+ private String existingSoftwareVersion;
+ @JsonProperty("new_software_version")
+ private String newSoftwareVersion;
+ @JsonProperty("request-parameters")
+ private RequestParameters requestParameters;
+ @JsonProperty("configuration-parameters")
+ private ConfigurationParameters configurationParameters;
+
+ @JsonProperty("request-parameters")
+ public RequestParameters getRequestParameters() {
+ return requestParameters;
+ }
+
+ @JsonProperty("request-parameters")
+ public void setRequestParameters(RequestParameters requestParameters) {
+ this.requestParameters = requestParameters;
+ }
+
+ @JsonProperty("configuration-parameters")
+ public ConfigurationParameters getConfigurationParameters() {
+ return configurationParameters;
+ }
+
+ @JsonProperty("configuration-parameters")
+ public void setConfigurationParameters(ConfigurationParameters configurationParameters) {
+ this.configurationParameters = configurationParameters;
+ }
+
+ @JsonProperty("vm-id")
+ public String getVmId() {
+ return vmId;
+ }
+
+ @JsonProperty("vm-id")
+ public void setVmId(String vmId) {
+ this.vmId = vmId;
+ }
+
+ @JsonProperty("identity-url")
+ public String getIdentityUrl() {
+ return identityUrl;
+ }
+
+ @JsonProperty("identity-url")
+ public void setIdentityUrl(String identityUrl) {
+ this.identityUrl = identityUrl;
+ }
+
+ @JsonProperty("operations_timeout")
+ public String getOperationsTimeout() {
+ return operationsTimeout;
+ }
+
+ @JsonProperty("operations_timeout")
+ public void setOperationsTimeout(String operationsTimeout) {
+ this.operationsTimeout = operationsTimeout;
+ }
+
+ @JsonProperty("existing_software_version")
+ public String getExistingSoftwareVersion() {
+ return existingSoftwareVersion;
+ }
+
+ @JsonProperty("existing_software_version")
+ public void setExistingSoftwareVersion(String existingSoftwareVersion) {
+ this.existingSoftwareVersion = existingSoftwareVersion;
+ }
+
+ @JsonProperty("new_software_version")
+ public String getNewSoftwareVersion() {
+ return newSoftwareVersion;
+ }
+
+ @JsonProperty("new_software_version")
+ public void setNewSoftwareVersion(String newSoftwareVersion) {
+ this.newSoftwareVersion = newSoftwareVersion;
+ }
+
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/RequestParameters.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/RequestParameters.java
new file mode 100644
index 0000000000..ddc0a0ea3d
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/client/beans/RequestParameters.java
@@ -0,0 +1,59 @@
+package org.onap.so.adapters.appc.orchestrator.client.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RequestParameters {
+
+ @JsonProperty("vnf-host-ip-address")
+ private String vnfHostIpAddress;
+ @JsonProperty("vf-module-id")
+ private String vfModuleId;
+ @JsonProperty("vnf-name")
+ private String vnfName;
+ @JsonProperty("host-ip-address")
+ private String hostIpAddress;
+
+ public String getVnfHostIpAddress() {
+ return vnfHostIpAddress;
+ }
+
+ public void setVnfHostIpAddress(String vnfHostIpAddress) {
+ this.vnfHostIpAddress = vnfHostIpAddress;
+ }
+
+ public String getVfModuleId() {
+ return vfModuleId;
+ }
+
+ public void setVfModuleId(String vfModuleId) {
+ this.vfModuleId = vfModuleId;
+ }
+
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getHostIpAddress() {
+ return hostIpAddress;
+ }
+
+ public void setHostIpAddress(String hostIpAddress) {
+ this.hostIpAddress = hostIpAddress;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RequestParametersConfigScaleOut{");
+ sb.append("vnf-host-ip-address=").append(vnfHostIpAddress);
+ sb.append(", vf-module-id='").append(vfModuleId);
+ sb.append('}');
+ return sb.toString();
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java
new file mode 100644
index 0000000000..181d114cc0
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTask.java
@@ -0,0 +1,50 @@
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
+import org.onap.so.utils.ExternalTaskUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+import org.onap.appc.client.lcm.model.Status;
+
+@Component
+public class ApplicationControllerTask extends ExternalTaskUtils {
+
+ private static final Logger logger = LoggerFactory.getLogger(ApplicationControllerTask.class);
+
+ @Autowired
+ public Environment env;
+
+ @Autowired
+ public ApplicationControllerTaskImpl applicationControllerTaskImpl;
+
+ @Autowired
+ public ApplicationControllerSupport applicationControllerSupport;
+
+ @Autowired
+ private AuditMDCSetup mdcSetup;
+
+ protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
+ mdcSetup.setupMDC(externalTask);
+ ApplicationControllerTaskRequest request = externalTask.getVariable("appcOrchestratorRequest");
+ String msoRequestId = externalTask.getVariable("mso-request-id");
+ logger.debug("Starting External Task for RequestId: {} ", msoRequestId);
+ Status status = null;
+ ApplicationControllerCallback listener =
+ new ApplicationControllerCallback(externalTask, externalTaskService, applicationControllerSupport);
+
+ try {
+ status = applicationControllerTaskImpl.execute(msoRequestId, request, listener);
+ } catch (Exception e) {
+ logger.error("Error while calling appc", e.getMessage());
+ }
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImpl.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImpl.java
new file mode 100644
index 0000000000..a174ccb05a
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImpl.java
@@ -0,0 +1,112 @@
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import java.util.Optional;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerClient;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException;
+import org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Identity;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Parameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVm;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+@Component
+public class ApplicationControllerTaskImpl {
+
+ @Autowired
+ private ApplicationControllerClient appcClient;
+
+ public Status execute(String msoRequestId, ApplicationControllerTaskRequest request,
+ ApplicationControllerCallback listener)
+ throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ Status status = null;
+ GraphInventoryCommonObjectMapperProvider mapper = new GraphInventoryCommonObjectMapperProvider();
+ Optional<String> payload = Optional.empty();
+ String vmId = null;
+ Optional<String> vserverId = Optional.empty();
+ Parameters parameters = new Parameters();
+ ConfigurationParameters configParams = new ConfigurationParameters();
+
+ switch (request.getAction()) {
+ case HealthCheck:
+ RequestParameters requestParams = new RequestParameters();
+ requestParams.setHostIpAddress(request.getApplicationControllerVnf().getVnfHostIpAddress());
+ parameters.setRequestParameters(requestParams);
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case ResumeTraffic:
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case Start:
+ case Stop:
+ Identity identity = new Identity();
+ identity.setIdentityUrl(request.getIdentityUrl());
+ payload = Optional.of((mapper.getMapper().writeValueAsString(identity)));
+ break;
+ case Unlock:
+ case Lock:
+ break;
+ case QuiesceTraffic:
+ parameters.setOperationsTimeout(request.getOperationsTimeout());
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case DistributeTraffic:
+ configParams.setBookName(request.getBookName());
+ configParams.setNodeList(request.getNodeList());
+ configParams.setFileParameterContent(request.getFileParameters());
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case DistributeTrafficCheck:
+ configParams.setBookName(request.getBookName());
+ configParams.setNodeList(request.getNodeList());
+ configParams.setFileParameterContent(request.getFileParameters());
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case ConfigModify:
+ case ConfigScaleOut:
+ break;
+ case UpgradePreCheck:
+ case UpgradePostCheck:
+ case UpgradeSoftware:
+ case UpgradeBackup:
+ parameters.setExistingSoftwareVersion(request.getExistingSoftwareVersion());
+ parameters.setNewSoftwareVersion(request.getNewSoftwareVersion());
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ break;
+ case ActionStatus:
+ break;
+ case Snapshot:
+ ApplicationControllerVm applicationControllerVm =
+ request.getApplicationControllerVnf().getApplicationControllerVm();
+ if (applicationControllerVm != null) {
+ vmId = request.getApplicationControllerVnf().getApplicationControllerVm().getVmId();
+ parameters.setVmId(vmId);
+ payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ vserverId = Optional
+ .of(request.getApplicationControllerVnf().getApplicationControllerVm().getVserverId());
+ }
+ default:
+ // errorMessage = "Unable to idenify Action request for AppCClient";
+ break;
+ }
+
+ status = appcClient.vnfCommand(request.getAction(), msoRequestId,
+ request.getApplicationControllerVnf().getVnfId(), vserverId, payload, request.getControllerType(),
+ listener);
+
+ return status;
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskService.java b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskService.java
new file mode 100644
index 0000000000..2a33124eac
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskService.java
@@ -0,0 +1,31 @@
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import javax.annotation.PostConstruct;
+import org.onap.so.utils.ExternalTaskServiceUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+@Profile("!test")
+public class ApplicationControllerTaskService {
+
+ @Autowired
+ public Environment env;
+
+ @Autowired
+ private ApplicationControllerTask appcOrchestrator;
+
+ @Autowired
+ private ExternalTaskServiceUtils externalTaskServiceUtils;
+
+ @PostConstruct
+ public void appcOrchestrator() throws Exception {
+ for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
+ externalTaskServiceUtils.createExternalTaskClient().subscribe("AppcService").lockDuration(604800000)
+ .handler(appcOrchestrator::executeExternalTask).open();
+ }
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/main/resources/application.yaml b/adapters/so-appc-orchestrator/src/main/resources/application.yaml
new file mode 100644
index 0000000000..c0c5962ea2
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/main/resources/application.yaml
@@ -0,0 +1,18 @@
+server:
+ port: 8080
+ tomcat:
+ max-threads: 50
+
+#Actuator
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ exposure:
+ include: "*"
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/TestApplication.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/TestApplication.java
new file mode 100644
index 0000000000..fe965b4444
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/TestApplication.java
@@ -0,0 +1,43 @@
+package org.onap.so;
+/*-
+ * ============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=========================================================
+ */
+
+
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Profile;
+
+@SpringBootApplication
+@Profile("test")
+@ComponentScan(basePackages = {"org.onap.so"},
+ excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)})
+public class TestApplication {
+ public static void main(String... args) {
+ SpringApplication.run(TestApplication.class, args);
+ System.getProperties().setProperty("mso.db", "MARIADB");
+ System.getProperties().setProperty("server.name", "Springboot");
+
+
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java
new file mode 100644
index 0000000000..90f5a44752
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.appc.orchestrator.client;
+
+import static org.hamcrest.CoreMatchers.any;
+import static org.mockito.Mockito.doReturn;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.appc.client.lcm.exceptions.AppcClientException;
+import org.onap.appc.client.lcm.model.ResumeTrafficOutput;
+
+public class ApplicationControllerCallbackTest {
+
+ @InjectMocks
+ ApplicationControllerCallback appcTaskCallback;
+
+ @Mock
+ ApplicationControllerSupport applicationControllerSupport;
+
+ @Mock
+ ExternalTask mockExternalTask;
+
+ @Mock
+ ExternalTaskService mockExternalTaskService;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ appcTaskCallback = new ApplicationControllerCallback(mockExternalTask, mockExternalTaskService,
+ applicationControllerSupport);
+ }
+
+ @Test
+ public void onResponse_appcCallback_success_Test() throws Exception {
+ Status status = new Status();
+ status.setCode(400);
+ ResumeTrafficOutput response = new ResumeTrafficOutput();
+ response.setStatus(status);
+ doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
+ doReturn(true).when(applicationControllerSupport).getFinalityOf(status);
+ doReturn(StatusCategory.NORMAL).when(applicationControllerSupport).getCategoryOf(status);
+ appcTaskCallback.onResponse(response);
+ Mockito.verify(mockExternalTaskService).complete(mockExternalTask);
+ }
+
+ @Test
+ public void onResponse_appcCallback_intermediateResponse_Test() throws Exception {
+ Status status = new Status();
+ status.setCode(100);
+ ResumeTrafficOutput response = new ResumeTrafficOutput();
+ response.setStatus(status);
+ doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
+ appcTaskCallback.onResponse(response);
+ Mockito.verifyZeroInteractions(mockExternalTaskService);
+ }
+
+ @Test
+ public void onResponse_appcCallback_failure_Test() throws Exception {
+ String testFailure = "test failure";
+ Status status = new Status();
+ status.setCode(200);
+ status.setMessage(testFailure);
+ ResumeTrafficOutput response = new ResumeTrafficOutput();
+ response.setStatus(status);
+ doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response);
+ doReturn(true).when(applicationControllerSupport).getFinalityOf(status);
+ doReturn(StatusCategory.ERROR).when(applicationControllerSupport).getCategoryOf(status);
+ appcTaskCallback.onResponse(response);
+ Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask, "MSOWorkflowException", testFailure);
+ }
+
+ @Test
+ public void onException_appcCallback_failure_Test() throws Exception {
+ String testFailure = "test failure";
+ AppcClientException appcException = new AppcClientException(testFailure);
+ Status status = new Status();
+ status.setCode(200);
+ String exceptionMessage = "Exception on APPC request: " + testFailure;
+ status.setMessage(exceptionMessage);
+ doReturn(status).when(applicationControllerSupport).buildStatusFromAppcException(appcException);
+ doReturn(StatusCategory.ERROR).when(applicationControllerSupport).getCategoryOf(status);
+ appcTaskCallback.onException(appcException);
+ Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask, "MSOWorkflowException",
+ exceptionMessage);
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupportTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupportTest.java
new file mode 100644
index 0000000000..2dd2fd7ac8
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerSupportTest.java
@@ -0,0 +1,79 @@
+/*-
+ * ============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.appc.orchestrator.client;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.appc.client.lcm.exceptions.AppcClientException;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.so.adapters.appc.orchestrator.client.StatusCategory;
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+
+@RunWith(JUnitParamsRunner.class)
+public class ApplicationControllerSupportTest {
+ private ApplicationControllerSupport applicationControllerSupport = new ApplicationControllerSupport();
+
+ public static Object[][] statusesAndCategories() {
+ return new Object[][] {{100, StatusCategory.NORMAL}, {200, StatusCategory.ERROR}, {300, StatusCategory.ERROR},
+ {400, StatusCategory.NORMAL}, {401, StatusCategory.ERROR}, {500, StatusCategory.NORMAL},
+ {501, StatusCategory.ERROR}, {502, StatusCategory.WARNING}, {800, StatusCategory.WARNING},};
+ }
+
+ public static Object[][] statusesAndFinalities() {
+ return new Object[][] {{100, false}, {200, true}, {300, true}, {400, true}, {500, false}, {800, true},};
+ }
+
+ @Test
+ @Parameters(method = "statusesAndCategories")
+ public void shouldReturnCategoryForCode(int code, StatusCategory category) throws Exception {
+ // when
+ StatusCategory detectedCategory = applicationControllerSupport.getCategoryOf(createStatus(code));
+ // then
+ assertThat(detectedCategory).isEqualTo(category);
+ }
+
+ @Test
+ @Parameters(method = "statusesAndFinalities")
+ public void shouldReturnFinalityForCode(int code, boolean expectedFinality) throws Exception {
+ // when
+ boolean finality = applicationControllerSupport.getFinalityOf(createStatus(code));
+ // then
+ assertThat(finality).isEqualTo(expectedFinality);
+ }
+
+ @Test
+ public void buildStatusFromAppcException_Test() {
+ String errorMessage = "errormessage";
+ AppcClientException exception = new AppcClientException(errorMessage);
+ Status status = applicationControllerSupport.buildStatusFromAppcException(exception);
+ assertThat(status.getCode() == 200);
+ assertThat((status.getMessage()).equals(("Exception on APPC request: " + errorMessage)));
+ }
+
+ private Status createStatus(int code) {
+ Status status = new Status();
+ status.setCode(code);
+ return status;
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/beans/BeansTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/beans/BeansTest.java
new file mode 100644
index 0000000000..76b5efacb3
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/beans/BeansTest.java
@@ -0,0 +1,20 @@
+package org.onap.so.adapters.appc.orchestrator.client.beans;
+
+import org.junit.Test;
+import com.openpojo.reflection.filters.FilterPackageInfo;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.rule.impl.GetterMustExistRule;
+import com.openpojo.validation.rule.impl.SetterMustExistRule;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+public class BeansTest {
+
+ @Test
+ public void validateGettersAndSetters() {
+ Validator validator = ValidatorBuilder.create().with(new SetterMustExistRule(), new GetterMustExistRule())
+ .with(new SetterTester(), new GetterTester()).build();
+ validator.validate("org.onap.so.adapters.appc.orchestrator.client.beans", new FilterPackageInfo());
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplITTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplITTest.java
new file mode 100644
index 0000000000..3eac851f13
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplITTest.java
@@ -0,0 +1,88 @@
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import java.util.List;
+import java.util.Optional;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.so.TestApplication;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerClient;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerSupport;
+import org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Identity;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Parameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters;
+import org.onap.so.adapters.appc.orchestrator.service.ApplicationControllerTaskImpl;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.onap.appc.client.lcm.model.Action;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+@ContextConfiguration
+@AutoConfigureWireMock(port = 0)
+public class ApplicationControllerTaskImplITTest {
+
+ @Autowired
+ private ApplicationControllerTaskImpl applicationControllerTaskImpl;
+
+ @Mock
+ ExternalTask externalTask;
+
+ @Mock
+ ExternalTaskService externalTaskService;
+
+ @Mock
+ ApplicationControllerSupport appCSupport;
+
+ ApplicationControllerTaskRequest request;
+
+ ApplicationControllerCallback listener;
+
+ GraphInventoryCommonObjectMapperProvider mapper = new GraphInventoryCommonObjectMapperProvider();
+
+ @Before
+ public void setup() {
+ request = new ApplicationControllerTaskRequest();
+ request.setBookName("testBookName");
+ request.setControllerType("testControllerType");
+ request.setFileParameters("testFileParams");
+ request.setIdentityUrl("testIdentityUrl");
+ request.setNewSoftwareVersion("2.0");
+ request.setExistingSoftwareVersion("1.0");
+ request.setOperationsTimeout("30");
+ ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
+ applicationControllerVnf.setVnfHostIpAddress("100.100");
+ applicationControllerVnf.setVnfId("testVnfId");
+ applicationControllerVnf.setVnfName("testVnfName");
+ request.setApplicationControllerVnf(applicationControllerVnf);
+ listener = new ApplicationControllerCallback(null, externalTaskService, appCSupport);
+ }
+
+
+ @Test
+ public void testListener() throws Exception {
+ request.setAction(Action.QuiesceTraffic);
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java
new file mode 100644
index 0000000000..640e2dbd6e
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java
@@ -0,0 +1,236 @@
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import java.util.Optional;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.appc.client.lcm.model.Status;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerClient;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerOrchestratorException;
+import org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Identity;
+import org.onap.so.adapters.appc.orchestrator.client.beans.Parameters;
+import org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters;
+import org.onap.so.adapters.appc.orchestrator.service.ApplicationControllerTaskImpl;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.onap.appc.client.lcm.model.Action;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ApplicationControllerTaskImplTest {
+
+ @Mock
+ ApplicationControllerClient applicationControllerClient;
+
+ @InjectMocks
+ @Spy
+ ApplicationControllerTaskImpl applicationControllerTaskImpl;
+
+ ApplicationControllerTaskRequest request;
+
+ ApplicationControllerCallback listener;
+
+ GraphInventoryCommonObjectMapperProvider mapper = new GraphInventoryCommonObjectMapperProvider();
+
+ @Before
+ public void setup() {
+ request = new ApplicationControllerTaskRequest();
+ request.setBookName("testBookName");
+ request.setControllerType("testControllerType");
+ request.setFileParameters("testFileParams");
+ request.setIdentityUrl("testIdentityUrl");
+ request.setNewSoftwareVersion("2.0");
+ request.setExistingSoftwareVersion("1.0");
+ request.setOperationsTimeout("30");
+ ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
+ applicationControllerVnf.setVnfHostIpAddress("100.100");
+ applicationControllerVnf.setVnfId("testVnfId");
+ applicationControllerVnf.setVnfName("testVnfName");
+ request.setApplicationControllerVnf(applicationControllerVnf);
+ listener = new ApplicationControllerCallback(null, null, null);
+
+ }
+
+ @Test
+ public void testExcute_healthCheck() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.HealthCheck);
+
+ Parameters parameters = new Parameters();
+ RequestParameters requestParams = new RequestParameters();
+ requestParams.setHostIpAddress(request.getApplicationControllerVnf().getVnfHostIpAddress());
+ parameters.setRequestParameters(requestParams);
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(Action.HealthCheck, "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(Action.HealthCheck, "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+
+ }
+
+ @Test
+ public void testExcute_resumeTraffic() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.ResumeTraffic);
+
+ Parameters parameters = new Parameters();
+ ConfigurationParameters configParams = new ConfigurationParameters();
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testExcute_stop() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.Stop);
+
+ Identity identity = new Identity();
+ identity.setIdentityUrl(request.getIdentityUrl());
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(identity)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testExcute_lock() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.Lock);
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), Optional.empty(),
+ "testControllerType", listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), Optional.empty(),
+ "testControllerType", listener);
+ }
+
+ @Test
+ public void testExcute_quiesceTraffic() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.QuiesceTraffic);
+
+
+ Parameters parameters = new Parameters();
+ parameters.setOperationsTimeout(request.getOperationsTimeout());
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+ System.out.println("PAYLOAD is: " + payload.get());
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testExcute_distributeTraffic()
+ throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.DistributeTraffic);
+
+ Parameters parameters = new Parameters();
+ ConfigurationParameters configParams = new ConfigurationParameters();
+ configParams.setBookName(request.getBookName());
+ configParams.setNodeList(request.getNodeList());
+ configParams.setFileParameterContent(request.getFileParameters());
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testExcute_distributeTrafficCheck()
+ throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.DistributeTrafficCheck);
+
+ Parameters parameters = new Parameters();
+ ConfigurationParameters configParams = new ConfigurationParameters();
+ configParams.setBookName(request.getBookName());
+ configParams.setNodeList(request.getNodeList());
+ configParams.setFileParameterContent(request.getFileParameters());
+ configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
+ parameters.setConfigurationParameters(configParams);
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testExcute_upgradeBackup() throws JsonProcessingException, ApplicationControllerOrchestratorException {
+ request.setAction(Action.UpgradeBackup);
+
+ Parameters parameters = new Parameters();
+ parameters.setExistingSoftwareVersion(request.getExistingSoftwareVersion());
+ parameters.setNewSoftwareVersion(request.getNewSoftwareVersion());
+ Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
+
+ Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener)).thenReturn(new Status());
+
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+
+ Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId",
+ request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType",
+ listener);
+ }
+
+ @Test
+ public void testListener() throws Exception {
+ request.setAction(Action.QuiesceTraffic);
+ Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
+ }
+
+}
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskTest.java
new file mode 100644
index 0000000000..228ee90107
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskTest.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.appc.orchestrator.service;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.so.externaltasks.logging.AuditMDCSetup;
+import org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.appc.client.lcm.model.Status;
+
+public class ApplicationControllerTaskTest extends ApplicationControllerTask {
+
+ @InjectMocks
+ ApplicationControllerTask appcTaskService = new ApplicationControllerTask();
+
+ @Mock
+ ApplicationControllerTaskImpl applicationControllerTaskImpl;
+
+ @Mock
+ ExternalTask mockExternalTask;
+
+ @Mock
+ ExternalTaskService mockExternalTaskService;
+
+ @Mock
+ private AuditMDCSetup mdcSetup;
+
+ private ApplicationControllerTaskRequest request = new ApplicationControllerTaskRequest();
+ private String msoRequestId = "testRequestId";
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ doNothing().when(mdcSetup).setupMDC(mockExternalTask);
+ doReturn(request).when(mockExternalTask).getVariable("appcOrchestratorRequest");
+ doReturn(msoRequestId).when(mockExternalTask).getVariable("mso-request-id");
+ }
+
+ @Test
+ public void executeExternalTask_appc_success_Test() throws Exception {
+ Status status = new Status();
+ doReturn(status).when(applicationControllerTaskImpl).execute(any(String.class),
+ any(ApplicationControllerTaskRequest.class), any(ApplicationControllerCallback.class));
+ appcTaskService.executeExternalTask(mockExternalTask, mockExternalTaskService);
+ Mockito.verify(applicationControllerTaskImpl).execute(any(String.class),
+ any(ApplicationControllerTaskRequest.class), any(ApplicationControllerCallback.class));
+ }
+}
diff --git a/adapters/so-appc-orchestrator/src/test/resources/application-test.yaml b/adapters/so-appc-orchestrator/src/test/resources/application-test.yaml
new file mode 100644
index 0000000000..eb693a263e
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/resources/application-test.yaml
@@ -0,0 +1,17 @@
+
+appc:
+ client:
+ key: LSl8QKolmKcC0yJR
+ response:
+ timeout: '60000'
+ secret: lgjXraD1HutKxv8jEN6tVouu
+ poolMembers: localhost:3904,localhost:3904
+ service: ueb
+ topic:
+ read:
+ name: APPC-1902-SHDEV-WRITE
+ timeout: '120000'
+ write: APPC-1902-SHDEV-READ
+ sdnc:
+ read: SDNC-LCM-READ
+ write: SDNC-LCM-WRITE \ No newline at end of file
diff --git a/adapters/so-appc-orchestrator/src/test/resources/logback-test.xml b/adapters/so-appc-orchestrator/src/test/resources/logback-test.xml
new file mode 100644
index 0000000000..8a9e705ca6
--- /dev/null
+++ b/adapters/so-appc-orchestrator/src/test/resources/logback-test.xml
@@ -0,0 +1,31 @@
+<configuration>
+
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+
+ <logger name="com.att.ecomp.audit" level="info" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <logger name="com.att.eelf.metrics" level="info" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <logger name="com.att.eelf.error" level="trace" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <logger name="org.onap" level="${so.log.level:-WARN}" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <root level="WARN">
+ <appender-ref ref="STDOUT" />
+ </root>
+
+</configuration> \ No newline at end of file
diff --git a/asdc-controller/pom.xml b/asdc-controller/pom.xml
index 60c517d944..6ae05896df 100644
--- a/asdc-controller/pom.xml
+++ b/asdc-controller/pom.xml
@@ -16,7 +16,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<antlr.version>4.7.1</antlr.version>
<java.version>1.8</java.version>
- <sdc.tosca.version>1.5.1</sdc.tosca.version>
+ <sdc.tosca.version>1.6.5</sdc.tosca.version>
<jtosca.version>1.5.1</jtosca.version>
</properties>
@@ -138,6 +138,9 @@
<executions>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
index e00bb1eb36..ecffb683ca 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
@@ -22,16 +22,21 @@
package org.onap.so.asdc;
+import java.security.SecureRandom;
import javax.annotation.PreDestroy;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.asdc.client.ASDCController;
import org.onap.so.asdc.client.exceptions.ASDCControllerException;
+import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ScheduledTasksMDCSetup;
+import org.onap.so.utils.Components;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
-import java.security.SecureRandom;
@Component
@@ -42,12 +47,16 @@ public class ASDCControllerSingleton {
private final ASDCController asdcController;
@Autowired
+ private ScheduledTasksMDCSetup scheduledMDCSetup;
+
+ @Autowired
public ASDCControllerSingleton(final ASDCController asdcController) {
this.asdcController = asdcController;
}
@Scheduled(fixedRate = 50000)
public void periodicControllerTask() {
+ scheduledMDCSetup.mdcSetup(Components.ASDC_CONTROLLER, "periodicControllerTask");
try {
final int randomNumber = new SecureRandom().nextInt(Integer.MAX_VALUE);
asdcController.setControllerName("mso-controller" + randomNumber);
@@ -57,8 +66,11 @@ public class ASDCControllerSingleton {
asdcController.initASDC();
}
} catch (final ASDCControllerException controllerException) {
+ scheduledMDCSetup.errorMDCSetup(ErrorCode.UnknownError, controllerException.getMessage());
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.error("Exception occurred", controllerException);
}
+ scheduledMDCSetup.exitAndClearMDC();
}
@PreDestroy
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java b/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java
deleted file mode 100644
index b45b4f0749..0000000000
--- a/asdc-controller/src/main/java/org/onap/so/asdc/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.asdc;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java
index c37eccf594..06887f1253 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java
@@ -29,7 +29,8 @@ import org.onap.so.asdc.activity.beans.ActivitySpec;
import org.onap.so.asdc.activity.beans.ActivitySpecCreateResponse;
import org.onap.so.client.HttpClient;
import org.onap.so.client.HttpClientFactory;
-import org.onap.so.utils.TargetEntity;
+import org.onap.so.logger.LoggingAnchor;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -62,7 +63,7 @@ public class ActivitySpecsActions {
String urlString = UriBuilder.fromUri(hostname).path(ACTIVITY_SPEC_URI).build().toString();
URL url = new URL(urlString);
- HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.SDC);
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.SDC);
httpClient.addAdditionalHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
Response response = httpClient.post(payload);
@@ -104,7 +105,7 @@ public class ActivitySpecsActions {
String urlString = UriBuilder.fromUri(hostname).path(path).build().toString();
URL url = new URL(urlString);
- HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.SDC);
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.SDC);
httpClient.addAdditionalHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
Response response = httpClient.put(CERTIFY_ACTIVITY_PAYLOAD);
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
index e048d4c567..e53b792a74 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
@@ -20,6 +20,8 @@
package org.onap.so.asdc.activity;
+import java.net.HttpURLConnection;
+import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.onap.so.logger.LoggingAnchor;
@@ -27,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
+import org.apache.http.HttpStatus;
import org.onap.so.asdc.activity.beans.ActivitySpec;
import org.onap.so.asdc.activity.beans.Input;
import org.onap.so.asdc.activity.beans.Output;
@@ -55,10 +58,15 @@ public class DeployActivitySpecs {
protected static final Logger logger = LoggerFactory.getLogger(DeployActivitySpecs.class);
@Transactional
- public void deployActivities() throws Exception {
+ public void deployActivities() {
String hostname = env.getProperty(SDC_ENDPOINT);
logger.debug("{} {}", "SDC ActivitySpec endpoint: ", hostname);
if (hostname == null || hostname.isEmpty()) {
+ logger.warn("The hostname for SDC activities deployment is not configured in SO");
+ return;
+ }
+ if (!checkHttpServerUp(hostname)) {
+ logger.warn("The sdc end point is not alive");
return;
}
List<org.onap.so.db.catalog.beans.ActivitySpec> activitySpecsFromCatalog = activitySpecRepository.findAll();
@@ -97,10 +105,8 @@ public class DeployActivitySpecs {
}
List<String> categoryList = new ArrayList<>();
for (ActivitySpecActivitySpecCategories activitySpecCat : activitySpecActivitySpecCategories) {
- if (activitySpecCat != null) {
- if (activitySpecCat.getActivitySpecCategories() != null) {
- categoryList.add(activitySpecCat.getActivitySpecCategories().getName());
- }
+ if (activitySpecCat != null && activitySpecCat.getActivitySpecCategories() != null) {
+ categoryList.add(activitySpecCat.getActivitySpecCategories().getName());
}
}
activitySpec.setCategoryList(categoryList);
@@ -137,4 +143,23 @@ public class DeployActivitySpecs {
activitySpec.setOutputs(outputs);
return;
}
+
+ public boolean checkHttpServerUp(String host) {
+ URL url = null;
+ boolean isUp = false;
+
+ int responseCode = 0;
+ try {
+ url = new URL(host);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setConnectTimeout(5000);
+ responseCode = connection.getResponseCode();
+ } catch (Exception e) {
+ logger.warn("Exception on connecting to SDC WFD endpoint: ", e);
+ }
+ if (responseCode == HttpStatus.SC_OK || responseCode == HttpStatus.SC_NOT_FOUND) {
+ isUp = true;
+ }
+ return isUp;
+ }
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
index 639a96eab6..3e5f82bc5e 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
@@ -59,7 +59,8 @@ public class ASDCConfiguration implements IConfiguration {
public static final String CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT = "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT";
private static final String[] SUPPORTED_ARTIFACT_TYPES = {HEAT, HEAT_ARTIFACT, HEAT_ENV, HEAT_NESTED, HEAT_NET,
- HEAT_VOL, OTHER, TOSCA_CSAR, VF_MODULES_METADATA, CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT, WORKFLOW};
+ HEAT_VOL, OTHER, TOSCA_CSAR, VF_MODULES_METADATA, WORKFLOW, CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT};
+
public static final List<String> SUPPORTED_ARTIFACT_TYPES_LIST =
Collections.unmodifiableList(Arrays.asList(SUPPORTED_ARTIFACT_TYPES));
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index 3b9406a697..f64adfd760 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -37,6 +37,7 @@ import java.nio.file.Paths;
import java.util.List;
import java.util.Optional;
import org.onap.so.logger.LoggingAnchor;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.sdc.api.IDistributionClient;
import org.onap.sdc.api.consumer.IDistributionStatusMessage;
import org.onap.sdc.api.consumer.IFinalDistrStatusMessage;
@@ -71,6 +72,7 @@ import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ObjectOptimisticLockingFailureException;
import org.springframework.stereotype.Component;
@@ -588,6 +590,10 @@ public class ASDCController {
logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_RECEIVE_CALLBACK_NOTIF.toString(),
String.valueOf(noOfArtifacts), iNotif.getServiceUUID(), "ASDC");
try {
+
+ if (iNotif.getDistributionID() != null && !iNotif.getDistributionID().isEmpty()) {
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, iNotif.getDistributionID());
+ }
logger.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif));
logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), iNotif.getServiceUUID(),
"ASDC", "treatNotification");
@@ -682,7 +688,7 @@ public class ASDCController {
iNotif.getDistributionID());
logger.error(LoggingAnchor.FIVE, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
"Database concurrency exception: ", "ASDC", "treatNotification",
- ErrorCode.BusinessProcesssError.getValue(), "RuntimeException in treatNotification", e);
+ ErrorCode.BusinessProcessError.getValue(), "RuntimeException in treatNotification", e);
} catch (Exception e) {
logger.error("", MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
@@ -717,7 +723,6 @@ public class ASDCController {
// For each artifact, create a structure describing the VFModule in a ordered flat level
ResourceStructure resourceStructure = null;
String msoConfigPath = getMsoConfigPath();
- boolean hasVFResource = false;
ToscaResourceStructure toscaResourceStructure = new ToscaResourceStructure(msoConfigPath);
DistributionStatusEnum deployStatus = DistributionStatusEnum.DEPLOY_OK;
String errorMessage = null;
@@ -732,12 +737,11 @@ public class ASDCController {
for (IResourceInstance resource : iNotif.getResources()) {
String resourceType = resource.getResourceType();
-
+ boolean hasVFResource = false;
logger.info("Processing Resource Type: {}, Model UUID: {}", resourceType, resource.getResourceUUID());
- if ("VF".equals(resourceType) && resource.getArtifacts() != null
- && !resource.getArtifacts().isEmpty()) {
+ if ("VF".equals(resourceType)) {
resourceStructure = new VfResourceStructure(iNotif, resource);
} else if ("PNF".equals(resourceType)) {
resourceStructure = new PnfResourceStructure(iNotif, resource);
@@ -755,8 +759,8 @@ public class ASDCController {
logger.debug("Processing Resource Type: " + resourceType + " and Model UUID: "
+ resourceStructure.getResourceInstance().getResourceUUID());
- if ("VF".equals(resourceType) && resource.getArtifacts() != null
- && !resource.getArtifacts().isEmpty()) {
+
+ if ("VF".equals(resourceType)) {
hasVFResource = true;
for (IArtifactInfo artifact : resource.getArtifacts()) {
IDistributionClientDownloadResult resultArtifact =
@@ -796,19 +800,20 @@ public class ASDCController {
errorMessage = e.getMessage();
logger.error("Exception occurred", e);
}
- }
- if (!hasVFResource) {
+ if (!hasVFResource) {
- logger.debug("No resources found for Service: " + iNotif.getServiceUUID());
+ logger.debug("No resources found for Service: " + iNotif.getServiceUUID());
- logger.debug("Preparing to deploy Service: {}", iNotif.getServiceUUID());
- try {
- this.deployResourceStructure(resourceStructure, toscaResourceStructure);
- } catch (ArtifactInstallerException e) {
- deployStatus = DistributionStatusEnum.DEPLOY_ERROR;
- errorMessage = e.getMessage();
- logger.error("Exception occurred", e);
+ logger.debug("Preparing to deploy Service: {}", iNotif.getServiceUUID());
+ try {
+ this.deployResourceStructure(resourceStructure, toscaResourceStructure);
+ serviceDeployed = true;
+ } catch (ArtifactInstallerException e) {
+ deployStatus = DistributionStatusEnum.DEPLOY_ERROR;
+ errorMessage = e.getMessage();
+ logger.error("Exception occurred", e);
+ }
}
}
@@ -818,7 +823,7 @@ public class ASDCController {
} catch (ASDCDownloadException | UnsupportedEncodingException e) {
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
"Exception caught during Installation of artifact", "ASDC", "processResourceNotification",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in processResourceNotification", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in processResourceNotification", e);
}
}
@@ -864,7 +869,7 @@ public class ASDCController {
} catch (Exception e) {
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
"Exception caught during processCsarServiceArtifacts", "ASDC",
- "processCsarServiceArtifacts", ErrorCode.BusinessProcesssError.getValue(),
+ "processCsarServiceArtifacts", ErrorCode.BusinessProcessError.getValue(),
"Exception in processCsarServiceArtifacts", e);
}
} else if (artifact.getArtifactType().equals(ASDCConfiguration.WORKFLOW)) {
@@ -885,7 +890,7 @@ public class ASDCController {
logger.info("Whats the error {}", e.getMessage());
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
"Exception caught during processCsarServiceArtifacts", "ASDC",
- "processCsarServiceArtifacts", ErrorCode.BusinessProcesssError.getValue(),
+ "processCsarServiceArtifacts", ErrorCode.BusinessProcessError.getValue(),
"Exception in processCsarServiceArtifacts", e);
}
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
index 24e1887847..a9d06d8e82 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
@@ -138,7 +138,7 @@ public class ASDCRestInterface {
logger.info("Error caught " + e.getMessage());
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION.toString(),
"Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService",
- ErrorCode.BusinessProcesssError.getValue(), "Exception in invokeASDCService", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in invokeASDCService", e);
}
return null;
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java
index 8be3d6ba06..f2c6b2f16a 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java
@@ -61,7 +61,7 @@ public abstract class ResourceStructure {
/**
* Number of resources provided by the resource structure.
*/
- protected int NumberOfResources;
+ protected int numberOfResources;
/**
* The list of artifacts existing in this resource hashed by UUID.
@@ -142,11 +142,11 @@ public abstract class ResourceStructure {
}
public int getNumberOfResources() {
- return NumberOfResources;
+ return numberOfResources;
}
public void setNumberOfResources(int numberOfResources) {
- NumberOfResources = numberOfResources;
+ this.numberOfResources = numberOfResources;
}
public Map<String, VfModuleArtifact> getArtifactsMapByUUID() {
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
index c49cb3e50f..dcb49478f4 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
@@ -25,7 +25,6 @@ package org.onap.so.asdc.installer;
import java.io.File;
import java.nio.file.Paths;
import java.util.List;
-import org.onap.so.logger.LoggingAnchor;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
@@ -52,10 +51,10 @@ import org.onap.so.db.catalog.beans.VfModule;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
public class ToscaResourceStructure {
@@ -152,7 +151,7 @@ public class ToscaResourceStructure {
logger.debug(e.getMessage(), e);
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
"Exception caught during parser *****LOOK********* " + artifact.getArtifactName(), "ASDC",
- "processResourceNotification", ErrorCode.BusinessProcesssError.getValue(),
+ "processResourceNotification", ErrorCode.BusinessProcessError.getValue(),
"Exception in " + "processResourceNotification", e);
throw new ASDCDownloadException("Exception caught when passing the csar file to the parser ", e);
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/WorkflowArtifact.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/WorkflowArtifact.java
index 83b5614104..c94370feb2 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/WorkflowArtifact.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/WorkflowArtifact.java
@@ -22,9 +22,6 @@ package org.onap.so.asdc.installer;
import java.io.UnsupportedEncodingException;
-import org.onap.so.db.catalog.beans.HeatEnvironment;
-import org.onap.so.db.catalog.beans.HeatFiles;
-import org.onap.so.db.catalog.beans.HeatTemplate;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.results.IDistributionClientDownloadResult;
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
index 095741c19b..195aa7e302 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
@@ -33,7 +33,6 @@ import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
@@ -49,6 +48,7 @@ import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.HttpClientBuilder;
import org.onap.so.asdc.client.ASDCConfiguration;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,9 +71,8 @@ public class BpmnInstaller {
public void installBpmn(String csarFilePath) {
logger.info("Deploying BPMN files from {}", csarFilePath);
- try {
- ZipInputStream csarFile =
- new ZipInputStream(new FileInputStream(Paths.get(csarFilePath).normalize().toString()));
+ try (ZipInputStream csarFile =
+ new ZipInputStream(new FileInputStream(Paths.get(csarFilePath).normalize().toString()))) {
ZipEntry entry = csarFile.getNextEntry();
while (entry != null) {
@@ -103,7 +102,6 @@ public class BpmnInstaller {
}
entry = csarFile.getNextEntry();
}
- csarFile.close();
} catch (IOException ex) {
logger.debug("Exception :", ex);
logger.error(LoggingAnchor.FIVE, MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), csarFilePath,
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
index a68d98e0b0..ef4dfa24aa 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
@@ -52,7 +52,7 @@ import org.springframework.stereotype.Component;
public class WorkflowResource {
protected static final Logger logger = LoggerFactory.getLogger(WorkflowResource.class);
- private static final String pattern = ".*\\\"activity:(.*)\\\" .*";
+ private static final String PATTERN = ".*\\\"activity:(.*)\\\" .*";
private static final String TARGET_RESOURCE_VNF = "vnf";
private static final String SOURCE_SDC = "sdc";
private static final String BPMN_SUFFIX = ".bpmn";
@@ -176,7 +176,7 @@ public class WorkflowResource {
protected List<String> getActivityNameList(String bpmnContent) {
List<String> activityNameList = new ArrayList<>();
- Pattern p = Pattern.compile(pattern);
+ Pattern p = Pattern.compile(PATTERN);
Matcher m = p.matcher(bpmnContent);
while (m.find()) {
activityNameList.add(m.group(1));
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 276b8183a8..240bb83862 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -26,6 +26,7 @@ package org.onap.so.asdc.installer.heat;
import java.sql.Timestamp;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -47,11 +48,15 @@ import org.onap.sdc.api.notification.IStatusData;
import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.elements.queries.EntityQuery;
+import org.onap.sdc.tosca.parser.elements.queries.EntityQuery.EntityQueryBuilder;
import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery;
import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery.TopologyTemplateQueryBuilder;
+import org.onap.sdc.tosca.parser.enums.EntityTemplateType;
import org.onap.sdc.tosca.parser.enums.SdcTypes;
import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.onap.sdc.toscaparser.api.*;
+import org.onap.sdc.toscaparser.api.CapabilityAssignment;
+import org.onap.sdc.toscaparser.api.Property;
+import org.onap.sdc.toscaparser.api.RequirementAssignment;
import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.onap.sdc.toscaparser.api.functions.GetInput;
import org.onap.sdc.toscaparser.api.parameters.Input;
@@ -177,6 +182,12 @@ public class ToscaResourceInstaller {
protected static final String SKIP_POST_INST_CONF = "skip_post_instantiation_configuration";
+ private static final String CONTROLLER_ACTOR = "controller_actor";
+
+ private static final String CDS_MODEL_NAME = "cds_model_name";
+
+ private static final String CDS_MODEL_VERSION = "cds_model_version";
+
@Autowired
protected ServiceRepository serviceRepo;
@@ -431,19 +442,26 @@ public class ToscaResourceInstaller {
createToscaCsar(toscaResourceStruct);
createService(toscaResourceStruct, vfResourceStruct);
Service service = toscaResourceStruct.getCatalogService();
- List<NodeTemplate> vfNodeTemplatesList = toscaResourceStruct.getSdcCsarHelper().getServiceVfList();
- for (NodeTemplate nodeTemplate : vfNodeTemplatesList) {
- Metadata metadata = nodeTemplate.getMetaData();
- String vfCustomizationCategory = toscaResourceStruct.getSdcCsarHelper()
- .getMetadataPropertyValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY);
- processVfModules(toscaResourceStruct, vfResourceStructure, service, nodeTemplate, metadata,
- vfCustomizationCategory);
+ List<IEntityDetails> vfEntityList = getEntityDetails(toscaResourceStruct,
+ EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+ List<IEntityDetails> arEntityDetails = new ArrayList<IEntityDetails>();
+
+ for (IEntityDetails vfEntityDetails : vfEntityList) {
+
+ Metadata metadata = vfEntityDetails.getMetadata();
+ String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+
+ if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) {
+ arEntityDetails.add(vfEntityDetails);
+ }
+
+ processVfModules(vfEntityDetails, toscaResourceStruct, vfResourceStructure, service, metadata);
}
processResourceSequence(toscaResourceStruct, service);
- List<NodeTemplate> allottedResourceList = toscaResourceStruct.getSdcCsarHelper().getAllottedResources();
- processAllottedResources(toscaResourceStruct, service, allottedResourceList);
+ processAllottedResources(arEntityDetails, toscaResourceStruct, service);
processNetworks(toscaResourceStruct, service);
// process Network Collections
processNetworkCollections(toscaResourceStruct, service);
@@ -499,24 +517,24 @@ public class ToscaResourceInstaller {
}
- List<NodeTemplate> getRequirementList(List<NodeTemplate> resultList, List<NodeTemplate> nodeTemplates,
+ List<IEntityDetails> getRequirementList(List<IEntityDetails> resultList, List<IEntityDetails> entityDetails,
ISdcCsarHelper iSdcCsarHelper) {
- List<NodeTemplate> nodes = new ArrayList<>();
- nodes.addAll(nodeTemplates);
+ List<IEntityDetails> entities = new ArrayList<>();
+ entityDetails.addAll(entityDetails);
- for (NodeTemplate nodeTemplate : nodeTemplates) {
- RequirementAssignments requirement = iSdcCsarHelper.getRequirementsOf(nodeTemplate);
- List<RequirementAssignment> reqAs = requirement.getAll();
- for (RequirementAssignment ra : reqAs) {
+ for (IEntityDetails entity : entityDetails) {
+ List<RequirementAssignment> requirements = entity.getRequirements();
+
+ for (RequirementAssignment ra : requirements) {
String reqNode = ra.getNodeTemplateName();
- for (NodeTemplate rNode : resultList) {
- if (rNode.getName().equals(reqNode)) {
- if (!resultList.contains(nodeTemplate)) {
- resultList.add(nodeTemplate);
+ for (IEntityDetails rEntity : resultList) {
+ if (rEntity.getName().equals(reqNode)) {
+ if (!resultList.contains(entityDetails)) {
+ resultList.add(entity);
}
- if (nodes.contains(nodeTemplate)) {
- nodes.remove(nodeTemplate);
+ if (entities.contains(entityDetails)) {
+ entities.remove(entityDetails);
}
break;
}
@@ -524,8 +542,8 @@ public class ToscaResourceInstaller {
}
}
- if (!nodes.isEmpty()) {
- getRequirementList(resultList, nodes, iSdcCsarHelper);
+ if (!entities.isEmpty()) {
+ getRequirementList(resultList, entities, iSdcCsarHelper);
}
return resultList;
@@ -534,26 +552,30 @@ public class ToscaResourceInstaller {
// This method retrieve resource sequence from csar file
void processResourceSequence(ToscaResourceStructure toscaResourceStructure, Service service) {
List<String> resouceSequence = new ArrayList<>();
- List<NodeTemplate> resultList = new ArrayList<>();
+ List<IEntityDetails> resultList = new ArrayList<>();
ISdcCsarHelper iSdcCsarHelper = toscaResourceStructure.getSdcCsarHelper();
- List<NodeTemplate> nodeTemplates = iSdcCsarHelper.getServiceNodeTemplates();
- List<NodeTemplate> nodes = new ArrayList<>();
- nodes.addAll(nodeTemplates);
- for (NodeTemplate nodeTemplate : nodeTemplates) {
- RequirementAssignments requirement = iSdcCsarHelper.getRequirementsOf(nodeTemplate);
+ List<IEntityDetails> vfEntityList =
+ getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+ List<IEntityDetails> entities = new ArrayList<>();
+ entities.addAll(vfEntityList);
- if (requirement == null || requirement.getAll() == null || requirement.getAll().isEmpty()) {
- resultList.add(nodeTemplate);
- nodes.remove(nodeTemplate);
+ for (IEntityDetails entityDetails : vfEntityList) {
+ List<RequirementAssignment> requirements = entityDetails.getRequirements();
+
+ if (requirements == null || requirements.isEmpty()) {
+ resultList.add(entityDetails);
+ entities.remove(entityDetails);
}
}
- resultList = getRequirementList(resultList, nodes, iSdcCsarHelper);
+ resultList = getRequirementList(resultList, entities, iSdcCsarHelper);
- for (NodeTemplate node : resultList) {
- String templateName = node.getMetaData().getValue("name");
+ for (IEntityDetails entity : resultList) {
+ String templateName = entity.getMetadata().getValue("name");
if (!resouceSequence.contains(templateName)) {
resouceSequence.add(templateName);
}
@@ -561,7 +583,7 @@ public class ToscaResourceInstaller {
String resourceSeqStr = resouceSequence.stream().collect(Collectors.joining(","));
service.setResourceOrder(resourceSeqStr);
- logger.debug(" resourceSeq for service uuid(" + service.getModelUUID() + ") : " + resourceSeqStr);
+ logger.debug(" resourceSeq for service uuid {}: {}", service.getModelUUID(), resourceSeqStr);
}
@@ -570,7 +592,8 @@ public class ToscaResourceInstaller {
String outInput;
String defaultValue = null;
if (value instanceof Map) {
- outInput = ((LinkedHashMap) value).values().toArray()[0].toString();
+ Collection values = ((LinkedHashMap) value).values();
+ outInput = (values.size() > 0) ? values.toArray()[0].toString() : "";
} else if (value instanceof GetInput) {
String inputName = ((GetInput) value).getInputName();
Optional<Input> inputOptional =
@@ -596,13 +619,17 @@ public class ToscaResourceInstaller {
Map<String, String> resouceRequest = new HashMap<>();
ISdcCsarHelper iSdcCsarHelper = toscaResourceStructure.getSdcCsarHelper();
+ List<IEntityDetails> nodeTemplateEntityList =
+ getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
List<Input> serInput = iSdcCsarHelper.getServiceInputs();
- Optional<NodeTemplate> nodeTemplateOpt = iSdcCsarHelper.getServiceNodeTemplates().stream()
- .filter(e -> e.getMetaData().getValue(CUSTOMIZATION_UUID).equals(resourceCustomizationUuid))
+ Optional<IEntityDetails> nodeTemplateOpt = nodeTemplateEntityList.stream()
+ .filter(e -> e.getMetadata().getValue(CUSTOMIZATION_UUID).equals(resourceCustomizationUuid))
.findFirst();
if (nodeTemplateOpt.isPresent()) {
- NodeTemplate nodeTemplate = nodeTemplateOpt.get();
- LinkedHashMap<String, Property> resourceProperties = nodeTemplate.getProperties();
+ IEntityDetails entityDetails = nodeTemplateOpt.get();
+ Map<String, Property> resourceProperties = entityDetails.getProperties();
for (String key : resourceProperties.keySet()) {
Property property = resourceProperties.get(key);
@@ -617,8 +644,7 @@ public class ToscaResourceInstaller {
String jsonStr = objectMapper.writeValueAsString(resouceRequest);
jsonStr = jsonStr.replace("\"", "\\\"");
- logger.debug(
- "resource request for resource customization id (" + resourceCustomizationUuid + ") : " + jsonStr);
+ logger.debug("resource request for resource customization id {}: {}", resourceCustomizationUuid, jsonStr);
return jsonStr;
} catch (JsonProcessingException e) {
logger.error("resource input could not be deserialized for resource customization id ("
@@ -630,7 +656,8 @@ public class ToscaResourceInstaller {
protected void processNetworks(ToscaResourceStructure toscaResourceStruct, Service service)
throws ArtifactInstallerException {
- List<IEntityDetails> vlEntityList = getEntityDetails(toscaResourceStruct, SdcTypes.VL, SdcTypes.SERVICE, false);
+ List<IEntityDetails> vlEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.VL),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
if (vlEntityList != null) {
for (IEntityDetails vlEntity : vlEntityList) {
@@ -646,7 +673,10 @@ public class ToscaResourceInstaller {
NetworkResourceCustomization networkCustomization = createNetwork(vlEntity, toscaResourceStruct,
heatTemplate, tempNetworkLookUp.getAicVersionMax(),
tempNetworkLookUp.getAicVersionMin(), service);
- service.getNetworkCustomizations().add(networkCustomization);
+ // only insert unique entries
+ if (!service.getNetworkCustomizations().contains(networkCustomization)) {
+ service.getNetworkCustomizations().add(networkCustomization);
+ }
} else {
throw new ArtifactInstallerException("No HeatTemplate found for artifactUUID: "
+ tempNetworkLookUp.getHeatTemplateArtifactUuid());
@@ -654,44 +684,68 @@ public class ToscaResourceInstaller {
} else {
NetworkResourceCustomization networkCustomization =
createNetwork(vlEntity, toscaResourceStruct, null, null, null, service);
+ networkCustomization.setResourceInput(
+ getResourceInput(toscaResourceStruct, networkCustomization.getModelCustomizationUUID()));
service.getNetworkCustomizations().add(networkCustomization);
- logger.debug("No NetworkResourceName found in TempNetworkHeatTemplateLookup for "
- + networkResourceModelName);
+ logger.debug("No NetworkResourceName found in TempNetworkHeatTemplateLookup for {}",
+ networkResourceModelName);
}
}
}
}
- protected void processAllottedResources(ToscaResourceStructure toscaResourceStruct, Service service,
- List<NodeTemplate> allottedResourceList) {
- if (allottedResourceList != null) {
- for (NodeTemplate allottedNode : allottedResourceList) {
- service.getAllottedCustomizations()
- .add(createAllottedResource(allottedNode, toscaResourceStruct, service));
+ protected void processAllottedResources(List<IEntityDetails> arEntityDetails,
+ ToscaResourceStructure toscaResourceStruct, Service service) throws ArtifactInstallerException {
+
+ List<IEntityDetails> pnfAREntityList = getEntityDetails(toscaResourceStruct,
+ EntityQuery.newBuilder(SdcTypes.PNF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+ for (IEntityDetails pnfEntity : pnfAREntityList) {
+
+ Metadata metadata = pnfEntity.getMetadata();
+ String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+ if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) {
+ arEntityDetails.add(pnfEntity);
+ }
+
+ }
+
+ if (arEntityDetails != null) {
+ for (IEntityDetails arEntity : arEntityDetails) {
+ AllottedResourceCustomization allottedResource =
+ createAllottedResource(arEntity, toscaResourceStruct, service);
+ String resourceInput =
+ getResourceInput(toscaResourceStruct, allottedResource.getModelCustomizationUUID());
+ if (!"{}".equals(resourceInput)) {
+ allottedResource.setResourceInput(resourceInput);
+ }
+ if (!service.getAllottedCustomizations().contains(allottedResource)) {
+ service.getAllottedCustomizations().add(allottedResource);
+ }
}
}
}
- protected ConfigurationResource getConfigurationResource(NodeTemplate nodeTemplate) {
- Metadata metadata = nodeTemplate.getMetaData();
+ protected ConfigurationResource getConfigurationResource(IEntityDetails configEntity) {
+ Metadata metadata = configEntity.getMetadata();
ConfigurationResource configResource = new ConfigurationResource();
configResource.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
configResource.setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
configResource.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
configResource.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
configResource.setDescription(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
- configResource.setToscaNodeType(nodeTemplate.getType());
+ configResource.setToscaNodeType(configEntity.getToscaType());
return configResource;
}
- protected ConfigurationResourceCustomization getConfigurationResourceCustomization(NodeTemplate nodeTemplate,
+ protected ConfigurationResourceCustomization getConfigurationResourceCustomization(IEntityDetails configEntity,
ToscaResourceStructure toscaResourceStructure, ServiceProxyResourceCustomization spResourceCustomization,
Service service) {
- Metadata metadata = nodeTemplate.getMetaData();
+ Metadata metadata = configEntity.getMetadata();
- ConfigurationResource configResource = getConfigurationResource(nodeTemplate);
+ ConfigurationResource configResource = getConfigurationResource(configEntity);
ConfigurationResourceCustomization configCustomizationResource = new ConfigurationResourceCustomization();
@@ -699,14 +753,12 @@ public class ToscaResourceInstaller {
configCustomizationResource
.setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- configCustomizationResource.setModelInstanceName(nodeTemplate.getName());
-
- configCustomizationResource.setFunction(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, "function"));
- configCustomizationResource.setRole(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, "role"));
- configCustomizationResource.setType(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, "type"));
+ configCustomizationResource.setModelInstanceName(configEntity.getName());
+
+ configCustomizationResource.setFunction(getLeafPropertyValue(configEntity, "function"));
+ configCustomizationResource.setRole(getLeafPropertyValue(configEntity, "role"));
+ configCustomizationResource.setType(getLeafPropertyValue(configEntity, "type"));
+
configCustomizationResource.setServiceProxyResourceCustomization(spResourceCustomization);
configCustomizationResource.setConfigurationResource(configResource);
@@ -718,37 +770,39 @@ public class ToscaResourceInstaller {
return configCustomizationResource;
}
-
protected void processServiceProxyAndConfiguration(ToscaResourceStructure toscaResourceStruct, Service service) {
- List<NodeTemplate> serviceProxyResourceList =
- toscaResourceStruct.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
+ List<IEntityDetails> spEntityList =
+ getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.SERVICE_PROXY),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
- List<NodeTemplate> configurationNodeTemplatesList =
- toscaResourceStruct.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CONFIGURATION);
+ List<IEntityDetails> configEntityList =
+ getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.CONFIGURATION),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
List<ServiceProxyResourceCustomization> serviceProxyList = new ArrayList<>();
List<ConfigurationResourceCustomization> configurationResourceList = new ArrayList<>();
ServiceProxyResourceCustomization serviceProxy = null;
- if (serviceProxyResourceList != null) {
- for (NodeTemplate spNode : serviceProxyResourceList) {
- serviceProxy = createServiceProxy(spNode, service, toscaResourceStruct);
+ if (spEntityList != null) {
+ for (IEntityDetails spEntity : spEntityList) {
+ serviceProxy = createServiceProxy(spEntity, service, toscaResourceStruct);
serviceProxyList.add(serviceProxy);
- for (NodeTemplate configNode : configurationNodeTemplatesList) {
+ for (IEntityDetails configEntity : configEntityList) {
+
+ List<RequirementAssignment> requirements = configEntity.getRequirements();
+
+ for (RequirementAssignment requirement : requirements) {
- List<RequirementAssignment> requirementsList =
- toscaResourceStruct.getSdcCsarHelper().getRequirementsOf(configNode).getAll();
- for (RequirementAssignment requirement : requirementsList) {
- if (requirement.getNodeTemplateName().equals(spNode.getName())) {
- ConfigurationResourceCustomization configurationResource = createConfiguration(configNode,
+ if (requirement.getNodeTemplateName().equals(spEntity.getName())) {
+ ConfigurationResourceCustomization configurationResource = createConfiguration(configEntity,
toscaResourceStruct, serviceProxy, service, configurationResourceList);
Optional<ConfigurationResourceCustomization> matchingObject =
configurationResourceList.stream()
- .filter(configurationResourceCustomization -> configNode.getMetaData()
+ .filter(configurationResourceCustomization -> configEntity.getMetadata()
.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)
.equals(configurationResource.getModelCustomizationUUID()))
.filter(configurationResourceCustomization -> configurationResourceCustomization
@@ -803,13 +857,13 @@ public class ToscaResourceInstaller {
protected void processNetworkCollections(ToscaResourceStructure toscaResourceStruct, Service service) {
- List<NodeTemplate> networkCollectionList =
- toscaResourceStruct.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR);
+ List<IEntityDetails> crEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.CR),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
- if (networkCollectionList != null) {
- for (NodeTemplate crNode : networkCollectionList) {
+ if (crEntityList != null) {
+ for (IEntityDetails ncEntity : crEntityList) {
- createNetworkCollection(crNode, toscaResourceStruct, service);
+ createNetworkCollection(ncEntity, toscaResourceStruct, service);
collectionRepo.saveAndFlush(toscaResourceStruct.getCatalogCollectionResource());
List<NetworkInstanceGroup> networkInstanceGroupList =
@@ -926,8 +980,8 @@ public class ToscaResourceInstaller {
pnfResourceCustomization.setBlueprintName(getStringValue(properties.get(SDNC_MODEL_NAME)));
pnfResourceCustomization.setBlueprintVersion(getStringValue(properties.get(SDNC_MODEL_VERSION)));
pnfResourceCustomization.setSkipPostInstConf(getBooleanValue(properties.get(SKIP_POST_INST_CONF)));
+ pnfResourceCustomization.setControllerActor(getStringValue(properties.get(CONTROLLER_ACTOR)));
pnfResourceCustomization.setPnfResources(pnfResource);
-
return pnfResourceCustomization;
}
@@ -953,49 +1007,56 @@ public class ToscaResourceInstaller {
return String.valueOf(value);
}
- protected void processVfModules(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStructure,
- Service service, NodeTemplate nodeTemplate, Metadata metadata, String vfCustomizationCategory)
- throws Exception {
+ protected void processVfModules(IEntityDetails vfEntityDetails, ToscaResourceStructure toscaResourceStruct,
+ VfResourceStructure vfResourceStructure, Service service, Metadata metadata) throws Exception {
+
+ String vfCustomizationCategory =
+ vfEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
- logger.debug("VF Category is : " + vfCustomizationCategory);
+ logger.debug("VF Category is: {} ", vfCustomizationCategory);
- if (vfResourceStructure.getVfModuleStructure() != null
- && !vfResourceStructure.getVfModuleStructure().isEmpty()) {
+ String vfCustomizationUUID =
+ vfEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
- String vfCustomizationUUID = toscaResourceStruct.getSdcCsarHelper().getMetadataPropertyValue(metadata,
- SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
- logger.debug("VFCustomizationUUID=" + vfCustomizationUUID);
+ logger.debug("VFCustomizationUUID= {}", vfCustomizationUUID);
- IResourceInstance vfNotificationResource = vfResourceStructure.getResourceInstance();
+ IResourceInstance vfNotificationResource = vfResourceStructure.getResourceInstance();
- // Make sure the VF ResourceCustomizationUUID from the notification and tosca customizations match before
- // comparing their VF Modules UUID's
- logger.debug("Checking if Notification VF ResourceCustomizationUUID: "
- + vfNotificationResource.getResourceCustomizationUUID() + " matches Tosca VF Customization UUID: "
- + vfCustomizationUUID);
+ // Make sure the VF ResourceCustomizationUUID from the notification and tosca customizations match before
+ // comparing their VF Modules UUID's
+ logger.debug(
+ "Checking if Notification VF ResourceCustomizationUUID: {} matches Tosca VF Customization UUID: {}",
+ vfNotificationResource.getResourceCustomizationUUID(), vfCustomizationUUID);
- if (vfCustomizationUUID.equals(vfNotificationResource.getResourceCustomizationUUID())) {
+ if (vfCustomizationUUID.equals(vfNotificationResource.getResourceCustomizationUUID())) {
- logger.debug("vfCustomizationUUID: " + vfCustomizationUUID
- + " matches vfNotificationResource CustomizationUUID");
+ logger.debug("vfCustomizationUUID: {} matches vfNotificationResource CustomizationUUID ",
+ vfCustomizationUUID);
- VnfResourceCustomization vnfResource = createVnfResource(nodeTemplate, toscaResourceStruct, service);
+ VnfResourceCustomization vnfResource = createVnfResource(vfEntityDetails, toscaResourceStruct, service);
+ if (vfResourceStructure.getVfModuleStructure() != null
+ && !vfResourceStructure.getVfModuleStructure().isEmpty()) {
Set<CvnfcCustomization> existingCvnfcSet = new HashSet<>();
Set<VnfcCustomization> existingVnfcSet = new HashSet<>();
List<CvnfcConfigurationCustomization> existingCvnfcConfigurationCustom = new ArrayList<>();
for (VfModuleStructure vfModuleStructure : vfResourceStructure.getVfModuleStructure()) {
- logger.debug("vfModuleStructure:" + vfModuleStructure.toString());
- List<org.onap.sdc.toscaparser.api.Group> vfGroups =
- toscaResourceStruct.getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID);
+ logger.debug("vfModuleStructure: {}", vfModuleStructure);
+
+ List<IEntityDetails> vfModuleEntityList =
+ getEntityDetails(toscaResourceStruct,
+ EntityQuery.newBuilder("org.openecomp.groups.VfModule"), TopologyTemplateQuery
+ .newBuilder(SdcTypes.SERVICE).customizationUUID(vfCustomizationUUID),
+ false);
+
IVfModuleData vfMetadata = vfModuleStructure.getVfModuleMetadata();
logger.debug("Comparing Vf_Modules_Metadata CustomizationUUID : "
+ vfMetadata.getVfModuleModelCustomizationUUID());
- Optional<org.onap.sdc.toscaparser.api.Group> matchingObject = vfGroups.stream()
+ Optional<IEntityDetails> matchingObject = vfModuleEntityList.stream()
.peek(group -> logger.debug("To Csar Group VFModuleModelCustomizationUUID "
+ group.getMetadata().getValue("vfModuleModelCustomizationUUID")))
.filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID")
@@ -1003,7 +1064,7 @@ public class ToscaResourceInstaller {
.findFirst();
if (matchingObject.isPresent()) {
VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(),
- nodeTemplate, toscaResourceStruct, vfResourceStructure, vfMetadata, vnfResource,
+ toscaResourceStruct, vfResourceStructure, vfMetadata, vnfResource, service,
existingCvnfcSet, existingVnfcSet, existingCvnfcConfigurationCustom);
vfModuleCustomization.getVfModule().setVnfResources(vnfResource.getVnfResources());
} else
@@ -1012,113 +1073,120 @@ public class ToscaResourceInstaller {
+ vfMetadata.getVfModuleModelCustomizationUUID());
}
+ }
+ // Check for VNFC Instance Group info and add it if there is
+ List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStruct,
+ EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(vfCustomizationUUID), false);
- // Check for VNFC Instance Group info and add it if there is
- List<Group> groupList =
- toscaResourceStruct.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(
- nodeTemplate, "org.openecomp.groups.VfcInstanceGroup");
+ Set<VnfcCustomization> existingVnfcGroupSet = new HashSet<>();
- for (Group group : groupList) {
- VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization =
- createVNFCInstanceGroup(nodeTemplate, group, vnfResource, toscaResourceStruct);
- vnfcInstanceGroupCustomizationRepo.saveAndFlush(vnfcInstanceGroupCustomization);
- }
+ for (IEntityDetails groupEntity : vfcEntityList) {
+ VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization = createVNFCInstanceGroup(groupEntity,
+ vfEntityDetails, vnfResource, toscaResourceStruct, existingVnfcGroupSet);
+ vnfcInstanceGroupCustomizationRepo.saveAndFlush(vnfcInstanceGroupCustomization);
+ }
- List<String> seqResult = processVNFCGroupSequence(toscaResourceStruct, groupList);
- if (!CollectionUtils.isEmpty(seqResult)) {
- String resultStr = seqResult.stream().collect(Collectors.joining(","));
- vnfResource.setVnfcInstanceGroupOrder(resultStr);
- logger.debug(
- "vnfcGroupOrder result for service uuid(" + service.getModelUUID() + ") : " + resultStr);
- }
- // add this vnfResource with existing vnfResource for this service
- addVnfCustomization(service, vnfResource);
- } else {
- logger.debug("Notification VF ResourceCustomizationUUID: "
- + vfNotificationResource.getResourceCustomizationUUID() + " doesn't match "
- + "Tosca VF Customization UUID: " + vfCustomizationUUID);
+ List<String> seqResult = processVNFCGroupSequence(toscaResourceStruct, vfcEntityList);
+ if (!CollectionUtils.isEmpty(seqResult)) {
+ String resultStr = seqResult.stream().collect(Collectors.joining(","));
+ vnfResource.setVnfcInstanceGroupOrder(resultStr);
+ logger.debug("vnfcGroupOrder result for service uuid {}: {}", service.getModelUUID(), resultStr);
}
+ // add this vnfResource with existing vnfResource for this service
+ addVnfCustomization(service, vnfResource);
+ } else {
+ logger.debug("Notification VF ResourceCustomizationUUID: "
+ + vfNotificationResource.getResourceCustomizationUUID() + " doesn't match "
+ + "Tosca VF Customization UUID: " + vfCustomizationUUID);
}
}
private List<String> processVNFCGroupSequence(ToscaResourceStructure toscaResourceStructure,
- List<Group> groupList) {
- if (CollectionUtils.isEmpty(groupList)) {
+ List<IEntityDetails> groupEntityDetails) {
+ if (CollectionUtils.isEmpty(groupEntityDetails)) {
return Collections.emptyList();
}
ISdcCsarHelper iSdcCsarHelper = toscaResourceStructure.getSdcCsarHelper();
- List<String> strSequence = new ArrayList<>(groupList.size());
- List<Group> tempGroupList = new ArrayList<>(groupList.size());
- List<NodeTemplate> nodes = new ArrayList<>();
- tempGroupList.addAll(groupList);
+ List<String> strSequence = new ArrayList<>(groupEntityDetails.size());
+ List<IEntityDetails> tempEntityList = new ArrayList<>(groupEntityDetails.size());
+ List<IEntityDetails> entities = new ArrayList<>();
+ tempEntityList.addAll(groupEntityDetails);
+
+ for (IEntityDetails vnfcEntityDetails : groupEntityDetails) {
+
+ List<IEntityDetails> vnfcMemberNodes = vnfcEntityDetails.getMemberNodes();
- for (Group group : groupList) {
- List<NodeTemplate> nodeList = group.getMemberNodes();
boolean hasRequirements = false;
- for (NodeTemplate node : nodeList) {
- RequirementAssignments requirements = iSdcCsarHelper.getRequirementsOf(node);
- if (requirements != null && requirements.getAll() != null && !requirements.getAll().isEmpty()) {
+ for (IEntityDetails vnfcDetails : vnfcMemberNodes) {
+
+ List<RequirementAssignment> requirements = vnfcDetails.getRequirements();
+
+ if (requirements != null && !requirements.isEmpty()) {
hasRequirements = true;
break;
}
}
if (!hasRequirements) {
- strSequence.add(group.getName());
- tempGroupList.remove(group);
- nodes.addAll(nodeList);
+ strSequence.add(vnfcEntityDetails.getName());
+ tempEntityList.remove(vnfcEntityDetails);
+ entities.addAll(vnfcMemberNodes);
}
}
- getVNFCGroupSequenceList(strSequence, tempGroupList, nodes, iSdcCsarHelper);
+ getVNFCGroupSequenceList(strSequence, tempEntityList, entities, iSdcCsarHelper);
return strSequence;
}
- private void getVNFCGroupSequenceList(List<String> strSequence, List<Group> groupList, List<NodeTemplate> nodes,
- ISdcCsarHelper iSdcCsarHelper) {
- if (CollectionUtils.isEmpty(groupList)) {
+ private void getVNFCGroupSequenceList(List<String> strSequence, List<IEntityDetails> vnfcGroupDetails,
+ List<IEntityDetails> vnfcMemberNodes, ISdcCsarHelper iSdcCsarHelper) {
+ if (CollectionUtils.isEmpty(vnfcGroupDetails)) {
return;
}
- List<Group> tempGroupList = new ArrayList<>();
- tempGroupList.addAll(groupList);
+ List<IEntityDetails> tempGroupList = new ArrayList<>();
+ tempGroupList.addAll(vnfcGroupDetails);
+
+ for (IEntityDetails vnfcGroup : vnfcGroupDetails) {
+ List<IEntityDetails> members = vnfcGroup.getMemberNodes();
+ for (IEntityDetails memberNode : members) {
+ boolean isAllExists = true;
- for (Group group : groupList) {
- boolean isAllExists = true;
- ArrayList<NodeTemplate> members = group.getMemberNodes();
- for (NodeTemplate memberNode : members) {
- RequirementAssignments requirements = iSdcCsarHelper.getRequirementsOf(memberNode);
- if (requirements == null || requirements.getAll() == null || requirements.getAll().isEmpty()) {
+
+ List<RequirementAssignment> requirements = memberNode.getRequirements();
+
+ if (requirements == null || requirements.isEmpty()) {
continue;
}
- List<RequirementAssignment> rqaList = requirements.getAll();
- for (RequirementAssignment rqa : rqaList) {
+
+
+ for (RequirementAssignment rqa : requirements) {
String name = rqa.getNodeTemplateName();
- Optional<NodeTemplate> findNode =
- nodes.stream().filter(node -> node.getName().equals(name)).findFirst();
- if (!findNode.isPresent()) {
- isAllExists = false;
- break;
+ for (IEntityDetails node : vnfcMemberNodes) {
+ if (name.equals(node.getName())) {
+ break;
+ }
}
- }
- if (!isAllExists) {
+
+ isAllExists = false;
break;
}
- }
- if (isAllExists) {
- strSequence.add(group.getName());
- tempGroupList.remove(group);
- nodes.addAll(group.getMemberNodes());
+ if (isAllExists) {
+ strSequence.add(vnfcGroup.getName());
+ tempGroupList.remove(vnfcGroupDetails);
+ vnfcMemberNodes.addAll(vnfcGroupDetails);
+ }
}
- }
- if (!tempGroupList.isEmpty() && tempGroupList.size() < groupList.size()) {
- getVNFCGroupSequenceList(strSequence, tempGroupList, nodes, iSdcCsarHelper);
+ if (!tempGroupList.isEmpty() && tempGroupList.size() < vnfcGroupDetails.size()) {
+ getVNFCGroupSequenceList(strSequence, tempGroupList, vnfcMemberNodes, iSdcCsarHelper);
+ }
}
}
@@ -1134,7 +1202,7 @@ public class ToscaResourceInstaller {
watchdogDistributionStatusRepository.saveAndFlush(distributionStatus);
} catch (ObjectOptimisticLockingFailureException e) {
- logger.debug("ObjectOptimisticLockingFailureException in processWatchdog : " + e.toString());
+ logger.debug("ObjectOptimisticLockingFailureException in processWatchdog : {} ", e);
throw e;
}
}
@@ -1338,8 +1406,14 @@ public class ToscaResourceInstaller {
ResourceStructure resourceStructure) {
Metadata serviceMetadata = toscaResourceStructure.getServiceMetadata();
-
- Service service = new Service();
+ List<Service> services =
+ serviceRepo.findByModelUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ Service service;
+ if (!services.isEmpty() && services.size() > 0) {
+ service = services.get(0);
+ } else {
+ service = new Service();
+ }
if (serviceMetadata != null) {
@@ -1368,6 +1442,10 @@ public class ToscaResourceInstaller {
generateNamingValue = "true".equalsIgnoreCase(generateNaming);
}
service.setOnapGeneratedNaming(generateNamingValue);
+ service.setBlueprintName(serviceMetadata.getValue(CDS_MODEL_NAME));
+ service.setBlueprintVersion(serviceMetadata.getValue(CDS_MODEL_VERSION));
+ service.setSkipPostInstConf(Boolean.valueOf(serviceMetadata.getValue(SKIP_POST_INST_CONF)));
+ service.setControllerActor(serviceMetadata.getValue(CONTROLLER_ACTOR));
}
@@ -1375,10 +1453,10 @@ public class ToscaResourceInstaller {
return service;
}
- protected ServiceProxyResourceCustomization createServiceProxy(NodeTemplate nodeTemplate, Service service,
+ protected ServiceProxyResourceCustomization createServiceProxy(IEntityDetails spEntity, Service service,
ToscaResourceStructure toscaResourceStructure) {
- Metadata spMetadata = nodeTemplate.getMetaData();
+ Metadata spMetadata = spEntity.getMetadata();
ServiceProxyResourceCustomization spCustomizationResource = new ServiceProxyResourceCustomization();
@@ -1393,15 +1471,15 @@ public class ToscaResourceInstaller {
spCustomizationResource
.setModelCustomizationUUID(spMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- spCustomizationResource.setModelInstanceName(nodeTemplate.getName());
- spCustomizationResource.setToscaNodeType(nodeTemplate.getType());
+ spCustomizationResource.setModelInstanceName(spEntity.getName());
+ spCustomizationResource.setToscaNodeType(spEntity.getToscaType());
String sourceServiceUUID = spMetadata.getValue("sourceModelUuid");
Service sourceService = serviceRepo.findOneByModelUUID(sourceServiceUUID);
spCustomizationResource.setSourceService(sourceService);
- spCustomizationResource.setToscaNodeType(nodeTemplate.getType());
+ spCustomizationResource.setToscaNodeType(spEntity.getToscaType());
serviceProxyCustomizationSet.add(spCustomizationResource);
@@ -1410,20 +1488,20 @@ public class ToscaResourceInstaller {
return spCustomizationResource;
}
- protected ConfigurationResourceCustomization createConfiguration(NodeTemplate nodeTemplate,
+ protected ConfigurationResourceCustomization createConfiguration(IEntityDetails configEntity,
ToscaResourceStructure toscaResourceStructure, ServiceProxyResourceCustomization spResourceCustomization,
Service service, List<ConfigurationResourceCustomization> configurationResourceList) {
ConfigurationResourceCustomization configCustomizationResource = getConfigurationResourceCustomization(
- nodeTemplate, toscaResourceStructure, spResourceCustomization, service);
+ configEntity, toscaResourceStructure, spResourceCustomization, service);
ConfigurationResource configResource = null;
ConfigurationResource existingConfigResource = findExistingConfiguration(service,
- nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID), configurationResourceList);
+ configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID), configurationResourceList);
if (existingConfigResource == null) {
- configResource = getConfigurationResource(nodeTemplate);
+ configResource = getConfigurationResource(configEntity);
} else {
configResource = existingConfigResource;
}
@@ -1451,13 +1529,20 @@ public class ToscaResourceInstaller {
}
protected void createToscaCsar(ToscaResourceStructure toscaResourceStructure) {
- ToscaCsar toscaCsar = new ToscaCsar();
+ Optional<ToscaCsar> toscaCsarOpt =
+ toscaCsarRepo.findById(toscaResourceStructure.getToscaArtifact().getArtifactUUID());
+ ToscaCsar toscaCsar;
+ if (!toscaCsarOpt.isPresent()) {
+ toscaCsar = new ToscaCsar();
+ toscaCsar.setArtifactUUID(toscaResourceStructure.getToscaArtifact().getArtifactUUID());
+ } else {
+ toscaCsar = toscaCsarOpt.get();
+ }
if (toscaResourceStructure.getToscaArtifact().getArtifactChecksum() != null) {
toscaCsar.setArtifactChecksum(toscaResourceStructure.getToscaArtifact().getArtifactChecksum());
} else {
toscaCsar.setArtifactChecksum(MANUAL_RECORD);
}
- toscaCsar.setArtifactUUID(toscaResourceStructure.getToscaArtifact().getArtifactUUID());
toscaCsar.setName(toscaResourceStructure.getToscaArtifact().getArtifactName());
toscaCsar.setVersion(toscaResourceStructure.getToscaArtifact().getArtifactVersion());
toscaCsar.setDescription(toscaResourceStructure.getToscaArtifact().getArtifactDescription());
@@ -1610,7 +1695,7 @@ public class ToscaResourceInstaller {
return networkResource;
}
- protected CollectionNetworkResourceCustomization createNetworkCollection(NodeTemplate networkNodeTemplate,
+ protected CollectionNetworkResourceCustomization createNetworkCollection(IEntityDetails cnrEntity,
ToscaResourceStructure toscaResourceStructure, Service service) {
CollectionNetworkResourceCustomization collectionNetworkResourceCustomization =
@@ -1619,33 +1704,26 @@ public class ToscaResourceInstaller {
// **** Build Object to populate Collection_Resource table
CollectionResource collectionResource = new CollectionResource();
+ collectionResource.setModelName(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
collectionResource
- .setModelName(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
- collectionResource.setModelInvariantUUID(
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
- collectionResource
- .setModelUUID(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- collectionResource
- .setModelVersion(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- collectionResource
- .setDescription(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
- collectionResource.setToscaNodeType(networkNodeTemplate.getType());
+ .setModelInvariantUUID(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ collectionResource.setModelUUID(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ collectionResource.setModelVersion(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ collectionResource.setDescription(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ collectionResource.setToscaNodeType(cnrEntity.getToscaType());
toscaResourceStructure.setCatalogCollectionResource(collectionResource);
// **** Build object to populate Collection_Resource_Customization table
NetworkCollectionResourceCustomization ncfc = new NetworkCollectionResourceCustomization();
- ncfc.setFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- "cr_function"));
- ncfc.setRole(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- "cr_role"));
- ncfc.setType(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- "cr_type"));
+ ncfc.setFunction(getLeafPropertyValue(cnrEntity, "cr_function"));
+ ncfc.setRole(getLeafPropertyValue(cnrEntity, "cr_role"));
+ ncfc.setType(getLeafPropertyValue(cnrEntity, "cr_type"));
- ncfc.setModelInstanceName(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ ncfc.setModelInstanceName(cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
ncfc.setModelCustomizationUUID(
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
Set<CollectionNetworkResourceCustomization> networkResourceCustomizationSet = new HashSet<>();
networkResourceCustomizationSet.add(collectionNetworkResourceCustomization);
@@ -1656,25 +1734,28 @@ public class ToscaResourceInstaller {
toscaResourceStructure.setCatalogCollectionResourceCustomization(ncfc);
// *** Build object to populate the Instance_Group table
- List<Group> groupList =
- toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(
- networkNodeTemplate, "org.openecomp.groups.NetworkCollection");
+ List<IEntityDetails> ncEntityList =
+ getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.NetworkCollection"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(
+ cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
+ false);
List<NetworkInstanceGroup> networkInstanceGroupList = new ArrayList<>();
List<CollectionResourceInstanceGroupCustomization> collectionResourceInstanceGroupCustomizationList =
new ArrayList<>();
- for (Group group : groupList) {
+ for (IEntityDetails ncGroupEntity : ncEntityList) {
NetworkInstanceGroup networkInstanceGroup = new NetworkInstanceGroup();
- Metadata instanceMetadata = group.getMetadata();
+ Metadata instanceMetadata = ncGroupEntity.getMetadata();
networkInstanceGroup.setModelName(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
networkInstanceGroup
.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
networkInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
networkInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- networkInstanceGroup.setToscaNodeType(group.getType());
+ networkInstanceGroup.setToscaNodeType(ncGroupEntity.getToscaType());
networkInstanceGroup.setRole(SubType.SUB_INTERFACE.toString()); // Set
// Role
networkInstanceGroup.setType(InstanceGroupType.L3_NETWORK); // Set
@@ -1688,27 +1769,26 @@ public class ToscaResourceInstaller {
crInstanceGroupCustomization.setInstanceGroup(networkInstanceGroup);
crInstanceGroupCustomization.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
crInstanceGroupCustomization.setModelCustomizationUUID(
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
// Loop through the template policy to find the subinterface_network_quantity property name. Then extract
// the value for it.
- List<Policy> policyList =
- toscaResourceStructure.getSdcCsarHelper().getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(
- networkNodeTemplate, "org.openecomp.policies.scaling.Fixed");
+ List<IEntityDetails> policyEntityList = getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.policies.scaling.Fixed"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), true);
- if (policyList != null) {
- for (Policy policy : policyList) {
- for (String policyNetworkCollection : policy.getTargets()) {
+ if (policyEntityList != null) {
+ for (IEntityDetails policyEntity : policyEntityList) {
+ for (String policyNetworkCollection : policyEntity.getTargets()) {
- if (policyNetworkCollection.equalsIgnoreCase(group.getName())) {
+ if (policyNetworkCollection.equalsIgnoreCase(ncGroupEntity.getName())) {
- Map<String, Object> propMap = policy.getPolicyProperties();
+ Map<String, Property> propMap = policyEntity.getProperties();
if (propMap.get("quantity") != null) {
- String quantity = toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- getPropertyInput(propMap.get("quantity").toString()));
+ String quantity = getLeafPropertyValue(cnrEntity,
+ getPropertyInput(propMap.get("quantity").toString()));
if (quantity != null) {
crInstanceGroupCustomization
@@ -1723,13 +1803,12 @@ public class ToscaResourceInstaller {
}
crInstanceGroupCustomization.setDescription(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)
- + "_network_collection_description"));
- crInstanceGroupCustomization.setFunction(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)
- + "_network_collection_function"));
+ getLeafPropertyValue(cnrEntity, instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)
+ + "_network_collection_description"));
+
+ crInstanceGroupCustomization.setFunction(getLeafPropertyValue(cnrEntity,
+ instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME) + "_network_collection_function"));
+
crInstanceGroupCustomization.setCollectionResourceCust(ncfc);
collectionResourceInstanceGroupCustomizationList.add(crInstanceGroupCustomization);
@@ -1741,18 +1820,21 @@ public class ToscaResourceInstaller {
toscaResourceStructure.setCatalogNetworkInstanceGroup(networkInstanceGroupList);
- List<NodeTemplate> vlNodeList = toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplateBySdcType(networkNodeTemplate, SdcTypes.VL);
+ List<IEntityDetails> networkEntityList =
+ getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VL),
+ TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(
+ cnrEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
+ false);
List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizationList = new ArrayList<>();
// *****Build object to populate the NetworkResource table
NetworkResource networkResource = new NetworkResource();
- for (NodeTemplate vlNodeTemplate : vlNodeList) {
+ for (IEntityDetails networkEntity : networkEntityList) {
- String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
+ String providerNetwork = getLeafPropertyValue(networkEntity,
+ SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
if ("true".equalsIgnoreCase(providerNetwork)) {
networkResource.setNeutronNetworkType(PROVIDER);
@@ -1760,22 +1842,20 @@ public class ToscaResourceInstaller {
networkResource.setNeutronNetworkType(BASIC);
}
- networkResource
- .setModelName(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ networkResource.setModelName(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
networkResource.setModelInvariantUUID(
- vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ networkResource.setModelUUID(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
networkResource
- .setModelUUID(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- networkResource
- .setModelVersion(vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ .setModelVersion(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
networkResource.setAicVersionMax(
- vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
TempNetworkHeatTemplateLookup tempNetworkLookUp =
tempNetworkLookupRepo.findFirstBynetworkResourceModelName(
- vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
if (tempNetworkLookUp != null) {
@@ -1787,29 +1867,28 @@ public class ToscaResourceInstaller {
}
- networkResource.setToscaNodeType(vlNodeTemplate.getType());
+ networkResource.setToscaNodeType(networkEntity.getToscaType());
networkResource.setDescription(
- vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
networkResource.setOrchestrationMode(HEAT);
// Build object to populate the
// Collection_Network_Resource_Customization table
- for (NodeTemplate memberNode : group.getMemberNodes()) {
- collectionNetworkResourceCustomization.setModelInstanceName(memberNode.getName());
+ for (IEntityDetails networkMemberEntity : ncGroupEntity.getMemberNodes()) {
+ collectionNetworkResourceCustomization.setModelInstanceName(networkMemberEntity.getName());
}
collectionNetworkResourceCustomization.setModelCustomizationUUID(
- vlNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
collectionNetworkResourceCustomization.setNetworkTechnology(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
- collectionNetworkResourceCustomization.setNetworkType(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
- collectionNetworkResourceCustomization.setNetworkRole(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
- collectionNetworkResourceCustomization.setNetworkScope(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vlNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
+ getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
+ collectionNetworkResourceCustomization.setNetworkType(
+ getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
+ collectionNetworkResourceCustomization.setNetworkRole(
+ getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
+ collectionNetworkResourceCustomization.setNetworkScope(
+ getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
collectionNetworkResourceCustomization.setInstanceGroup(networkInstanceGroup);
collectionNetworkResourceCustomization.setNetworkResource(networkResource);
collectionNetworkResourceCustomization.setNetworkResourceCustomization(ncfc);
@@ -1822,24 +1901,26 @@ public class ToscaResourceInstaller {
return collectionNetworkResourceCustomization;
}
- protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(NodeTemplate vnfcNodeTemplate, Group group,
- VnfResourceCustomization vnfResourceCustomization, ToscaResourceStructure toscaResourceStructure) {
+ protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(IEntityDetails vfcInstanceEntity,
+ IEntityDetails vfEntityDetails, VnfResourceCustomization vnfResourceCustomization,
+ ToscaResourceStructure toscaResourceStructure, Set<VnfcCustomization> existingVnfcGroupSet) {
- Metadata instanceMetadata = group.getMetadata();
+ Metadata instanceMetadata = vfcInstanceEntity.getMetadata();
InstanceGroup existingInstanceGroup =
instanceGroupRepo.findByModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- VFCInstanceGroup vfcInstanceGroup = new VFCInstanceGroup();
+ VFCInstanceGroup vfcInstanceGroup;
if (existingInstanceGroup == null) {
// Populate InstanceGroup
+ vfcInstanceGroup = new VFCInstanceGroup();
vfcInstanceGroup.setModelName(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
vfcInstanceGroup
.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
vfcInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vfcInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- vfcInstanceGroup.setToscaNodeType(group.getType());
+ vfcInstanceGroup.setToscaNodeType(vfcInstanceEntity.getToscaType());
vfcInstanceGroup.setRole("SUB-INTERFACE"); // Set Role
vfcInstanceGroup.setType(InstanceGroupType.VNFC); // Set type
} else {
@@ -1858,59 +1939,89 @@ public class ToscaResourceInstaller {
vfcInstanceGroupCustom.setDescription(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
String getInputName = null;
- String groupProperty = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- "vfc_instance_group_function");
- if (groupProperty != null) {
- int getInputIndex = groupProperty.indexOf("{get_input=");
- if (getInputIndex > -1) {
- getInputName = groupProperty.substring(getInputIndex + 11, groupProperty.length() - 1);
+
+ Map<String, Property> groupProperties = vfcInstanceEntity.getProperties();
+
+ for (String key : groupProperties.keySet()) {
+ Property property = groupProperties.get(key);
+
+ String vfcName = property.getName();
+
+ if (vfcName != null) {
+ if (vfcName.equals("vfc_instance_group_function")) {
+
+ String vfcValue = property.getValue().toString();
+ int getInputIndex = vfcValue.indexOf("{get_input=");
+ if (getInputIndex > -1) {
+ getInputName = vfcValue.substring(getInputIndex + 11, vfcValue.length() - 1);
+ }
+
+ }
}
+
}
- vfcInstanceGroupCustom.setFunction(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vnfcNodeTemplate, getInputName));
+
+ List<IEntityDetails> serviceEntityList = getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VF)
+ .customizationUUID(vnfResourceCustomization.getModelCustomizationUUID()),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+ if (serviceEntityList != null && !serviceEntityList.isEmpty()) {
+ vfcInstanceGroupCustom.setFunction(getLeafPropertyValue(serviceEntityList.get(0), getInputName));
+ }
+
vfcInstanceGroupCustom.setInstanceGroup(vfcInstanceGroup);
- ArrayList<Input> inputs = vnfcNodeTemplate.getSubMappingToscaTemplate().getInputs();
- createVFCInstanceGroupMembers(vfcInstanceGroupCustom, group, inputs);
+ List<Input> inputs = vfEntityDetails.getInputs();
- return vfcInstanceGroupCustom;
+ createVFCInstanceGroupMembers(vfcInstanceGroupCustom, vfcInstanceEntity, inputs, existingVnfcGroupSet);
+ return vfcInstanceGroupCustom;
}
- private void createVFCInstanceGroupMembers(VnfcInstanceGroupCustomization vfcInstanceGroupCustom, Group group,
- List<Input> inputList) {
- List<NodeTemplate> members = group.getMemberNodes();
+ private void createVFCInstanceGroupMembers(VnfcInstanceGroupCustomization vfcInstanceGroupCustom,
+ IEntityDetails vfcModuleEntity, List<Input> inputList, Set<VnfcCustomization> existingVnfcGroupSet) {
+ List<IEntityDetails> members = vfcModuleEntity.getMemberNodes();
if (!CollectionUtils.isEmpty(members)) {
- for (NodeTemplate vfcTemplate : members) {
- VnfcCustomization vnfcCustomization = new VnfcCustomization();
-
- Metadata metadata = vfcTemplate.getMetaData();
- vnfcCustomization
- .setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- vnfcCustomization.setModelInstanceName(vfcTemplate.getName());
- vnfcCustomization.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- vnfcCustomization
- .setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
- vnfcCustomization.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- vnfcCustomization.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
- vnfcCustomization.setToscaNodeType(testNull(vfcTemplate.getType()));
- vnfcCustomization
- .setDescription(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
- vnfcCustomization.setResourceInput(getVnfcResourceInput(vfcTemplate, inputList));
- List<VnfcCustomization> vnfcCustomizations = vfcInstanceGroupCustom.getVnfcCustomizations();
-
- if (vnfcCustomizations == null) {
- vnfcCustomizations = new ArrayList<>();
- vfcInstanceGroupCustom.setVnfcCustomizations(vnfcCustomizations);
+ for (IEntityDetails vfcEntity : members) {
+
+ VnfcCustomization existingVfcGroup = findExistingVfc(existingVnfcGroupSet,
+ vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+
+ if (existingVfcGroup == null) {
+ VnfcCustomization vnfcCustomization = new VnfcCustomization();
+
+ Metadata metadata = vfcEntity.getMetadata();
+ vnfcCustomization.setModelCustomizationUUID(
+ metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ vnfcCustomization.setModelInstanceName(vfcEntity.getName());
+ vnfcCustomization.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ vnfcCustomization
+ .setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ vnfcCustomization.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ vnfcCustomization.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ vnfcCustomization.setToscaNodeType(testNull(vfcEntity.getToscaType()));
+ vnfcCustomization
+ .setDescription(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ vnfcCustomization.setResourceInput(getVnfcResourceInput(vfcEntity, inputList));
+ vnfcCustomization.setVnfcInstanceGroupCustomization(vfcInstanceGroupCustom);
+ List<VnfcCustomization> vnfcCustomizations = vfcInstanceGroupCustom.getVnfcCustomizations();
+
+ if (vnfcCustomizations == null) {
+ vnfcCustomizations = new ArrayList<>();
+ vfcInstanceGroupCustom.setVnfcCustomizations(vnfcCustomizations);
+ }
+ vnfcCustomizations.add(vnfcCustomization);
+
+ existingVnfcGroupSet.add(vnfcCustomization);
}
- vnfcCustomizations.add(vnfcCustomization);
}
}
}
- public String getVnfcResourceInput(NodeTemplate vfcTemplate, List<Input> inputList) {
+ public String getVnfcResourceInput(IEntityDetails vfcEntity, List<Input> inputList) {
Map<String, String> resouceRequest = new HashMap<>();
- LinkedHashMap<String, Property> vfcTemplateProperties = vfcTemplate.getProperties();
+ Map<String, Property> vfcTemplateProperties = vfcEntity.getProperties();
for (String key : vfcTemplateProperties.keySet()) {
Property property = vfcTemplateProperties.get(key);
String resourceValue = getValue(property.getValue(), inputList);
@@ -1918,15 +2029,15 @@ public class ToscaResourceInstaller {
}
String resourceCustomizationUuid =
- vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
+ vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
String jsonStr = null;
try {
ObjectMapper objectMapper = new ObjectMapper();
jsonStr = objectMapper.writeValueAsString(resouceRequest);
jsonStr = jsonStr.replace("\"", "\\\"");
- logger.debug("vfcResource request for resource customization id (" + resourceCustomizationUuid + ") : "
- + jsonStr);
+ logger.debug("vfcResource request for resource customization id {}: {}", resourceCustomizationUuid,
+ jsonStr);
} catch (JsonProcessingException e) {
logger.debug("Json Exception: {}", e.getMessage());
logger.error("Exception occurred", e);
@@ -1935,22 +2046,26 @@ public class ToscaResourceInstaller {
return jsonStr;
}
- protected VfModuleCustomization createVFModuleResource(Group group, NodeTemplate vfTemplate,
+ protected VfModuleCustomization createVFModuleResource(IEntityDetails vfModuleEntityDetails,
ToscaResourceStructure toscaResourceStructure, VfResourceStructure vfResourceStructure,
- IVfModuleData vfModuleData, VnfResourceCustomization vnfResource, Set<CvnfcCustomization> existingCvnfcSet,
- Set<VnfcCustomization> existingVnfcSet,
+ IVfModuleData vfModuleData, VnfResourceCustomization vnfResource, Service service,
+ Set<CvnfcCustomization> existingCvnfcSet, Set<VnfcCustomization> existingVnfcSet,
List<CvnfcConfigurationCustomization> existingCvnfcConfigurationCustom) {
VfModuleCustomization vfModuleCustomization =
findExistingVfModuleCustomization(vnfResource, vfModuleData.getVfModuleModelCustomizationUUID());
+
if (vfModuleCustomization == null) {
+
VfModule vfModule = findExistingVfModule(vnfResource,
- vfTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));
- Metadata vfMetadata = group.getMetadata();
+ vfModuleEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));
+
+ Metadata vfMetadata = vfModuleEntityDetails.getMetadata();
if (vfModule == null)
- vfModule = createVfModule(group, toscaResourceStructure, vfModuleData, vfMetadata);
+ vfModule = createVfModule(vfModuleEntityDetails, toscaResourceStructure, vfModuleData, vfMetadata);
- vfModuleCustomization = createVfModuleCustomization(group, toscaResourceStructure, vfModule, vfModuleData);
+ vfModuleCustomization =
+ createVfModuleCustomization(vfModuleEntityDetails, toscaResourceStructure, vfModule, vfModuleData);
vfModuleCustomization.setVnfCustomization(vnfResource);
setHeatInformationForVfModule(toscaResourceStructure, vfResourceStructure, vfModule, vfModuleCustomization,
vfMetadata);
@@ -1970,38 +2085,48 @@ public class ToscaResourceInstaller {
Set<VnfcCustomization> vnfcCustomizations = new HashSet<>();
// Only set the CVNFC if this vfModule group is a member of it.
- List<NodeTemplate> groupMembers =
- toscaResourceStructure.getSdcCsarHelper().getMembersOfVfModule(vfTemplate, group);
- String vfModuleMemberName = null;
- for (NodeTemplate node : groupMembers) {
- vfModuleMemberName = node.getName();
- }
+ List<IEntityDetails> groupMembers = getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.VfModule")
+ .uUID(vfModuleCustomization.getVfModule().getModelUUID()),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
+
+ String vfModuleMemberName = null;
// Extract CVFC lists
- List<IEntityDetails> cvnfcEntityList =
- getEntityDetails(toscaResourceStructure, SdcTypes.CVFC, SdcTypes.VF, false);
+ List<IEntityDetails> cvnfcEntityList = getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.CVFC), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
+
for (IEntityDetails cvfcEntity : cvnfcEntityList) {
boolean cvnfcVfModuleNameMatch = false;
- for (NodeTemplate node : groupMembers) {
- vfModuleMemberName = node.getName();
+ for (IEntityDetails entity : groupMembers) {
+
+ List<IEntityDetails> groupMembersNodes = entity.getMemberNodes();
+ for (IEntityDetails groupMember : groupMembersNodes) {
+
+ vfModuleMemberName = groupMember.getName();
+
+ if (vfModuleMemberName.equalsIgnoreCase(cvfcEntity.getName())) {
+ cvnfcVfModuleNameMatch = true;
+ break;
+ }
- if (vfModuleMemberName.equalsIgnoreCase(cvfcEntity.getName())) {
- cvnfcVfModuleNameMatch = true;
- break;
}
}
+
if (vfModuleMemberName != null && cvnfcVfModuleNameMatch) {
// Extract associated VFC - Should always be just one
- List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStructure, SdcTypes.VFC,
+ List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VFC),
TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(
cvfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
false);
+
for (IEntityDetails vfcEntity : vfcEntityList) {
VnfcCustomization vnfcCustomization = new VnfcCustomization();
@@ -2071,37 +2196,48 @@ public class ToscaResourceInstaller {
cvnfcCustomization.setNfcNamingCode(getLeafPropertyValue(cvfcEntity, "nfc_naming_code"));
cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization);
+
// *****************************************************************************************************************************************
// * Extract Fabric Configuration
// *****************************************************************************************************************************************
List<IEntityDetails> fabricEntityList =
- getEntityDetails(toscaResourceStructure, SdcTypes.CONFIGURATION, SdcTypes.VF, false);
+ getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CONFIGURATION),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
for (IEntityDetails fabricEntity : fabricEntityList) {
- ConfigurationResource fabricConfig = null;
+ List<RequirementAssignment> requirements = fabricEntity.getRequirements();
- ConfigurationResource existingConfig =
- findExistingConfiguration(existingCvnfcConfigurationCustom,
+ for (RequirementAssignment requirement : requirements) {
+
+ if (requirement.getNodeTemplateName().equals(cvfcEntity.getName())) {
+
+ ConfigurationResource fabricConfig = null;
+
+ ConfigurationResource existingConfig = findExistingConfiguration(
+ existingCvnfcConfigurationCustom,
fabricEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- if (existingConfig == null) {
+ if (existingConfig == null) {
- fabricConfig = createFabricConfiguration(fabricEntity, toscaResourceStructure);
+ fabricConfig = createFabricConfiguration(fabricEntity, toscaResourceStructure);
- } else {
- fabricConfig = existingConfig;
- }
+ } else {
+ fabricConfig = existingConfig;
+ }
- CvnfcConfigurationCustomization cvnfcConfigurationCustomization =
- createCvnfcConfigurationCustomization(fabricEntity, toscaResourceStructure,
- vnfResource, vfModuleCustomization, cvnfcCustomization, fabricConfig,
- vfTemplate, vfModuleMemberName);
+ CvnfcConfigurationCustomization cvnfcConfigurationCustomization =
+ createCvnfcConfigurationCustomization(fabricEntity, toscaResourceStructure,
+ vnfResource, vfModuleCustomization, cvnfcCustomization,
+ fabricConfig, vfModuleMemberName);
- cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization);
+ cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization);
- existingCvnfcConfigurationCustom.add(cvnfcConfigurationCustomization);
+ existingCvnfcConfigurationCustom.add(cvnfcConfigurationCustomization);
+
+ }
+ }
}
cvnfcCustomization.setCvnfcConfigurationCustomization(cvnfcConfigurationCustomizations);
@@ -2122,7 +2258,7 @@ public class ToscaResourceInstaller {
protected CvnfcConfigurationCustomization createCvnfcConfigurationCustomization(IEntityDetails fabricEntity,
ToscaResourceStructure toscaResourceStruct, VnfResourceCustomization vnfResource,
VfModuleCustomization vfModuleCustomization, CvnfcCustomization cvnfcCustomization,
- ConfigurationResource configResource, NodeTemplate vfTemplate, String vfModuleMemberName) {
+ ConfigurationResource configResource, String vfModuleMemberName) {
Metadata fabricMetadata = fabricEntity.getMetadata();
@@ -2137,7 +2273,9 @@ public class ToscaResourceInstaller {
cvnfcConfigurationCustomization.setModelInstanceName(fabricEntity.getName());
List<IEntityDetails> policyList =
- getEntityDetails(toscaResourceStruct, "org.openecomp.policies.External", SdcTypes.VF, true);
+ getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder("org.openecomp.policies.External"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF), true);
+
if (policyList != null) {
for (IEntityDetails policyEntity : policyList) {
@@ -2214,7 +2352,7 @@ public class ToscaResourceInstaller {
return vfModule;
}
- protected VfModuleCustomization createVfModuleCustomization(Group group,
+ protected VfModuleCustomization createVfModuleCustomization(IEntityDetails vfModuleEntityDetails,
ToscaResourceStructure toscaResourceStructure, VfModule vfModule, IVfModuleData vfModuleData) {
VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
@@ -2222,62 +2360,72 @@ public class ToscaResourceInstaller {
vfModuleCustomization.setVfModule(vfModule);
- String initialCount = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT);
+ String initialCount = getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT);
+
+
if (initialCount != null && initialCount.length() > 0) {
vfModuleCustomization.setInitialCount(Integer.valueOf(initialCount));
}
- vfModuleCustomization.setInitialCount(Integer.valueOf(toscaResourceStructure.getSdcCsarHelper()
- .getGroupPropertyLeafValue(group, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT)));
+ String availabilityZoneCount =
+ getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT);
- String availabilityZoneCount = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT);
if (availabilityZoneCount != null && availabilityZoneCount.length() > 0) {
vfModuleCustomization.setAvailabilityZoneCount(Integer.valueOf(availabilityZoneCount));
}
- vfModuleCustomization.setLabel(toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_VFMODULELABEL));
+ vfModuleCustomization
+ .setLabel(getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_VFMODULELABEL));
+
+ String maxInstances =
+ getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_MAXVFMODULEINSTANCES);
- String maxInstances = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_MAXVFMODULEINSTANCES);
if (maxInstances != null && maxInstances.length() > 0) {
vfModuleCustomization.setMaxInstances(Integer.valueOf(maxInstances));
}
- String minInstances = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_MINVFMODULEINSTANCES);
+ String minInstances =
+ getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_MINVFMODULEINSTANCES);
+
if (minInstances != null && minInstances.length() > 0) {
vfModuleCustomization.setMinInstances(Integer.valueOf(minInstances));
}
+
+ String skipPostInstConfText = getLeafPropertyValue(vfModuleEntityDetails, SKIP_POST_INST_CONF);
+
+ if (skipPostInstConfText != null) {
+ vfModuleCustomization.setSkipPostInstConf(
+ Boolean.parseBoolean(getLeafPropertyValue(vfModuleEntityDetails, SKIP_POST_INST_CONF)));
+ }
+
return vfModuleCustomization;
}
- protected VfModule createVfModule(Group group, ToscaResourceStructure toscaResourceStructure,
+ protected VfModule createVfModule(IEntityDetails groupEntityDetails, ToscaResourceStructure toscaResourceStructure,
IVfModuleData vfModuleData, Metadata vfMetadata) {
VfModule vfModule = new VfModule();
String vfModuleModelUUID = vfModuleData.getVfModuleModelUUID();
if (vfModuleModelUUID == null) {
- vfModuleModelUUID = testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));
+
+ vfModuleModelUUID = testNull(
+ groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));
+
} else if (vfModuleModelUUID.indexOf('.') > -1) {
vfModuleModelUUID = vfModuleModelUUID.substring(0, vfModuleModelUUID.indexOf('.'));
}
- vfModule.setModelInvariantUUID(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
- vfModule.setModelName(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)));
+ vfModule.setModelInvariantUUID(
+ groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID));
+ vfModule.setModelName(
+ groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME));
vfModule.setModelUUID(vfModuleModelUUID);
- vfModule.setModelVersion(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)));
- vfModule.setDescription(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ vfModule.setModelVersion(
+ groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION));
+ vfModule.setDescription(groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+
+ String vfModuleType = getLeafPropertyValue(groupEntityDetails, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE);
- String vfModuleType = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE);
if (vfModuleType != null && "Base".equalsIgnoreCase(vfModuleType)) {
vfModule.setIsBase(true);
} else {
@@ -2292,8 +2440,7 @@ public class ToscaResourceInstaller {
Optional<VfModuleStructure> matchingObject = vfResourceStructure.getVfModuleStructure().stream()
.filter(vfModuleStruct -> vfModuleStruct.getVfModuleMetadata().getVfModuleModelUUID()
- .equalsIgnoreCase(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)))
+ .equalsIgnoreCase(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)))
.findFirst();
if (matchingObject.isPresent()) {
@@ -2382,26 +2529,26 @@ public class ToscaResourceInstaller {
}
}
- protected VnfResourceCustomization createVnfResource(NodeTemplate vfNodeTemplate,
+ protected VnfResourceCustomization createVnfResource(IEntityDetails entityDetails,
ToscaResourceStructure toscaResourceStructure, Service service) throws ArtifactInstallerException {
VnfResourceCustomization vnfResourceCustomization = null;
if (vnfResourceCustomization == null) {
+
VnfResource vnfResource = findExistingVnfResource(service,
- vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
if (vnfResource == null) {
- vnfResource = createVnfResource(vfNodeTemplate);
+ vnfResource = createVnfResource(entityDetails);
}
vnfResourceCustomization =
- createVnfResourceCustomization(vfNodeTemplate, toscaResourceStructure, vnfResource);
+ createVnfResourceCustomization(entityDetails, toscaResourceStructure, vnfResource);
vnfResourceCustomization.setVnfResources(vnfResource);
vnfResourceCustomization.setService(service);
// setting resource input for vnf customization
vnfResourceCustomization.setResourceInput(
getResourceInput(toscaResourceStructure, vnfResourceCustomization.getModelCustomizationUUID()));
- service.getVnfCustomizations().add(vnfResourceCustomization);
}
return vnfResourceCustomization;
@@ -2421,61 +2568,62 @@ public class ToscaResourceInstaller {
return vnfResource;
}
- protected VnfResourceCustomization createVnfResourceCustomization(NodeTemplate vfNodeTemplate,
+ protected VnfResourceCustomization createVnfResourceCustomization(IEntityDetails entityDetails,
ToscaResourceStructure toscaResourceStructure, VnfResource vnfResource) {
VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization();
vnfResourceCustomization.setModelCustomizationUUID(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
- vnfResourceCustomization.setModelInstanceName(vfNodeTemplate.getName());
-
- vnfResourceCustomization.setNfFunction(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)));
- vnfResourceCustomization.setNfNamingCode(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, "nf_naming_code")));
- vnfResourceCustomization.setNfRole(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)));
- vnfResourceCustomization.setNfType(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)));
+ entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- vnfResourceCustomization.setMultiStageDesign(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, MULTI_STAGE_DESIGN));
+ vnfResourceCustomization.setModelInstanceName(entityDetails.getName());
+ vnfResourceCustomization
+ .setNfFunction(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ vnfResourceCustomization.setNfNamingCode(getLeafPropertyValue(entityDetails, "nf_naming_code"));
+ vnfResourceCustomization.setNfRole(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ vnfResourceCustomization.setNfType(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
- vnfResourceCustomization.setBlueprintName(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SDNC_MODEL_NAME)));
+ vnfResourceCustomization.setMultiStageDesign(getLeafPropertyValue(entityDetails, MULTI_STAGE_DESIGN));
+ vnfResourceCustomization.setBlueprintName(getLeafPropertyValue(entityDetails, SDNC_MODEL_NAME));
+ vnfResourceCustomization.setBlueprintVersion(getLeafPropertyValue(entityDetails, SDNC_MODEL_VERSION));
- vnfResourceCustomization.setBlueprintVersion(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SDNC_MODEL_VERSION)));
+ String skipPostInstConfText = getLeafPropertyValue(entityDetails, SKIP_POST_INST_CONF);
- String skipPostInstConfText = toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SKIP_POST_INST_CONF);
if (skipPostInstConfText != null) {
- vnfResourceCustomization.setSkipPostInstConf(Boolean.parseBoolean(skipPostInstConfText));
+ vnfResourceCustomization.setSkipPostInstConf(
+ Boolean.parseBoolean(getLeafPropertyValue(entityDetails, SKIP_POST_INST_CONF)));
}
+ vnfResourceCustomization.setControllerActor(getLeafPropertyValue(entityDetails, CONTROLLER_ACTOR));
vnfResourceCustomization.setVnfResources(vnfResource);
vnfResourceCustomization.setAvailabilityZoneMaxCount(Integer.getInteger(
- vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)));
+ entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)));
- CapabilityAssignments vnfCustomizationCapability =
- toscaResourceStructure.getSdcCsarHelper().getCapabilitiesOf(vfNodeTemplate);
+ List<CapabilityAssignment> capAssignList = entityDetails.getCapabilities();
- if (vnfCustomizationCapability != null) {
- CapabilityAssignment capAssign = vnfCustomizationCapability.getCapabilityByName(SCALABLE);
+ if (capAssignList != null) {
- if (capAssign != null) {
- vnfResourceCustomization.setMinInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper()
- .getCapabilityPropertyLeafValue(capAssign, SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
- vnfResourceCustomization.setMaxInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper()
- .getCapabilityPropertyLeafValue(capAssign, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
- }
+ for (CapabilityAssignment capAssign : capAssignList) {
+
+
+ if (capAssign != null) {
+ String capabilityName = capAssign.getName();
+
+ if (capabilityName.equalsIgnoreCase(SCALABLE)) {
+ vnfResourceCustomization.setMinInstances(Integer.getInteger(
+ getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
+ vnfResourceCustomization.setMaxInstances(Integer.getInteger(
+ getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
+ }
+ }
+
+ }
}
if (vnfResourceCustomization.getMinInstances() == null && vnfResourceCustomization.getMaxInstances() == null) {
- vnfResourceCustomization.setMinInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
- vnfResourceCustomization.setMaxInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
+ vnfResourceCustomization.setMinInstances(Integer
+ .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
+ vnfResourceCustomization.setMaxInstances(Integer
+ .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
}
toscaResourceStructure.setCatalogVnfResourceCustomization(vnfResourceCustomization);
@@ -2483,44 +2631,44 @@ public class ToscaResourceInstaller {
return vnfResourceCustomization;
}
- protected VnfResource createVnfResource(NodeTemplate vfNodeTemplate) {
+ protected VnfResource createVnfResource(IEntityDetails entityDetails) {
VnfResource vnfResource = new VnfResource();
vnfResource.setModelInvariantUUID(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
- vnfResource.setModelName(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
- vnfResource.setModelUUID(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ vnfResource.setModelName(testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ vnfResource.setModelUUID(testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
vnfResource.setModelVersion(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
vnfResource.setDescription(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
vnfResource.setOrchestrationMode(HEAT);
- vnfResource.setToscaNodeType(testNull(vfNodeTemplate.getType()));
+ vnfResource.setToscaNodeType(testNull(entityDetails.getToscaType()));
vnfResource.setAicVersionMax(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
+ testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
vnfResource.setAicVersionMin(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
- vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
- vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
+ testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
+ vnfResource.setCategory(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
+ vnfResource.setSubCategory(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
return vnfResource;
}
- protected AllottedResourceCustomization createAllottedResource(NodeTemplate nodeTemplate,
+ protected AllottedResourceCustomization createAllottedResource(IEntityDetails arEntity,
ToscaResourceStructure toscaResourceStructure, Service service) {
AllottedResourceCustomization allottedResourceCustomization =
allottedCustomizationRepo.findOneByModelCustomizationUUID(
- nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
if (allottedResourceCustomization == null) {
AllottedResource allottedResource = findExistingAllottedResource(service,
- nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
if (allottedResource == null)
- allottedResource = createAR(nodeTemplate);
+ allottedResource = createAR(arEntity);
toscaResourceStructure.setAllottedResource(allottedResource);
- allottedResourceCustomization = createAllottedResourceCustomization(nodeTemplate, toscaResourceStructure);
+ allottedResourceCustomization = createAllottedResourceCustomization(arEntity, toscaResourceStructure);
allottedResourceCustomization.setAllottedResource(allottedResource);
allottedResource.getAllotedResourceCustomization().add(allottedResourceCustomization);
}
@@ -2541,73 +2689,80 @@ public class ToscaResourceInstaller {
return allottedResource;
}
- protected AllottedResourceCustomization createAllottedResourceCustomization(NodeTemplate nodeTemplate,
+ protected AllottedResourceCustomization createAllottedResourceCustomization(IEntityDetails arEntity,
ToscaResourceStructure toscaResourceStructure) {
AllottedResourceCustomization allottedResourceCustomization = new AllottedResourceCustomization();
allottedResourceCustomization.setModelCustomizationUUID(
- testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
- allottedResourceCustomization.setModelInstanceName(nodeTemplate.getName());
+ testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ allottedResourceCustomization.setModelInstanceName(arEntity.getName());
+
+ allottedResourceCustomization
+ .setNfFunction(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ allottedResourceCustomization.setNfNamingCode(getLeafPropertyValue(arEntity, "nf_naming_code"));
+ allottedResourceCustomization.setNfRole(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ allottedResourceCustomization.setNfType(getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ EntityQuery entityQuery = EntityQuery.newBuilder(SdcTypes.VFC).build();
- allottedResourceCustomization.setNfFunction(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)));
- allottedResourceCustomization.setNfNamingCode(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(nodeTemplate, "nf_naming_code")));
- allottedResourceCustomization.setNfRole(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE)));
- allottedResourceCustomization.setNfType(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE)));
+ TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF)
+ .customizationUUID(allottedResourceCustomization.getModelCustomizationUUID()).build();
- List<NodeTemplate> vfcNodes = toscaResourceStructure.getSdcCsarHelper()
- .getVfcListByVf(allottedResourceCustomization.getModelCustomizationUUID());
+ List<IEntityDetails> vfcEntities =
+ toscaResourceStructure.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, false);
- if (vfcNodes != null) {
- for (NodeTemplate vfcNode : vfcNodes) {
- allottedResourceCustomization.setProvidingServiceModelUUID(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_uuid"));
+ if (vfcEntities != null) {
+ for (IEntityDetails vfcEntity : vfcEntities) {
+
+ allottedResourceCustomization
+ .setProvidingServiceModelUUID(getLeafPropertyValue(vfcEntity, "providing_service_uuid"));
+ allottedResourceCustomization.setProvidingServiceModelInvariantUUID(
+ getLeafPropertyValue(vfcEntity, "providing_service_invariant_uuid"));
allottedResourceCustomization
- .setProvidingServiceModelInvariantUUID(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_invariant_uuid"));
- allottedResourceCustomization.setProvidingServiceModelName(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vfcNode, "providing_service_name"));
+ .setProvidingServiceModelName(getLeafPropertyValue(vfcEntity, "providing_service_name"));
}
}
+ List<CapabilityAssignment> capAssignmentList = arEntity.getCapabilities();
- CapabilityAssignments arCustomizationCapability =
- toscaResourceStructure.getSdcCsarHelper().getCapabilitiesOf(nodeTemplate);
+ if (capAssignmentList != null) {
- if (arCustomizationCapability != null) {
- CapabilityAssignment capAssign = arCustomizationCapability.getCapabilityByName(SCALABLE);
+ for (CapabilityAssignment arCapability : capAssignmentList) {
+
+ if (arCapability != null) {
+
+ String capabilityName = arCapability.getName();
+
+ if (capabilityName.equals(SCALABLE)) {
+
+ allottedResourceCustomization
+ .setMinInstances(Integer.getInteger(getCapabilityLeafPropertyValue(arCapability,
+ SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
+ allottedResourceCustomization
+ .setMinInstances(Integer.getInteger(getCapabilityLeafPropertyValue(arCapability,
+ SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
+
+ }
+ }
- if (capAssign != null) {
- allottedResourceCustomization.setMinInstances(
- Integer.getInteger(toscaResourceStructure.getSdcCsarHelper().getCapabilityPropertyLeafValue(
- capAssign, SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
- allottedResourceCustomization.setMaxInstances(
- Integer.getInteger(toscaResourceStructure.getSdcCsarHelper().getCapabilityPropertyLeafValue(
- capAssign, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
}
}
+
return allottedResourceCustomization;
}
- protected AllottedResource createAR(NodeTemplate nodeTemplate) {
+ protected AllottedResource createAR(IEntityDetails arEntity) {
AllottedResource allottedResource = new AllottedResource();
- allottedResource
- .setModelUUID(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ allottedResource.setModelUUID(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
allottedResource.setModelInvariantUUID(
- testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ allottedResource.setModelName(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
allottedResource
- .setModelName(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ .setModelVersion(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ allottedResource.setToscaNodeType(testNull(arEntity.getToscaType()));
allottedResource
- .setModelVersion(testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
- allottedResource.setToscaNodeType(testNull(nodeTemplate.getType()));
- allottedResource.setSubcategory(
- testNull(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
- allottedResource
- .setDescription(nodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ .setSubcategory(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
+ allottedResource.setDescription(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
return allottedResource;
}
@@ -2676,23 +2831,11 @@ public class ToscaResourceInstaller {
+ vfModuleStructure.getVfModuleMetadata().getVfModuleModelName();
}
- protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType,
- SdcTypes topologyTemplate, boolean nestedSearch) {
-
- EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
- TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build();
- List<IEntityDetails> entityDetails =
- toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch);
-
- return entityDetails;
-
- }
-
- protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, String entityType,
- SdcTypes topologyTemplate, boolean nestedSearch) {
+ public List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct,
+ EntityQueryBuilder entityType, TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) {
- EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
- TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build();
+ EntityQuery entityQuery = entityType.build();
+ TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build();
List<IEntityDetails> entityDetails =
toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch);
@@ -2700,21 +2843,20 @@ public class ToscaResourceInstaller {
}
- protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType,
- TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) {
+ public String getLeafPropertyValue(IEntityDetails entityDetails, String propName) {
- EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
- TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build();
- List<IEntityDetails> entityDetails =
- toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch);
+ Property leafProperty = entityDetails.getProperties().get(propName);
- return entityDetails;
+ if (leafProperty != null && leafProperty.getValue() != null) {
+ return leafProperty.getValue().toString();
+ }
+ return null;
}
- protected String getLeafPropertyValue(IEntityDetails entityDetails, String propName) {
+ protected String getCapabilityLeafPropertyValue(CapabilityAssignment capAssign, String propName) {
- Property leafProperty = entityDetails.getProperties().get(propName);
+ Property leafProperty = capAssign.getProperties().get(propName);
if (leafProperty != null && leafProperty.getValue() != null) {
return leafProperty.getValue().toString();
@@ -2729,8 +2871,9 @@ public class ToscaResourceInstaller {
if (propertyName != null) {
int getInputIndex = propertyName.indexOf("{get_input=");
+ int getClosingIndex = propertyName.indexOf("}");
if (getInputIndex > -1) {
- inputName = propertyName.substring(getInputIndex + 11, propertyName.length() - 1);
+ inputName = propertyName.substring(getInputIndex + 11, getClosingIndex);
}
}
@@ -2744,10 +2887,18 @@ public class ToscaResourceInstaller {
if (!services.isEmpty()) {
// service exist in db
Service existingService = services.get(0);
- List<VnfResourceCustomization> vnfCustomizations = existingService.getVnfCustomizations();
- vnfCustomizations.forEach(e -> service.getVnfCustomizations().add(e));
+ List<VnfResourceCustomization> existingVnfCustomizations = existingService.getVnfCustomizations();
+ if (existingService != null) {
+ // it is duplicating entries, so added a check
+ for (VnfResourceCustomization existingVnfResourceCustomization : existingVnfCustomizations) {
+ if (!service.getVnfCustomizations().contains(existingVnfResourceCustomization)) {
+ service.getVnfCustomizations().add(existingVnfResourceCustomization);
+ }
+ }
+ }
}
service.getVnfCustomizations().add(vnfResourceCustomization);
+
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
index a154734690..6908fe4eda 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
@@ -26,15 +26,16 @@ import java.util.Map;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.sdc.api.notification.IResourceInstance;
+import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.elements.queries.EntityQuery;
+import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery;
import org.onap.sdc.tosca.parser.enums.SdcTypes;
import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.onap.sdc.toscaparser.api.Group;
-import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.onap.so.asdc.installer.IVfModuleData;
import org.onap.so.asdc.installer.ToscaResourceStructure;
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.asdc.installer.heat.ToscaResourceInstaller;
public class ASDCNotificationLogging {
@@ -63,7 +64,7 @@ public class ASDCNotificationLogging {
return "NULL";
}
-
+ ToscaResourceInstaller toscaResourceInstaller = new ToscaResourceInstaller();
StringBuilder buffer = new StringBuilder("CSAR Notification:");
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -103,33 +104,33 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
- List<NodeTemplate> serviceProxyResourceList =
- toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
+ List<IEntityDetails> serviceProxyResourceList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.SERVICE_PROXY), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE),
+ true);
+
if (serviceProxyResourceList != null) {
- for (NodeTemplate serviceProxyNodeTemplate : serviceProxyResourceList) {
+ for (IEntityDetails serviceProxyEntity : serviceProxyResourceList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Service Proxy Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(
- serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(
- serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -138,31 +139,31 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
- buffer.append(serviceProxyNodeTemplate.getMetaData()
- .getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ buffer.append(
+ serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
- buffer.append(serviceProxyNodeTemplate.getName());
+ buffer.append(serviceProxyEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(serviceProxyNodeTemplate.getType());
+ buffer.append(serviceProxyEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(
- serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
}
}
- List<NodeTemplate> configurationNodeTemplatesList =
- toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CONFIGURATION);
+ List<IEntityDetails> configurationList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.CONFIGURATION), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE),
+ true);
- if (configurationNodeTemplatesList != null) {
- for (NodeTemplate configNodeTemplate : configurationNodeTemplatesList) {
+ if (configurationList != null) {
+ for (IEntityDetails configEntity : configurationList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -170,22 +171,22 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(configNodeTemplate.getType());
+ buffer.append(configEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -193,62 +194,63 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
- buffer.append(
- configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
- buffer.append(configNodeTemplate.getName());
+ buffer.append(configEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
- List<NodeTemplate> vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList();
- for (NodeTemplate vfNodeTemplate : vfNodeTemplatesList) {
+ List<IEntityDetails> vfEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+
+ for (IEntityDetails vfEntity : vfEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNF Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Type:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
buffer.append(System.lineSeparator());
buffer.append("Category:");
- buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Max Instances:");
- buffer.append(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
+ buffer.append(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
buffer.append(System.lineSeparator());
buffer.append("Min Instances:");
- buffer.append(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES));
+ buffer.append(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -256,37 +258,35 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Customization UUID:");
- buffer.append(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ buffer.append(
+ toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFCode:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate,
- "nf_naming_code"));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, "nf_naming_code"));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
buffer.append("MultiStageDesign:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate,
- "multi_stage_design"));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, "multi_stage_design"));
buffer.append(System.lineSeparator());
- List<Group> groupList =
- toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(
- vfNodeTemplate, "org.openecomp.groups.VfcInstanceGroup");
- if (groupList != null) {
- for (Group group : groupList) {
- Metadata instanceMetadata = group.getMetadata();
+ List<IEntityDetails> vfcInstanceEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF)
+ .customizationUUID(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID),
+ false);
+
+ if (vfcInstanceEntityList != null) {
+ for (IEntityDetails vfcEntity : vfcInstanceEntityList) {
+ Metadata instanceMetadata = vfcEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -300,7 +300,7 @@ public class ASDCNotificationLogging {
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("Type:");
- buffer.append(vfNodeTemplate.getType());
+ buffer.append(vfcEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
@@ -309,43 +309,43 @@ public class ASDCNotificationLogging {
}
+ List<IEntityDetails> vfModuleEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.VfModule"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE)
+ .customizationUUID(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID),
+ false);
- List<Group> vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(
- testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
- for (Group group : vfGroups) {
+ for (IEntityDetails vfModuleEntity : vfModuleEntityList) {
- Metadata vfMetadata = group.getMetadata();
+ Metadata vfMetadata = vfModuleEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VF Module Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
+ buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)));
+ buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)));
+ buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)));
+ buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
- SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
- List<NodeTemplate> groupMembers =
- toscaResourceStructure.getSdcCsarHelper().getMembersOfVfModule(vfNodeTemplate, group);
+ List<IEntityDetails> groupMembers = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.VfModule")
+ .uUID(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID),
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
- for (NodeTemplate node : groupMembers) {
+ for (IEntityDetails node : groupMembers) {
buffer.append("Member Name:");
buffer.append(testNull(node.getName()));
buffer.append(System.lineSeparator());
@@ -355,17 +355,18 @@ public class ASDCNotificationLogging {
buffer.append("VF Module Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
- buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata,
+ buffer.append(testNull(toscaResourceInstaller.getLeafPropertyValue(vfModuleEntity,
SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
}
- List<NodeTemplate> vfConfigList = toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CONFIGURATION);
+ List<IEntityDetails> fabricEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.CONFIGURATION), TopologyTemplateQuery.newBuilder(SdcTypes.VF),
+ false);
- if (vfConfigList != null) {
- for (NodeTemplate configNodeTemplate : vfConfigList) {
+ if (fabricEntityList != null) {
+ for (IEntityDetails configEntity : fabricEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -373,24 +374,22 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(
- configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(
- configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(configNodeTemplate.getType());
+ buffer.append(configEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -398,95 +397,96 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
- buffer.append(configNodeTemplate.getMetaData()
- .getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ buffer.append(
+ configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
- buffer.append(configNodeTemplate.getName());
+ buffer.append(configEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
- List<NodeTemplate> cvfcList =
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CVFC);
+ List<IEntityDetails> cvnfcEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.CVFC), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
- for (NodeTemplate cvfcTemplate : cvfcList) {
+ for (IEntityDetails cvnfcEntity : cvnfcEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("CVNFC Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelCustomizationUuid:");
- buffer.append(testNull(
- cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(
+ testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(
- testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
- buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
- buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
- buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(
- testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Template Name:");
- buffer.append(testNull(cvfcTemplate.getName()));
+ buffer.append(testNull(cvnfcEntity.getName()));
buffer.append(System.lineSeparator());
+ List<IEntityDetails> vfcEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VFC),
+ TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(
+ cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
+ false);
- List<NodeTemplate> vfcList =
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC);
-
- for (NodeTemplate vfcTemplate : vfcList) {
+ for (IEntityDetails vfcEntity : vfcEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNFC Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelCustomizationUuid:");
buffer.append(testNull(
- vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(
- testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
- buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
- buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
- buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(
- testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Sub Category:");
buffer.append(
- testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
+ testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
buffer.append(System.lineSeparator());
}
@@ -495,41 +495,40 @@ public class ASDCNotificationLogging {
}
+ List<IEntityDetails> vlEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VL), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+ if (vlEntityList != null) {
- List<NodeTemplate> nodeTemplatesVLList = toscaResourceStructure.getSdcCsarHelper().getServiceVlList();
-
- if (nodeTemplatesVLList != null) {
-
- for (NodeTemplate vlNode : nodeTemplatesVLList) {
+ for (IEntityDetails vlEntity : vlEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("NETWORK Level Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model InvariantUuid:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Version:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("AIC Max Version:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
buffer.append(System.lineSeparator());
buffer.append("AIC Min Version:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
@@ -537,22 +536,22 @@ public class ASDCNotificationLogging {
buffer.append("NETWORK Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("CustomizationUUID:");
- buffer.append(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ buffer.append(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Network Technology:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
buffer.append(System.lineSeparator());
buffer.append("Network Type:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
buffer.append(System.lineSeparator());
buffer.append("Network Role:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
buffer.append(System.lineSeparator());
buffer.append("Network Scope:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
buffer.append(System.lineSeparator());
@@ -560,52 +559,55 @@ public class ASDCNotificationLogging {
}
+ List<IEntityDetails> crEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.CR), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
- List<NodeTemplate> networkCollectionList =
- toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR);
-
- if (networkCollectionList != null) {
- for (NodeTemplate crNode : networkCollectionList) {
+ if (crEntityList != null) {
+ for (IEntityDetails crEntity : crEntityList) {
buffer.append(System.lineSeparator());
buffer.append("Network Collection Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ buffer.append(System.lineSeparator());
+ buffer.append("Customization UUID:");
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(crNode.getType());
+ buffer.append(crEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("CR Function:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode,
- "cr_function"));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_function"));
buffer.append(System.lineSeparator());
buffer.append("CR Role:");
- buffer.append(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, "cr_role"));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_role"));
buffer.append(System.lineSeparator());
buffer.append("CR Type:");
- buffer.append(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, "cr_type"));
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_type"));
buffer.append(System.lineSeparator());
- List<NodeTemplate> vlNodeList =
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(crNode, SdcTypes.VL);
+ List<IEntityDetails> networkEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VL),
+ TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(
+ crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
+ false);
- for (NodeTemplate vlNodeTemplate : vlNodeList) {
- Metadata vlMetadata = vlNodeTemplate.getMetaData();
+ for (IEntityDetails vlEntity : networkEntityList) {
+
+ Metadata vlMetadata = vlEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
@@ -631,19 +633,20 @@ public class ASDCNotificationLogging {
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
- buffer.append(vlNodeTemplate.getType());
+ buffer.append(vlEntity.getToscaType());
buffer.append(System.lineSeparator());
}
+ List<IEntityDetails> ncEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder("org.openecomp.groups.NetworkCollection"),
+ TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(
+ crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)),
+ false);
- List<Group> groupList =
- toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(
- crNode, "org.openecomp.groups.NetworkCollection");
-
- if (groupList != null) {
- for (Group group : groupList) {
- Metadata instanceMetadata = group.getMetadata();
+ if (ncEntityList != null) {
+ for (IEntityDetails ncEntity : ncEntityList) {
+ Metadata instanceMetadata = ncEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Network Instance Group Properties:");
@@ -670,93 +673,179 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
- buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
- buffer.append(crNode.getName());
+ buffer.append(crEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("Network Scope:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
buffer.append(System.lineSeparator());
buffer.append("Network Role:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
buffer.append(System.lineSeparator());
buffer.append("Network Type:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
buffer.append(System.lineSeparator());
buffer.append("Network Technology:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode,
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity,
SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
buffer.append(System.lineSeparator());
}
}
- List<NodeTemplate> allottedResourceList = toscaResourceStructure.getSdcCsarHelper().getAllottedResources();
+ List<IEntityDetails> arEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
- if (allottedResourceList != null) {
+ if (arEntityList != null) {
buffer.append(System.lineSeparator());
- buffer.append("Allotted Resource Properties:");
+ buffer.append("VF Allotted Resource Properties:");
buffer.append(System.lineSeparator());
- for (NodeTemplate allottedNode : allottedResourceList) {
+ for (IEntityDetails arEntity : arEntityList) {
- buffer.append("Model Name:");
- buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
- buffer.append(System.lineSeparator());
- buffer.append("Model Name:");
- buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
- buffer.append(System.lineSeparator());
- buffer.append("Model InvariantUuid:");
- buffer.append(
- testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
- buffer.append(System.lineSeparator());
- buffer.append("Model Version:");
- buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
- buffer.append(System.lineSeparator());
- buffer.append("Model UUID:");
- buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
- buffer.append(System.lineSeparator());
- buffer.append("Model Subcategory:");
- buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
- buffer.append(System.lineSeparator());
- buffer.append("Model Description:");
- buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
- buffer.append(System.lineSeparator());
+ Metadata metadata = arEntity.getMetadata();
+ String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+ if ("Allotted Resource".equalsIgnoreCase(category)) {
- buffer.append("Allotted Resource Customization Properties:");
- buffer.append(System.lineSeparator());
+ buffer.append(System.lineSeparator());
+ buffer.append("Allotted Resource Properties:");
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Name:");
+ buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Name:");
+ buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model InvariantUuid:");
+ buffer.append(
+ testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Version:");
+ buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model UUID:");
+ buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Subcategory:");
+ buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Category:");
+ buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Description:");
+ buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(System.lineSeparator());
+ buffer.append(System.lineSeparator());
- buffer.append("Model Cutomization UUID:");
- buffer.append(testNull(
- allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
- buffer.append(System.lineSeparator());
- buffer.append("NFFunction:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode,
- SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
- buffer.append(System.lineSeparator());
- buffer.append("NFCode:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode,
- "nf_naming_code"));
- buffer.append(System.lineSeparator());
- buffer.append("NFRole:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode,
- SdcPropertyNames.PROPERTY_NAME_NFROLE));
- buffer.append(System.lineSeparator());
- buffer.append("NFType:");
- buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode,
- SdcPropertyNames.PROPERTY_NAME_NFTYPE));
- buffer.append(System.lineSeparator());
+ buffer.append("Allotted Resource Customization Properties:");
+ buffer.append(System.lineSeparator());
+
+ buffer.append("Model Cutomization UUID:");
+ buffer.append(testNull(
+ arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFFunction:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFCode:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity, "nf_naming_code"));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFRole:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFType:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity,
+ SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ buffer.append(System.lineSeparator());
+ }
}
}
+ List<IEntityDetails> pnfAREntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(SdcTypes.PNF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
+
+ if (pnfAREntityList != null) {
+
+ buffer.append(System.lineSeparator());
+ buffer.append("PNF Allotted Resource Properties:");
+ buffer.append(System.lineSeparator());
+
+ for (IEntityDetails pnfAREntity : pnfAREntityList) {
+
+ Metadata metadata = pnfAREntity.getMetadata();
+ String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+
+ if ("Allotted Resource".equalsIgnoreCase(category)) {
+
+ buffer.append(System.lineSeparator());
+ buffer.append("Allotted Resource Properties:");
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Name:");
+ buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Name:");
+ buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model InvariantUuid:");
+ buffer.append(
+ testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Version:");
+ buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model UUID:");
+ buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Subcategory:");
+ buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Category:");
+ buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
+ buffer.append(System.lineSeparator());
+ buffer.append("Model Description:");
+ buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ buffer.append(System.lineSeparator());
+ buffer.append(System.lineSeparator());
+
+ buffer.append("Allotted Resource Customization Properties:");
+ buffer.append(System.lineSeparator());
+
+ buffer.append("Model Cutomization UUID:");
+ buffer.append(testNull(
+ pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFFunction:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity,
+ SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFCode:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity, "nf_naming_code"));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFRole:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity,
+ SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ buffer.append(System.lineSeparator());
+ buffer.append("NFType:");
+ buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity,
+ SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ buffer.append(System.lineSeparator());
+ }
+
+ }
+ }
+
+
return buffer.toString();
}
diff --git a/asdc-controller/src/main/resources/application-aaf.yaml b/asdc-controller/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/asdc-controller/src/main/resources/application-aaf.yaml
diff --git a/asdc-controller/src/main/resources/application-basic.yaml b/asdc-controller/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/asdc-controller/src/main/resources/application-basic.yaml
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
index 81977da278..75ab089719 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
@@ -22,11 +22,16 @@ package org.onap.asdc.activity;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;
+import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import org.junit.Test;
+import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Spy;
import org.onap.so.asdc.BaseTest;
import org.onap.so.asdc.activity.DeployActivitySpecs;
import org.onap.so.asdc.activity.beans.ActivitySpecCreateResponse;
@@ -47,6 +52,10 @@ public class DeployActivitySpecsITTest extends BaseTest {
@Autowired
private DeployActivitySpecs deployActivitySpecs;
+ @InjectMocks
+ @Spy
+ DeployActivitySpecs deployActivitySpecsM;
+
@Test
public void deployActivitySpecsIT_Test() throws Exception {
ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse();
@@ -73,4 +82,34 @@ public class DeployActivitySpecsITTest extends BaseTest {
deployActivitySpecs.deployActivities();
assertTrue(activitySpecCreateResponse.getId().equals("testActivityId"));
}
+
+ @Test
+ public void deployActivitySpecsIT_SDCEndpointDown_Test() throws Exception {
+ ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse();
+ activitySpecCreateResponse.setId("testActivityId");
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+
+ ObjectMapper mapper = new ObjectMapper();
+ String body = mapper.writeValueAsString(activitySpecCreateResponse);
+
+ wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.OK.value()).withBody(body)));
+
+ when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://localhost:8090");
+
+ String urlPath = "/v1.0/activity-spec/testActivityId/versions/latest/actions";
+
+ wireMockServer.stubFor(
+ put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.OK.value())));
+
+ String host = "http://localhost:8090";
+ when(deployActivitySpecsM.checkHttpServerUp(host)).thenReturn(false);
+ deployActivitySpecsM.deployActivities();
+ verify(0, putRequestedFor(urlEqualTo(urlPath)));
+ }
+
}
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
index aae5e5dc53..6d88ab6630 100644
--- a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsTest.java
@@ -30,6 +30,7 @@ import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
+import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.asdc.activity.ActivitySpecsActions;
import org.onap.so.asdc.activity.DeployActivitySpecs;
@@ -54,6 +55,7 @@ public class DeployActivitySpecsTest {
protected ActivitySpecsActions activitySpecsActions;
@InjectMocks
+ @Spy
private DeployActivitySpecs deployActivitySpecs;
@Test
@@ -68,7 +70,8 @@ public class DeployActivitySpecsTest {
List<org.onap.so.db.catalog.beans.ActivitySpec> catalogActivitySpecList =
new ArrayList<org.onap.so.db.catalog.beans.ActivitySpec>();
catalogActivitySpecList.add(catalogActivitySpec);
- when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("testEndpoint");
+ when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://testEndpoint");
+ doReturn(true).when(deployActivitySpecs).checkHttpServerUp("http://testEndpoint");
when(activitySpecRepository.findAll()).thenReturn(catalogActivitySpecList);
doReturn("testActivityId").when(activitySpecsActions).createActivitySpec(Mockito.any(), Mockito.any());
doReturn(true).when(activitySpecsActions).certifyActivitySpec(Mockito.any(), Mockito.any());
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/TestApplication.java b/asdc-controller/src/test/java/org/onap/so/asdc/TestApplication.java
index c35e8e34d6..e25de9c3d4 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/TestApplication.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/TestApplication.java
@@ -31,7 +31,7 @@ import org.springframework.context.annotation.Profile;
@SpringBootApplication
@Profile("test")
-@ComponentScan(basePackages = {"org.onap.so.asdc"},
+@ComponentScan(basePackages = {"org.onap.so.asdc", "org.onap.so.security"},
excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class),
@Filter(type = FilterType.ASSIGNABLE_TYPE, classes = RequestsDBHelper.class),
@Filter(type = FilterType.ASSIGNABLE_TYPE, classes = InfraActiveRequestsRepositoryImpl.class)})
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 0681cd8aed..3db017cac5 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
@@ -1,15 +1,20 @@
-/*
- * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
- * Foundation. ================================================================================ Licensed under the
- * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
- * obtain a copy of the License at
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix
+ * ================================================================================
+ * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
*/
package org.onap.so.asdc.client;
@@ -20,6 +25,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Collections;
@@ -29,10 +35,10 @@ import java.util.UUID;
import javax.persistence.EntityNotFoundException;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.asdc.BaseTest;
import org.onap.so.asdc.client.exceptions.ASDCControllerException;
import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl;
@@ -55,6 +61,7 @@ import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -62,7 +69,10 @@ import org.springframework.transaction.annotation.Transactional;
* This is used to run some basic integration test(BIT) for ASDC controller. It will test the csar install and all the
* testing csar files are located underneath src/main/resources/download folder,
*
- * PNF csar: service-Testservice140-csar.csar VNF csar: service-Svc140-VF-csar.csar
+ * PNF csar: service-pnfservice.csar VNF csar: service-Svc140-VF-csar.csar
+ *
+ * All the csar files are cleaned, i.e, removing the comments and most of the description to avoid violation of
+ * security.
*/
@Transactional
public class ASDCControllerITTest extends BaseTest {
@@ -139,23 +149,23 @@ public class ASDCControllerITTest extends BaseTest {
* Mock the AAI using wireshark.
*/
private void initMockAaiServer(final String serviceUuid, final String serviceInvariantUuid) {
- String modelEndpoint = "/aai/v15/service-design-and-creation/models/model/" + serviceInvariantUuid
+ String modelEndpoint = "/aai/v17/service-design-and-creation/models/model/" + serviceInvariantUuid
+ "/model-vers/model-ver/" + serviceUuid + "?depth=0";
wireMockServer.stubFor(post(urlEqualTo(modelEndpoint)).willReturn(ok()));
}
/**
- * Test with service-Testservice140-csar.csar.
+ * Test with service-pnfservice.csar.
*/
@Test
public void treatNotification_ValidPnfResource_ExpectedOutput() {
/**
- * service UUID/invariantUUID from global metadata in service-Testservice140-template.yml.
+ * service UUID/invariantUUID from global metadata in service-PnfServiceTestCds-template.yml.
*/
- String serviceUuid = "efaea486-561f-4159-9191-a8d3cb346728";
- String serviceInvariantUuid = "f2edfbf4-bb0a-4fe7-a57a-71362d4b0b23";
+ String serviceUuid = "77cf276e-905c-43f6-8d54-dda474be2f2e";
+ String serviceInvariantUuid = "913e6776-4bc3-49b9-b399-b5bb4690f0c7";
initMockAaiServer(serviceUuid, serviceInvariantUuid);
@@ -177,6 +187,7 @@ public class ASDCControllerITTest extends BaseTest {
try {
asdcController.treatNotification(notificationData);
+
logger.info("Checking the database for PNF ingestion");
/**
@@ -185,11 +196,11 @@ public class ASDCControllerITTest extends BaseTest {
ToscaCsar toscaCsar = toscaCsarRepository.findById(artifactUuid)
.orElseThrow(() -> new EntityNotFoundException("Tosca csar: " + artifactUuid + " not found"));
assertEquals("tosca csar UUID", artifactUuid, toscaCsar.getArtifactUUID());
- assertEquals("tosca csar name", "service-Testservice140-csar.csar", toscaCsar.getName());
+ assertEquals("tosca csar name", "service-pnfservice.csar", toscaCsar.getName());
assertEquals("tosca csar version", "1.0", toscaCsar.getVersion());
assertNull("tosca csar descrption", toscaCsar.getDescription());
assertEquals("tosca csar checksum", "MANUAL_RECORD", toscaCsar.getArtifactChecksum());
- assertEquals("toscar csar URL", "/download/service-Testservice140-csar.csar", toscaCsar.getUrl());
+ assertEquals("toscar csar URL", "/download/service-pnfservice.csar", toscaCsar.getUrl());
/**
* Check the service entity, it should be the same as global metadata information in
@@ -197,49 +208,50 @@ public class ASDCControllerITTest extends BaseTest {
*/
Service service = serviceRepository.findById(serviceUuid)
.orElseThrow(() -> new EntityNotFoundException("Service: " + serviceUuid + " not found"));
- assertEquals("model UUID", "efaea486-561f-4159-9191-a8d3cb346728", service.getModelUUID());
- assertEquals("model name", "TestService140", service.getModelName());
- assertEquals("model invariantUUID", "f2edfbf4-bb0a-4fe7-a57a-71362d4b0b23",
- service.getModelInvariantUUID());
+ assertEquals("model UUID", serviceUuid, service.getModelUUID());
+ assertEquals("model name", "PNF Service Test CDS", service.getModelName());
+ assertEquals("model invariantUUID", serviceInvariantUuid, service.getModelInvariantUUID());
assertEquals("model version", "1.0", service.getModelVersion());
- assertEquals("description", "Test Service for extended attributes of PNF resource",
- service.getDescription().trim());
+ assertEquals("description", "123123", service.getDescription().trim());
assertEquals("tosca csar artifact UUID", artifactUuid, service.getCsar().getArtifactUUID());
- assertEquals("service type", "Network", service.getServiceType());
- assertEquals("service role", "nfv", service.getServiceRole());
+ assertEquals("service type", "", service.getServiceType());
+ assertEquals("service role", "", service.getServiceRole());
assertEquals("environment context", "General_Revenue-Bearing", service.getEnvironmentContext());
- assertEquals("service category", "Network Service", service.getCategory());
+ assertEquals("service category", "Network L1-3", service.getCategory());
assertNull("workload context", service.getWorkloadContext());
- assertEquals("resource order", "Test140PNF", service.getResourceOrder());
+ assertEquals("resource order", "PNF CDS Test", service.getResourceOrder());
+ assertEquals("CDS blueprint name", "Blueprint140", service.getBlueprintName());
+ assertEquals("CDS blueprint version", "v1.4.0", service.getBlueprintVersion());
+ assertEquals("controller actor", "SO-REF-DATA", service.getControllerActor());
/**
* Check PNF resource, it should be the same as metadata in the topology template in
- * service-Testservice140-template.yml OR global metadata in the resource-Test140pnf-template.yml
+ * service-PnfServiceTestCds-template.yml OR global metadata in the resource-PnfServiceTestCds-template.yml
*/
- String pnfResourceKey = "9c54e269-122b-4e8a-8b2a-6eac849b441a";
+ String pnfResourceKey = "aa5d0562-80e7-43e9-af74-3085e57ab09f";
PnfResource pnfResource = pnfResourceRepository.findById(pnfResourceKey)
.orElseThrow(() -> new EntityNotFoundException("PNF resource:" + pnfResourceKey + " not found"));
assertNull("orchestration mode", pnfResource.getOrchestrationMode());
- assertEquals("Description", "Oracle", pnfResource.getDescription().trim());
+ assertEquals("Description", "123123", pnfResource.getDescription().trim());
assertEquals("model UUID", pnfResourceKey, pnfResource.getModelUUID());
- assertEquals("model invariant UUID", "d832a027-75f3-455d-9de4-f02fcdee7e7e",
+ assertEquals("model invariant UUID", "17d9d183-cee5-4a46-b5c4-6d5203f7d2e8",
pnfResource.getModelInvariantUUID());
assertEquals("model version", "1.0", pnfResource.getModelVersion());
- assertEquals("model name", "Test140PNF", pnfResource.getModelName());
- assertEquals("tosca node type", "org.openecomp.resource.pnf.Test140pnf", pnfResource.getToscaNodeType());
+ assertEquals("model name", "PNF CDS Test", pnfResource.getModelName());
+ assertEquals("tosca node type", "org.openecomp.resource.pnf.PnfCdsTest", pnfResource.getToscaNodeType());
assertEquals("resource category", "Application L4+", pnfResource.getCategory());
- assertEquals("resource sub category", "Call Control", pnfResource.getSubCategory());
+ assertEquals("resource sub category", "Firewall", pnfResource.getSubCategory());
/**
* Check PNF resource customization, it should be the same as metadata in the topology template in
- * service-Testservice140-template.yml OR global metadata in the resource-Test140pnf-template.yml
+ * service-PnfServiceTestCds-template.yml OR global metadata in the resource-PnfServiceTestCds-template.yml
*/
- String pnfCustomizationKey = "428a3d73-f962-4cc2-ba62-2483c45d6b12";
+ String pnfCustomizationKey = "9f01263a-eaf7-4d98-a37b-3785f751903e";
PnfResourceCustomization pnfCustomization = pnfCustomizationRepository.findById(pnfCustomizationKey)
.orElseThrow(() -> new EntityNotFoundException(
"PNF resource customization: " + pnfCustomizationKey + " not found"));
assertEquals("model customizationUUID", pnfCustomizationKey, pnfCustomization.getModelCustomizationUUID());
- assertEquals("model instance name", "Test140PNF 0", pnfCustomization.getModelInstanceName());
+ assertEquals("model instance name", "PNF CDS Test 0", pnfCustomization.getModelInstanceName());
assertEquals("NF type", "", pnfCustomization.getNfType());
assertEquals("NF Role", "nf", pnfCustomization.getNfRole());
assertEquals("NF function", "nf", pnfCustomization.getNfFunction());
@@ -247,10 +259,12 @@ public class ASDCControllerITTest extends BaseTest {
assertEquals("PNF resource model UUID", pnfResourceKey, pnfCustomization.getPnfResources().getModelUUID());
assertEquals("Multi stage design", "", pnfCustomization.getMultiStageDesign());
assertNull("resource input", pnfCustomization.getResourceInput());
- assertEquals("cds blueprint name(sdnc_model_name property)", pnfCustomization.getBlueprintName(),
+ assertEquals("cds blueprint name(sdnc_model_name property)", "Blueprint140",
pnfCustomization.getBlueprintName());
- assertEquals("cds blueprint version(sdnc_model_version property)", pnfCustomization.getBlueprintVersion(),
+ assertEquals("cds blueprint version(sdnc_model_version property)", "v1.4.0",
pnfCustomization.getBlueprintVersion());
+ assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf());
+ assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor());
/**
* Check the pnf resource customization with service mapping
@@ -277,11 +291,40 @@ public class ASDCControllerITTest extends BaseTest {
}
}
+ /**
+ * Test to check RequestId is being set using the DistributionID.
+ */
+ @Test
+ public void treatNotification_verifyRequestID() {
+
+ String serviceUuid = "efaea486-561f-4159-9191-a8d3cb346728";
+ String serviceInvariantUuid = "f2edfbf4-bb0a-4fe7-a57a-71362d4b0b23";
+ distributionId = "bb15de12-166d-4e45-9e5f-4b3f25200d7b";
+
+ initMockAaiServer(serviceUuid, serviceInvariantUuid);
+
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ notificationData.setServiceUUID(serviceUuid);
+ notificationData.setDistributionID(distributionId);
+ notificationData.setServiceInvariantUUID(serviceInvariantUuid);
+ notificationData.setServiceVersion("1.0");
+
+ try {
+ asdcController.treatNotification(notificationData);
+ logger.info("Verify RequestId : {}", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ assertEquals("bb15de12-166d-4e45-9e5f-4b3f25200d7b", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+
+ } catch (Exception e) {
+ logger.info(e.getMessage(), e);
+ fail(e.getMessage());
+ }
+ }
+
private ArtifactInfoImpl constructPnfServiceArtifact() {
ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl();
artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR);
- artifactInfo.setArtifactURL("/download/service-Testservice140-csar.csar");
- artifactInfo.setArtifactName("service-Testservice140-csar.csar");
+ artifactInfo.setArtifactURL("/download/service-pnfservice.csar");
+ artifactInfo.setArtifactName("service-pnfservice.csar");
artifactInfo.setArtifactVersion("1.0");
artifactInfo.setArtifactUUID(artifactUuid);
return artifactInfo;
@@ -293,13 +336,13 @@ public class ASDCControllerITTest extends BaseTest {
*/
private ResourceInfoImpl constructPnfResourceInfo() {
ResourceInfoImpl resourceInfo = new ResourceInfoImpl();
- resourceInfo.setResourceInstanceName("Test140PNF");
- resourceInfo.setResourceInvariantUUID("d832a027-75f3-455d-9de4-f02fcdee7e7e");
+ resourceInfo.setResourceInstanceName("PNF CDS Test");
+ resourceInfo.setResourceInvariantUUID("17d9d183-cee5-4a46-b5c4-6d5203f7d2e8");
resourceInfo.setResoucreType("PNF");
resourceInfo.setCategory("Application L4+");
- resourceInfo.setSubcategory("Call Control");
- resourceInfo.setResourceUUID("9c54e269-122b-4e8a-8b2a-6eac849b441a");
- resourceInfo.setResourceCustomizationUUID("428a3d73-f962-4cc2-ba62-2483c45d6b12");
+ resourceInfo.setSubcategory("Firewall");
+ resourceInfo.setResourceUUID("aa5d0562-80e7-43e9-af74-3085e57ab09f");
+ resourceInfo.setResourceCustomizationUUID("9f01263a-eaf7-4d98-a37b-3785f751903e");
resourceInfo.setResourceVersion("1.0");
return resourceInfo;
}
@@ -308,7 +351,6 @@ public class ASDCControllerITTest extends BaseTest {
* Testing with the service-Svc140-VF-csar.csar.
*/
@Test
- @Ignore
public void treatNotification_ValidVnfResource_ExpectedOutput() {
/**
@@ -345,11 +387,11 @@ public class ASDCControllerITTest extends BaseTest {
ToscaCsar toscaCsar = toscaCsarRepository.findById(artifactUuid)
.orElseThrow(() -> new EntityNotFoundException("Tosca csar: " + artifactUuid + " not found"));
assertEquals("tosca csar UUID", artifactUuid, toscaCsar.getArtifactUUID());
- assertEquals("tosca csar name", "service-Svc140-VF-csar.csar", toscaCsar.getName());
+ assertEquals("tosca csar name", "service-vnfservice.csar", toscaCsar.getName());
assertEquals("tosca csar version", "1.0", toscaCsar.getVersion());
assertNull("tosca csar descrption", toscaCsar.getDescription());
assertEquals("tosca csar checksum", "MANUAL_RECORD", toscaCsar.getArtifactChecksum());
- assertEquals("toscar csar URL", "/download/service-Svc140-VF-csar.csar", toscaCsar.getUrl());
+ assertEquals("toscar csar URL", "/download/service-vnfservice.csar", toscaCsar.getUrl());
/**
* Check the service entity, it should be the same as global metadata information in
@@ -369,6 +411,9 @@ public class ASDCControllerITTest extends BaseTest {
assertEquals("service category", "Network Service", service.getCategory());
assertNull("workload context", service.getWorkloadContext());
assertEquals("resource order", "TestVF140", service.getResourceOrder());
+ assertEquals("CDS blueprint name", "BP140", service.getBlueprintName());
+ assertEquals("CDS blueprint version", "v1.4.0", service.getBlueprintVersion());
+ assertEquals("controller actor", "SO-REF-DATA", service.getControllerActor());
/**
* Check VNF resource, it should be the same as metadata in the topology template in
@@ -405,11 +450,12 @@ public class ASDCControllerITTest extends BaseTest {
assertNull("NF naming code", vnfCustomization.getNfNamingCode());
assertEquals("VNF resource model UUID", vnfResourceKey, vnfCustomization.getVnfResources().getModelUUID());
assertEquals("Multi stage design", "false", vnfCustomization.getMultiStageDesign());
- assertNull("resource input", vnfCustomization.getResourceInput());
- assertEquals("cds blueprint name(sdnc_model_name property)", vnfCustomization.getBlueprintName(),
- vnfCustomization.getBlueprintName());
- assertEquals("cds blueprint version(sdnc_model_version property)", vnfCustomization.getBlueprintVersion(),
+ assertNotNull("resource input", vnfCustomization.getResourceInput());
+ assertEquals("cds blueprint name(sdnc_model_name property)", "BP140", vnfCustomization.getBlueprintName());
+ assertEquals("cds blueprint version(sdnc_model_version property)", "v1.4.0",
vnfCustomization.getBlueprintVersion());
+ assertEquals("controller actor", "SO-REF-DATA", vnfCustomization.getControllerActor());
+
/**
* Check the vnf resource customization with service mapping
*/
@@ -436,8 +482,8 @@ public class ASDCControllerITTest extends BaseTest {
private ArtifactInfoImpl constructVnfServiceArtifact() {
ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl();
artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR);
- artifactInfo.setArtifactURL("/download/service-Svc140-VF-csar.csar");
- artifactInfo.setArtifactName("service-Svc140-VF-csar.csar");
+ artifactInfo.setArtifactURL("/download/service-vnfservice.csar");
+ artifactInfo.setArtifactName("service-vnfservice.csar");
artifactInfo.setArtifactVersion("1.0");
artifactInfo.setArtifactUUID(artifactUuid);
return artifactInfo;
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
index 2c520a3bba..9294677b95 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java
@@ -43,21 +43,29 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import org.mockito.ArgumentMatchers;
+import org.mockito.Mockito;
import org.mockito.Spy;
import org.onap.so.asdc.BaseTest;
import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator;
import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
import org.onap.so.db.catalog.beans.AllottedResource;
import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
+import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.onap.so.db.catalog.beans.NetworkResource;
import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ToscaCsar;
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.Workflow;
+import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
import org.onap.so.db.catalog.data.repository.ServiceRepository;
import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
+import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
import org.onap.so.db.catalog.data.repository.WorkflowRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -67,6 +75,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.test.util.ReflectionTestUtils;
public class ASDCRestInterfaceTest extends BaseTest {
@@ -74,12 +83,18 @@ public class ASDCRestInterfaceTest extends BaseTest {
private AllottedResourceRepository allottedRepo;
@Autowired
+ private AllottedResourceCustomizationRepository allottedCustomRepo;
+
+ @Autowired
private ServiceRepository serviceRepo;
@Autowired
private NetworkResourceRepository networkRepo;
@Autowired
+ private VnfCustomizationRepository vnfCustRepo;
+
+ @Autowired
private WorkflowRepository workflowRepo;
@Autowired
@@ -107,6 +122,7 @@ public class ASDCRestInterfaceTest extends BaseTest {
public void setUp() {
// ASDC Controller writes to this path
System.setProperty("mso.config.path", folder.getRoot().toString());
+ ReflectionTestUtils.setField(toscaInstaller, "toscaCsarRepo", toscaCsarRepo);
}
@Test
@@ -164,7 +180,7 @@ public class ASDCRestInterfaceTest extends BaseTest {
@Test
@Transactional
- public void test_VFW_Distrobution() throws Exception {
+ public void test_VFW_Distribution() throws Exception {
wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
@@ -288,6 +304,90 @@ public class ASDCRestInterfaceTest extends BaseTest {
Optional<NetworkResource> networkResource = networkRepo.findById("89789b26-a46b-4cee-aed0-d46e21f93a5e");
assertTrue(networkResource.isPresent());
assertEquals("Generic NeutronNet", networkResource.get().getModelName());
+
+ List<VnfResourceCustomization> vnfCustomizationResources =
+ vnfCustRepo.findByModelCustomizationUUID("01564fe7-0541-4d92-badc-464cc35f83ba");
+
+ for (VnfResourceCustomization vnfResourceCustomization : vnfCustomizationResources) {
+
+ assertTrue(vnfResourceCustomization.getVfModuleCustomizations().stream()
+ .anyMatch(vfModuleCust -> "354b1e83-47db-4af1-8af4-9c14b03b482d"
+ .equals(vfModuleCust.getModelCustomizationUUID())));
+
+ }
+
+ }
+
+ @Test
+ public void test_CCVPN_Distribution() throws Exception {
+ wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
+ .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
+
+ wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value())));
+
+ String resourceLocation = "src/test/resources/resource-examples/ccvpn/";
+ ObjectMapper mapper = new ObjectMapper();
+ NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-ccvpn-notification.json"),
+ NotificationDataImpl.class);
+ headers.add("resource-location", resourceLocation);
+ HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers);
+ ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"),
+ HttpMethod.POST, entity, String.class);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+
+ Optional<Service> service = serviceRepo.findById("317887d3-a4e4-45cb-8971-2a78426fefac");
+ assertTrue(service.isPresent());
+ assertEquals("CCVPNService", service.get().getModelName());
+ }
+
+ @Test
+ public void test_PublicNS_Distribution() throws Exception {
+ wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
+ .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
+
+ wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value())));
+
+ String resourceLocation = "src/test/resources/resource-examples/public-ns/";
+ ObjectMapper mapper = new ObjectMapper();
+ NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-public-ns-notification.json"),
+ NotificationDataImpl.class);
+ headers.add("resource-location", resourceLocation);
+ HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers);
+ ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"),
+ HttpMethod.POST, entity, String.class);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+
+ Optional<Service> service = serviceRepo.findById("da28696e-d4c9-4df4-9f91-465c6c09a81e");
+ assertTrue(service.isPresent());
+ assertEquals("PublicNS", service.get().getModelName());
+ }
+
+ @Test
+ public void test_Vcperescust_Distribution() throws Exception {
+ wireMockServer.stubFor(post(urlPathMatching("/aai/.*"))
+ .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json")));
+
+ wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value())));
+
+ String resourceLocation = "src/test/resources/resource-examples/vcpe-rescust/";
+ ObjectMapper mapper = new ObjectMapper();
+ NotificationDataImpl request = mapper.readValue(
+ new File(resourceLocation + "demo-vcpe-rescust-notification.json"), NotificationDataImpl.class);
+ headers.add("resource-location", resourceLocation);
+ HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers);
+ ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"),
+ HttpMethod.POST, entity, String.class);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+
+ Optional<Service> service = serviceRepo.findById("d3aac917-543d-4421-b6d7-ba2b65884eb7");
+ assertTrue(service.isPresent());
+ assertEquals("vCPEResCust 2019-10-01 _2364", service.get().getModelName());
}
protected String createURLWithPort(String uri) {
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
index 846eaf47e2..9940b81361 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
@@ -24,7 +24,13 @@ import org.junit.Test;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.elements.queries.EntityQuery;
+import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery;
+import org.onap.sdc.tosca.parser.enums.EntityTemplateType;
+import org.onap.sdc.tosca.parser.enums.SdcTypes;
+import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.elements.Metadata;
@@ -33,9 +39,11 @@ import org.onap.sdc.toscaparser.api.parameters.Input;
import org.onap.so.asdc.client.exceptions.ArtifactInstallerException;
import org.onap.so.asdc.installer.ToscaResourceStructure;
import org.onap.so.db.catalog.beans.Service;
+import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
public class ToscaResourceInputTest {
@@ -49,6 +57,9 @@ public class ToscaResourceInputTest {
NodeTemplate nodeTemplate;
@Mock
+ IEntityDetails entityDetails;
+
+ @Mock
Property property;
@Mock
@@ -57,6 +68,12 @@ public class ToscaResourceInputTest {
@Mock
Input input;
+ @Mock
+ ToscaResourceInstaller toscaInstaller;
+
+ @Mock
+ ToscaResourceStructure toscaStructure;
+
@Test
public void getListResourceInput() {
ToscaResourceInstaller toscaResourceInstaller = new ToscaResourceInstaller();
@@ -65,16 +82,16 @@ public class ToscaResourceInputTest {
Map<String, Object> map = new HashMap<>();
map.put("customizationUUID", "69df3303-d2b3-47a1-9d04-41604d3a95fd");
Metadata metadata = new Metadata(map);
- when(nodeTemplate.getProperties()).thenReturn(hashMap);
+ when(entityDetails.getProperties()).thenReturn(hashMap);
when(property.getValue()).thenReturn(getInput);
when(getInput.getInputName()).thenReturn("nameKey");
when(input.getName()).thenReturn("nameKey");
when(input.getDefault()).thenReturn("defaultValue");
when(getInput.toString()).thenReturn("getinput:[sites,INDEX,role]");
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(entityDetails.getMetadata()).thenReturn(metadata);
List<Input> inputs = new ArrayList<>();
inputs.add(input);
- String resourceInput = toscaResourceInstaller.getVnfcResourceInput(nodeTemplate, inputs);
+ String resourceInput = toscaResourceInstaller.getVnfcResourceInput(entityDetails, inputs);
assertEquals("{\\\"key1\\\":\\\"[sites,INDEX,role]|defaultValue\\\"}", resourceInput);
}
@@ -90,14 +107,18 @@ public class ToscaResourceInputTest {
hashMap.put("name", "node1");
Metadata metadata = new Metadata(hashMap);
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(entityDetails.getMetadata()).thenReturn(metadata);
when(sdcCsarHelper.getServiceInputs()).thenReturn(inputs);
- when(sdcCsarHelper.getServiceNodeTemplates()).thenReturn(Arrays.asList(nodeTemplate));
- when(sdcCsarHelper.getRequirementsOf(any())).thenReturn(null);
+ when(toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false)).thenReturn(Arrays.asList(entityDetails));
+
+
+ when(entityDetails.getRequirements()).thenReturn(null);
toscaResourceInstaller.processResourceSequence(toscaResourceStructure, service);
- assertEquals(service.getResourceOrder(), "node1");
+ assertEquals(service.getResourceOrder(), "");
}
@Test
@@ -107,20 +128,23 @@ public class ToscaResourceInputTest {
toscaResourceStructure.setSdcCsarHelper(sdcCsarHelper);
- HashMap hashMap = new HashMap();
+ Map hashMap = new HashMap();
hashMap.put("customizationUUID", "id1");
Metadata metadata = new Metadata(hashMap);
- LinkedHashMap propertyMap = new LinkedHashMap();
+ Map<String, Property> propertyMap = new HashMap<String, Property>();
propertyMap.put("prop1", property);
- when(sdcCsarHelper.getServiceNodeTemplates()).thenReturn(Arrays.asList(nodeTemplate));
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
- when(nodeTemplate.getProperties()).thenReturn(propertyMap);
+ when(toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false)).thenReturn(Arrays.asList(entityDetails));
+
+ when(entityDetails.getMetadata()).thenReturn(metadata);
+ when(entityDetails.getProperties()).thenReturn(propertyMap);
when(property.getValue()).thenReturn("value1");
String resourceInput = toscaResourceInstaller.getResourceInput(toscaResourceStructure, "id1");
- assertEquals("{\\\"prop1\\\":\\\"value1\\\"}", resourceInput);
+ assertEquals("{}", resourceInput);
}
@Test
@@ -134,20 +158,22 @@ public class ToscaResourceInputTest {
hashMap.put("customizationUUID", "id1");
Metadata metadata = new Metadata(hashMap);
- LinkedHashMap propertyMap = new LinkedHashMap();
+ Map<String, Property> propertyMap = new HashMap<String, Property>();
propertyMap.put("prop1", property);
- when(sdcCsarHelper.getServiceNodeTemplates()).thenReturn(Arrays.asList(nodeTemplate));
+ when(toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false)).thenReturn(Arrays.asList(entityDetails));
when(sdcCsarHelper.getServiceInputs()).thenReturn(Arrays.asList(input));
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
- when(nodeTemplate.getProperties()).thenReturn(propertyMap);
+ when(entityDetails.getMetadata()).thenReturn(metadata);
+ when(entityDetails.getProperties()).thenReturn(propertyMap);
when(property.getValue()).thenReturn(getInput);
when(getInput.getInputName()).thenReturn("res_key");
when(input.getName()).thenReturn("res_key");
when(input.getDefault()).thenReturn("default_value");
String resourceInput = toscaResourceInstaller.getResourceInput(toscaResourceStructure, "id1");
- assertEquals("{\\\"prop1\\\":\\\"res_key|default_value\\\"}", resourceInput);
+ assertEquals("{}", resourceInput);
}
@Test
@@ -161,20 +187,22 @@ public class ToscaResourceInputTest {
hashMap.put("customizationUUID", "id1");
Metadata metadata = new Metadata(hashMap);
- LinkedHashMap propertyMap = new LinkedHashMap();
+ Map<String, Property> propertyMap = new HashMap<String, Property>();
propertyMap.put("prop1", property);
- when(sdcCsarHelper.getServiceNodeTemplates()).thenReturn(Arrays.asList(nodeTemplate));
+ when(toscaResourceInstaller.getEntityDetails(toscaResourceStructure,
+ EntityQuery.newBuilder(EntityTemplateType.NODE_TEMPLATE),
+ TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false)).thenReturn(Arrays.asList(entityDetails));
when(sdcCsarHelper.getServiceInputs()).thenReturn(Arrays.asList(input));
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
- when(nodeTemplate.getProperties()).thenReturn(propertyMap);
+ when(entityDetails.getMetadata()).thenReturn(metadata);
+ when(entityDetails.getProperties()).thenReturn(propertyMap);
when(property.getValue()).thenReturn(getInput);
when(getInput.getInputName()).thenReturn("res_key");
when(input.getName()).thenReturn("res_key");
when(input.getDefault()).thenReturn(new Integer(10));
String resourceInput = toscaResourceInstaller.getResourceInput(toscaResourceStructure, "id1");
- assertEquals("{\\\"prop1\\\":\\\"res_key|10\\\"}", resourceInput);
+ assertEquals("{}", resourceInput);
}
@Test
@@ -190,7 +218,6 @@ public class ToscaResourceInputTest {
LinkedHashMap propertyMap = new LinkedHashMap();
- when(sdcCsarHelper.getServiceNodeTemplates()).thenReturn(Arrays.asList(nodeTemplate));
when(sdcCsarHelper.getServiceInputs()).thenReturn(Arrays.asList(input));
when(nodeTemplate.getMetaData()).thenReturn(metadata);
when(nodeTemplate.getProperties()).thenReturn(propertyMap);
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index 7534ea645a..c25c4c2828 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -25,16 +25,19 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import org.hibernate.exception.LockAcquisitionException;
import org.junit.Before;
@@ -52,33 +55,43 @@ import org.onap.sdc.tosca.parser.impl.SdcCsarHelperImpl;
import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
import org.onap.sdc.toscaparser.api.Group;
import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.RequirementAssignment;
import org.onap.sdc.toscaparser.api.RequirementAssignments;
+import org.onap.sdc.toscaparser.api.SubstitutionMappings;
import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.onap.sdc.toscaparser.api.elements.StatefulEntityType;
+import org.onap.sdc.toscaparser.api.parameters.Input;
import org.onap.sdc.utils.DistributionStatusEnum;
import org.onap.so.asdc.BaseTest;
+import org.onap.so.asdc.client.ResourceInstance;
import org.onap.so.asdc.client.exceptions.ArtifactInstallerException;
import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl;
import org.onap.so.asdc.client.test.emulators.JsonStatusData;
import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
+import org.onap.so.asdc.installer.IVfModuleData;
import org.onap.so.asdc.installer.ResourceStructure;
import org.onap.so.asdc.installer.ToscaResourceStructure;
+import org.onap.so.asdc.installer.VfModuleStructure;
+import org.onap.so.asdc.installer.VfResourceStructure;
+import org.onap.so.asdc.installer.bpmn.WorkflowResource;
import org.onap.so.db.catalog.beans.ConfigurationResource;
import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
import org.onap.so.db.catalog.beans.ToscaCsar;
-import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
+import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
import org.onap.so.db.catalog.data.repository.ServiceRepository;
import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
+import org.onap.so.db.catalog.data.repository.VFModuleRepository;
+import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
+import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
-import java.util.Optional;
import java.util.stream.Collectors;
public class ToscaResourceInstallerTest extends BaseTest {
@@ -86,12 +99,6 @@ public class ToscaResourceInstallerTest extends BaseTest {
private ToscaResourceInstaller toscaInstaller;
@Autowired
private WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository;
- @Autowired
- private AllottedResourceRepository allottedRepo;
- @Autowired
- private AllottedResourceCustomizationRepository allottedCustomizationRepo;
- @Autowired
- private ServiceRepository serviceRepo;
@Mock
private SdcCsarHelperImpl sdcCsarHelper;
@Mock
@@ -111,6 +118,8 @@ public class ToscaResourceInstallerTest extends BaseTest {
@Mock
private ToscaResourceStructure toscaResourceStructure;
@Mock
+ private VfResourceStructure vfResourceStruct;
+ @Mock
private ServiceProxyResourceCustomization spResourceCustomization;
@Mock
private ISdcCsarHelper csarHelper;
@@ -118,6 +127,8 @@ public class ToscaResourceInstallerTest extends BaseTest {
private StatefulEntityType entityType;
@Mock
private Service service;
+ @Mock
+ Property property;
private NotificationDataImpl notificationData;
private JsonStatusData statusData;
@@ -258,6 +269,191 @@ public class ToscaResourceInstallerTest extends BaseTest {
}
@Test
+ public void installTheResourceWithGroupAndVFModulesTest() throws Exception {
+ ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller();
+ ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(true, toscaInstaller);
+
+ toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct);
+ assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully());
+ }
+
+ @Test
+ public void installTheResourceGroupWithoutVFModulesTest() throws Exception {
+ ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller();
+ ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(false, toscaInstaller);
+
+ toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct);
+ assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully());
+ }
+
+ private ToscaResourceStructure prepareToscaResourceStructure(boolean prepareVFModuleStructures,
+ ToscaResourceInstaller toscaInstaller) throws ArtifactInstallerException {
+
+ Metadata metadata = mock(Metadata.class);
+ IResourceInstance resourceInstance = mock(ResourceInstance.class);
+ NodeTemplate nodeTemplate = mock(NodeTemplate.class);
+ ISdcCsarHelper csarHelper = mock(SdcCsarHelperImpl.class);
+
+ IArtifactInfo inputCsar = mock(IArtifactInfo.class);
+ String artifactUuid = "0122c05e-e13a-4c63-b5d2-475ccf23aa74";
+ String checkSum = "MGUzNjJjMzk3OTBkYzExYzQ0MDg2ZDc2M2E3ZjZiZmY=";
+
+ doReturn(checkSum).when(inputCsar).getArtifactChecksum();
+ doReturn(artifactUuid).when(inputCsar).getArtifactUUID();
+ doReturn("1.0").when(inputCsar).getArtifactVersion();
+ doReturn("TestCsarWithGroupAndVFModule").when(inputCsar).getArtifactName();
+ doReturn("Test Csar data with Group and VF module inputs").when(inputCsar).getArtifactDescription();
+ doReturn("http://localhost/dummy/url/test.csar").when(inputCsar).getArtifactURL();
+
+ ToscaResourceStructure toscaResourceStructObj = new ToscaResourceStructure();
+ toscaResourceStructObj.setToscaArtifact(inputCsar);
+
+ ToscaCsarRepository toscaCsarRepo = spy(ToscaCsarRepository.class);
+
+
+ ToscaCsar toscaCsar = mock(ToscaCsar.class);
+ Optional<ToscaCsar> returnValue = Optional.of(toscaCsar);
+ doReturn(artifactUuid).when(toscaCsar).getArtifactUUID();
+ doReturn(checkSum).when(toscaCsar).getArtifactChecksum();
+ doReturn(returnValue).when(toscaCsarRepo).findById(artifactUuid);
+
+ ReflectionTestUtils.setField(toscaInstaller, "toscaCsarRepo", toscaCsarRepo);
+
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ notificationData.setDistributionID("testStatusSuccessfulTosca");
+ notificationData.setServiceVersion("1234567");
+ notificationData.setServiceUUID("serviceUUID1");
+ notificationData.setWorkloadContext("workloadContext1");
+
+
+
+ String serviceType = "test-type1";
+ String serviceRole = "test-role1";
+ String category = "Network L3+";
+ String description = "Customer Orderable service description";
+ String name = "Customer_Orderable_Service";
+ String uuid = "72db5868-4575-4804-b546-0b0d3c3b5ac6";
+ String invariantUUID = "6f30bbe3-4590-4185-a7e0-4f9610926c6f";
+ String namingPolicy = "naming Policy1";
+ String ecompGeneratedNaming = "true";
+ String environmentContext = "General_Revenue-Bearing1";
+ String resourceCustomizationUUID = "0177ba22-5547-4e4e-bcf8-178f7f71de3a";
+
+ doReturn(serviceType).when(metadata).getValue("serviceType");
+ doReturn(serviceRole).when(metadata).getValue("serviceRole");
+
+ doReturn(category).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
+ doReturn(description).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION);
+ doReturn("1.0").when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_VERSION);
+ doReturn(name).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+
+ doReturn(uuid).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
+
+ doReturn(environmentContext).when(metadata).getValue(metadata.getValue("environmentContext"));
+ doReturn(invariantUUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID);
+ doReturn(namingPolicy).when(metadata).getValue("namingPolicy");
+ doReturn(ecompGeneratedNaming).when(metadata).getValue("ecompGeneratedNaming");
+ doReturn(resourceCustomizationUUID).when(metadata).getValue("vfModuleModelCustomizationUUID");
+
+ ServiceRepository serviceRepo = spy(ServiceRepository.class);
+
+ VnfResourceRepository vnfRepo = spy(VnfResourceRepository.class);
+ doReturn(null).when(vnfRepo).findResourceByModelUUID(uuid);
+
+ VFModuleRepository vfModuleRepo = spy(VFModuleRepository.class);
+ InstanceGroupRepository instanceGroupRepo = spy(InstanceGroupRepository.class);
+
+ WorkflowResource workflowResource = spy(WorkflowResource.class);
+
+ ReflectionTestUtils.setField(toscaInstaller, "serviceRepo", serviceRepo);
+ ReflectionTestUtils.setField(toscaInstaller, "vnfRepo", vnfRepo);
+ ReflectionTestUtils.setField(toscaInstaller, "vfModuleRepo", vfModuleRepo);
+ ReflectionTestUtils.setField(toscaInstaller, "instanceGroupRepo", instanceGroupRepo);
+ ReflectionTestUtils.setField(toscaInstaller, "workflowResource", workflowResource);
+
+ // doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper();
+ toscaResourceStructObj.setSdcCsarHelper(csarHelper);
+
+ doReturn(resourceCustomizationUUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
+ doReturn(uuid).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID);
+
+
+ // vnfc instance group list
+ List<Group> vnfcInstanceGroupList = new ArrayList<>();
+ Group vnfcG1 = mock(Group.class);
+ Map<String, Object> metaProperties = new HashMap<>();
+ metaProperties.put(SdcPropertyNames.PROPERTY_NAME_UUID, "vnfc_group1_uuid");
+ metaProperties.put(SdcPropertyNames.PROPERTY_NAME_NAME, "vnfc_group1_uuid");
+ metaProperties.put(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID, "vnfc_group1_invariantid");
+ metaProperties.put(SdcPropertyNames.PROPERTY_NAME_VERSION, "1.0");
+ Metadata vnfcmetadata = new Metadata(metaProperties);
+
+ doReturn(vnfcmetadata).when(vnfcG1).getMetadata();
+ ArrayList<NodeTemplate> memberList = new ArrayList();
+ doReturn(memberList).when(vnfcG1).getMemberNodes();
+ vnfcInstanceGroupList.add(vnfcG1);
+ SubstitutionMappings submappings = mock(SubstitutionMappings.class);
+ doReturn(new ArrayList<Input>()).when(submappings).getInputs();
+ doReturn(submappings).when(nodeTemplate).getSubMappingToscaTemplate();
+
+ doReturn(notificationData).when(vfResourceStruct).getNotification();
+ doReturn(resourceInstance).when(vfResourceStruct).getResourceInstance();
+
+ if (prepareVFModuleStructures) {
+
+ // VfModule list
+ List<Group> vfModuleGroups = new ArrayList<>();
+ Group g1 = mock(Group.class);
+ doReturn(metadata).when(g1).getMetadata();
+ vfModuleGroups.add(g1);
+
+ doReturn(metadata).when(nodeTemplate).getMetaData();
+ List<NodeTemplate> nodeList = new ArrayList<>();
+ nodeList.add(nodeTemplate);
+
+ IVfModuleData moduleMetadata = mock(IVfModuleData.class);
+ doReturn(name).when(moduleMetadata).getVfModuleModelName();
+ doReturn(invariantUUID).when(moduleMetadata).getVfModuleModelInvariantUUID();
+ doReturn(Collections.<String>emptyList()).when(moduleMetadata).getArtifacts();
+ doReturn(resourceCustomizationUUID).when(moduleMetadata).getVfModuleModelCustomizationUUID();
+ doReturn(uuid).when(moduleMetadata).getVfModuleModelUUID();
+ doReturn("1.0").when(moduleMetadata).getVfModuleModelVersion();
+
+ VfModuleStructure moduleStructure = new VfModuleStructure(vfResourceStruct, moduleMetadata);
+
+ List<VfModuleStructure> moduleStructures = new ArrayList<>();
+ moduleStructures.add(moduleStructure);
+ doReturn(moduleStructures).when(vfResourceStruct).getVfModuleStructure();
+ }
+
+ toscaResourceStructObj.setServiceMetadata(metadata);
+ doReturn("resourceInstanceName1").when(resourceInstance).getResourceInstanceName();
+ doReturn(resourceCustomizationUUID).when(resourceInstance).getResourceCustomizationUUID();
+ doReturn("resourceName1").when(resourceInstance).getResourceName();
+
+ Service service = toscaInstaller.createService(toscaResourceStructObj, vfResourceStruct);
+
+ assertNotNull(service);
+ service.setModelVersion("1.0");
+
+ doReturn(service).when(serviceRepo).save(service);
+
+ WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository =
+ spy(WatchdogComponentDistributionStatusRepository.class);
+ ReflectionTestUtils.setField(toscaInstaller, "watchdogCDStatusRepository", watchdogCDStatusRepository);
+ doReturn(null).when(watchdogCDStatusRepository).save(any(WatchdogComponentDistributionStatus.class));
+
+ VnfcInstanceGroupCustomizationRepository vnfcInstanceGroupCustomizationRepo =
+ spy(VnfcInstanceGroupCustomizationRepository.class);
+ ReflectionTestUtils.setField(toscaInstaller, "vnfcInstanceGroupCustomizationRepo",
+ vnfcInstanceGroupCustomizationRepo);
+ doReturn(null).when(vnfcInstanceGroupCustomizationRepo).save(any(VnfcInstanceGroupCustomization.class));
+ return toscaResourceStructObj;
+ }
+
+
+
+ @Test
public void installTheResourceExceptionTest() throws Exception {
expectedException.expect(ArtifactInstallerException.class);
@@ -405,8 +601,8 @@ public class ToscaResourceInstallerTest extends BaseTest {
}
private void prepareConfigurationResource() {
- doReturn(metadata).when(nodeTemplate).getMetaData();
- doReturn(MockConstants.TEMPLATE_TYPE).when(nodeTemplate).getType();
+ doReturn(metadata).when(entityDetails).getMetadata();
+ doReturn(MockConstants.TEMPLATE_TYPE).when(entityDetails).getToscaType();
doReturn(MockConstants.MODEL_NAME).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
doReturn(MockConstants.MODEL_INVARIANT_UUID).when(metadata)
@@ -422,7 +618,7 @@ public class ToscaResourceInstallerTest extends BaseTest {
public void getConfigurationResourceTest() {
prepareConfigurationResource();
- ConfigurationResource configResource = toscaInstaller.getConfigurationResource(nodeTemplate);
+ ConfigurationResource configResource = toscaInstaller.getConfigurationResource(entityDetails);
assertNotNull(configResource);
assertEquals(MockConstants.MODEL_NAME, configResource.getModelName());
@@ -430,7 +626,7 @@ public class ToscaResourceInstallerTest extends BaseTest {
assertEquals(MockConstants.MODEL_UUID, configResource.getModelUUID());
assertEquals(MockConstants.MODEL_VERSION, configResource.getModelVersion());
assertEquals(MockConstants.MODEL_DESCRIPTION, configResource.getDescription());
- assertEquals(MockConstants.TEMPLATE_TYPE, nodeTemplate.getType());
+ assertEquals(MockConstants.TEMPLATE_TYPE, entityDetails.getToscaType());
}
private void prepareConfigurationResourceCustomization() {
@@ -438,13 +634,11 @@ public class ToscaResourceInstallerTest extends BaseTest {
doReturn(MockConstants.MODEL_CUSTOMIZATIONUUID).when(metadata)
.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper();
- doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFFUNCTION);
- doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFROLE);
- doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NFTYPE);
doReturn(MockConstants.MODEL_CUSTOMIZATIONUUID).when(spResourceCustomization).getModelCustomizationUUID();
+ doReturn(null).when(toscaInstaller).getLeafPropertyValue(entityDetails,
+ SdcPropertyNames.PROPERTY_NAME_NFFUNCTION);
+ doReturn(null).when(toscaInstaller).getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFROLE);
+ doReturn(null).when(toscaInstaller).getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFTYPE);
}
@@ -453,7 +647,7 @@ public class ToscaResourceInstallerTest extends BaseTest {
prepareConfigurationResourceCustomization();
ConfigurationResourceCustomization configurationResourceCustomization =
- toscaInstaller.getConfigurationResourceCustomization(nodeTemplate, toscaResourceStructure,
+ toscaInstaller.getConfigurationResourceCustomization(entityDetails, toscaResourceStructure,
spResourceCustomization, service);
assertNotNull(configurationResourceCustomization);
assertNotNull(configurationResourceCustomization.getConfigurationResource());
@@ -537,9 +731,6 @@ public class ToscaResourceInstallerTest extends BaseTest {
groupList.add(group3);
doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper();
- doReturn(null).when(csarHelper).getRequirementsOf(node1);
- doReturn(requirements2).when(csarHelper).getRequirementsOf(node2);
- doReturn(requirements3).when(csarHelper).getRequirementsOf(node3);
ToscaResourceInstaller installer = new ToscaResourceInstaller();
Method[] methods = installer.getClass().getDeclaredMethods();
diff --git a/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar b/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar
deleted file mode 100644
index 0de1b0b0a0..0000000000
--- a/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar
+++ /dev/null
Binary files differ
diff --git a/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar b/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar
deleted file mode 100644
index bd9a1dc775..0000000000
--- a/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar
+++ /dev/null
Binary files differ
diff --git a/asdc-controller/src/test/resources/download/service-pnfservice.csar b/asdc-controller/src/test/resources/download/service-pnfservice.csar
new file mode 100644
index 0000000000..89d24a18ee
--- /dev/null
+++ b/asdc-controller/src/test/resources/download/service-pnfservice.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/download/service-vnfservice.csar b/asdc-controller/src/test/resources/download/service-vnfservice.csar
new file mode 100644
index 0000000000..25d2ebd6c6
--- /dev/null
+++ b/asdc-controller/src/test/resources/download/service-vnfservice.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json
new file mode 100644
index 0000000000..1ca96f7dc9
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json
@@ -0,0 +1,47 @@
+{
+ "distributionID": "8a01603d-606d-4e40-8bc4-37107ad97897",
+ "serviceName": "CCVPNService",
+ "serviceVersion": "1.0",
+ "serviceUUID": "317887d3-a4e4-45cb-8971-2a78426fefac",
+ "serviceDescription": "CCVPN",
+ "serviceInvariantUUID": "e43f9b81-3035-44df-b618-a787e1c49427",
+ "resources": [
+ {
+ "resourceInstanceName": "siteResource",
+ "resourceCustomizationUUID": "e9e01777-bb2f-42f0-b825-aef0f4c37ccf",
+ "resourceName": "siteResource",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "5a641276-443b-45ca-ac9c-a0ee84f5007b",
+ "resourceInvariantUUID": "5338673f-df81-483a-afa4-b9766442ebf1",
+ "category": "Configuration",
+ "subcategory": "Configuration",
+ "artifacts": []
+ },
+ {
+ "resourceInstanceName": "SDWANVPNResource",
+ "resourceCustomizationUUID": "7815f32c-bdbf-41f7-9a18-6f0e6d5a0d0e",
+ "resourceName": "SDWANVPNResource",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "5f9f2164-f7e4-461d-b8de-3470297ce2b3",
+ "resourceInvariantUUID": "5ca15886-9990-419c-a4bb-f0229eac0926",
+ "category": "Configuration",
+ "subcategory": "Configuration",
+ "artifacts": []
+ }
+ ],
+ "serviceArtifacts": [
+ {
+ "artifactName": "service-Ccvpnservice-csar.csar",
+ "artifactType": "TOSCA_CSAR",
+ "artifactURL": "/service-Ccvpnservice-csar.csar",
+ "artifactChecksum": "NTZlNGU4YTQwNzVkZWMwYWZkODE5M2MwYzcyNzM3M2U\u003d",
+ "artifactDescription": "TOSCA definition package of the asset",
+ "artifactTimeout": 0,
+ "artifactVersion": "2",
+ "artifactUUID": "59f34dcf-ec33-4a88-8dbe-aa7f4571ef59"
+ }
+ ],
+ "workloadContext": "Production"
+} \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Ccvpnservice-csar.csar b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Ccvpnservice-csar.csar
new file mode 100644
index 0000000000..ce2ac5e0c9
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Ccvpnservice-csar.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json b/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json
new file mode 100644
index 0000000000..f829bf0246
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/demo-public-ns-notification.json
@@ -0,0 +1,173 @@
+{
+ "distributionID": "2d6c5aa8-b644-4f30-a632-5577801ef954",
+ "serviceName": "PublicNS",
+ "serviceVersion": "1.0",
+ "serviceUUID": "da28696e-d4c9-4df4-9f91-465c6c09a81e",
+ "serviceDescription": "PUblic NS",
+ "serviceInvariantUUID": "e907ce73-7e4d-4bf8-b94a-21bd1a7c7592",
+ "resources": [
+ {
+ "resourceInstanceName": "vCPE 0",
+ "resourceName": "vCPE",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "a67562cf-1bf3-4450-8b69-3bb1cff43089",
+ "resourceInvariantUUID": "e0b3088d-9ca8-482a-aa5a-a1e6906b2d22",
+ "resourceCustomizationUUID": "ae70c293-8db3-40cd-8cd0-30cde194bea5",
+ "category": "Generic",
+ "subcategory": "Infrastructure",
+ "artifacts": [
+ {
+ "artifactName": "vf-license-model.xml",
+ "artifactType": "VF_LICENSE",
+ "artifactURL": "/vcpe0/vf-license-model.xml",
+ "artifactChecksum": "YjYyYWNiMzUxM2YzMWYxYWVhN2Y5MTM3N2E5YzNhNmU\u003d",
+ "artifactDescription": "VF license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "5c29e823-7114-4988-824f-f670ba9d7b21",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "vcpe0_modules.json",
+ "artifactType": "VF_MODULES_METADATA",
+ "artifactURL": "/vcpe0/vcpe0_modules.json",
+ "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d",
+ "artifactDescription": "Auto-generated VF Modules information artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "128e4e77-21a4-49c3-ac7a-7ca3b187bddc",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "ar1000v.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/vcpe0/ar1000v.yaml",
+ "artifactChecksum": "NWU2NGUwNmNkMGEzYjAxMTAyODkzNTc5YzFmZDBmMzM\u003d",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 120,
+ "artifactUUID": "12dcc618-20f2-4f15-ab00-c549b96b3910",
+ "artifactVersion": "2"
+ },
+ {
+ "artifactName": "vendor-license-model.xml",
+ "artifactType": "VENDOR_LICENSE",
+ "artifactURL": "/vcpe0/vendor-license-model.xml",
+ "artifactChecksum": "OTRkOTY3YjdjM2ZlNDM3NjNlZjBjODU4YTJmNGZhNGE\u003d",
+ "artifactDescription": " Vendor license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "74c4d1bd-1779-421f-8c9d-774ac4567031",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "ar1000v.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/vcpe0/ar1000v.env",
+ "artifactChecksum": "YzI4MjlkODk4YzcyOTgzZTg2YjAyM2ZiNWU1N2FmMjI\u003d",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "5821b043-ba50-49ef-b739-61b0896050f2",
+ "artifactVersion": "2",
+ "generatedFromUUID": "12dcc618-20f2-4f15-ab00-c549b96b3910"
+ }
+ ]
+ },
+ {
+ "resourceInstanceName": "vGW 0",
+ "resourceName": "vGW",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "cd82e255-56cf-4644-858e-36cfc45ef754",
+ "resourceInvariantUUID": "52905e03-0632-43f9-93f2-2ab7d959f633",
+ "resourceCustomizationUUID": "fd8595de-1081-4e39-a401-24ffebaa9ed8",
+ "category": "Generic",
+ "subcategory": "Infrastructure",
+ "artifacts": [
+ {
+ "artifactName": "vf-license-model.xml",
+ "artifactType": "VF_LICENSE",
+ "artifactURL": "/vgw0/vf-license-model.xml",
+ "artifactChecksum": "YTdlMDhmYjMzODg5NmI3ODgwNjA0MmUyOWU2N2I2MGM\u003d",
+ "artifactDescription": "VF license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "f2db3ba5-190f-4214-90fd-93407caf10c1",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "vgw0_modules.json",
+ "artifactType": "VF_MODULES_METADATA",
+ "artifactURL": "/vgw0/vgw0_modules.json",
+ "artifactChecksum": "OTQwY2ZlZThjMjNlYjAyNzU4NDUyZDVhY2VjNTIwZTk\u003d",
+ "artifactDescription": "Auto-generated VF Modules information artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "8730baa0-1b8c-4ac3-bc5c-d49c5b88f111",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "gateway.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/vgw0/gateway.yaml",
+ "artifactChecksum": "NGNiMGRjMWViNGRkMGQzM2ZjNDNjMjQ5OGMwMjI2MjM\u003d",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 120,
+ "artifactUUID": "60d55796-212c-4c66-8af5-63964d636ae4",
+ "artifactVersion": "2"
+ },
+ {
+ "artifactName": "vendor-license-model.xml",
+ "artifactType": "VENDOR_LICENSE",
+ "artifactURL": "/vgw0/vendor-license-model.xml",
+ "artifactChecksum": "OTRkOTY3YjdjM2ZlNDM3NjNlZjBjODU4YTJmNGZhNGE\u003d",
+ "artifactDescription": " Vendor license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "019bdcbf-03fc-4ec2-8d39-c09f808722e9",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "gateway.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/vgw0/gateway.env",
+ "artifactChecksum": "Y2Y4ZDgzMDg3NDBiMDhkODZiMmE1MGUyYjU2ZGFlZDU\u003d",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "9df0452f-826c-4287-9a2d-ca0095339866",
+ "artifactVersion": "2",
+ "generatedFromUUID": "60d55796-212c-4c66-8af5-63964d636ae4"
+ }
+ ]
+ },
+ {
+ "resourceInstanceName": "Generic NeutronNet 0",
+ "resourceName": "Generic NeutronNet",
+ "resourceVersion": "1.0",
+ "resoucreType": "VL",
+ "resourceUUID": "4069be99-5d9a-427b-a427-04fe16ccbf38",
+ "resourceInvariantUUID": "f3ed1133-c1bb-4735-82d4-8e041265fad6",
+ "resourceCustomizationUUID": "c8a1a81d-d836-4f33-9d0e-91e9417f812a",
+ "category": "Generic",
+ "subcategory": "Network Elements",
+ "artifacts": []
+ }
+ ],
+ "serviceArtifacts": [
+ {
+ "artifactName": "service-Publicns-template.yml",
+ "artifactType": "TOSCA_TEMPLATE",
+ "artifactURL": "/service-Publicns-template.yml",
+ "artifactChecksum": "NTUzMDU5YzM3MTk4OGNiNjQ2OGRlMWY2YjU3MjE2YjM\u003d",
+ "artifactDescription": "TOSCA representation of the asset",
+ "artifactTimeout": 0,
+ "artifactUUID": "2617d0ca-54f0-4222-b659-c12e292d94dd",
+ "artifactVersion": "1"
+ },
+ {
+ "artifactName": "service-Publicns-csar.csar",
+ "artifactType": "TOSCA_CSAR",
+ "artifactURL": "/service-Publicns-csar.csar",
+ "artifactChecksum": "ZTRhOGI0M2UxN2ZhYjQ0ODI5ZDZhZTExZTFkMGU3N2Y\u003d",
+ "artifactDescription": "TOSCA definition package of the asset",
+ "artifactTimeout": 0,
+ "artifactUUID": "26a323ff-b97b-4b86-96b1-25a80c0876e5",
+ "artifactVersion": "1"
+ }
+ ],
+ "workloadContext": "Production"
+}
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar
new file mode 100644
index 0000000000..b8cc1f3919
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-csar.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml
new file mode 100644
index 0000000000..2e6f29360f
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/service-Publicns-template.yml
@@ -0,0 +1,1186 @@
+tosca_definitions_version: tosca_simple_yaml_1_1
+metadata:
+ invariantUUID: e907ce73-7e4d-4bf8-b94a-21bd1a7c7592
+ UUID: da28696e-d4c9-4df4-9f91-465c6c09a81e
+ name: PublicNS
+ description: PUblic NS
+ type: Service
+ category: E2E Service
+ serviceType: ''
+ serviceRole: ''
+ instantiationType: A-la-carte
+ serviceEcompNaming: true
+ ecompGeneratedNaming: true
+ namingPolicy: ''
+ environmentContext: General_Revenue-Bearing
+imports:
+- nodes:
+ file: nodes.yml
+- datatypes:
+ file: data.yml
+- capabilities:
+ file: capabilities.yml
+- relationships:
+ file: relationships.yml
+- groups:
+ file: groups.yml
+- policies:
+ file: policies.yml
+- annotations:
+ file: annotations.yml
+- service-PublicNS-interface:
+ file: service-Publicns-template-interface.yml
+- resource-vCPE:
+ file: resource-Vcpe-template.yml
+- resource-vCPE-interface:
+ file: resource-Vcpe-template-interface.yml
+- resource-vGW:
+ file: resource-Vgw-template.yml
+- resource-vGW-interface:
+ file: resource-Vgw-template-interface.yml
+- resource-Generic NeutronNet:
+ file: resource-GenericNeutronnet-template.yml
+topology_template:
+ node_templates:
+ vCPE 0:
+ type: org.openecomp.resource.vf.Vcpe
+ metadata:
+ invariantUUID: e0b3088d-9ca8-482a-aa5a-a1e6906b2d22
+ UUID: 32edc5e6-34f7-4d62-92f8-c38817280eb9
+ customizationUUID: ae70c293-8db3-40cd-8cd0-30cde194bea5
+ version: '1.0'
+ name: vCPE
+ description: vCPE
+ type: VF
+ category: Generic
+ subcategory: Infrastructure
+ resourceVendor: huawei
+ resourceVendorRelease: '1.0'
+ resourceVendorModelNumber: ''
+ properties:
+ vf_module_id: vCPEAR1000V
+ private_subnet_lan_id: 265e1457-8eb7-4fe8-a580-fb547656aad1
+ vcpe_image_name: vCPE_images
+ skip_post_instantiation_configuration: true
+ nf_naming:
+ ecomp_generated_naming: true
+ multi_stage_design: 'false'
+ availability_zone_max_count: 1
+ private_net_id: 1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d
+ vcpe_name: ar1000v
+ private_subnet_wan_id: 86048e4e-861e-47c9-ae55-a5531b747e36
+ vnf_id: vCPE_huaweicloud
+ vcpe_flavor_name: vCPE_flavor
+ vcpe_private_ip_lan: 192.168.10.250
+ requirements:
+ - abstract_vcpe.link_vcpe_vcpe_private_lan_port:
+ capability: virtual_linkable
+ node: Generic NeutronNet 0
+ - abstract_vcpe.link_vcpe_vcpe_private_wan_port:
+ capability: virtual_linkable
+ node: Generic NeutronNet 0
+ capabilities:
+ abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_vcpe.scalable_vcpe:
+ properties:
+ max_instances: 1
+ min_instances: 1
+ abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.read.requests_vcpe:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: compute
+ abstract_vcpe.disk.device.write.requests.rate_vcpe:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: disk
+ abstract_vcpe.disk.read.bytes.rate_vcpe:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: compute
+ abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_vcpe.disk.device.read.requests_vcpe:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: disk
+ abstract_vcpe.disk.device.capacity_vcpe:
+ properties:
+ unit: B
+ description: The amount of disk per device that the instance can see
+ type: Gauge
+ category: disk
+ abstract_vcpe.cpu.delta_vcpe:
+ properties:
+ unit: ns
+ description: CPU time used since previous datapoint
+ type: Delta
+ category: compute
+ abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_vcpe_private_lan_port_network_role
+ nfc_naming_code: vcpe
+ abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_vcpe_private_wan_port_network_role
+ nfc_naming_code: vcpe
+ abstract_vcpe.cpu_vcpe:
+ properties:
+ unit: ns
+ description: CPU time used
+ type: Cumulative
+ category: compute
+ abstract_vcpe.disk.latency_vcpe:
+ properties:
+ unit: ms
+ description: Average disk latency
+ type: Gauge
+ category: disk
+ abstract_vcpe.disk.device.read.bytes_vcpe:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: disk
+ abstract_vcpe.disk.write.bytes_vcpe:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: compute
+ abstract_vcpe.disk.device.read.requests.rate_vcpe:
+ properties:
+ unit: request/s
+ description: Average rate of read requests
+ type: Gauge
+ category: disk
+ abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.root.size_vcpe:
+ properties:
+ unit: GB
+ description: Size of root disk
+ type: Gauge
+ category: compute
+ abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.iops_vcpe:
+ properties:
+ unit: count/s
+ description: Average disk iops
+ type: Gauge
+ category: disk
+ abstract_vcpe.endpoint_vcpe:
+ properties:
+ secure: true
+ abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.device.write.requests_vcpe:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: disk
+ abstract_vcpe.disk.write.bytes.rate_vcpe:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: compute
+ abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ abstract_vcpe.disk.capacity_vcpe:
+ properties:
+ unit: B
+ description: The amount of disk that the instance can see
+ type: Gauge
+ category: disk
+ abstract_vcpe.cpu_util_vcpe:
+ properties:
+ unit: '%'
+ description: Average CPU utilization
+ type: Gauge
+ category: compute
+ abstract_vcpe.disk.write.requests_vcpe:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: compute
+ abstract_vcpe.disk.read.bytes_vcpe:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: compute
+ abstract_vcpe.disk.device.write.bytes_vcpe:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: disk
+ abstract_vcpe.disk.device.write.bytes.rate_vcpe:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: disk
+ abstract_vcpe.vcpus_vcpe:
+ properties:
+ unit: vcpu
+ description: Number of virtual CPUs allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_vcpe.disk.allocation_vcpe:
+ properties:
+ unit: B
+ description: The amount of disk occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ abstract_vcpe.memory_vcpe:
+ properties:
+ unit: MB
+ description: Volume of RAM allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_vcpe.disk.device.read.bytes.rate_vcpe:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: disk
+ abstract_vcpe.memory.usage_vcpe:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance from the amount of its allocated memory
+ type: Gauge
+ category: compute
+ abstract_vcpe.disk.device.iops_vcpe:
+ properties:
+ unit: count/s
+ description: Average disk iops per device
+ type: Gauge
+ category: disk
+ abstract_vcpe.disk.device.allocation_vcpe:
+ properties:
+ unit: B
+ description: The amount of disk per device occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_vcpe.disk.usage_vcpe:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host
+ type: Gauge
+ category: disk
+ abstract_vcpe.disk.device.latency_vcpe:
+ properties:
+ unit: ms
+ description: Average disk latency per device
+ type: Gauge
+ category: disk
+ abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.write.requests.rate_vcpe:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: compute
+ abstract_vcpe.instance_vcpe:
+ properties:
+ unit: instance
+ description: Existence of instance
+ type: Gauge
+ category: compute
+ abstract_vcpe.disk.device.usage_vcpe:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host per device
+ type: Gauge
+ category: disk
+ abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_vcpe.disk.ephemeral.size_vcpe:
+ properties:
+ unit: GB
+ description: Size of ephemeral disk
+ type: Gauge
+ category: compute
+ abstract_vcpe.memory.resident_vcpe:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance on the physical machine
+ type: Gauge
+ category: compute
+ abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ Generic NeutronNet 0:
+ type: org.openecomp.resource.vl.GenericNeutronNet
+ metadata:
+ invariantUUID: f3ed1133-c1bb-4735-82d4-8e041265fad6
+ UUID: 24ec2ed8-a072-4f86-9a58-3a4fe220862e
+ customizationUUID: c8a1a81d-d836-4f33-9d0e-91e9417f812a
+ version: '1.0'
+ name: Generic NeutronNet
+ description: Generic NeutronNet
+ type: VL
+ category: Generic
+ subcategory: Network Elements
+ resourceVendor: ONAP (Tosca)
+ resourceVendorRelease: 1.0.0.wd03
+ resourceVendorModelNumber: ''
+ properties:
+ network_assignments:
+ is_external_network: false
+ is_trunked: false
+ ipv4_subnet_default_assignment:
+ min_subnets_count: 1
+ ecomp_generated_network_assignment: false
+ ipv6_subnet_default_assignment:
+ min_subnets_count: 1
+ exVL_naming:
+ ecomp_generated_naming: true
+ network_flows:
+ is_network_policy: false
+ is_bound_to_vpn: false
+ network_ecomp_naming:
+ ecomp_generated_naming: true
+ network_type: NEUTRON
+ network_technology: NEUTRON
+ network_homing:
+ ecomp_selected_instance_node_target: false
+ vGW 0:
+ type: org.openecomp.resource.vf.Vgw
+ metadata:
+ invariantUUID: 52905e03-0632-43f9-93f2-2ab7d959f633
+ UUID: 4f442b9c-237d-4d2d-b549-ee1bdb9842b3
+ customizationUUID: fd8595de-1081-4e39-a401-24ffebaa9ed8
+ version: '1.0'
+ name: vGW
+ description: vGW
+ type: VF
+ category: Generic
+ subcategory: Infrastructure
+ resourceVendor: huawei
+ resourceVendorRelease: '1.0'
+ resourceVendorModelNumber: ''
+ properties:
+ vf_module_id: CCVPNvGW
+ gateway_image_name: gateway_image
+ private_subnet_lan_id: 265e1457-8eb7-4fe8-a580-fb547656aad1
+ skip_post_instantiation_configuration: true
+ nf_naming:
+ ecomp_generated_naming: true
+ multi_stage_design: 'false'
+ availability_zone_max_count: 1
+ vnf_id: vGW_huaweicloud
+ private_net_id: 1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d
+ gateway_flavor_name: s3.large.4
+ gateway_private_ip_lan: 192.168.10.200
+ gateway_name: gateway-vm
+ requirements:
+ - abstract_gateway.link_gateway_gateway_private_lan_port:
+ capability: virtual_linkable
+ node: Generic NeutronNet 0
+ capabilities:
+ abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ abstract_gateway.disk.device.read.bytes.rate_gateway:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.capacity_gateway:
+ properties:
+ unit: B
+ description: The amount of disk that the instance can see
+ type: Gauge
+ category: disk
+ abstract_gateway.scalable_gateway:
+ properties:
+ max_instances: 1
+ min_instances: 1
+ abstract_gateway.disk.read.bytes_gateway:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: compute
+ abstract_gateway.disk.allocation_gateway:
+ properties:
+ unit: B
+ description: The amount of disk occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.device.write.requests_gateway:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: disk
+ abstract_gateway.disk.device.read.bytes_gateway:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: disk
+ abstract_gateway.cpu.delta_gateway:
+ properties:
+ unit: ns
+ description: CPU time used since previous datapoint
+ type: Delta
+ category: compute
+ abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ abstract_gateway.cpu_gateway:
+ properties:
+ unit: ns
+ description: CPU time used
+ type: Cumulative
+ category: compute
+ abstract_gateway.disk.device.allocation_gateway:
+ properties:
+ unit: B
+ description: The amount of disk per device occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.latency_gateway:
+ properties:
+ unit: ms
+ description: Average disk latency
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.device.read.requests_gateway:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: disk
+ abstract_gateway.disk.device.read.requests.rate_gateway:
+ properties:
+ unit: request/s
+ description: Average rate of read requests
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.write.requests.rate_gateway:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: compute
+ abstract_gateway.disk.device.write.bytes.rate_gateway:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: disk
+ abstract_gateway.cpu_util_gateway:
+ properties:
+ unit: '%'
+ description: Average CPU utilization
+ type: Gauge
+ category: compute
+ abstract_gateway.instance_gateway:
+ properties:
+ unit: instance
+ description: Existence of instance
+ type: Gauge
+ category: compute
+ abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_gateway.disk.root.size_gateway:
+ properties:
+ unit: GB
+ description: Size of root disk
+ type: Gauge
+ category: compute
+ abstract_gateway.memory.usage_gateway:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance from the amount of its allocated memory
+ type: Gauge
+ category: compute
+ abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_gateway.disk.device.capacity_gateway:
+ properties:
+ unit: B
+ description: The amount of disk per device that the instance can see
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.iops_gateway:
+ properties:
+ unit: count/s
+ description: Average disk iops
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.write.requests_gateway:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: compute
+ abstract_gateway.disk.device.write.bytes_gateway:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: disk
+ abstract_gateway.disk.ephemeral.size_gateway:
+ properties:
+ unit: GB
+ description: Size of ephemeral disk
+ type: Gauge
+ category: compute
+ abstract_gateway.disk.device.write.requests.rate_gateway:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: disk
+ abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_gateway.disk.device.iops_gateway:
+ properties:
+ unit: count/s
+ description: Average disk iops per device
+ type: Gauge
+ category: disk
+ abstract_gateway.endpoint_gateway:
+ properties:
+ secure: true
+ abstract_gateway.disk.device.latency_gateway:
+ properties:
+ unit: ms
+ description: Average disk latency per device
+ type: Gauge
+ category: disk
+ abstract_gateway.vcpus_gateway:
+ properties:
+ unit: vcpu
+ description: Number of virtual CPUs allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_gateway.memory_gateway:
+ properties:
+ unit: MB
+ description: Volume of RAM allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_gateway.disk.read.bytes.rate_gateway:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: compute
+ abstract_gateway.disk.read.requests_gateway:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: compute
+ abstract_gateway.port_mirroring_gateway_gateway_private_lan_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_gateway_private_lan_port_network_role
+ nfc_naming_code: gateway
+ abstract_gateway.disk.device.usage_gateway:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host per device
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.write.bytes.rate_gateway:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: compute
+ abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_gateway.memory.resident_gateway:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance on the physical machine
+ type: Gauge
+ category: compute
+ abstract_gateway.disk.usage_gateway:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host
+ type: Gauge
+ category: disk
+ abstract_gateway.disk.write.bytes_gateway:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: compute
+ groups:
+ vcpe0..Vcpe..ar1000v..module-0:
+ type: org.openecomp.groups.VfModule
+ metadata:
+ vfModuleModelName: Vcpe..ar1000v..module-0
+ vfModuleModelInvariantUUID: d7719964-c045-4ed3-84d6-20a01db7612f
+ vfModuleModelUUID: c84ade8a-6e4b-49c7-86e8-0e4fc009f4cd
+ vfModuleModelVersion: '1'
+ vfModuleModelCustomizationUUID: 8caeefbd-ab71-40c9-9387-8729d7d9c2de
+ properties:
+ min_vf_module_instances: 1
+ vf_module_label: ar1000v
+ max_vf_module_instances: 1
+ vf_module_type: Base
+ isBase: true
+ initial_count: 1
+ volume_group: false
+ vgw0..Vgw..gateway..module-0:
+ type: org.openecomp.groups.VfModule
+ metadata:
+ vfModuleModelName: Vgw..gateway..module-0
+ vfModuleModelInvariantUUID: 8c8c936c-e71c-4bc4-94f7-c5680c9dbc00
+ vfModuleModelUUID: ddda7e87-8113-463f-aa27-a60112a4e438
+ vfModuleModelVersion: '1'
+ vfModuleModelCustomizationUUID: ea551d60-f9c9-48f2-9757-b01eb2d26d13
+ properties:
+ min_vf_module_instances: 1
+ vf_module_label: gateway
+ max_vf_module_instances: 1
+ vf_module_type: Base
+ isBase: true
+ initial_count: 1
+ volume_group: false
+ substitution_mappings:
+ node_type: org.openecomp.service.Publicns
+ capabilities:
+ vgw0.abstract_gateway.disk.allocation_gateway:
+ - vGW 0
+ - abstract_gateway.disk.allocation_gateway
+ vgw0.abstract_gateway.memory.usage_gateway:
+ - vGW 0
+ - abstract_gateway.memory.usage_gateway
+ vcpe0.abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_wan_port
+ vgw0.abstract_gateway.disk.device.write.bytes.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.write.bytes.rate_gateway
+ vgw0.abstract_gateway.disk.device.latency_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.latency_gateway
+ vgw0.abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.incoming.bytes.rate_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.scalable_gateway:
+ - vGW 0
+ - abstract_gateway.scalable_gateway
+ vcpe0.abstract_vcpe.host_vcpe:
+ - vCPE 0
+ - abstract_vcpe.host_vcpe
+ vcpe0.abstract_vcpe.disk.latency_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.latency_vcpe
+ vcpe0.abstract_vcpe.scalable_vcpe:
+ - vCPE 0
+ - abstract_vcpe.scalable_vcpe
+ vcpe0.abstract_vcpe.disk.device.write.bytes.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.write.bytes.rate_vcpe
+ vgw0.abstract_gateway.disk.write.requests.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.write.requests.rate_gateway
+ vcpe0.abstract_vcpe.feature_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.feature_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.disk.iops_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.iops_vcpe
+ vcpe0.abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.feature_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.feature_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.host_gateway:
+ - vGW 0
+ - abstract_gateway.host_gateway
+ vgw0.abstract_gateway.disk.device.write.requests.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.write.requests.rate_gateway
+ vcpe0.abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.port_mirroring_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.disk.device.capacity_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.capacity_vcpe
+ vcpe0.abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.os_vcpe:
+ - vCPE 0
+ - abstract_vcpe.os_vcpe
+ vgw0.abstract_gateway.disk.usage_gateway:
+ - vGW 0
+ - abstract_gateway.disk.usage_gateway
+ vcpe0.abstract_vcpe.binding_vcpe:
+ - vCPE 0
+ - abstract_vcpe.binding_vcpe
+ vgw0.abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.outgoing.bytes_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.binding_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.binding_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.memory.resident_vcpe:
+ - vCPE 0
+ - abstract_vcpe.memory.resident_vcpe
+ vgw0.abstract_gateway.disk.write.bytes_gateway:
+ - vGW 0
+ - abstract_gateway.disk.write.bytes_gateway
+ vgw0.abstract_gateway.disk.read.bytes.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.read.bytes.rate_gateway
+ vcpe0.abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.disk.root.size_gateway:
+ - vGW 0
+ - abstract_gateway.disk.root.size_gateway
+ vcpe0.abstract_vcpe.disk.write.requests_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.write.requests_vcpe
+ vcpe0.abstract_vcpe.disk.device.write.bytes_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.write.bytes_vcpe
+ vcpe0.abstract_vcpe.feature_vcpe:
+ - vCPE 0
+ - abstract_vcpe.feature_vcpe
+ vcpe0.abstract_vcpe.disk.device.latency_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.latency_vcpe
+ vgw0.abstract_gateway.cpu_util_gateway:
+ - vGW 0
+ - abstract_gateway.cpu_util_gateway
+ vgw0.abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.incoming.packets_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.disk.device.read.requests.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.read.requests.rate_gateway
+ vgw0.abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.incoming.packets.rate_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.port_mirroring_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.disk.write.bytes_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.write.bytes_vcpe
+ vgw0.abstract_gateway.disk.capacity_gateway:
+ - vGW 0
+ - abstract_gateway.disk.capacity_gateway
+ vgw0.abstract_gateway.memory_gateway:
+ - vGW 0
+ - abstract_gateway.memory_gateway
+ vcpe0.abstract_vcpe.cpu_util_vcpe:
+ - vCPE 0
+ - abstract_vcpe.cpu_util_vcpe
+ vgw0.abstract_gateway.disk.device.write.requests_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.write.requests_gateway
+ vgw0.abstract_gateway.vcpus_gateway:
+ - vGW 0
+ - abstract_gateway.vcpus_gateway
+ vcpe0.abstract_vcpe.disk.ephemeral.size_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.ephemeral.size_vcpe
+ vgw0.abstract_gateway.disk.device.read.bytes_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.read.bytes_gateway
+ vgw0.abstract_gateway.disk.device.allocation_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.allocation_gateway
+ vgw0.abstract_gateway.disk.device.capacity_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.capacity_gateway
+ vcpe0.abstract_vcpe.disk.write.requests.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.write.requests.rate_vcpe
+ vcpe0.abstract_vcpe.disk.usage_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.usage_vcpe
+ vgw0.abstract_gateway.disk.device.iops_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.iops_gateway
+ vcpe0.abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.packets.rate_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.endpoint_gateway:
+ - vGW 0
+ - abstract_gateway.endpoint_gateway
+ vcpe0.abstract_vcpe.disk.device.read.bytes.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.read.bytes.rate_vcpe
+ vcpe0.abstract_vcpe.disk.read.requests_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.read.requests_vcpe
+ vcpe0.abstract_vcpe.disk.read.bytes.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.read.bytes.rate_vcpe
+ vcpe0.abstract_vcpe.disk.device.read.bytes_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.read.bytes_vcpe
+ vgw0.abstract_gateway.binding_gateway:
+ - vGW 0
+ - abstract_gateway.binding_gateway
+ vcpe0.abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.packets.rate_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.bytes_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.cpu.delta_vcpe:
+ - vCPE 0
+ - abstract_vcpe.cpu.delta_vcpe
+ vcpe0.abstract_vcpe.disk.device.write.requests.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.write.requests.rate_vcpe
+ vgw0.abstract_gateway.instance_gateway:
+ - vGW 0
+ - abstract_gateway.instance_gateway
+ vgw0.abstract_gateway.memory.resident_gateway:
+ - vGW 0
+ - abstract_gateway.memory.resident_gateway
+ vcpe0.abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_wan_port
+ vgw0.abstract_gateway.disk.read.bytes_gateway:
+ - vGW 0
+ - abstract_gateway.disk.read.bytes_gateway
+ vcpe0.abstract_vcpe.disk.device.iops_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.iops_vcpe
+ vgw0.abstract_gateway.binding_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.binding_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.disk.ephemeral.size_gateway:
+ - vGW 0
+ - abstract_gateway.disk.ephemeral.size_gateway
+ vgw0.abstract_gateway.feature_gateway:
+ - vGW 0
+ - abstract_gateway.feature_gateway
+ vcpe0.abstract_vcpe.forwarder_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.forwarder_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.disk.device.allocation_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.allocation_vcpe
+ vgw0.abstract_gateway.disk.read.requests_gateway:
+ - vGW 0
+ - abstract_gateway.disk.read.requests_gateway
+ vcpe0.abstract_vcpe.disk.device.write.requests_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.write.requests_vcpe
+ vgw0.abstract_gateway.disk.device.usage_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.usage_gateway
+ vgw0.abstract_gateway.cpu.delta_gateway:
+ - vGW 0
+ - abstract_gateway.cpu.delta_gateway
+ vgw0.abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.outgoing.packets.rate_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.port_mirroring_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.port_mirroring_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.forwarder_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.forwarder_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.packets_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.disk.latency_gateway:
+ - vGW 0
+ - abstract_gateway.disk.latency_gateway
+ vcpe0.abstract_vcpe.disk.read.bytes_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.read.bytes_vcpe
+ vcpe0.abstract_vcpe.attachment_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.attachment_vcpe_vcpe_private_wan_port
+ vgw0.abstract_gateway.cpu_gateway:
+ - vGW 0
+ - abstract_gateway.cpu_gateway
+ vcpe0.abstract_vcpe.instance_vcpe:
+ - vCPE 0
+ - abstract_vcpe.instance_vcpe
+ vcpe0.abstract_vcpe.memory_vcpe:
+ - vCPE 0
+ - abstract_vcpe.memory_vcpe
+ vgw0.abstract_gateway.feature_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.feature_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.disk.device.write.bytes_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.write.bytes_gateway
+ vcpe0.abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outpoing.packets_vcpe_vcpe_private_wan_port
+ vgw0.abstract_gateway.disk.device.read.requests_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.read.requests_gateway
+ vgw0.abstract_gateway.disk.write.requests_gateway:
+ - vGW 0
+ - abstract_gateway.disk.write.requests_gateway
+ vgw0.abstract_gateway.os_gateway:
+ - vGW 0
+ - abstract_gateway.os_gateway
+ vgw0.abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.outgoing.bytes.rate_gateway_gateway_private_lan_port
+ vgw0.abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.outpoing.packets_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.disk.write.bytes.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.write.bytes.rate_vcpe
+ vgw0.abstract_gateway.disk.write.bytes.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.write.bytes.rate_gateway
+ vcpe0.abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.bytes.rate_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.cpu_vcpe:
+ - vCPE 0
+ - abstract_vcpe.cpu_vcpe
+ vcpe0.abstract_vcpe.disk.allocation_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.allocation_vcpe
+ vcpe0.abstract_vcpe.disk.device.read.requests.rate_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.read.requests.rate_vcpe
+ vgw0.abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.network.incoming.bytes_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.disk.device.read.requests_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.read.requests_vcpe
+ vgw0.abstract_gateway.disk.device.read.bytes.rate_gateway:
+ - vGW 0
+ - abstract_gateway.disk.device.read.bytes.rate_gateway
+ vcpe0.abstract_vcpe.binding_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.binding_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.forwarder_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.forwarder_gateway_gateway_private_lan_port
+ genericneutronnet0.virtual_linkable:
+ - Generic NeutronNet 0
+ - virtual_linkable
+ vcpe0.abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.network.incoming.bytes_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.disk.device.usage_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.device.usage_vcpe
+ genericneutronnet0.feature:
+ - Generic NeutronNet 0
+ - feature
+ vcpe0.abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.network.outgoing.bytes.rate_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.disk.root.size_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.root.size_vcpe
+ vcpe0.abstract_vcpe.vcpus_vcpe:
+ - vCPE 0
+ - abstract_vcpe.vcpus_vcpe
+ vcpe0.abstract_vcpe.endpoint_vcpe:
+ - vCPE 0
+ - abstract_vcpe.endpoint_vcpe
+ vgw0.abstract_gateway.attachment_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.attachment_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.attachment_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.attachment_vcpe_vcpe_private_lan_port
+ vcpe0.abstract_vcpe.memory.usage_vcpe:
+ - vCPE 0
+ - abstract_vcpe.memory.usage_vcpe
+ vcpe0.abstract_vcpe.disk.capacity_vcpe:
+ - vCPE 0
+ - abstract_vcpe.disk.capacity_vcpe
+ vgw0.abstract_gateway.disk.iops_gateway:
+ - vGW 0
+ - abstract_gateway.disk.iops_gateway
+ requirements:
+ vcpe0.abstract_vcpe.dependency_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.dependency_vcpe_vcpe_private_wan_port
+ vcpe0.abstract_vcpe.link_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.link_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.local_storage_gateway:
+ - vGW 0
+ - abstract_gateway.local_storage_gateway
+ genericneutronnet0.dependency:
+ - Generic NeutronNet 0
+ - dependency
+ vcpe0.abstract_vcpe.local_storage_vcpe:
+ - vCPE 0
+ - abstract_vcpe.local_storage_vcpe
+ vcpe0.abstract_vcpe.dependency_vcpe_vcpe_private_lan_port:
+ - vCPE 0
+ - abstract_vcpe.dependency_vcpe_vcpe_private_lan_port
+ vgw0.abstract_gateway.dependency_gateway:
+ - vGW 0
+ - abstract_gateway.dependency_gateway
+ vcpe0.abstract_vcpe.dependency_vcpe:
+ - vCPE 0
+ - abstract_vcpe.dependency_vcpe
+ vgw0.abstract_gateway.dependency_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.dependency_gateway_gateway_private_lan_port
+ vcpe0.abstract_vcpe.link_vcpe_vcpe_private_wan_port:
+ - vCPE 0
+ - abstract_vcpe.link_vcpe_vcpe_private_wan_port
+ vgw0.abstract_gateway.link_gateway_gateway_private_lan_port:
+ - vGW 0
+ - abstract_gateway.link_gateway_gateway_private_lan_port
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env
new file mode 100644
index 0000000000..f0cc985078
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.env
@@ -0,0 +1,10 @@
+parameters:
+ private_net_id: "1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d"
+ private_subnet_lan_id: "265e1457-8eb7-4fe8-a580-fb547656aad1"
+ private_subnet_wan_id: "86048e4e-861e-47c9-ae55-a5531b747e36"
+ vcpe_flavor_name: "vCPE_flavor"
+ vcpe_image_name: "vCPE_images"
+ vcpe_name: "ar1000v"
+ vcpe_private_ip_lan: "192.168.10.250"
+ vf_module_id: "vCPEAR1000V"
+ vnf_id: "vCPE_huaweicloud"
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml
new file mode 100644
index 0000000000..b4d0fa7a6b
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/ar1000v.yaml
@@ -0,0 +1,103 @@
+##########################################################################
+#
+#==================LICENSE_START==========================================
+#
+#
+# Copyright 2017 Huawei Technologies Co., Ltd. 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============================================
+
+heat_template_version: 2013-05-23
+
+description: Heat template to deploy Huawei AR1000V vCPE
+
+##############
+# #
+# PARAMETERS #
+# #
+##############
+
+parameters:
+ vcpe_name:
+ type: string
+ label: name
+ description: name to be used for compute instance
+ vcpe_image_name:
+ type: string
+ label: Image name or ID
+ description: Image to be used for compute instance
+ vcpe_flavor_name:
+ type: string
+ label: Flavor
+ description: Type of instance (flavor) to be used
+ private_net_id:
+ type: string
+ label: Private oam network name or ID
+ description: Private network that enables remote connection to VNF
+ private_subnet_wan_id:
+ type: string
+ label: Private wan sub-network name or ID
+ description: Private wan sub-network that enables remote connection to VNF
+ private_subnet_lan_id:
+ type: string
+ label: Private lan sub-network name or ID
+ description: Private lan sub-network that enables remote connection to VNF
+ vcpe_private_ip_lan:
+ type: string
+ label: vCPE lan private IP address
+ description: Private IP address that is assigned to the vCPE lan port
+ vnf_id:
+ type: string
+ label: VNF ID
+ description: The VNF ID is provided by ECOMP
+ vf_module_id:
+ type: string
+ label: VF module id
+ description: the vf module id is provided by ECOMP
+#############
+# #
+# RESOURCES #
+# #
+#############
+
+resources:
+# For the floating IP in Public cloud , floating_network_id is not needed
+ vCPE_oam_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: private_net_id}
+ port_id: { get_resource: vcpe_private_wan_port}
+
+ vcpe_private_wan_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: private_net_id }
+ fixed_ips: [{"subnet": { get_param: private_subnet_wan_id }}]
+
+ vcpe_private_lan_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: private_net_id }
+ fixed_ips: [{"subnet": { get_param: private_subnet_lan_id }, "ip_address": { get_param: vcpe_private_ip_lan }}]
+
+ ar_1000v:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: vcpe_image_name }
+ flavor: { get_param: vcpe_flavor_name }
+ name: { get_param: vcpe_name }
+ networks:
+ - port: { get_resource: vcpe_private_wan_port }
+ - port: { get_resource: vcpe_private_lan_port }
+ metadata: { vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json
new file mode 100644
index 0000000000..3376b1bf40
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vcpe0_modules.json
@@ -0,0 +1,25 @@
+[
+ {
+ "vfModuleModelName": "Vcpe..ar1000v..module-0",
+ "vfModuleModelInvariantUUID": "d7719964-c045-4ed3-84d6-20a01db7612f",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelUUID": "c84ade8a-6e4b-49c7-86e8-0e4fc009f4cd",
+ "vfModuleModelCustomizationUUID": "8caeefbd-ab71-40c9-9387-8729d7d9c2de",
+ "isBase": true,
+ "artifacts": [
+ "12dcc618-20f2-4f15-ab00-c549b96b3910",
+ "5821b043-ba50-49ef-b739-61b0896050f2"
+ ],
+ "properties": {
+ "min_vf_module_instances": "1",
+ "vf_module_label": "ar1000v",
+ "max_vf_module_instances": "1",
+ "vfc_list": "",
+ "vf_module_description": "",
+ "vf_module_type": "Base",
+ "availability_zone_count": "",
+ "volume_group": "false",
+ "initial_count": "1"
+ }
+ }
+] \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml
new file mode 100644
index 0000000000..a10a5b2bb1
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vendor-license-model.xml
@@ -0,0 +1 @@
+<vendor-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><entitlement-pool-list><entitlement-pool><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><version>1.0</version><name>test</name><description/><increments/><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><version>1.0</version><name>test</name><description/><type>One_Time</type><increments/><manufacturerReferenceNumber>123</manufacturerReferenceNumber><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list></vendor-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml
new file mode 100644
index 0000000000..ed1575b7f5
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vcpe0/vf-license-model.xml
@@ -0,0 +1 @@
+<vf-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><vf-id>c1aad4e55922438f956ff97b91c5446d</vf-id><feature-group-list><feature-group><entitlement-pool-list><entitlement-pool><name>test</name><description/><increments/><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><name>test</name><description/><type>One_Time</type><increments/><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><manufacturer-reference-number>123</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list><name>testgroup</name><feature-group-uuid>ae361d4e44ca48e68f734abb531e19af</feature-group-uuid><description/><part-number>123</part-number></feature-group></feature-group-list></vf-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env
new file mode 100644
index 0000000000..a995d16b31
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.env
@@ -0,0 +1,9 @@
+parameters:
+ gateway_flavor_name: "s3.large.4"
+ gateway_image_name: "gateway_image"
+ gateway_name: "gateway-vm"
+ gateway_private_ip_lan: "192.168.10.200"
+ private_net_id: "1ecdeb3d-5d6d-45c4-a3d2-6cc53372fa8d"
+ private_subnet_lan_id: "265e1457-8eb7-4fe8-a580-fb547656aad1"
+ vf_module_id: "CCVPNvGW"
+ vnf_id: "vGW_huaweicloud"
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml
new file mode 100644
index 0000000000..2d72a1c183
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/gateway.yaml
@@ -0,0 +1,109 @@
+##########################################################################
+#
+#==================LICENSE_START==========================================
+#
+#
+# Copyright 2017 Huawei Technologies Co., Ltd. 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============================================
+
+heat_template_version: 2013-05-23
+
+description: Heat template to deploy CCVPN gateway instance
+
+##############
+# #
+# PARAMETERS #
+# #
+##############
+
+parameters:
+ gateway_name:
+ type: string
+ label: name
+ description: name to be used for compute instance
+ gateway_image_name:
+ type: string
+ label: Image name or ID
+ description: Image to be used for compute instance
+ gateway_flavor_name:
+ type: string
+ label: Flavor
+ description: Type of instance (flavor) to be used
+ private_net_id:
+ type: string
+ label: Private oam network name or ID
+ description: Private network that enables remote connection to VNF
+# private_subnet_wan_id:
+# type: string
+# label: Private wan sub-network name or ID
+# description: Private wan sub-network that enables remote connection to VNF
+ private_subnet_lan_id:
+ type: string
+ label: Private lan sub-network name or ID
+ description: Private lan sub-network that enables remote connection to VNF
+ gateway_private_ip_lan:
+ type: string
+ label: gateway lan private IP address
+ description: Private IP address that is assigned to the gateway lan port
+ vnf_id:
+ type: string
+ label: VNF ID
+ description: The VNF ID is provided by ECOMP
+ vf_module_id:
+ type: string
+ label: VF module id
+ description: the vf module id is provided by ECOMP
+#############
+# #
+# RESOURCES #
+# #
+#############
+
+resources:
+# For the floating IP in Public cloud , floating_network_id is not needed
+ gateway_oam_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: private_net_id}
+ port_id: { get_resource: gateway_private_lan_port}
+
+ #gateway_private_wan_port:
+ # type: OS::Neutron::Port
+ # properties:
+ # network: { get_param: private_net_id }
+ # fixed_ips: [{"subnet": { get_param: private_subnet_wan_id }}]
+
+ gateway_private_lan_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: private_net_id }
+ fixed_ips: [{"subnet": { get_param: private_subnet_lan_id }, "ip_address": { get_param: gateway_private_ip_lan }}]
+
+ gateway_instacne:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: gateway_image_name }
+ flavor: { get_param: gateway_flavor_name }
+ name: { get_param: gateway_name }
+ networks:
+ #- port: { get_resource: gateway_private_wan_port }
+ - port: { get_resource: gateway_private_lan_port }
+ metadata: { vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
+ user_data: |
+ #!/bin/bash
+ docker start msb_consul
+ docker start msb_discovery
+ docker start msb_internal_apigateway
+ #user_data_format: HEAT_CFNTOOLS/RAW \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml
new file mode 100644
index 0000000000..a10a5b2bb1
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vendor-license-model.xml
@@ -0,0 +1 @@
+<vendor-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><entitlement-pool-list><entitlement-pool><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><version>1.0</version><name>test</name><description/><increments/><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><version>1.0</version><name>test</name><description/><type>One_Time</type><increments/><manufacturerReferenceNumber>123</manufacturerReferenceNumber><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list></vendor-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml
new file mode 100644
index 0000000000..a4a84cc4c0
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vf-license-model.xml
@@ -0,0 +1 @@
+<vf-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>huawei</vendor-name><vf-id>8c1c2b40525942aca038a4528ce3bb4e</vf-id><feature-group-list><feature-group><entitlement-pool-list><entitlement-pool><name>test</name><description/><increments/><entitlement-pool-invariant-uuid>d948f2a8354d41ef9f8e5819adccfd0d</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86BA71BDC4EC44DB8099115BC7202F3A</entitlement-pool-uuid><manufacturer-reference-number>1234</manufacturer-reference-number><threshold-value><unit>Absolute</unit><value>80</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2020-01-04T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><name>test</name><description/><type>One_Time</type><increments/><license-key-group-invariant-uuid>8b3c7d985b1541518fe0dfc8e40d5116</license-key-group-invariant-uuid><license-key-group-uuid>85FF42563DAA4111BAB854264F1D2898</license-key-group-uuid><manufacturer-reference-number>123</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>88</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-08-23T00:00:00Z</start-date><expiry-date>2019-09-21T23:59:59Z</expiry-date></license-key-group></license-key-group-list><name>testgroup</name><feature-group-uuid>ae361d4e44ca48e68f734abb531e19af</feature-group-uuid><description/><part-number>123</part-number></feature-group></feature-group-list></vf-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json
new file mode 100644
index 0000000000..1a1badec5e
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/public-ns/vgw0/vgw0_modules.json
@@ -0,0 +1,25 @@
+[
+ {
+ "vfModuleModelName": "Vgw..gateway..module-0",
+ "vfModuleModelInvariantUUID": "8c8c936c-e71c-4bc4-94f7-c5680c9dbc00",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelUUID": "ddda7e87-8113-463f-aa27-a60112a4e438",
+ "vfModuleModelCustomizationUUID": "ea551d60-f9c9-48f2-9757-b01eb2d26d13",
+ "isBase": true,
+ "artifacts": [
+ "60d55796-212c-4c66-8af5-63964d636ae4",
+ "9df0452f-826c-4287-9a2d-ca0095339866"
+ ],
+ "properties": {
+ "min_vf_module_instances": "1",
+ "vf_module_label": "gateway",
+ "max_vf_module_instances": "1",
+ "vfc_list": "",
+ "vf_module_description": "",
+ "vf_module_type": "Base",
+ "availability_zone_count": "",
+ "volume_group": "false",
+ "initial_count": "1"
+ }
+ }
+] \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.env b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.env
new file mode 100644
index 0000000000..5cdbc9b882
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.env
@@ -0,0 +1,27 @@
+parameters:
+ cloud_env: "PUT THE CLOUD PROVIDED HERE (openstack or rackspace)"
+ cpe_public_net_cidr: "10.2.0.0/24"
+ cpe_public_net_id: "zdfw1cpe01_public"
+ cpe_public_subnet_id: "zdfw1cpe01_sub_public"
+ dcae_collector_ip: "10.0.4.1"
+ dcae_collector_port: "8081"
+ key_name: "vgw_key"
+ mux_gw_private_net_cidr: "10.5.0.0/24"
+ mux_gw_private_net_id: "zdfw1muxgw01_private"
+ mux_gw_private_subnet_id: "zdfw1muxgw01_sub_private"
+ mux_ip_addr: "10.5.0.20"
+ nexus_artifact_repo: "https://nexus.onap.org"
+ onap_private_net_cidr: "10.0.0.0/16"
+ onap_private_net_id: "PUT THE ONAP PRIVATE NETWORK NAME HERE"
+ onap_private_subnet_id: "PUT THE ONAP PRIVATE SUBNETWORK NAME HERE"
+ pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN"
+ public_net_id: "PUT THE PUBLIC NETWORK ID HERE"
+ script_version: "1.5.0-SNAPSHOT"
+ vcpe_flavor_name: "PUT THE FLAVOR NAME HERE (MEDIUM FLAVOR SUGGESTED)"
+ vcpe_image_name: "PUT THE IMAGE NAME HERE (Ubuntu 1604 SUGGESTED)"
+ vf_module_id: "vCPE_Customer_GW"
+ vg_vgmux_tunnel_vni: 100
+ vgw_name_0: "zdcpe1cpe01gw01"
+ vgw_private_ip_0: "10.5.0.21"
+ vgw_private_ip_1: "10.0.101.30"
+ vnf_id: "vCPE_Infrastructure_GW_demo_app"
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.yaml b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.yaml
new file mode 100644
index 0000000000..74fa490b23
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/base_vcpe_vgw.yaml
@@ -0,0 +1,243 @@
+##########################################################################
+#
+#==================LICENSE_START==========================================
+#
+#
+# Copyright 2017 AT&T Intellectual Property. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#==================LICENSE_END============================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+##########################################################################
+
+heat_template_version: 2013-05-23
+
+description: Heat template to deploy vCPE vGateway (vG)
+
+##############
+# #
+# PARAMETERS #
+# #
+##############
+
+parameters:
+ vcpe_image_name:
+ type: string
+ label: Image name or ID
+ description: Image to be used for compute instance
+ vcpe_flavor_name:
+ type: string
+ label: Flavor
+ description: Type of instance (flavor) to be used
+ public_net_id:
+ type: string
+ label: Public network name or ID
+ description: Public network that enables remote connection to VNF
+ mux_gw_private_net_id:
+ type: string
+ label: vGMUX private network name or ID
+ description: Private network that connects vGMUX to vGWs
+ mux_gw_private_subnet_id:
+ type: string
+ label: vGMUX private sub-network name or ID
+ description: vGMUX private sub-network name or ID
+ mux_gw_private_net_cidr:
+ type: string
+ label: vGMUX private network CIDR
+ description: The CIDR of the vGMUX private network
+ onap_private_net_id:
+ type: string
+ label: ONAP management network name or ID
+ description: Private network that connects ONAP components and the VNF
+ onap_private_subnet_id:
+ type: string
+ label: ONAP management sub-network name or ID
+ description: Private sub-network that connects ONAP components and the VNF
+ onap_private_net_cidr:
+ type: string
+ label: ONAP private network CIDR
+ description: The CIDR of the protected private network
+ cpe_public_net_id:
+ type: string
+ label: vCPE network that emulates internetmanagement name or ID
+ description: Private network that connects vGW to emulated internet
+ cpe_public_subnet_id:
+ type: string
+ label: vCPE Public subnet
+ description: vCPE Public subnet
+ cpe_public_net_cidr:
+ type: string
+ label: vCPE public network CIDR
+ description: The CIDR of the vCPE public
+ vgw_private_ip_0:
+ type: string
+ label: vGW private IP address towards the vGMUX
+ description: Private IP address that is assigned to the vGW to communicate with vGMUX
+ vgw_private_ip_1:
+ type: string
+ label: vGW private IP address towards the ONAP management network
+ description: Private IP address that is assigned to the vGW to communicate with ONAP components
+ ## VPP will use DHCP to get the vgw_private_ip_2 on the CPE_PUBLIC subnet
+ #vgw_private_ip_2:
+ # type: string
+ # label: vGW private IP address towards the vCPE public network
+ # description: Private IP address that is assigned to the vGW to communicate with vCPE public network
+ vgw_name_0:
+ type: string
+ label: vGW name
+ description: Name of the vGW
+ vnf_id:
+ type: string
+ label: VNF ID
+ description: The VNF ID is provided by ONAP
+ vf_module_id:
+ type: string
+ label: vCPE module ID
+ description: The vCPE Module ID is provided by ONAP
+ dcae_collector_ip:
+ type: string
+ label: DCAE collector IP address
+ description: IP address of the DCAE collector
+ dcae_collector_port:
+ type: string
+ label: DCAE collector port
+ description: Port of the DCAE collector
+ key_name:
+ type: string
+ label: Key pair name
+ description: Public/Private key pair name
+ pub_key:
+ type: string
+ label: Public key
+ description: Public key to be installed on the compute instance
+ script_version:
+ type: string
+ label: Script version number
+ description: Version number of the scripts that install the vGW
+ nexus_artifact_repo:
+ type: string
+ description: Root URL for the Nexus repository for Maven artifacts.
+ default: "https://nexus.onap.org"
+ cloud_env:
+ type: string
+ label: Cloud environment
+ description: Cloud environment (e.g., openstack, rackspace)
+ mux_ip_addr:
+ type: string
+ label: vGMUX IP address
+ description: IP address of vGMUX
+ vg_vgmux_tunnel_vni:
+ type: number
+ label: vG-vGMUX tunnel vni
+ description: vni value of vG-vGMUX vxlan tunnel
+
+#############
+# #
+# RESOURCES #
+# #
+#############
+
+resources:
+
+ random-str:
+ type: OS::Heat::RandomString
+ properties:
+ length: 4
+
+ my_keypair:
+ type: OS::Nova::KeyPair
+ properties:
+ name:
+ str_replace:
+ template: base_rand
+ params:
+ base: { get_param: key_name }
+ rand: { get_resource: random-str }
+ public_key: { get_param: pub_key }
+ save_private_key: false
+
+ # Virtual GW Instantiation
+ vgw_private_0_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: mux_gw_private_net_id }
+ fixed_ips: [{"subnet": { get_param: mux_gw_private_subnet_id }, "ip_address": { get_param: vgw_private_ip_0 }}]
+
+ vgw_private_1_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: onap_private_net_id }
+ fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vgw_private_ip_1 }}]
+
+ vgw_private_2_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: cpe_public_net_id}
+ fixed_ips: [{"subnet": { get_param: cpe_public_subnet_id }}]
+ ##fixed_ips: [{"subnet": { get_param: cpe_public_subnet_id }, "ip_address": { get_param: vgw_private_ip_2 }}]
+
+ vgw_0:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: vcpe_image_name }
+ flavor: { get_param: vcpe_flavor_name }
+ name: { get_param: vgw_name_0 }
+ key_name: { get_resource: my_keypair }
+ networks:
+ - network: { get_param: public_net_id }
+ - port: { get_resource: vgw_private_0_port }
+ - port: { get_resource: vgw_private_1_port }
+ - port: { get_resource: vgw_private_2_port }
+ metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
+ user_data_format: RAW
+ user_data:
+ str_replace:
+ params:
+ __mux_gw_private_net_ipaddr__ : { get_param: vgw_private_ip_0 }
+ __oam_ipaddr__ : { get_param: vgw_private_ip_1 }
+ __oam_cidr__ : { get_param: onap_private_net_cidr }
+ __cpe_public_net_cidr__ : { get_param: cpe_public_net_cidr }
+ __mux_gw_private_net_cidr__ : { get_param: mux_gw_private_net_cidr }
+ __script_version__ : { get_param: script_version }
+ __cloud_env__ : { get_param: cloud_env }
+ __mux_ip_addr__: { get_param: mux_ip_addr }
+ __vg_vgmux_tunnel_vni__: { get_param: vg_vgmux_tunnel_vni }
+ __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
+ template: |
+ #!/bin/bash
+
+ # Create configuration files
+ mkdir /opt/config
+ echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
+ echo "__oam_cidr__" > /opt/config/oam_cidr.txt
+ echo "__cpe_public_net_cidr__" > /opt/config/cpe_public_net_cidr.txt
+ echo "__mux_gw_private_net_ipaddr__" > /opt/config/mux_gw_private_net_ipaddr.txt
+ echo "__mux_gw_private_net_cidr__" > /opt/config/mux_gw_private_net_cidr.txt
+ echo "__script_version__" > /opt/config/script_version.txt
+ echo "__cloud_env__" > /opt/config/cloud_env.txt
+ echo "__mux_ip_addr__" > /opt/config/mux_ip_addr.txt
+ echo "__vg_vgmux_tunnel_vni__" > /opt/config/vg_vgmux_tunnel_vni.txt
+ echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
+
+ # Download and run install script
+ apt-get update
+ apt-get -y install unzip
+ if [[ "__script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
+ curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vcpe&a=vcpe-scripts&e=zip&v=__script_version__" -o /opt/vcpe-scripts-__script_version__.zip
+ unzip -j /opt/vcpe-scripts-__script_version__.zip -d /opt v_gw_install.sh
+ cd /opt
+ chmod +x v_gw_install.sh
+ ./v_gw_install.sh
+
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/demo-vcpe-rescust-notification.json b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/demo-vcpe-rescust-notification.json
new file mode 100644
index 0000000000..f4f4fcc0de
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/demo-vcpe-rescust-notification.json
@@ -0,0 +1,108 @@
+{
+ "distributionID": "5ea97d50-9e1d-4b2c-aa47-2523e35e2120",
+ "serviceName": "vCPEResCust 2019-10-01 _2364",
+ "serviceVersion": "1.0",
+ "serviceUUID": "d3aac917-543d-4421-b6d7-ba2b65884eb7",
+ "serviceDescription": "catalog service description",
+ "serviceInvariantUUID": "d0568a10-a0e0-4efa-b698-ad3772f2e30f",
+ "resources": [{
+ "resourceInstanceName": "TunnelXConn_2019-10-01 03:23:27.409 0",
+ "resourceName": "TunnelXConn_2019-10-01 03:23:27.409",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "629f9662-55bb-430c-8f22-5204c37c9898",
+ "resourceInvariantUUID": "3a367ac8-5dff-4325-a0e7-9e0299d22152",
+ "resourceCustomizationUUID": "4e0249f0-5118-4323-b5e9-0783ad1123ba",
+ "category": "Allotted Resource",
+ "subcategory": "TunnelXConn",
+ "artifacts": []
+ }, {
+ "resourceInstanceName": "BRG_2019-10-01 03:23:27.409 0",
+ "resourceName": "BRG_2019-10-01 03:23:27.409",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "abafad1c-47fc-4d30-a079-be14871f0c6a",
+ "resourceInvariantUUID": "05a482b5-ec0d-45cb-ae95-397ce6765c9e",
+ "resourceCustomizationUUID": "aff592e4-cfc7-43ce-abea-f026b56995ab",
+ "category": "Allotted Resource",
+ "subcategory": "BRG",
+ "artifacts": []
+ }, {
+ "resourceInstanceName": "vCPE_vgw bf175ab0-4fa2 0",
+ "resourceName": "vCPE_vgw bf175ab0-4fa2",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "df1ce337-78b2-4e43-afb8-081d5ca175fc",
+ "resourceInvariantUUID": "1d2b0362-af54-43b9-9a5b-2dba408742b2",
+ "resourceCustomizationUUID": "6f2c39b3-d14f-4575-97b3-c93a7620591e",
+ "category": "Generic",
+ "subcategory": "Abstract",
+ "artifacts": [{
+ "artifactName": "vf-license-model.xml",
+ "artifactType": "VF_LICENSE",
+ "artifactURL": "/vf-license-model.xml",
+ "artifactChecksum": "YjBlNjhjNGU0ZjZkYzUwYjlhODg2NDMzZjk0MGNjMzM\u003d",
+ "artifactDescription": "VF license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "2f362774-ac17-48a9-9c93-632b661ea689",
+ "artifactVersion": "1"
+ }, {
+ "artifactName": "vcpe_vgwbf175ab04fa20_modules.json",
+ "artifactType": "VF_MODULES_METADATA",
+ "artifactURL": "/vcpe_vgwbf175ab04fa20_modules.json",
+ "artifactChecksum": "NTg2NjQxOWNkNmNjY2EzY2M3ZGJjM2YyOTI2ZjlkNzU\u003d",
+ "artifactDescription": "Auto-generated VF Modules information artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "b02ab2a2-a657-44c4-ae88-578fe0caa30d",
+ "artifactVersion": "1"
+ }, {
+ "artifactName": "base_vcpe_vgw.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/base_vcpe_vgw.yaml",
+ "artifactChecksum": "OTI1ODIwZTFhMjc3ZDVhYWU4ZjJjMTEzZGZiZTY4Zjg\u003d",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 120,
+ "artifactUUID": "e3a33b76-1f8a-44ba-808b-8a4c79e4b44a",
+ "artifactVersion": "2"
+ }, {
+ "artifactName": "vendor-license-model.xml",
+ "artifactType": "VENDOR_LICENSE",
+ "artifactURL": "/vendor-license-model.xml",
+ "artifactChecksum": "YThkMTY5ZWU5MDg5YmI5MWNiY2M5OTg1MTdjMzQzNWM\u003d",
+ "artifactDescription": " Vendor license file",
+ "artifactTimeout": 120,
+ "artifactUUID": "3eae4c31-394f-497b-83e9-110e87e40964",
+ "artifactVersion": "1"
+ }, {
+ "artifactName": "base_vcpe_vgw.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/base_vcpe_vgw.env",
+ "artifactChecksum": "MTY4ZDUxYTUwNjExN2JhZjQzNGE5ZWQ3MGUxM2IyYWM\u003d",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactTimeout": 120,
+ "artifactUUID": "9b73763b-0f60-47c3-8939-cf2f819bc75a",
+ "artifactVersion": "2",
+ "generatedFromUUID": "e3a33b76-1f8a-44ba-808b-8a4c79e4b44a"
+ }]
+ }],
+ "serviceArtifacts": [{
+ "artifactName": "service-Vcperescust201910012364-template.yml",
+ "artifactType": "TOSCA_TEMPLATE",
+ "artifactURL": "/service-Vcperescust201910012364-template.yml",
+ "artifactChecksum": "ZDRmZTZkNTkyNTBhMjM1Nzk1NzBiMjdkYmVjMWJiZjI\u003d",
+ "artifactDescription": "TOSCA representation of the asset",
+ "artifactTimeout": 0,
+ "artifactUUID": "50f4eed5-3330-46c3-89e8-a56d2de4354b",
+ "artifactVersion": "1"
+ }, {
+ "artifactName": "service-Vcperescust201910012364-csar.csar",
+ "artifactType": "TOSCA_CSAR",
+ "artifactURL": "/service-Vcperescust201910012364-csar.csar",
+ "artifactChecksum": "ZDlmMTMyYjVjZmMxNmQ1MDM2NmIyN2ZlYWUzNjM5ODU\u003d",
+ "artifactDescription": "TOSCA definition package of the asset",
+ "artifactTimeout": 0,
+ "artifactUUID": "2da4976c-1532-4b1e-b662-d80f487d1661",
+ "artifactVersion": "1"
+ }],
+ "workloadContext": "Production"
+} \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-csar.csar b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-csar.csar
new file mode 100644
index 0000000000..29d2d72bf1
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-csar.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-template.yml b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-template.yml
new file mode 100644
index 0000000000..1fe6117f59
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/service-Vcperescust201910012364-template.yml
@@ -0,0 +1,822 @@
+tosca_definitions_version: tosca_simple_yaml_1_1
+metadata:
+ invariantUUID: d0568a10-a0e0-4efa-b698-ad3772f2e30f
+ UUID: d3aac917-543d-4421-b6d7-ba2b65884eb7
+ name: vCPEResCust 2019-10-01 _2364
+ description: catalog service description
+ type: Service
+ category: Network L1-3
+ serviceType: ''
+ serviceRole: ''
+ instantiationType: A-la-carte
+ serviceEcompNaming: true
+ ecompGeneratedNaming: true
+ namingPolicy: ''
+ environmentContext: General_Revenue-Bearing
+imports:
+- nodes:
+ file: nodes.yml
+- datatypes:
+ file: data.yml
+- capabilities:
+ file: capabilities.yml
+- relationships:
+ file: relationships.yml
+- groups:
+ file: groups.yml
+- policies:
+ file: policies.yml
+- annotations:
+ file: annotations.yml
+- service-vCPEResCust 2019-10-01 _2364-interface:
+ file: service-Vcperescust201910012364-template-interface.yml
+- resource-TunnelXConn_2019-10-01 03:23:27.409:
+ file: resource-Tunnelxconn20191001032327409-template.yml
+- resource-TunnelXConn_2019-10-01 03:23:27.409-interface:
+ file: resource-Tunnelxconn20191001032327409-template-interface.yml
+- resource-BRG_2019-10-01 03:23:27.409:
+ file: resource-Brg20191001032327409-template.yml
+- resource-BRG_2019-10-01 03:23:27.409-interface:
+ file: resource-Brg20191001032327409-template-interface.yml
+- resource-vCPE_vgw bf175ab0-4fa2:
+ file: resource-VcpeVgwBf175ab04fa2-template.yml
+- resource-vCPE_vgw bf175ab0-4fa2-interface:
+ file: resource-VcpeVgwBf175ab04fa2-template-interface.yml
+topology_template:
+ node_templates:
+ vCPE_vgw bf175ab0-4fa2 0:
+ type: org.openecomp.resource.vf.VcpeVgwBf175ab04fa2
+ metadata:
+ invariantUUID: 1d2b0362-af54-43b9-9a5b-2dba408742b2
+ UUID: d9f21a73-33cb-49b5-9e5c-87c2c7dd93dc
+ customizationUUID: 6f2c39b3-d14f-4575-97b3-c93a7620591e
+ version: '1.0'
+ name: vCPE_vgw bf175ab0-4fa2
+ description: vendor software product
+ type: VF
+ category: Generic
+ subcategory: Abstract
+ resourceVendor: 6dccd115-ce6a-4b1a-88aa
+ resourceVendorRelease: '1.0'
+ resourceVendorModelNumber: ''
+ properties:
+ vf_module_id: vCPE_Customer_GW
+ vcpe_image_name: PUT THE IMAGE NAME HERE (Ubuntu 1604 SUGGESTED)
+ skip_post_instantiation_configuration: true
+ vgw_name_0: zdcpe1cpe01gw01
+ public_net_id: PUT THE PUBLIC NETWORK ID HERE
+ onap_private_subnet_id: PUT THE ONAP PRIVATE SUBNETWORK NAME HERE
+ nexus_artifact_repo: https://nexus.onap.org
+ onap_private_net_cidr: 10.0.0.0/16
+ cpe_public_net_id: zdfw1cpe01_public
+ mux_ip_addr: 10.5.0.20
+ mux_gw_private_net_id: zdfw1muxgw01_private
+ dcae_collector_ip: 10.0.4.1
+ vnf_id: vCPE_Infrastructure_GW_demo_app
+ cpe_public_net_cidr: 10.2.0.0/24
+ vg_vgmux_tunnel_vni: 100.0
+ dcae_collector_port: '8081'
+ mux_gw_private_net_cidr: 10.5.0.0/24
+ mux_gw_private_subnet_id: zdfw1muxgw01_sub_private
+ nf_naming:
+ ecomp_generated_naming: true
+ multi_stage_design: 'false'
+ onap_private_net_id: PUT THE ONAP PRIVATE NETWORK NAME HERE
+ availability_zone_max_count: 1
+ vgw_private_ip_0: 10.5.0.21
+ pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN
+ vgw_private_ip_1: 10.0.101.30
+ key_name: vgw_key
+ vcpe_flavor_name: PUT THE FLAVOR NAME HERE (MEDIUM FLAVOR SUGGESTED)
+ script_version: 1.5.0-SNAPSHOT
+ cpe_public_subnet_id: zdfw1cpe01_sub_public
+ cloud_env: PUT THE CLOUD PROVIDED HERE (openstack or rackspace)
+ capabilities:
+ abstract_vgw.network.incoming.packets_vgw_vgw_private_0_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_vgw.disk.read.bytes_vgw:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: compute
+ abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_0_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ abstract_vgw.disk.read.requests_vgw:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: compute
+ abstract_vgw.disk.write.bytes_vgw:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: compute
+ abstract_vgw.disk.capacity_vgw:
+ properties:
+ unit: B
+ description: The amount of disk that the instance can see
+ type: Gauge
+ category: disk
+ abstract_vgw.network.incoming.bytes_vgw_vgw_private_1_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.port_mirroring_vgw_vgw_private_2_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_vgw_private_2_port_network_role
+ nfc_naming_code: vgw
+ abstract_vgw.disk.write.requests_vgw:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: compute
+ abstract_vgw.disk.device.read.requests.rate_vgw:
+ properties:
+ unit: request/s
+ description: Average rate of read requests
+ type: Gauge
+ category: disk
+ abstract_vgw.port_mirroring_vgw_vgw_private_1_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_vgw_private_1_port_network_role
+ nfc_naming_code: vgw
+ abstract_vgw.network.outpoing.packets_vgw_vgw_private_0_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_vgw.memory.resident_vgw:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance on the physical machine
+ type: Gauge
+ category: compute
+ abstract_vgw.disk.allocation_vgw:
+ properties:
+ unit: B
+ description: The amount of disk occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_vgw.network.incoming.bytes_vgw_vgw_private_0_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.cpu_vgw:
+ properties:
+ unit: ns
+ description: CPU time used
+ type: Cumulative
+ category: compute
+ abstract_vgw.network.incoming.bytes_vgw_vgw_private_2_port:
+ properties:
+ unit: B
+ description: Number of incoming bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.network.outpoing.packets_vgw_vgw_private_1_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_vgw.disk.device.read.bytes_vgw:
+ properties:
+ unit: B
+ description: Volume of reads
+ type: Cumulative
+ category: disk
+ abstract_vgw.disk.device.write.bytes.rate_vgw:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: disk
+ abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_2_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_0_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_vgw.disk.device.iops_vgw:
+ properties:
+ unit: count/s
+ description: Average disk iops per device
+ type: Gauge
+ category: disk
+ abstract_vgw.disk.latency_vgw:
+ properties:
+ unit: ms
+ description: Average disk latency
+ type: Gauge
+ category: disk
+ abstract_vgw.network.incoming.packets_vgw_vgw_private_2_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_vgw.disk.device.allocation_vgw:
+ properties:
+ unit: B
+ description: The amount of disk per device occupied by the instance on the host machine
+ type: Gauge
+ category: disk
+ abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_0_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_vgw.instance_vgw:
+ properties:
+ unit: instance
+ description: Existence of instance
+ type: Gauge
+ category: compute
+ abstract_vgw.memory_vgw:
+ properties:
+ unit: MB
+ description: Volume of RAM allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_vgw.disk.device.write.requests_vgw:
+ properties:
+ unit: request
+ description: Number of write requests
+ type: Cumulative
+ category: disk
+ abstract_vgw.cpu.delta_vgw:
+ properties:
+ unit: ns
+ description: CPU time used since previous datapoint
+ type: Delta
+ category: compute
+ abstract_vgw.disk.device.latency_vgw:
+ properties:
+ unit: ms
+ description: Average disk latency per device
+ type: Gauge
+ category: disk
+ abstract_vgw.port_mirroring_vgw_vgw_private_0_port:
+ properties:
+ connection_point:
+ network_role:
+ get_input: port_vgw_private_0_port_network_role
+ nfc_naming_code: vgw
+ abstract_vgw.disk.iops_vgw:
+ properties:
+ unit: count/s
+ description: Average disk iops
+ type: Gauge
+ category: disk
+ abstract_vgw.cpu_util_vgw:
+ properties:
+ unit: '%'
+ description: Average CPU utilization
+ type: Gauge
+ category: compute
+ abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_2_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_1_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_vgw.network.outgoing.bytes_vgw_vgw_private_0_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_1_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ abstract_vgw.disk.usage_vgw:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host
+ type: Gauge
+ category: disk
+ abstract_vgw.disk.write.requests.rate_vgw:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: compute
+ abstract_vgw.network.outgoing.bytes_vgw_vgw_private_1_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.scalable_vgw:
+ properties:
+ max_instances: 1
+ min_instances: 1
+ abstract_vgw.disk.device.read.bytes.rate_vgw:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: disk
+ abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_0_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ abstract_vgw.disk.device.read.requests_vgw:
+ properties:
+ unit: request
+ description: Number of read requests
+ type: Cumulative
+ category: disk
+ abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_1_port:
+ properties:
+ unit: B/s
+ description: Average rate of outgoing bytes
+ type: Gauge
+ category: network
+ abstract_vgw.disk.device.write.requests.rate_vgw:
+ properties:
+ unit: request/s
+ description: Average rate of write requests
+ type: Gauge
+ category: disk
+ abstract_vgw.disk.device.usage_vgw:
+ properties:
+ unit: B
+ description: The physical size in bytes of the image container on the host per device
+ type: Gauge
+ category: disk
+ abstract_vgw.disk.write.bytes.rate_vgw:
+ properties:
+ unit: B/s
+ description: Average rate of writes
+ type: Gauge
+ category: compute
+ abstract_vgw.disk.device.write.bytes_vgw:
+ properties:
+ unit: B
+ description: Volume of writes
+ type: Cumulative
+ category: disk
+ abstract_vgw.memory.usage_vgw:
+ properties:
+ unit: MB
+ description: Volume of RAM used by the instance from the amount of its allocated memory
+ type: Gauge
+ category: compute
+ abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_2_port:
+ properties:
+ unit: packet/s
+ description: Average rate of outgoing packets
+ type: Gauge
+ category: network
+ abstract_vgw.disk.root.size_vgw:
+ properties:
+ unit: GB
+ description: Size of root disk
+ type: Gauge
+ category: compute
+ abstract_vgw.disk.ephemeral.size_vgw:
+ properties:
+ unit: GB
+ description: Size of ephemeral disk
+ type: Gauge
+ category: compute
+ abstract_vgw.disk.device.capacity_vgw:
+ properties:
+ unit: B
+ description: The amount of disk per device that the instance can see
+ type: Gauge
+ category: disk
+ abstract_vgw.disk.read.bytes.rate_vgw:
+ properties:
+ unit: B/s
+ description: Average rate of reads
+ type: Gauge
+ category: compute
+ abstract_vgw.endpoint_vgw:
+ properties:
+ secure: true
+ abstract_vgw.network.outpoing.packets_vgw_vgw_private_2_port:
+ properties:
+ unit: packet
+ description: Number of outgoing packets
+ type: Cumulative
+ category: network
+ abstract_vgw.vcpus_vgw:
+ properties:
+ unit: vcpu
+ description: Number of virtual CPUs allocated to the instance
+ type: Gauge
+ category: compute
+ abstract_vgw.network.outgoing.bytes_vgw_vgw_private_2_port:
+ properties:
+ unit: B
+ description: Number of outgoing bytes
+ type: Cumulative
+ category: network
+ abstract_vgw.network.incoming.packets_vgw_vgw_private_1_port:
+ properties:
+ unit: packet
+ description: Number of incoming packets
+ type: Cumulative
+ category: network
+ abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_2_port:
+ properties:
+ unit: packet/s
+ description: Average rate of incoming packets
+ type: Gauge
+ category: network
+ abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_1_port:
+ properties:
+ unit: B/s
+ description: Average rate of incoming bytes
+ type: Gauge
+ category: network
+ BRG_2019-10-01 03:23:27.409 0:
+ type: org.openecomp.resource.vf.Brg2019100103:23:27409
+ metadata:
+ invariantUUID: 05a482b5-ec0d-45cb-ae95-397ce6765c9e
+ UUID: 12519dd0-46ca-46da-9dcc-c6155b2a6d15
+ customizationUUID: aff592e4-cfc7-43ce-abea-f026b56995ab
+ version: '1.0'
+ name: BRG_2019-10-01 03:23:27.409
+ description: Alloted Resource BRG
+ type: VF
+ category: Allotted Resource
+ subcategory: BRG
+ resourceVendor: ONAP
+ resourceVendorRelease: '1.0'
+ resourceVendorModelNumber: ''
+ properties:
+ nf_naming:
+ ecomp_generated_naming: true
+ skip_post_instantiation_configuration: true
+ multi_stage_design: 'false'
+ availability_zone_max_count: 1
+ nf_role: BRG
+ nf_type: BRG
+ TunnelXConn_2019-10-01 03:23:27.409 0:
+ type: org.openecomp.resource.vf.Tunnelxconn2019100103:23:27409
+ metadata:
+ invariantUUID: 3a367ac8-5dff-4325-a0e7-9e0299d22152
+ UUID: 93d3e01d-4f8c-4a60-99f2-26b64c69bc11
+ customizationUUID: 4e0249f0-5118-4323-b5e9-0783ad1123ba
+ version: '1.0'
+ name: TunnelXConn_2019-10-01 03:23:27.409
+ description: Alloted Resource TunnelXConn
+ type: VF
+ category: Allotted Resource
+ subcategory: TunnelXConn
+ resourceVendor: ONAP
+ resourceVendorRelease: '1.0'
+ resourceVendorModelNumber: ''
+ properties:
+ nf_naming:
+ ecomp_generated_naming: true
+ skip_post_instantiation_configuration: true
+ multi_stage_design: 'false'
+ availability_zone_max_count: 1
+ nf_role: TunnelXConn
+ nf_type: TunnelXConn
+ groups:
+ vcpe_vgwbf175ab04fa20..VcpeVgwBf175ab04fa2..base_vcpe_vgw..module-0:
+ type: org.openecomp.groups.VfModule
+ metadata:
+ vfModuleModelName: VcpeVgwBf175ab04fa2..base_vcpe_vgw..module-0
+ vfModuleModelInvariantUUID: 7caf746f-46c6-4e47-bbfc-9374b1c17ba1
+ vfModuleModelUUID: a4654496-9862-47e4-9640-d84708ea8bfb
+ vfModuleModelVersion: '1'
+ vfModuleModelCustomizationUUID: ddd095d2-c2ba-48fe-90f4-e3f6fc806d7e
+ properties:
+ min_vf_module_instances: 1
+ vf_module_label: base_vcpe_vgw
+ max_vf_module_instances: 1
+ vf_module_type: Base
+ isBase: true
+ initial_count: 1
+ volume_group: false
+ substitution_mappings:
+ node_type: org.openecomp.service.Vcperescust201910012364
+ capabilities:
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.feature_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.feature_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.write.requests.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.write.requests.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.iops_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.iops_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.read.requests.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.read.requests.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.attachment_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.attachment_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.write.requests_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.write.requests_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.endpoint_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.endpoint_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.latency_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.latency_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.write.bytes_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.write.bytes_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.memory_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.memory_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.write.requests.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.write.requests.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.read.bytes.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.read.bytes.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outpoing.packets_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outpoing.packets_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.feature_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.feature_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.port_mirroring_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.port_mirroring_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.binding_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.binding_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.attachment_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.attachment_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.iops_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.iops_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.forwarder_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.forwarder_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.ephemeral.size_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.ephemeral.size_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.port_mirroring_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.port_mirroring_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.host_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.host_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.memory.usage_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.memory.usage_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outpoing.packets_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outpoing.packets_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.write.bytes.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.write.bytes.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.attachment_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.attachment_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.binding_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.binding_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.read.bytes_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.read.bytes_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.usage_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.usage_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.cpu_util_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.cpu_util_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.memory.resident_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.memory.resident_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.read.requests_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.read.requests_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.binding_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.binding_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.usage_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.usage_vgw
+ brg_2019100103:23:274090.brg.feature:
+ - BRG_2019-10-01 03:23:27.409 0
+ - brg.feature
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.latency_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.latency_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.cpu_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.cpu_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.instance_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.instance_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.allocation_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.allocation_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.write.bytes.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.write.bytes.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes.rate_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.capacity_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.capacity_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.forwarder_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.forwarder_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.read.requests_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.read.requests_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.allocation_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.allocation_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.root.size_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.root.size_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.feature_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.feature_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outpoing.packets_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outpoing.packets_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.bytes.rate_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.packets.rate_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.incoming.packets.rate_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.write.requests_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.write.requests_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.binding_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.binding_vgw_vgw_private_2_port
+ tunnelxconn_2019100103:23:274090.tunnelxconn.feature:
+ - TunnelXConn_2019-10-01 03:23:27.409 0
+ - tunnelxconn.feature
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.read.bytes_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.read.bytes_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.network.outgoing.bytes_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.network.outgoing.bytes_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.scalable_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.scalable_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.write.bytes_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.write.bytes_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.device.read.bytes.rate_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.device.read.bytes.rate_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.feature_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.feature_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.os_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.os_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.vcpus_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.vcpus_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.forwarder_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.forwarder_vgw_vgw_private_0_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.port_mirroring_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.port_mirroring_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.cpu.delta_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.cpu.delta_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.disk.capacity_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.disk.capacity_vgw
+ requirements:
+ vcpe_vgwbf175ab04fa20.abstract_vgw.dependency_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.dependency_vgw_vgw_private_1_port
+ tunnelxconn_2019100103:23:274090.tunnelxconn.service_dependency:
+ - TunnelXConn_2019-10-01 03:23:27.409 0
+ - tunnelxconn.service_dependency
+ vcpe_vgwbf175ab04fa20.abstract_vgw.local_storage_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.local_storage_vgw
+ vcpe_vgwbf175ab04fa20.abstract_vgw.dependency_vgw:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.dependency_vgw
+ brg_2019100103:23:274090.brg.service_dependency:
+ - BRG_2019-10-01 03:23:27.409 0
+ - brg.service_dependency
+ vcpe_vgwbf175ab04fa20.abstract_vgw.link_vgw_vgw_private_1_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.link_vgw_vgw_private_1_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.dependency_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.dependency_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.link_vgw_vgw_private_2_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.link_vgw_vgw_private_2_port
+ vcpe_vgwbf175ab04fa20.abstract_vgw.link_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.link_vgw_vgw_private_0_port
+ tunnelxconn_2019100103:23:274090.tunnelxconn.dependency:
+ - TunnelXConn_2019-10-01 03:23:27.409 0
+ - tunnelxconn.dependency
+ brg_2019100103:23:274090.brg.dependency:
+ - BRG_2019-10-01 03:23:27.409 0
+ - brg.dependency
+ vcpe_vgwbf175ab04fa20.abstract_vgw.dependency_vgw_vgw_private_0_port:
+ - vCPE_vgw bf175ab0-4fa2 0
+ - abstract_vgw.dependency_vgw_vgw_private_0_port
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vcpe_vgwbf175ab04fa20_modules.json b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vcpe_vgwbf175ab04fa20_modules.json
new file mode 100644
index 0000000000..e74c3c05a8
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vcpe_vgwbf175ab04fa20_modules.json
@@ -0,0 +1,25 @@
+[
+ {
+ "vfModuleModelName": "VcpeVgwBf175ab04fa2..base_vcpe_vgw..module-0",
+ "vfModuleModelInvariantUUID": "7caf746f-46c6-4e47-bbfc-9374b1c17ba1",
+ "vfModuleModelVersion": "1",
+ "vfModuleModelUUID": "a4654496-9862-47e4-9640-d84708ea8bfb",
+ "vfModuleModelCustomizationUUID": "ddd095d2-c2ba-48fe-90f4-e3f6fc806d7e",
+ "isBase": true,
+ "artifacts": [
+ "e3a33b76-1f8a-44ba-808b-8a4c79e4b44a",
+ "9b73763b-0f60-47c3-8939-cf2f819bc75a"
+ ],
+ "properties": {
+ "min_vf_module_instances": "1",
+ "vf_module_label": "base_vcpe_vgw",
+ "max_vf_module_instances": "1",
+ "vfc_list": "",
+ "vf_module_description": "",
+ "vf_module_type": "Base",
+ "availability_zone_count": "",
+ "volume_group": "false",
+ "initial_count": "1"
+ }
+ }
+] \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vendor-license-model.xml
new file mode 100644
index 0000000000..67bbea4677
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vendor-license-model.xml
@@ -0,0 +1 @@
+<vendor-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>6dccd115-ce6a-4b1a-88aa</vendor-name><entitlement-pool-list><entitlement-pool><entitlement-pool-invariant-uuid>40d4819966b04a28aac2db35f2d84755</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86EFCDA3995C4232B96C833E97804D4F</entitlement-pool-uuid><version>1.0</version><name>ce52c558-b095-4a8f-84f3</name><description>vendor entitlement pool</description><increments/><manufacturer-reference-number>111111</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>100</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-10-01T00:00:00Z</start-date><expiry-date>2020-09-30T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><version>1.0</version><name>c712eb11-eddd-459f-a383</name><description>vendor license key group</description><type>Universal</type><increments/><manufacturerReferenceNumber>11111</manufacturerReferenceNumber><license-key-group-invariant-uuid>fc8a672de0d041ecb7637b1ae5446e99</license-key-group-invariant-uuid><license-key-group-uuid>DF4EA9695A4943ABB8437F244FC6623B</license-key-group-uuid><threshold-value><unit>Percentage</unit><value>100</value></threshold-value><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-10-01T00:00:00Z</start-date><expiry-date>2020-09-30T23:59:59Z</expiry-date></license-key-group></license-key-group-list></vendor-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vf-license-model.xml
new file mode 100644
index 0000000000..fb15c3aa16
--- /dev/null
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-rescust/vf-license-model.xml
@@ -0,0 +1 @@
+<vf-license-model xmlns="http://xmlns.openecomp.org/asdc/license-model/1.0"><vendor-name>6dccd115-ce6a-4b1a-88aa</vendor-name><vf-id>8228aa3775634529bb6f86e77b0e40d7</vf-id><feature-group-list><feature-group><entitlement-pool-list><entitlement-pool><name>ce52c558-b095-4a8f-84f3</name><description>vendor entitlement pool</description><increments/><entitlement-pool-invariant-uuid>40d4819966b04a28aac2db35f2d84755</entitlement-pool-invariant-uuid><entitlement-pool-uuid>86EFCDA3995C4232B96C833E97804D4F</entitlement-pool-uuid><manufacturer-reference-number>111111</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>100</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-10-01T00:00:00Z</start-date><expiry-date>2020-09-30T23:59:59Z</expiry-date></entitlement-pool></entitlement-pool-list><license-key-group-list><license-key-group><name>c712eb11-eddd-459f-a383</name><description>vendor license key group</description><type>Universal</type><increments/><license-key-group-invariant-uuid>fc8a672de0d041ecb7637b1ae5446e99</license-key-group-invariant-uuid><license-key-group-uuid>DF4EA9695A4943ABB8437F244FC6623B</license-key-group-uuid><manufacturer-reference-number>11111</manufacturer-reference-number><threshold-value><unit>Percentage</unit><value>100</value></threshold-value><version>1.0</version><sp-limits/><vendor-limits/><operational-scope><value/></operational-scope><start-date>2019-10-01T00:00:00Z</start-date><expiry-date>2020-09-30T23:59:59Z</expiry-date></license-key-group></license-key-group-list><name>ec13e8a7-f181-4d96-b821</name><part-number>123abc456</part-number><feature-group-uuid>7b85e31faa0541afa21a60b85907aa40</feature-group-uuid><description>vendor feature group</description></feature-group></feature-group-list></vf-license-model> \ No newline at end of file
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index 652fc8f0de..0821ebc97c 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -738,6 +738,8 @@ CREATE TABLE `orchestration_flow_reference` (
`SEQ_NO` int(11) NOT NULL,
`FLOW_NAME` varchar(200) NOT NULL,
`FLOW_VERSION` double NOT NULL,
+ `SCOPE` varchar(200) DEFAULT NULL,
+ `ACTION` varchar(200) DEFAULT NULL,
`NB_REQ_REF_LOOKUP_ID` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_orchestration_flow_reference` (`COMPOSITE_ACTION`,`FLOW_NAME`,`SEQ_NO`,`NB_REQ_REF_LOOKUP_ID`),
@@ -809,6 +811,10 @@ CREATE TABLE `service` (
`OVERALL_DISTRIBUTION_STATUS` varchar(45),
`ONAP_GENERATED_NAMING` TINYINT(1) DEFAULT NULL,
`NAMING_POLICY` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -963,6 +969,7 @@ CREATE TABLE `vf_module_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VF_MODULE_MODEL_UUID` varchar(200) NOT NULL,
`VNF_RESOURCE_CUSTOMIZATION_ID` int(13) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`ID`),
KEY `fk_vf_module_customization__vf_module1_idx` (`VF_MODULE_MODEL_UUID`),
KEY `fk_vf_module_customization__heat_env__heat_environment1_idx` (`HEAT_ENVIRONMENT_ARTIFACT_UUID`),
@@ -1113,6 +1120,8 @@ CREATE TABLE `vnf_resource_customization` (
`VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_MODEL_UUID` varchar(200) NOT NULL,
`VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL,
+ `NF_DATA_VALID` tinyint(1) DEFAULT '0',
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`),
KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`),
@@ -1194,6 +1203,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
`CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
`CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
`SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -1418,8 +1428,6 @@ CREATE TABLE `active_requests` (
CREATE TABLE `infra_active_requests` (
`REQUEST_ID` varchar(45) NOT NULL,
- `CLIENT_REQUEST_ID` varchar(45) DEFAULT NULL,
- `ACTION` varchar(45) DEFAULT NULL,
`REQUEST_STATUS` varchar(20) DEFAULT NULL,
`STATUS_MESSAGE` longtext DEFAULT NULL,
`PROGRESS` bigint(20) DEFAULT NULL,
@@ -1430,23 +1438,19 @@ CREATE TABLE `infra_active_requests` (
`VNF_NAME` varchar(80) DEFAULT NULL,
`VNF_TYPE` varchar(200) DEFAULT NULL,
`SERVICE_TYPE` varchar(45) DEFAULT NULL,
- `AIC_NODE_CLLI` varchar(11) DEFAULT NULL,
`TENANT_ID` varchar(45) DEFAULT NULL,
- `PROV_STATUS` varchar(20) DEFAULT NULL,
`VNF_PARAMS` longtext,
`VNF_OUTPUTS` longtext,
`REQUEST_BODY` longtext,
`RESPONSE_BODY` longtext,
`LAST_MODIFIED_BY` varchar(100) DEFAULT NULL,
`MODIFY_TIME` datetime DEFAULT NULL,
- `REQUEST_TYPE` varchar(20) DEFAULT NULL,
`VOLUME_GROUP_ID` varchar(45) DEFAULT NULL,
`VOLUME_GROUP_NAME` varchar(45) DEFAULT NULL,
`VF_MODULE_ID` varchar(45) DEFAULT NULL,
`VF_MODULE_NAME` varchar(200) DEFAULT NULL,
`VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL,
- `AAI_SERVICE_ID` varchar(50) DEFAULT NULL,
- `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL,
+ `CLOUD_REGION` varchar(11) DEFAULT NULL,
`CALLBACK_URL` varchar(200) DEFAULT NULL,
`CORRELATOR` varchar(80) DEFAULT NULL,
`NETWORK_ID` varchar(45) DEFAULT NULL,
@@ -1465,14 +1469,11 @@ CREATE TABLE `infra_active_requests` (
`ORIGINAL_REQUEST_ID` varchar(45) DEFAULT NULL,
`EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
`ROLLBACK_EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
- PRIMARY KEY (`REQUEST_ID`),
- UNIQUE KEY `UK_bhu6w8p7wvur4pin0gjw2d5ak` (`CLIENT_REQUEST_ID`)
+ PRIMARY KEY (`REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `archived_infra_requests` (
`REQUEST_ID` varchar(45) NOT NULL,
- `CLIENT_REQUEST_ID` varchar(45) DEFAULT NULL,
- `ACTION` varchar(45) DEFAULT NULL,
`REQUEST_STATUS` varchar(20) DEFAULT NULL,
`STATUS_MESSAGE` longtext DEFAULT NULL,
`PROGRESS` bigint(20) DEFAULT NULL,
@@ -1483,23 +1484,19 @@ CREATE TABLE `archived_infra_requests` (
`VNF_NAME` varchar(80) DEFAULT NULL,
`VNF_TYPE` varchar(200) DEFAULT NULL,
`SERVICE_TYPE` varchar(45) DEFAULT NULL,
- `AIC_NODE_CLLI` varchar(11) DEFAULT NULL,
`TENANT_ID` varchar(45) DEFAULT NULL,
- `PROV_STATUS` varchar(20) DEFAULT NULL,
`VNF_PARAMS` longtext,
`VNF_OUTPUTS` longtext,
`REQUEST_BODY` longtext,
`RESPONSE_BODY` longtext,
`LAST_MODIFIED_BY` varchar(100) DEFAULT NULL,
`MODIFY_TIME` datetime DEFAULT NULL,
- `REQUEST_TYPE` varchar(20) DEFAULT NULL,
`VOLUME_GROUP_ID` varchar(45) DEFAULT NULL,
`VOLUME_GROUP_NAME` varchar(45) DEFAULT NULL,
`VF_MODULE_ID` varchar(45) DEFAULT NULL,
`VF_MODULE_NAME` varchar(200) DEFAULT NULL,
`VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL,
- `AAI_SERVICE_ID` varchar(50) DEFAULT NULL,
- `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL,
+ `CLOUD_REGION` varchar(11) DEFAULT NULL,
`CALLBACK_URL` varchar(200) DEFAULT NULL,
`CORRELATOR` varchar(80) DEFAULT NULL,
`NETWORK_ID` varchar(45) DEFAULT NULL,
@@ -1515,8 +1512,7 @@ CREATE TABLE `archived_infra_requests` (
`OPERATIONAL_ENV_ID` varchar(45) DEFAULT NULL,
`OPERATIONAL_ENV_NAME` varchar(200) DEFAULT NULL,
`REQUEST_URL` varchar(500) DEFAULT NULL,
- PRIMARY KEY (`REQUEST_ID`),
- UNIQUE KEY `UK_bhu6w8p7wvur4pin0gjw2d72h` (`CLIENT_REQUEST_ID`)
+ PRIMARY KEY (`REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `site_status` (
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
index f14e3dcc42..ee70dcc89c 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
@@ -44,7 +44,7 @@ import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.onap.so.openpojo.rules.HasToStringRule
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
@Deprecated
class AaiUtil {
@@ -96,7 +96,7 @@ class AaiUtil {
String regionId = ""
try{
URL Url = new URL(url)
- HttpClient client = new HttpClientFactory().newXmlClient(Url, TargetEntity.AAI)
+ HttpClient client = new HttpClientFactory().newXmlClient(Url, ONAPComponents.AAI)
client.addBasicAuthHeader(UrnPropertiesReader.getVariable("aai.auth", execution), UrnPropertiesReader.getVariable("mso.msoKey", execution))
client.addAdditionalHeader("X-FromAppId", "MSO")
client.addAdditionalHeader("X-TransactionId", utils.getRequestID())
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy
index 2bf7298584..83784e1960 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy
@@ -37,7 +37,7 @@ import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.springframework.web.util.UriUtils
import javax.ws.rs.core.MediaType
@@ -442,7 +442,7 @@ class CatalogDbUtils {
String catalogDbEndpoint = UrnPropertiesReader.getVariable("mso.catalog.db.endpoint",execution)
String queryEndpoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + endPoint
def responseData = ''
- HttpClient client = httpClientFactory.newJsonClient(new URL(queryEndpoint), TargetEntity.CATALOG_DB)
+ HttpClient client = httpClientFactory.newJsonClient(new URL(queryEndpoint), ONAPComponents.CATALOG_DB)
client.addAdditionalHeader(ONAPLogConstants.Headers.REQUEST_ID, UUID.randomUUID().toString())
client.addAdditionalHeader('X-FromAppId', "BPMN")
client.addAdditionalHeader('Accept', MediaType.APPLICATION_JSON)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcess.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcess.groovy
index 7e1280729c..841fe9f50e 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcess.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcess.groovy
@@ -9,9 +9,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -25,295 +25,98 @@ package org.onap.so.bpmn.common.scripts
import org.onap.so.logger.LoggingAnchor
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.so.db.request.beans.InfraActiveRequests
+import org.onap.so.db.request.client.RequestsDbClient
import org.onap.so.logger.ErrorCode
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import org.onap.so.bpmn.core.UrnPropertiesReader;
public class CompleteMsoProcess extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CompleteMsoProcess.class);
-
- String Prefix="CMSO_"
- ExceptionUtil exceptionUtil = new ExceptionUtil()
-
- // Complete MSO Request processing
- public initializeProcessVariables(DelegateExecution execution){
-
- def method = getClass().getSimpleName() + '.initializeProcessVariables(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
- try {
-
- /* Initialize all the process request variables in this block */
- execution.setVariable("prefix",Prefix)
- execution.setVariable("CMSO_request_id","")
- execution.setVariable("CMSO_notification-url","")
- execution.setVariable("CMSO_mso-bpel-name","")
- execution.setVariable("CMSO_request_action","")
- execution.setVariable("CMSO_notification-url-Ok", false)
- execution.setVariable("CMSO_request_id-Ok", false)
-
- //updateRequest Adapter process variables
- execution.setVariable("CMSO_updateRequestResponse", "")
- execution.setVariable("CMSO_updateRequestResponseCode", "")
- execution.setVariable("CMSO_updateFinalNotifyAckStatusFailedPayload", "")
-
- //Set DB adapter variables here
- execution.setVariable("CMSO_updateDBStatusToSuccessPayload", "")
- execution.setVariable("CMSO_updateInfraRequestDBPayload", "")
- execution.setVariable("CMSO_setUpdateDBstatustoSuccessPayload", "")
-
- //Auth variables
- execution.setVariable("BasicAuthHeaderValue","")
-
- //Response variables
- execution.setVariable("CompletionHandlerResponse","")
- execution.setVariable("CMSO_ErrorResponse", null)
- execution.setVariable("CMSO_ResponseCode", "")
-
- setSuccessIndicator(execution, false)
-
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in' +
- ' ' + method, "BPMN", ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
- }
-
- }
-
- public void preProcessRequest (DelegateExecution execution) {
-
- initializeProcessVariables(execution)
- def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
- // logger.trace("Started CompleteMsoProcess preProcessRequest Method ");
- logger.trace('Entered ' + method)
-
- setBasicDBAuthHeader(execution, execution.getVariable('isDebugLogEnabled'))
-
- try {
- def xml = execution.getVariable("CompleteMsoProcessRequest")
-
- logger.debug("CompleteMsoProcess Request: " + xml)
- logger.debug("Incoming Request is: "+ xml)
-
- //mso-bpel-name from the incoming request
- def msoBpelName = utils.getNodeText(xml,"mso-bpel-name")
- execution.setVariable("CMSO_mso-bpel-name",msoBpelName)
-
- //Check the incoming request type
- //Incoming request can be ACTIVE_REQUESTS (request-information node) or INFRA_ACTIVE_REQUESTS (request-info node)
- if (utils.nodeExists(xml, "request-information")) {
- execution.setVariable("CMSO_request_id-Ok", true) // Incoming request is for ACTIVE_REQUESTS
- }
-
- //Check for rehome indicator
- def rehomeIndicator = utils.getNodeText(xml,"rehomeDone")
- execution.setVariable("rehomeDone", rehomeIndicator)
-
- //Check notification-url for the incoming request type
- //ACTIVE_REQUESTS may have notificationurl node
- //INFRA_ACTIVE_REQUESTS notificationurl node does not exist
- def notificationurl = ""
- if (utils.nodeExists(xml, "notification-url")) {
- notificationurl = utils.getNodeText(xml,"notification-url")
- if(notificationurl != null && !notificationurl.isEmpty()) {
- execution.setVariable("CMSO_notification-url-Ok", true)
- execution.setVariable("CMSO_notification-url",notificationurl)
- }
- }
-
- //Check request_id for the incoming request type
- //For INFRA_ACTIVE_REQUESTS payload request-id IS optional (Not sure why this is option since req id is primary key ... also tried exe through SOAP UI to check if MSO code handles null like auto generated seq not it does not)
- //For ACTIVE_REQUESTS payload request-id is NOT optional
- def request_id = ""
- if (utils.nodeExists(xml, "request-id")) {
- execution.setVariable("CMSO_request_id",utils.getNodeText(xml,"request-id"))
- }
-
-
- // INFRA_ACTIVE_REQUESTS have "action" element ... mandatory
- // ACTIVE_REQUEST have "request-action" ... mandatory
- if (utils.nodeExists(xml, "request-action")) {
- execution.setVariable("CMSO_request_action",utils.getNodeText(xml,"request-action"))
- } else if (utils.nodeExists(xml, "action")) {
- execution.setVariable("CMSO_request_action",utils.getNodeText(xml,"action"))
- }
-
- //Check source for the incoming request type
- //For INFRA_ACTIVE_REQUESTS payload source IS optional
- //For ACTIVE_REQUESTS payload source is NOT optional
- def source = ""
- if (utils.nodeExists(xml, "source")) {
- execution.setVariable("CMSO_source",utils.getNodeText(xml,"source"))
- }
-
- logger.trace("--> " + execution.getVariable(""))
- logger.trace("--> " + execution.getVariable(""))
-
- // set the DHV/Service Instantiation values if specified in the request
- execution.setVariable("CMSO_is_srv_inst_req", String.valueOf("true".equals(utils.getNodeText(xml, "is-srv-inst-req"))))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("CMSO_is_json_content", String.valueOf("JSON".equals(utils.getNodeText(xml, "resp-content-type"))))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("CMSO_service_inst_id", utils.getNodeText(xml, "service-instance-id"))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("CMSO_start_time", utils.getNodeText(xml, "start-time"))
- logger.trace("--> " + execution.getVariable(""))
- // this variable is used by the camunda flow to set the Content-Type for the async response
- if (execution.getVariable("CMSO_is_srv_inst_req").equals("true") &&
- execution.getVariable("CMSO_is_json_content").equals("true")) {
- execution.setVariable("CMSO_content_type", "application/json")
- } else {
- execution.setVariable("CMSO_content_type", "text/xml")
- }
-
- logger.trace('Exited ' + method)
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logger.debug("Exception Occured During PreProcessRequest: " + e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public void setUpdateDBstatustoSuccessPayload (DelegateExecution execution){
-
- def method = getClass().getSimpleName() + '.setUpdateDBstatustoSuccessPayload(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
-
- def xml = execution.getVariable("CompleteMsoProcessRequest")
-
- //Get statusMessage if exists
- def statusMessage
- if(utils.nodeExists(xml, "status-message")){
- statusMessage = utils.getNodeText(xml, "status-message")
- }else{
- statusMessage = "Resource Completed Successfully"
- }
-
- //Get instance Id if exist
- String idXml = ""
- if(utils.nodeExists(xml, "vnfId")){
- idXml = utils.getNodeXml(xml, "vnfId")
- }else if(utils.nodeExists(xml, "networkId")){
- idXml = utils.getNodeXml(xml, "networkId")
- }else if(utils.nodeExists(xml, "configurationId")){
- idXml = utils.getNodeXml(xml, "configurationId")
- }else if(utils.nodeExists(xml, "serviceInstanceId")){
- idXml = utils.getNodeXml(xml, "serviceInstanceId")
- }else if(utils.nodeExists(xml, "vfModuleId")){
- idXml = utils.getNodeXml(xml, "vfModuleId")
- }else if(utils.nodeExists(xml, "volumeGroupId")){
- idXml = utils.getNodeXml(xml, "volumeGroupId")
- }else{
- idXml = ""
- }
- idXml = utils.removeXmlPreamble(idXml)
- idXml = utils.removeXmlNamespaces(idXml)
- logger.debug("Incoming Instance Id Xml: " + idXml)
-
- String payload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>${MsoUtils.xmlEscape(execution.getVariable("CMSO_request_id"))}</requestId>
- <lastModifiedBy>${MsoUtils.xmlEscape(execution.getVariable("CMSO_mso-bpel-name"))}</lastModifiedBy>
- <statusMessage>${MsoUtils.xmlEscape(statusMessage)}</statusMessage>
- <requestStatus>COMPLETE</requestStatus>
- <progress>100</progress>
- ${idXml}
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- execution.setVariable("CMSO_setUpdateDBstatustoSuccessPayload", payload)
- logger.debug("Outgoing Update Mso Request Payload is: " + payload)
- logger.debug("setUpdateDBstatustoSuccessPayload: " + payload)
-
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
- }
- logger.trace('Exited ' + method)
- }
-
- public void buildDataError (DelegateExecution execution, String message) {
-
- def method = getClass().getSimpleName() + '.buildDataError(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
- try {
-
- String msoCompletionResponse = """
- <sdncadapterworkflow:MsoCompletionResponse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <sdncadapterworkflow:out>BPEL ${execution.getVariable("CMSO_mso-bpel-name")} FAILED</sdncadapterworkflow:out>
- </sdncadapterworkflow:MsoCompletionResponse>
- """.trim()
-
- // Format Response
- def xmlMsoCompletionResponse = utils.formatXml(msoCompletionResponse)
- String buildMsoCompletionResponseAsString = xmlMsoCompletionResponse.drop(38).trim()
- logger.debug("CompleteMsoProcess Response: " + buildMsoCompletionResponseAsString)
- execution.setVariable("CompleteMsoProcessResponse", buildMsoCompletionResponseAsString)
- logger.debug("@@ CompleteMsoProcess Response @@ " + "\n" + execution.getVariable("CompletionHandlerResponse"))
-
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, message)
-
- } catch (BpmnError e) {
- logger.debug("Rethrowing MSOWorkflowException")
- throw e;
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
- }
-
- }
-
- public void postProcessResponse (DelegateExecution execution) {
-
- def method = getClass().getSimpleName() + '.postProcessResponse(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
- // logger.trace("Started CompleteMsoProcess PostProcessRequest Method ");
- try {
-
- String msoCompletionResponse = """
- <sdncadapterworkflow:MsoCompletionResponse xmlns:sdncadapterworkflow="http://ecomp.com/mso/workflow/schema/v1">
- <sdncadapterworkflow:out>BPEL ${execution.getVariable("CMSO_mso-bpel-name")} completed</sdncadapterworkflow:out>
- </sdncadapterworkflow:MsoCompletionResponse>
- """.trim()
-
- // Format Response
- def xmlMsoCompletionResponse = utils.formatXML(msoCompletionResponse)
- String buildMsoCompletionResponseAsString = xmlMsoCompletionResponse.drop(38).trim()
- // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead
- execution.setVariable("WorkflowResponse", buildMsoCompletionResponseAsString)
- logger.debug("CompleteMsoProcess Response: " + buildMsoCompletionResponseAsString)
- execution.setVariable("CompleteMsoProcessResponse", buildMsoCompletionResponseAsString)
- execution.setVariable("CMSO_ResponseCode", "200")
-
- setSuccessIndicator(execution, true)
-
- logger.debug("@@ CompleteMsoProcess Response @@ " + "\n" + execution.getVariable("CompleteMsoProcessResponse"))
-
- logger.trace('Exited ' + method)
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
- }
- }
-
+ private static final Logger logger = LoggerFactory.getLogger(CompleteMsoProcess.class);
+
+ String Prefix="CMSO_"
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ public void preProcessRequest (DelegateExecution execution) {
+ try {
+ def xml = execution.getVariable("CompleteMsoProcessRequest")
+
+ logger.debug("CompleteMsoProcess Request: " + xml)
+ logger.debug("Incoming Request is: "+ xml)
+
+ //mso-bpel-name from the incoming request
+ def msoBpelName = utils.getNodeText(xml,"mso-bpel-name")
+ execution.setVariable("CMSO_mso-bpel-name",msoBpelName)
+
+ if (utils.nodeExists(xml, "request-information")) {
+ throw new BpmnError("500", "FalloutHandler subflow does not support this request type.")
+ }
+
+ def request_id = ""
+ if (utils.nodeExists(xml, "request-id")) {
+ execution.setVariable("CMSO_request_id",utils.getNodeText(xml,"request-id"))
+ }
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logger.debug("Exception Occured During PreProcessRequest: " + e);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in preprocess")
+ }
+ }
+
+ public void updateInfraRequestDB (DelegateExecution execution){
+ try {
+
+ def xml = execution.getVariable("CompleteMsoProcessRequest")
+
+ //Get statusMessage if exists
+ def statusMessage
+ if(utils.nodeExists(xml, "status-message")){
+ statusMessage = utils.getNodeText(xml, "status-message")
+ }else{
+ statusMessage = "Resource Completed Successfully"
+ }
+
+ RequestsDbClient dbClient = getDbClient()
+
+ InfraActiveRequests infraRequest = dbClient.getInfraActiveRequests(execution.getVariable("CMSO_request_id"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.endpoint"))
+ if(infraRequest == null){
+ infraRequest = new InfraActiveRequests();
+ infraRequest.setRequestId(execution.getVariable("CMSO_request_id"))
+ }
+ infraRequest.setLastModifiedBy("BPMN")
+ infraRequest.setStatusMessage(statusMessage)
+ infraRequest.setRequestStatus("COMPLETED")
+ infraRequest.setProgress(100)
+
+ if(utils.nodeExists(xml, "vnfId")){
+ infraRequest.setVnfId(utils.getNodeText(xml, "vnfId"))
+ }else if(utils.nodeExists(xml, "networkId")){
+ infraRequest.setNetworkId(utils.getNodeText(xml, "networkId"))
+ }else if(utils.nodeExists(xml, "configurationId")){
+ infraRequest.setConfigurationId(utils.getNodeText(xml, "configurationId"))
+ }else if(utils.nodeExists(xml, "serviceInstanceId")){
+ infraRequest.setServiceInstanceId(utils.getNodeText(xml, "serviceInstanceId"))
+ }else if(utils.nodeExists(xml, "vfModuleId")){
+ infraRequest.setVfModuleId(utils.getNodeText(xml, "vfModuleId"))
+ }else if(utils.nodeExists(xml, "volumeGroupId")){
+ infraRequest.setVolumeGroupId(utils.getNodeText(xml, "volumeGroupId"))
+
+ }
+
+ dbClient.updateInfraActiveRequests(infraRequest, UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.endpoint"))
+
+ } catch (Exception e) {
+ logger.error("Internal error while updating request db", e);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in update infra request db")
+ }
+ }
+
+ protected RequestsDbClient getDbClient(){
+ return new RequestsDbClient()
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
index c23150384e..195b1fc0d6 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
@@ -34,7 +34,7 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
-import org.onap.so.utils.TargetEntities
+import org.onap.logging.filter.base.ONAPComponentsList
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -285,7 +285,7 @@ class ExceptionUtil extends AbstractServiceTaskProcessor {
logger.debug("Outgoing WorkflowException is " + exception)
}
- public void buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, TargetEntities extSystemErrorSource) {
+ public void buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, ONAPComponentsList extSystemErrorSource) {
MsoUtils utils = new MsoUtils()
String processKey = getProcessKey(execution);
logger.debug("Building a WorkflowException for " + processKey)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
index 64567a349e..a5111a62d3 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -29,7 +29,7 @@ import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response
@@ -40,11 +40,11 @@ class ExternalAPIUtil {
String Prefix="EXTAPI_"
- private static final Logger logger = LoggerFactory.getLogger( ExternalAPIUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger( ExternalAPIUtil.class)
- private final HttpClientFactory httpClientFactory;
- private final MsoUtils utils;
- private final ExceptionUtil exceptionUtil;
+ private final HttpClientFactory httpClientFactory
+ private final MsoUtils utils
+ private final ExceptionUtil exceptionUtil
public static final String PostServiceOrderRequestsTemplate =
"{\n" +
@@ -107,22 +107,22 @@ class ExternalAPIUtil {
// }
public String setTemplate(String template, Map<String, String> valueMap) {
- logger.debug("ExternalAPIUtil setTemplate", true);
- StringBuffer result = new StringBuffer();
+ logger.debug("ExternalAPIUtil setTemplate", true)
+ StringBuffer result = new StringBuffer()
- String pattern = "<.*>";
- Pattern r = Pattern.compile(pattern);
- Matcher m = r.matcher(template);
+ String pattern = "<.*>"
+ Pattern r = Pattern.compile(pattern)
+ Matcher m = r.matcher(template)
- logger.debug("ExternalAPIUtil template:" + template, true);
+ logger.debug("ExternalAPIUtil template:" + template, true)
while (m.find()) {
- String key = template.substring(m.start() + 1, m.end() - 1);
- logger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
- m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""));
+ String key = template.substring(m.start() + 1, m.end() - 1)
+ logger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true)
+ m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""))
}
- m.appendTail(result);
- logger.debug("ExternalAPIUtil return:" + result.toString(), true);
- return result.toString();
+ m.appendTail(result)
+ logger.debug("ExternalAPIUtil return:" + result.toString(), true)
+ return result.toString()
}
/**
@@ -145,7 +145,7 @@ class ExternalAPIUtil {
logger.debug( "URL to be used is: " + url)
logger.debug("URL to be passed in header is: " + execution.getVariable("SPPartnerUrl"))
- HttpClient client = httpClientFactory.newJsonClient(new URL(url), TargetEntity.EXTERNAL)
+ HttpClient client = httpClientFactory.newJsonClient(new URL(url), ONAPComponents.EXTERNAL)
client.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey"))
client.addAdditionalHeader("X-FromAppId", "MSO")
client.addAdditionalHeader(ONAPLogConstants.Headers.REQUEST_ID, uuid)
@@ -183,7 +183,7 @@ class ExternalAPIUtil {
logger.debug( "URL to be used is: " + url)
logger.debug("URL to be passed in header is: " + execution.getVariable("SPPartnerUrl"))
- HttpClient httpClient = httpClientFactory.newJsonClient(new URL(url), TargetEntity.AAI)
+ HttpClient httpClient = httpClientFactory.newJsonClient(new URL(url), ONAPComponents.AAI)
httpClient.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey"))
httpClient.addAdditionalHeader("X-FromAppId", "MSO")
httpClient.addAdditionalHeader("X-TransactionId", uuid)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
index e7f46464ee..549267eec1 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2018 Nokia.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/FalloutHandler.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/FalloutHandler.groovy
index ed849755b7..8306f33592 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/FalloutHandler.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/FalloutHandler.groovy
@@ -9,9 +9,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -24,376 +24,134 @@ package org.onap.so.bpmn.common.scripts
import org.onap.so.logger.LoggingAnchor
import org.onap.so.bpmn.core.UrnPropertiesReader
+import org.onap.so.db.request.beans.InfraActiveRequests
+import org.onap.so.db.request.client.RequestsDbClient
import org.onap.so.logger.ErrorCode
-
+import org.onap.so.bpmn.core.UrnPropertiesReader;
import java.text.SimpleDateFormat
import org.apache.commons.lang3.*
+import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
public class FalloutHandler extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( FalloutHandler.class);
-
- String Prefix="FH_"
- ExceptionUtil exceptionUtil = new ExceptionUtil()
-
- public initializeProcessVariables(DelegateExecution execution){
- def method = getClass().getSimpleName() + '.initializeProcessVariables(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- execution.setVariable("prefix",Prefix)
-
- //These variables are form the input Message to the BPMN
- execution.setVariable("FH_request_id","")
- execution.setVariable("FH_request_action","")
- execution.setVariable("FH_notification-url","")
- execution.setVariable("FH_mso-bpel-name","")
- execution.setVariable("FH_ErrorCode", "")
- execution.setVariable("FH_ErrorMessage", "")
-
- execution.setVariable("FH_notification-url-Ok", false)
- execution.setVariable("FH_request_id-Ok", false)
-
- //These variables are for Get Mso Aai Password Adapter
- execution.setVariable("FH_deliveryStatus", true)
-
- //update Response Status to pending ...Adapter variables
- execution.setVariable("FH_updateResponseStatusPayload", null)
- execution.setVariable("FH_updateResponseStatusResponse", null)
-
- //update Request Gamma ...Adapter variables
- execution.setVariable("FH_updateRequestGammaPayload", "")
- execution.setVariable("FH_updateRequestGammaResponse", null)
- execution.setVariable("FH_updateRequestGammaResponseCode", null)
-
- //update Request Infra ...Adapter variables
- execution.setVariable("FH_updateRequestInfraPayload", "")
- execution.setVariable("FH_updateRequestInfraResponse", null)
- execution.setVariable("FH_updateRequestInfraResponseCode", null)
-
- //assign True to success variable
- execution.setVariable("FH_success", true)
-
- //Set notify status to Failed variable
- execution.setVariable("FH_NOTIFY_STATUS", "SUCCESS")
-
- //Set DB update variable
- execution.setVariable("FH_updateRequestPayload", "")
- execution.setVariable("FH_updateRequestResponse", null)
- execution.setVariable("FH_updateRequestResponseCode", null)
-
- //Auth variables
- execution.setVariable("BasicAuthHeaderValue","")
-
- //Parameter list
- execution.setVariable("FH_parameterList", "")
-
- //Response variables
- execution.setVariable("FalloutHandlerResponse","")
- execution.setVariable("FH_ErrorResponse", null)
- execution.setVariable("FH_ResponseCode", "")
-
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public void preProcessRequest (DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- // Initialize flow variables
- initializeProcessVariables(execution)
- setSuccessIndicator(execution, false)
-
- setBasicDBAuthHeader(execution, execution.getVariable('isDebugLogEnabled'))
-
- try {
- def xml = execution.getVariable("FalloutHandlerRequest")
- logger.debug(" XML --> " + xml)
- logger.debug("FalloutHandler request: " + xml)
-
- //Check the incoming request type
- //Incoming request can be ACTIVE_REQUESTS (request-information node) or INFRA_ACTIVE_REQUESTS (request-info node)
- if (utils.nodeExists(xml, "request-information")) {
- execution.setVariable("FH_request_id-Ok", true) // Incoming request is for ACTIVE_REQUESTS
- }
-
- //Check notification-url for the incoming request type
- //ACTIVE_REQUESTS may have notificationurl node
- //INFRA_ACTIVE_REQUESTS notificationurl node does not exist
- def notificationurl = ""
- if (utils.nodeExists(xml, "notification-url")) {
- notificationurl = utils.getNodeText(xml,"notification-url")
- if(notificationurl != null && !notificationurl.isEmpty()) {
- logger.debug("********** Incoming notification Url is: " + notificationurl);
- execution.setVariable("FH_notification-url-Ok", true)
- execution.setVariable("FH_notification-url",notificationurl)
- }
- }
-
- //Check request_id for the incoming request type
- //For INFRA_ACTIVE_REQUESTS payload request-id IS optional (Not sure why this is option since req id is primary key ... also tried exe through SOAP UI to check if MSO code handles null like auto generated seq not it does not)
- //For ACTIVE_REQUESTS payload request-id is NOT optional
- def request_id = ""
- if (utils.nodeExists(xml, "request-id")) {
- execution.setVariable("FH_request_id",utils.getNodeText(xml,"request-id"))
- }
- logger.debug("FH_request_id: " + execution.getVariable("FH_request_id"))
-
- // INFRA_ACTIVE_REQUESTS have "action" element ... mandatory
- // ACTIVE_REQUEST have "request-action" ... mandatory
- if (utils.nodeExists(xml, "request-action")) {
- execution.setVariable("FH_request_action",utils.getNodeText(xml,"request-action"))
- } else if (utils.nodeExists(xml, "action")) {
- execution.setVariable("FH_request_action",utils.getNodeText(xml,"action"))
- }
-
-
- //Check source for the incoming request type
- //For INFRA_ACTIVE_REQUESTS payload source IS optional
- //For ACTIVE_REQUESTS payload source is NOT optional
- def source = ""
- if (utils.nodeExists(xml, "source")) {
- execution.setVariable("FH_source",utils.getNodeText(xml,"source"))
- }
-
- //Check if ErrorCode node exists. If yes, initialize it from request xml, if no, it will stay with defaulf value already set in initializeProcessVariables() method above.
- def errorCode = ""
- if (utils.nodeExists(xml, "ErrorCode")) {
- errorCode = utils.getNodeText(xml,"ErrorCode")
- if(errorCode != null && !errorCode.isEmpty()) {
- execution.setVariable("FH_ErrorCode", errorCode)
- }
- }
- logger.debug("FH_ErrorCode: " + errorCode)
-
- //Check if ErrorMessage node exists. If yes, initialize it from request xml, if no, it will stay with defaulf value already set in initializeProcessVariables() method above.
- def errorMessage = ""
- if (utils.nodeExists(xml, "ErrorMessage")) {
- errorCode = utils.getNodeText(xml,"ErrorMessage")
- if(errorCode != null && !errorCode.isEmpty()) {
- errorCode = errorCode
- execution.setVariable("FH_ErrorMessage", errorCode)
- }
- }
-
- //Check for Parameter List
- if (utils.nodeExists(xml, "parameter-list")) {
- def parameterList = utils.getNodeXml(xml, "parameter-list", false)
- execution.setVariable("FH_parameterList", parameterList)
- }
-
- logger.trace("--> " + execution.getVariable(""))
- logger.debug("FH_request_id-OK --> " + execution.getVariable("FH_request_id-Ok"))
-
- // set the DHV/Service Instantiation values if specified in the request
- execution.setVariable("FH_is_srv_inst_req", String.valueOf("true".equals(utils.getNodeText(xml, "is-srv-inst-req"))))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("FH_is_json_content", String.valueOf("JSON".equals(utils.getNodeText(xml, "resp-content-type"))))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("FH_service_inst_id", utils.getNodeText(xml, "service-instance-id"))
- logger.trace("--> " + execution.getVariable(""))
- execution.setVariable("FH_start_time", utils.getNodeText(xml, "start-time"))
- logger.trace("--> " + execution.getVariable(""))
- // this variable is used by the camunda flow to set the Content-Type for the async response
- if (execution.getVariable("FH_is_srv_inst_req").equals("true") &&
- execution.getVariable("FH_is_json_content").equals("true")) {
- execution.setVariable("FH_content_type", "application/json")
- } else {
- execution.setVariable("FH_content_type", "text/xml")
- }
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
- }
-
- logger.debug("OUTOF --> Initialize Variables Fallout Handler #########");
- }
-
- public String updateRequestPayload (DelegateExecution execution){
- def method = getClass().getSimpleName() + '.updateRequestPayload(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- String payload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>${MsoUtils.xmlEscape(execution.getVariable("FH_request_id"))}</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>${MsoUtils.xmlEscape(execution.getVariable("FH_ErrorMessage"))}</finalErrorMessage>
- <finalErrorCode>${MsoUtils.xmlEscape(execution.getVariable("FH_ErrorCode"))}</finalErrorCode>
- <status>FAILED</status>
- <responseStatus>${MsoUtils.xmlEscape(execution.getVariable("FH_NOTIFY_STATUS"))}</responseStatus>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- logger.debug("updateRequestPayload: " + payload)
- execution.setVariable("FH_updateRequestPayload", payload)
- return execution.getVariable("FH_updateRequestPayload")
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public String updateRequestInfraPayload (DelegateExecution execution){
- def method = getClass().getSimpleName() + '.updateRequestInfraPayload(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- String payload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>${MsoUtils.xmlEscape(execution.getVariable("FH_request_id"))}</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <statusMessage>${MsoUtils.xmlEscape(execution.getVariable("FH_ErrorMessage"))}</statusMessage>
- <requestStatus>FAILED</requestStatus>
- <progress>100</progress>
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- execution.setVariable("FH_updateRequestInfraPayload", payload)
- logger.debug("updateRequestInfraPayload: " + payload)
- return execution.getVariable("FH_updateRequestInfraPayload")
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public String updateRequestGammaPayload (DelegateExecution execution){
- def method = getClass().getSimpleName() + '.updateRequestGammaPayload(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- String payload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="${UrnPropertiesReader.getVariable("mso.default.adapter.namespace", execution)}/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>${MsoUtils.xmlEscape(execution.getVariable("FH_request_id"))}</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>${MsoUtils.xmlEscape(execution.getVariable("FH_ErrorMessage"))}</finalErrorMessage>
- <finalErrorCode>${MsoUtils.xmlEscape(execution.getVariable("FH_ErrorCode"))}</finalErrorCode>
- <status>FAILED</status>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- execution.setVariable("FH_updateRequestGammaPayload", payload)
- logger.debug("updateRequestGammaPayload: " + payload)
- return execution.getVariable("FH_updateRequestGammaPayload")
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public String updateResponseStatusPayload (DelegateExecution execution){
- def method = getClass().getSimpleName() + '.updateResponseStatusPayload(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- String payload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateResponseStatus>
- <requestId>${MsoUtils.xmlEscape(execution.getVariable("FH_request_id"))}</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <responseStatus>SENDING_FINAL_NOTIFY</responseStatus>
- </req:updateResponseStatus>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- execution.setVariable("FH_updateResponseStatusPayload", payload)
- logger.debug("updateResponseStatusPayload: " + payload)
- return execution.getVariable("FH_updateResponseStatusPayload")
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- public void buildDBWorkflowException(DelegateExecution execution, String responseCodeVariable) {
- def method = getClass().getSimpleName() + '.buildDBWorkflowException(' +
- 'execution=' + execution.getId() +
- ', responseCodeVariable=' + responseCodeVariable + ')'
- logger.trace('Entered ' + method)
-
- try {
- def responseCode = execution.getVariable(responseCodeVariable)
- // If the HTTP response code was null, it means a connection fault occurred (a java exception)
- def errorMessage = responseCode == null ? "Could not connect to DB Adapter" : "DB Adapter returned ${responseCode} response"
- def errorCode = responseCode == null ? 7000 : 7020
- // exceptionUtil.buildWorkflowException(execution, errorCode, errorMessage)
- } catch (Exception e) {
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in " + method)
- }
- }
-
- /**
- * Used to create a workflow response in success and failure cases.
- */
- public void postProcessResponse (DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.postProcessResponse(' +'execution=' + execution.getId() +')'
- logger.trace('Entered ' + method)
-
- try {
- Boolean success = (Boolean) execution.getVariable("FH_success")
- String out = success ? "Fallout Handler Succeeded" : "Fallout Handler Failed";
-
- String falloutHandlerResponse = """
+ private static final Logger logger = LoggerFactory.getLogger(FalloutHandler.class);
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+
+ public void preProcessRequest (DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
+ logger.trace('Entered ' + method)
+
+ execution.setVariable("FH_success", true)
+
+ try {
+ def xml = execution.getVariable("FalloutHandlerRequest")
+ logger.debug("FalloutHandler request: " + xml)
+
+ if (utils.nodeExists(xml, "request-information")) {
+ throw new BpmnError("500", "FalloutHandler subflow does not support this request type.")
+ }
+
+ //Check request_id for the incoming request type
+ //For INFRA_ACTIVE_REQUESTS payload request-id IS optional (Not sure why this is option since req id is primary key ... also tried exe through SOAP UI to check if MSO code handles null like auto generated seq not it does not)
+ //For ACTIVE_REQUESTS payload request-id is NOT optional
+ def request_id = ""
+ if (utils.nodeExists(xml, "request-id")) {
+ execution.setVariable("FH_request_id",utils.getNodeText(xml,"request-id"))
+ }
+ logger.debug("FH_request_id: " + execution.getVariable("FH_request_id"))
+
+ //Check if ErrorCode node exists. If yes, initialize it from request xml, if no, it will stay with defaulf value already set in initializeProcessVariables() method above.
+ def errorCode = "500"
+ if (utils.nodeExists(xml, "ErrorCode")) {
+ if(errorCode != null && !errorCode.isEmpty()) {
+ errorCode = utils.getNodeText(xml,"ErrorCode")
+ }
+ }
+ execution.setVariable("FH_ErrorCode", errorCode)
+
+ //Check if ErrorMessage node exists. If yes, initialize it from request xml, if no, it will stay with defaulf value already set in initializeProcessVariables() method above.
+ String errorMessage = "Internal Error occured in MSO, unable to determine error message"
+ if (utils.nodeExists(xml, "ErrorMessage")) {
+ if(errorCode != null && !errorCode.isEmpty()) {
+ errorMessage = utils.getNodeText(xml,"ErrorMessage")
+ }
+ }
+ execution.setVariable("FH_ErrorMessage", errorMessage)
+
+ //Check for Parameter List
+ if (utils.nodeExists(xml, "parameter-list")) {
+ def parameterList = utils.getNodeXml(xml, "parameter-list", false)
+ execution.setVariable("FH_parameterList", parameterList)
+ }
+
+
+ } catch (Exception e) {
+ logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN",
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ // exceptionUtil.buildWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
+ }
+
+ }
+
+ public String updateInfraRequestDB(DelegateExecution execution){
+ try {
+ RequestsDbClient client = getDbClient()
+ InfraActiveRequests infraRequest = client.getInfraActiveRequests(execution.getVariable("FH_request_id"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.endpoint"))
+ if(infraRequest == null){
+ infraRequest = new InfraActiveRequests();
+ infraRequest.setRequestId(execution.getVariable("CMSO_request_id"))
+ }
+ infraRequest.setLastModifiedBy("BPMN")
+ infraRequest.setStatusMessage(MsoUtils.xmlEscape(execution.getVariable("FH_ErrorMessage")))
+ infraRequest.setRequestStatus("FAILED")
+ infraRequest.setProgress(100)
+ client.updateInfraActiveRequests(infraRequest, UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth"), UrnPropertiesReader.getVariable("mso.adapters.requestDb.endpoint"))
+ } catch (Exception e) {
+ execution.setVariable("FH_success", false)
+ logger.error("Exception Occured while updating infra request db", e)
+ }
+ }
+
+ /**
+ * Used to create a workflow response in success and failure cases.
+ */
+ public void postProcessResponse (DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.postProcessResponse(' +'execution=' + execution.getId() +')'
+ logger.trace('Entered ' + method)
+
+ try {
+ Boolean success = (Boolean) execution.getVariable("FH_success")
+ String out = success ? "Fallout Handler Succeeded" : "Fallout Handler Failed";
+
+ String falloutHandlerResponse = """
<workflow:FalloutHandlerResponse xmlns:workflow="http://org.onap/so/workflow/schema/v1">
<workflow:out>${MsoUtils.xmlEscape(out)}</workflow:out>
</workflow:FalloutHandlerResponse>
"""
- falloutHandlerResponse = utils.formatXml(falloutHandlerResponse)
- logger.debug("FalloutHandler Response: " + falloutHandlerResponse);
+ falloutHandlerResponse = utils.formatXml(falloutHandlerResponse)
+
+ execution.setVariable("FalloutHandlerResponse", falloutHandlerResponse)
+ execution.setVariable("WorkflowResponse", falloutHandlerResponse)
+ execution.setVariable("FH_ResponseCode", success ? "200" : "500")
+ setSuccessIndicator(execution, success)
- execution.setVariable("FalloutHandlerResponse", falloutHandlerResponse)
- execution.setVariable("WorkflowResponse", falloutHandlerResponse)
- execution.setVariable("FH_ResponseCode", success ? "200" : "500")
- setSuccessIndicator(execution, success)
+ logger.debug("FalloutHandlerResponse =\n" + falloutHandlerResponse)
+ } catch (Exception e) {
+ logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN",
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ }
+ }
- logger.debug("FalloutHandlerResponse =\n" + falloutHandlerResponse)
- } catch (Exception e) {
- // Do NOT throw WorkflowException!
- logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
- 'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
- }
- }
+ protected RequestsDbClient getDbClient(){
+ return new RequestsDbClient()
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
index 3008f77b62..6d4b50f690 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
@@ -42,7 +42,7 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.client.graphinventory.entities.uri.Depth
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -92,7 +92,7 @@ public class GenerateVfModuleName extends AbstractServiceTaskProcessor{
logger.debug("AAI endPoint: " + endPoint)
try {
- HttpClient client = new HttpClientFactory().newXmlClient(new URL(endPoint), TargetEntity.AAI)
+ HttpClient client = new HttpClientFactory().newXmlClient(new URL(endPoint), ONAPComponents.AAI)
client.addAdditionalHeader('X-TransactionId', UUID.randomUUID().toString())
client.addAdditionalHeader('X-FromAppId', 'MSO')
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
index 6583ded413..b082c1830e 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
@@ -41,7 +41,7 @@ import org.onap.so.db.catalog.beans.CloudIdentity
import org.onap.so.db.catalog.beans.CloudSite
import org.onap.so.db.catalog.beans.HomingInstance
import org.onap.so.db.catalog.beans.ServerType
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -165,7 +165,7 @@ class OofHoming extends AbstractServiceTaskProcessor {
URL url = new URL(urlString)
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.OOF)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.OOF)
httpClient.addAdditionalHeader("Authorization", authHeader)
Response httpResponse = httpClient.post(oofRequest)
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 4bfb29bc45..606b97bec2 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
@@ -40,7 +40,7 @@ import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
import org.onap.so.db.catalog.beans.CloudSite
import org.onap.so.db.catalog.beans.HomingInstance
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
index f013fa8698..db39358ccd 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -22,9 +22,9 @@
package org.onap.so.bpmn.common.scripts
-import org.onap.so.logger.LoggingAnchor;
+import org.onap.so.logger.LoggingAnchor
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
import java.text.SimpleDateFormat
@@ -39,7 +39,7 @@ import static org.apache.commons.lang3.StringUtils.*
// SDNC Adapter Request/Response processing
public class SDNCAdapter extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapter.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapter.class)
def Prefix="SDNCA_"
@@ -77,7 +77,7 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
} catch (IOException ex) {
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Unable to encode username password string", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
}
// TODO Use variables instead of passing xml request - Huh?
@@ -238,9 +238,9 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
def sdnccallbackreq=execution.getVariable("sdncAdapterCallbackRequest")
logger.debug("sdncAdapterCallbackRequest :" + sdnccallbackreq)
if (sdnccallbackreq==null){
- execution.setVariable("callbackResponseReceived",false);
+ execution.setVariable("callbackResponseReceived",false)
}else{
- execution.setVariable("callbackResponseReceived",true);
+ execution.setVariable("callbackResponseReceived",true)
}
}
@@ -303,10 +303,10 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
}
public String generateCurrentTimeInUtc(){
- final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
- sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
- final String utcTime = sdf.format(new Date());
- return utcTime;
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"))
+ final String utcTime = sdf.format(new Date())
+ return utcTime
}
public void toggleSuccessIndicator(DelegateExecution execution){
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
index 449f4e3222..52d6758b2b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -47,13 +47,13 @@ import org.onap.so.client.HttpClient
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV1.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV1.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -88,7 +88,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': mso:adapters:sdnc:rest:endpoint URN mapping is not defined'
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -109,7 +109,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no sdncRequestId in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -124,7 +124,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no bpNotificationUrl in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -141,7 +141,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -157,7 +157,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.debug(getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
} else {
try {
def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution))
@@ -166,7 +166,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter",
- "BPMN", ErrorCode.UnknownError.getValue(), ex);
+ "BPMN", ErrorCode.UnknownError.getValue(), ex)
}
}
@@ -176,7 +176,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String timeout = jsonUtil.getJsonValue(request, requestType + ".bpTimeout")
// in addition to null/empty, also need to verify that the timer value is a valid duration "P[n]T[n]H|M|S"
- String timerRegex = "PT[0-9]+[HMS]";
+ String timerRegex = "PT[0-9]+[HMS]"
if (timeout == null || timeout.isEmpty() || !timeout.matches(timerRegex)) {
logger.debug(getProcessKey(execution) + ': preProcessRequest(): null/empty/invalid bpTimeout value. Using "mso.adapters.sdnc.timeout"')
timeout = UrnPropertiesReader.getVariable("mso.adapters.sdnc.timeout", execution)
@@ -197,7 +197,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -221,9 +221,9 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String sdncAdapterRequest = execution.getVariable(prefix + 'sdncAdapterRequest')
logger.debug("SDNC Rest Request is: " + sdncAdapterRequest)
- URL url = new URL(sdncAdapterUrl);
+ URL url = new URL(sdncAdapterUrl)
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.SDNC_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SDNC_ADAPTER)
httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id"))
httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString())
httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-SDNCAdapter")
@@ -245,7 +245,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Unsupported HTTP method "' + sdncAdapterMethod + '" in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -259,7 +259,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg, e)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -330,7 +330,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
}
// Note: the mapping function handles a null or empty responseCode
- int mappedResponseCode = Integer.parseInt(exceptionUtil.MapSDNCResponseCodeToErrorCode(responseCode));
+ int mappedResponseCode = Integer.parseInt(exceptionUtil.MapSDNCResponseCodeToErrorCode(responseCode))
exceptionUtil.buildWorkflowException(execution, mappedResponseCode, "Received " + responseType +
" from SDNCAdapter:" + info)
} catch (Exception e) {
@@ -370,7 +370,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -396,12 +396,12 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
public Logger getLogger() {
- return logger;
+ return logger
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
index 62c7bb5adf..ba5145d19b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory
* any non-final response received from SDNC.
*/
class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV2.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV2.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -87,7 +87,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': mso:adapters:sdnc:rest:endpoint URN mapping is not defined'
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -108,7 +108,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': no sdncRequestId in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -123,7 +123,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': no bpNotificationUrl in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -134,7 +134,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -153,7 +153,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
logger.debug(getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
} else {
try {
def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution))
@@ -162,7 +162,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter",
- "BPMN", ErrorCode.UnknownError.getValue(), ex);
+ "BPMN", ErrorCode.UnknownError.getValue(), ex)
}
}
@@ -172,7 +172,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String timeout = jsonUtil.getJsonValue(request, requestType + ".bpTimeout")
// in addition to null/empty, also need to verify that the timer value is a valid duration "P[n]T[n]H|M|S"
- String timerRegex = "PT[0-9]+[HMS]";
+ String timerRegex = "PT[0-9]+[HMS]"
if (timeout == null || timeout.isEmpty() || !timeout.matches(timerRegex)) {
logger.debug(getProcessKey(execution) + ': preProcessRequest(): null/empty/invalid bpTimeout value. Using "mso.adapters.sdnc.timeout"')
timeout = UrnPropertiesReader.getVariable("mso.adapters.sdnc.timeout", execution)
@@ -193,7 +193,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -297,6 +297,6 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
}
public Logger getLogger() {
- return logger;
+ return logger
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
index 8c2da2c112..08c032fba3 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy
@@ -37,7 +37,7 @@ import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.json.JSONArray
@@ -136,7 +136,7 @@ class SniroHomingV1 extends AbstractServiceTaskProcessor{
logger.debug("Sniro Url is: " + urlString)
URL url = new URL(urlString);
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.SNIRO)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
httpClient.addAdditionalHeader("Authorization", authHeader)
Response httpResponse = httpClient.post(sniroRequest)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
index 866229f6b8..803a3f71de 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
@@ -35,8 +35,9 @@ import org.onap.so.client.HttpClient
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import java.util.UUID
+import org.onap.so.utils.Components
@@ -80,7 +81,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no messageId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
execution.setVariable('VNFAResponse_CORRELATOR', messageId)
@@ -94,7 +95,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
execution.setVariable(prefix + 'notificationUrl', notificationUrl)
@@ -108,7 +109,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined'
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
while (vnfAdapterEndpoint.endsWith('/')) {
@@ -126,7 +127,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'POST'
@@ -139,7 +140,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
String vfModuleId = getChildText(root, 'vfModuleId')
@@ -148,7 +149,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'PUT'
@@ -162,7 +163,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
String vfModuleId = getChildText(root, 'vfModuleId')
@@ -171,7 +172,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -185,7 +186,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
String vnfId = getChildText(vfModuleRollbackNode, 'vnfId')
@@ -194,7 +195,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
String vfModuleId = getChildText(vfModuleRollbackNode, 'vfModuleId')
@@ -203,7 +204,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -224,7 +225,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'PUT'
@@ -240,7 +241,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -256,7 +257,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -269,7 +270,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
execution.setVariable(prefix + 'vnfAdapterMethod', vnfAdapterMethod)
@@ -306,7 +307,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
logger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
}
@@ -337,7 +338,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
URL url = new URL(vnfAdapterUrl);
- HttpClient httpClient = new HttpClientFactory().newXmlClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue"))
httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id"))
@@ -357,7 +358,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
execution.setVariable(prefix + "vnfAdapterStatusCode", response.getStatus())
@@ -370,7 +371,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO)
}
}
@@ -399,7 +400,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
}
} catch (Exception e) {
logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method", TargetEntity.SO)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method", ONAPComponents.SO)
}
}
@@ -418,10 +419,10 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String rolledBack = getChildText(root, "rolledBack")
rolledBack = rolledBack == null || rolledBack.isEmpty() ? "" : " rolledBack='" + rolledBack + "'"
exceptionUtil.buildWorkflowException(execution, 7020, "Received " + root.name() +
- " from VnfAdapter:" + category + message + rolledBack, TargetEntity.OPENSTACK);
+ " from VnfAdapter:" + category + message + rolledBack, Components.OPENSTACK);
} catch (Exception e) {
response = response == null || String.valueOf(response).isEmpty() ? "NONE" : response
- exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response, TargetEntity.OPENSTACK)
+ exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response, Components.OPENSTACK)
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java
index 68cda5c22b..69151ff74f 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java
@@ -27,9 +27,9 @@ import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.ListenerRunner;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.listener.ListenerRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java
index 5f4dc871fb..ea7de687ee 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java
@@ -27,8 +27,8 @@ import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.ListenerRunner;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.listener.ListenerRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/FlowValidatorRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/FlowValidatorRunner.java
index 040522b576..02cddf3655 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/FlowValidatorRunner.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/FlowValidatorRunner.java
@@ -28,9 +28,11 @@ import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.javatuples.Pair;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
-import org.onap.so.bpmn.common.listener.ListenerRunner;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.listener.ListenerRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -47,6 +49,9 @@ public abstract class FlowValidatorRunner<S extends FlowValidator, E extends Flo
private static Logger logger = LoggerFactory.getLogger(FlowValidatorRunner.class);
+ @Autowired
+ protected ExceptionBuilder exceptionBuilder;
+
protected List<S> preFlowValidators;
protected List<E> postFlowValidators;
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntities.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionCompletion.java
index 94385ec8ea..1018d7f025 100644
--- a/common/src/main/java/org/onap/so/utils/TargetEntities.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionCompletion.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 - 2018 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.
@@ -18,8 +18,8 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.utils;
+package org.onap.so.bpmn.common.listener.validation;
-public interface TargetEntities {
+public interface WorkflowActionCompletion extends WorkflowActionListener {
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListener.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListener.java
new file mode 100644
index 0000000000..4788c55053
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListener.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.common.listener.validation;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+
+public interface WorkflowActionListener {
+
+ /**
+ * Should this listener run for given bb
+ *
+ * @return
+ *
+ */
+ public boolean shouldRunFor(String bbName, String eventName);
+
+ /**
+ * Determines whether or not the listener should be executed
+ *
+ *
+ * @param execution
+ * @return
+ */
+ public void executeListener(DelegateExecution execution);
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListenerRunner.java
new file mode 100644
index 0000000000..806c1b835d
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/validation/WorkflowActionListenerRunner.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.bpmn.common.listener.validation;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Optional;
+import javax.annotation.PostConstruct;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.listener.ListenerRunner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+
+@Component
+public class WorkflowActionListenerRunner extends ListenerRunner {
+
+ private static Logger logger = LoggerFactory.getLogger(WorkflowActionListenerRunner.class);
+
+ protected List<WorkflowActionListener> workflowActionListeners;
+
+ @PostConstruct
+ protected void init() {
+ workflowActionListeners = new ArrayList<>(Optional
+ .ofNullable(context.getBeansOfType(WorkflowActionListener.class)).orElse(new HashMap<>()).values());
+ }
+
+ public void executeAsyncListeners(String bbName, DelegateExecution execution, String eventName) {
+ try {
+ logger.info("NotifyingWorkflowActionListeners");
+ runNotifications(workflowActionListeners, bbName, execution, eventName);
+ } catch (Exception e) {
+ logger.error("Error in Notifying Workflow Action Listeners", e);
+ }
+ }
+
+ protected void runNotifications(List<? extends WorkflowActionListener> listeners, String bbName,
+ DelegateExecution execution, String eventName) {
+ List<? extends WorkflowActionListener> filtered =
+ filterListeners(listeners, (item -> item.shouldRunFor(bbName, eventName)));
+ filtered.forEach(item -> item.executeListener(execution));
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/BpmnRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/BpmnRestClient.java
index c98c9ad5da..d9356306b7 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/BpmnRestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/BpmnRestClient.java
@@ -179,7 +179,7 @@ public class BpmnRestClient {
logger.trace("request body is {}", jsonReq);
} catch (Exception e) {
logger.error(LoggingAnchor.FIVE, MessageEnum.APIH_WARP_REQUEST.toString(), "Camunda", "wrapVIDRequest",
- ErrorCode.BusinessProcesssError.getValue(), "Error in APIH Warp request", e);
+ ErrorCode.BusinessProcessError.getValue(), "Error in APIH Warp request", e);
}
return jsonReq;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
index b1173bbf95..3a4df68f02 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
@@ -68,7 +68,7 @@ public class InstanceResourceList {
public static List<Resource> getInstanceResourceList(final VnfResource vnfResource, final String uuiRequest) {
- List<Resource> sequencedResourceList = new ArrayList<Resource>();
+ List<Resource> sequencedResourceList = new ArrayList<>();
Gson gson = new Gson();
JsonObject servJsonObject = gson.fromJson(uuiRequest, JsonObject.class);
JsonObject reqInputJsonObj = servJsonObject.getAsJsonObject("service").getAsJsonObject("parameters")
@@ -108,11 +108,16 @@ public class InstanceResourceList {
sequencedResourceList.add(vnfResource);
}
+ // check if the resource contains vf-module
+ if (vnfResource != null && vnfResource.getVfModules() != null) {
+ sequencedResourceList.addAll(vnfResource.getVfModules());
+ }
+
return sequencedResourceList;
}
private static List<Resource> getGroupResourceInstanceList(VnfResource vnfResource, JsonObject vfObj) {
- List<Resource> sequencedResourceList = new ArrayList<Resource>();
+ List<Resource> sequencedResourceList = new ArrayList<>();
if (vnfResource.getGroupOrder() != null && !StringUtils.isEmpty(vnfResource.getGroupOrder())) {
String[] grpSequence = vnfResource.getGroupOrder().split(",");
for (String grpType : grpSequence) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
index 8d02fa3e4f..8efb6a3e1c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
@@ -44,7 +44,7 @@ import org.onap.so.bpmn.core.domain.VnfResource;
import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.client.HttpClient;
import org.onap.so.client.HttpClientFactory;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -118,7 +118,7 @@ public class ResourceRequestBuilder {
logger.info("resource resolved using model uuid");
String uuid = (String) JsonUtils.getJsonValue(eachResource, "resourceUuid");
if ((null != uuid) && uuid.equals(resource.getModelInfo().getModelUuid())) {
- logger.info("found resource uuid" + uuid);
+ logger.info("found resource uuid {}", uuid);
String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
}
@@ -133,7 +133,7 @@ public class ResourceRequestBuilder {
Map<String, Object> uuiRequestInputs = null;
if (JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs") != null) {
String uuiRequestInputStr = JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs");
- logger.info("resource input from UUI: " + uuiRequestInputStr);
+ logger.info("resource input from UUI:{} ", uuiRequestInputStr);
if (uuiRequestInputStr == null || uuiRequestInputStr.isEmpty()) {
uuiRequestInputStr = "{}";
}
@@ -371,7 +371,7 @@ public class ResourceRequestBuilder {
int val = Integer.parseInt(inputObj.toString());
return val;
} catch (NumberFormatException e) {
- logger.warn("Unable to parse to int", e.getMessage());
+ logger.warn("Unable to parse to int", e);
}
}
}
@@ -383,7 +383,7 @@ public class ResourceRequestBuilder {
HttpClient client = new HttpClientFactory().newJsonClient(UriBuilder.fromUri(catalogEndPoint)
.path(SERVICE_URL_SERVICE_INSTANCE).queryParam("serviceModelUuid", uuid).build().toURL(),
- TargetEntity.CATALOG_DB);
+ ONAPComponents.CATALOG_DB);
client.addAdditionalHeader("Accept", "application/json");
client.addAdditionalHeader("Authorization", UrnPropertiesReader.getVariable("mso.db.auth"));
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CryptoHandler.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CryptoHandler.java
deleted file mode 100644
index 5c0406cc9e..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/util/CryptoHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.bpmn.common.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.GeneralSecurityException;
-import java.util.Properties;
-import org.onap.so.utils.CryptoUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CryptoHandler implements ICryptoHandler {
- private static final Logger logger = LoggerFactory.getLogger(CryptoHandler.class);
- private static final String GENERAL_SECURITY_EXCEPTION_PREFIX = "GeneralSecurityException :";
- private static final String MSO_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
- private static final String PROPERTY_KEY = "mso.AaiEncrypted.Pwd";
-
- @Override
- public String getMsoAaiPassword() {
- Properties keyProp = new Properties();
- try {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- InputStream rs = cl.getResourceAsStream("urn.properties");
- keyProp.load(rs);
- rs.close();
- return CryptoUtils.decrypt((String) keyProp.get(PROPERTY_KEY), MSO_KEY);
- } catch (GeneralSecurityException | IOException e) {
- logger.error(GENERAL_SECURITY_EXCEPTION_PREFIX + e.getMessage(), e);
- return null;
- }
- }
-
-
- @Override
- public String encryptMsoPassword(String plainMsoPwd) {
- try {
- return CryptoUtils.encrypt(plainMsoPwd, MSO_KEY);
- } catch (GeneralSecurityException e) {
- logger.error(GENERAL_SECURITY_EXCEPTION_PREFIX + e.getMessage(), e);
- return null;
- }
- }
-
- @Override
- public String decryptMsoPassword(String encryptedPwd) {
- try {
- return CryptoUtils.decrypt(encryptedPwd, MSO_KEY);
- } catch (GeneralSecurityException e) {
- logger.error(GENERAL_SECURITY_EXCEPTION_PREFIX + e.getMessage(), e);
- return null;
- }
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/Metadata.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/Metadata.java
index f56fad3bcf..84b162e1a2 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/Metadata.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/Metadata.java
@@ -31,7 +31,7 @@ public class Metadata implements Serializable {
private static final long serialVersionUID = 4981393122007858950L;
@JsonProperty("metadatum")
- private List<Metadatum> metadatum = new ArrayList<Metadatum>();
+ private List<Metadatum> metadatum = new ArrayList<>();
public List<Metadatum> getMetadatum() {
return metadatum;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
index a5eb9d86a7..96a6ab7bd2 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
@@ -36,8 +36,6 @@ public class AggregateRoute implements Serializable, ShallowCopy<AggregateRoute>
@Id
@JsonProperty("route-id")
private String routeId;
- @JsonProperty("route-name")
- private String routeName;
@JsonProperty("network-start-address")
private String networkStartAddress;
@JsonProperty("cidr-mask")
@@ -54,14 +52,6 @@ public class AggregateRoute implements Serializable, ShallowCopy<AggregateRoute>
this.routeId = routeId;
}
- public String getRouteName() {
- return routeName;
- }
-
- public void setRouteName(String routeName) {
- this.routeName = routeName;
- }
-
public String getNetworkStartAddress() {
return networkStartAddress;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java
index 841546b3b1..0bce305f1d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java
@@ -133,7 +133,7 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> {
@JsonProperty("model-info-generic-vnf")
private ModelInfoGenericVnf modelInfoGenericVnf;
@JsonProperty("instance-groups")
- private List<InstanceGroup> instanceGroups = new ArrayList<InstanceGroup>();
+ private List<InstanceGroup> instanceGroups = new ArrayList<>();
@JsonProperty("call-homing")
private Boolean callHoming;
@JsonProperty("nf-function")
@@ -144,6 +144,8 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> {
private String blueprintName;
@JsonProperty("CDS_BLUEPRINT_VERSION")
private String blueprintVersion;
+ @JsonProperty("application-id")
+ private String applicationId;
public String getBlueprintName() {
@@ -530,6 +532,15 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> {
this.callHoming = callHoming;
}
+
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
+ }
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof GenericVnf)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java
index 387d191409..db2785902a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java
@@ -65,15 +65,15 @@ public class LInterface implements Serializable, ShallowCopy<LInterface> {
@JsonProperty("allowed-address-pairs")
private String allowedAddressPairs;
@JsonProperty("vlans")
- private List<Vlan> vlans = new ArrayList<Vlan>();
+ private List<Vlan> vlans = new ArrayList<>();
@JsonProperty("sriov-vfs")
- private List<SriovVf> sriovVfs = new ArrayList<SriovVf>();
+ private List<SriovVf> sriovVfs = new ArrayList<>();
@JsonProperty("l-interfaces")
- private List<LInterface> lInterfaces = new ArrayList<LInterface>();
+ private List<LInterface> lInterfaces = new ArrayList<>();
@JsonProperty("l3-interface-ipv4-address-list")
- private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<L3InterfaceIpv4AddressList>();
+ private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<>();
@JsonProperty("l3-interface-ipv6-address-list")
- private List<L3InterfaceIpv6AddressList> l3InterfaceIpv6AddressList = new ArrayList<L3InterfaceIpv6AddressList>();
+ private List<L3InterfaceIpv6AddressList> l3InterfaceIpv6AddressList = new ArrayList<>();
public String getInterfaceName() {
return interfaceName;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PServer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PServer.java
index d0bf1f588b..f3e28faf44 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PServer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PServer.java
@@ -41,9 +41,9 @@ public class PServer implements Serializable, ShallowCopy<PServer> {
@JsonProperty("hostname")
private String hostname;
@JsonProperty("physical-links")
- private List<PhysicalLink> physicalLinks = new ArrayList<PhysicalLink>(); // TODO techincally there is a pInterface
- // between (pserver <--> physical-link)
- // but dont really need that pojo
+ private List<PhysicalLink> physicalLinks = new ArrayList<>(); // TODO techincally there is a pInterface
+ // between (pserver <--> physical-link)
+ // but dont really need that pojo
public String getPserverId() {
return pserverId;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
index 0803bed574..6cc8aa368c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
@@ -79,7 +79,7 @@ public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstanc
@JsonProperty("instance-groups")
private List<InstanceGroup> instanceGroups = new ArrayList<>();
@JsonProperty("service-proxies")
- private List<ServiceProxy> serviceProxies = new ArrayList<ServiceProxy>();
+ private List<ServiceProxy> serviceProxies = new ArrayList<>();
public void setServiceProxies(List<ServiceProxy> serviceProxies) {
this.serviceProxies = serviceProxies;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceSubscription.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceSubscription.java
index 05199b7f37..b677b1efd0 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceSubscription.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceSubscription.java
@@ -41,7 +41,7 @@ public class ServiceSubscription implements Serializable, ShallowCopy<ServiceSub
@JsonProperty("temp-ub-sub-account-id")
private String tempUbSubAccountId;
@JsonProperty("service-instances")
- private List<ServiceInstance> serviceInstances = new ArrayList<ServiceInstance>();
+ private List<ServiceInstance> serviceInstances = new ArrayList<>();
public String getServiceType() {
return serviceType;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java
index 6951a23630..8c0db18d80 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java
@@ -62,9 +62,9 @@ public class Vlan implements Serializable, ShallowCopy<Vlan> {
@JsonProperty("is-ip-unnumbered")
private Boolean isIpUnnumbered;
@JsonProperty("l3-interface-ipv4-address-list")
- private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<L3InterfaceIpv4AddressList>();
+ private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<>();
@JsonProperty("l3-interface-ipv6-address-list")
- private List<L3InterfaceIpv6AddressList> l3InterfaceIpv6AddressList = new ArrayList<L3InterfaceIpv6AddressList>();
+ private List<L3InterfaceIpv6AddressList> l3InterfaceIpv6AddressList = new ArrayList<>();
public String getVlanInterface() {
return vlanInterface;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VpnBondingLink.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VpnBondingLink.java
index 4ee8213e59..4e5b3557d8 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VpnBondingLink.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VpnBondingLink.java
@@ -41,10 +41,10 @@ public class VpnBondingLink implements Serializable, ShallowCopy<VpnBondingLink>
private String vpnBondingLinkId;
@JsonProperty("configurations")
- private List<Configuration> configurations = new ArrayList<Configuration>();
+ private List<Configuration> configurations = new ArrayList<>();
@JsonProperty("service-proxies")
- private List<ServiceProxy> serviceProxies = new ArrayList<ServiceProxy>();
+ private List<ServiceProxy> serviceProxies = new ArrayList<>();
public String getVpnBondingLinkId() {
return vpnBondingLinkId;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java
index 1f689e97e3..c1591ad984 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java
@@ -39,6 +39,10 @@ public class BuildingBlock implements Serializable {
private Boolean isVirtualLink;
@JsonProperty("virtual-link-key")
private String virtualLinkKey;
+ @JsonProperty("scope")
+ private String bpmnScope;
+ @JsonProperty("action")
+ private String bpmnAction;
public String getBpmnFlowName() {
return bpmnFlowName;
@@ -79,4 +83,21 @@ public class BuildingBlock implements Serializable {
public void setVirtualLinkKey(String virtualLinkKey) {
this.virtualLinkKey = virtualLinkKey;
}
+
+ public String getBpmnScope() {
+ return bpmnScope;
+ }
+
+ public void setBpmnScope(String scope) {
+ this.bpmnScope = scope;
+ }
+
+ public String getBpmnAction() {
+ return bpmnAction;
+ }
+
+ public void setBpmnAction(String action) {
+ this.bpmnAction = action;
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
index 8608fee244..30a6e1fe35 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 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
@@ -31,5 +33,6 @@ public enum ResourceKey {
NETWORK_COLLECTION_ID,
VPN_ID,
VPN_BONDING_LINK_ID,
- INSTANCE_GROUP_ID;
+ INSTANCE_GROUP_ID,
+ PNF
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ServiceModel.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ServiceModel.java
new file mode 100644
index 0000000000..51bc4d7064
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ServiceModel.java
@@ -0,0 +1,32 @@
+package org.onap.so.bpmn.servicedecomposition.entities;
+
+import org.onap.so.db.catalog.beans.Service;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("serviceModel")
+public class ServiceModel {
+
+ @JsonProperty("currentService")
+ private Service currentService;
+ @JsonProperty("newService")
+ private Service newService;
+
+
+ public Service getCurrentService() {
+ return currentService;
+ }
+
+ public void setCurrentService(Service currentService) {
+ this.currentService = currentService;
+ }
+
+ public Service getNewService() {
+ return newService;
+ }
+
+ public void setNewService(Service newService) {
+ this.newService = newService;
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
index dc07d13acb..e8be2734cc 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 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
@@ -30,6 +32,7 @@ public class WorkflowResourceIds implements Serializable {
*/
private static final long serialVersionUID = 8591599114353940105L;
private String serviceInstanceId;
+ private String pnfId;
private String vnfId;
private String networkId;
private String volumeGroupId;
@@ -40,10 +43,10 @@ public class WorkflowResourceIds implements Serializable {
@Override
public String toString() {
- return new ToStringBuilder(this).append("serviceInstanceId", serviceInstanceId).append("vnfId", vnfId)
- .append("networkId", networkId).append("volumeGroupId", volumeGroupId).append("vfModuleId", vfModuleId)
- .append("networkCollectionId", networkCollectionId).append("configurationId", configurationId)
- .toString();
+ return new ToStringBuilder(this).append("serviceInstanceId", serviceInstanceId).append("pnfId", pnfId)
+ .append("vnfId", vnfId).append("networkId", networkId).append("volumeGroupId", volumeGroupId)
+ .append("vfModuleId", vfModuleId).append("networkCollectionId", networkCollectionId)
+ .append("configurationId", configurationId).toString();
}
public String getServiceInstanceId() {
@@ -54,6 +57,14 @@ public class WorkflowResourceIds implements Serializable {
this.serviceInstanceId = serviceInstanceId;
}
+ public String getPnfId() {
+ return pnfId;
+ }
+
+ public void setPnfId(String pnfId) {
+ this.pnfId = pnfId;
+ }
+
public String getVnfId() {
return vnfId;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java
index c9f7e5e948..93d85daad1 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java
@@ -34,9 +34,9 @@ public class License implements Serializable {
private static final long serialVersionUID = 2345786874755685318L;
@JsonProperty("entitlement-pool-uuids")
- private List<String> entitlementPoolUuids = new ArrayList<String>();
+ private List<String> entitlementPoolUuids = new ArrayList<>();
@JsonProperty("license-key-group-uuids")
- private List<String> licenseKeyGroupUuids = new ArrayList<String>();
+ private List<String> licenseKeyGroupUuids = new ArrayList<>();
public List<String> getEntitlementPoolUuids() {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java
index 632e61b85c..0193469d93 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java
@@ -55,6 +55,8 @@ public class RequestContext implements Serializable {
private RequestParameters requestParameters;
@JsonProperty("configurationParameters")
private List<Map<String, String>> configurationParameters = new ArrayList<>();
+ @JsonProperty("application-id")
+ private String applicationId;
public String getServiceURI() {
return serviceURI;
@@ -143,4 +145,12 @@ public class RequestContext implements Serializable {
public void setConfigurationParameters(List<Map<String, String>> configurationParameters) {
this.configurationParameters = configurationParameters;
}
+
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index 433aa0c11a..ac66fb1a41 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -6,6 +6,8 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
+ * Modifications Copyright (c) 2019 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
@@ -26,6 +28,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -33,35 +36,22 @@ import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.javatuples.Pair;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Vnfc;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.entities.ServiceModel;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.ServiceModelNotFoundException;
import org.onap.so.client.aai.AAICommonObjectMapperProvider;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
@@ -87,6 +77,7 @@ import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.Networks;
+import org.onap.so.serviceinstancebeans.Pnfs;
import org.onap.so.serviceinstancebeans.RelatedInstance;
import org.onap.so.serviceinstancebeans.RelatedInstanceList;
import org.onap.so.serviceinstancebeans.RequestDetails;
@@ -113,8 +104,10 @@ public class BBInputSetup implements JavaDelegate {
private static final String VF_MODULE = "VfModule";
private static final String NETWORK = "Network";
private static final String VNF = "Vnf";
+ private static final String PNF = "Pnf";
private static final String NETWORK_COLLECTION = "NetworkCollection";
private static final String PREPROV = "PREPROV";
+ private static final String CREATEVOLUME = "CreateVolume";
@Autowired
private BBInputSetupUtils bbInputSetupUtils;
@@ -237,6 +230,7 @@ public class BBInputSetup implements JavaDelegate {
lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, workflowResourceIds.getServiceInstanceId());
lookupKeyMap.put(ResourceKey.NETWORK_ID, workflowResourceIds.getNetworkId());
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, workflowResourceIds.getVnfId());
+ lookupKeyMap.put(ResourceKey.PNF, workflowResourceIds.getPnfId());
lookupKeyMap.put(ResourceKey.VF_MODULE_ID, workflowResourceIds.getVfModuleId());
lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, workflowResourceIds.getVolumeGroupId());
lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, workflowResourceIds.getConfigurationId());
@@ -249,26 +243,62 @@ public class BBInputSetup implements JavaDelegate {
String bbName = executeBB.getBuildingBlock().getBpmnFlowName();
String serviceInstanceId = lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID);
org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = null;
+ ServiceModel serviceModel = new ServiceModel();
+ Service service = null;
+ Service newService = null;
+ boolean isReplace = false;
if (serviceInstanceId != null) {
aaiServiceInstance = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId);
+ if (aaiServiceInstance != null) {
+ if (requestAction.equalsIgnoreCase("replaceInstance")
+ || requestAction.equalsIgnoreCase("replaceInstanceRetainAssignments")) {
+ RelatedInstanceList[] relatedInstanceList = requestDetails.getRelatedInstanceList();
+ if (relatedInstanceList != null) {
+ for (RelatedInstanceList relatedInstList : relatedInstanceList) {
+ RelatedInstance relatedInstance = relatedInstList.getRelatedInstance();
+ if (relatedInstance.getModelInfo().getModelType().equals(ModelType.service)) {
+ newService = bbInputSetupUtils.getCatalogServiceByModelUUID(
+ relatedInstance.getModelInfo().getModelVersionId());
+ isReplace = true;
+ }
+ }
+ }
+ }
+
+ service = bbInputSetupUtils.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+
+ serviceModel.setNewService(newService);
+ serviceModel.setCurrentService(service);
+
+ if (service == null) {
+ String message = String.format(
+ "Related service instance model not found in MSO CatalogDB: model-version-id=%s",
+ aaiServiceInstance.getModelVersionId());
+ throw new ServiceModelNotFoundException(message);
+ } else if (newService == null && isReplace) {
+ String message = "Related service instance model in Request not found in MSO CatalogDB";
+ throw new ServiceModelNotFoundException(message);
+ }
+ } else {
+ String message = String.format("Related service instance from AAI not found: service-instance-id=%s",
+ serviceInstanceId);
+ throw new NoServiceInstanceFoundException(message);
+ }
}
- Service service = null;
- if (aaiServiceInstance != null) {
- service = bbInputSetupUtils.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
- }
- if (aaiServiceInstance != null && service != null) {
- ServiceInstance serviceInstance = this.getExistingServiceInstance(aaiServiceInstance);
- serviceInstance.setModelInfoServiceInstance(this.mapperLayer.mapCatalogServiceIntoServiceInstance(service));
- this.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance, lookupKeyMap,
- resourceId, vnfType, executeBB.getBuildingBlock().getKey(),
- executeBB.getConfigurationResourceKeys());
- return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction,
- null);
+
+ ServiceInstance serviceInstance = this.getExistingServiceInstance(aaiServiceInstance);
+ if (isReplace) {
+ serviceInstance.setModelInfoServiceInstance(
+ this.mapperLayer.mapCatalogServiceIntoServiceInstance(serviceModel.getNewService()));
} else {
- logger.debug("Related Service Instance from AAI: {}", aaiServiceInstance);
- logger.debug("Related Service Instance Model Info from AAI: {}", service);
- throw new Exception("Could not find relevant information for related Service Instance");
+ serviceInstance.setModelInfoServiceInstance(
+ this.mapperLayer.mapCatalogServiceIntoServiceInstance(serviceModel.getCurrentService()));
}
+ this.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance, lookupKeyMap,
+ resourceId, vnfType, executeBB.getBuildingBlock().getKey(), executeBB.getConfigurationResourceKeys(),
+ isReplace, serviceModel);
+ return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, null);
+
}
protected GeneralBuildingBlock getGBBCM(ExecuteBuildingBlock executeBB, RequestDetails requestDetails,
@@ -287,7 +317,7 @@ public class BBInputSetup implements JavaDelegate {
}
String instanceGroupId = lookupKeyMap.get(ResourceKey.INSTANCE_GROUP_ID);
- if (instanceGroupId != null) {
+ if (instanceGroupId != null && !instanceGroupId.isEmpty()) {
org.onap.aai.domain.yang.InstanceGroup aaiInstancegroup =
bbInputSetupUtils.getAAIInstanceGroup(instanceGroupId);
InstanceGroup instanceGroup = this.mapperLayer.mapAAIInstanceGroupIntoInstanceGroup(aaiInstancegroup);
@@ -328,7 +358,8 @@ public class BBInputSetup implements JavaDelegate {
protected void populateObjectsOnAssignAndCreateFlows(RequestDetails requestDetails, Service service, String bbName,
ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String vnfType,
- String configurationKey, ConfigurationResourceKeys configurationResourceKeys) throws Exception {
+ String configurationKey, ConfigurationResourceKeys configurationResourceKeys, boolean isReplace,
+ ServiceModel serviceModel) throws Exception {
ModelInfo modelInfo = requestDetails.getModelInfo();
String instanceName = requestDetails.getRequestInfo().getInstanceName();
String productFamilyId = requestDetails.getRequestInfo().getProductFamilyId();
@@ -337,6 +368,10 @@ public class BBInputSetup implements JavaDelegate {
org.onap.so.serviceinstancebeans.Platform platform = requestDetails.getPlatform();
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness = requestDetails.getLineOfBusiness();
+ String applicationId = "";
+ if (requestDetails.getRequestInfo().getApplicationId() != null) {
+ applicationId = requestDetails.getRequestInfo().getApplicationId();
+ }
if (modelType.equals(ModelType.network)) {
lookupKeyMap.put(ResourceKey.NETWORK_ID, resourceId);
@@ -345,8 +380,10 @@ public class BBInputSetup implements JavaDelegate {
} else if (modelType.equals(ModelType.vnf)) {
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, resourceId);
this.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName, serviceInstance,
- lookupKeyMap, relatedInstanceList, resourceId, vnfType, null, productFamilyId);
- } else if (modelType.equals(ModelType.volumeGroup)) {
+ lookupKeyMap, relatedInstanceList, resourceId, vnfType, null, productFamilyId, applicationId,
+ isReplace);
+ } else if (modelType.equals(ModelType.volumeGroup) || (modelType.equals(ModelType.vfModule)
+ && (bbName.equalsIgnoreCase(AssignFlows.VOLUME_GROUP.toString()) || bbName.startsWith(CREATEVOLUME)))) {
lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, resourceId);
this.populateVolumeGroup(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
relatedInstanceList, instanceName, vnfType, null);
@@ -360,7 +397,8 @@ public class BBInputSetup implements JavaDelegate {
} else {
lookupKeyMap.put(ResourceKey.VF_MODULE_ID, resourceId);
this.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
- relatedInstanceList, instanceName, null, requestDetails.getCloudConfiguration());
+ relatedInstanceList, instanceName, null, requestDetails.getCloudConfiguration(), isReplace,
+ serviceModel);
}
} else if (modelType.equals(ModelType.instanceGroup)) {
lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, resourceId);
@@ -490,13 +528,18 @@ public class BBInputSetup implements JavaDelegate {
protected void populateVfModule(ModelInfo modelInfo, Service service, String bbName,
ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId,
RelatedInstanceList[] relatedInstanceList, String instanceName, List<Map<String, String>> instanceParams,
- CloudConfiguration cloudConfiguration) throws Exception {
+ CloudConfiguration cloudConfiguration, boolean isReplace, ServiceModel serviceModel) throws Exception {
+ String replaceVnfModelCustomizationUUID = null;
String vnfModelCustomizationUUID = null;
if (relatedInstanceList != null) {
for (RelatedInstanceList relatedInstList : relatedInstanceList) {
RelatedInstance relatedInstance = relatedInstList.getRelatedInstance();
if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) {
- vnfModelCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId();
+ if (isReplace) {
+ replaceVnfModelCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId();
+ } else {
+ vnfModelCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId();
+ }
}
if (relatedInstance.getModelInfo().getModelType().equals(ModelType.volumeGroup)) {
lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, relatedInstance.getInstanceId());
@@ -510,8 +553,13 @@ public class BBInputSetup implements JavaDelegate {
vnfModelCustomizationUUID =
this.bbInputSetupUtils.getAAIGenericVnf(vnf.getVnfId()).getModelCustomizationId();
ModelInfo vnfModelInfo = new ModelInfo();
- vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID);
- this.mapCatalogVnf(tempVnf, vnfModelInfo, service);
+ if (isReplace) {
+ vnfModelInfo.setModelCustomizationUuid(replaceVnfModelCustomizationUUID);
+ this.mapCatalogVnf(tempVnf, vnfModelInfo, serviceModel.getNewService());
+ } else {
+ vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID);
+ this.mapCatalogVnf(tempVnf, vnfModelInfo, serviceModel.getCurrentService());
+ }
Optional<String> volumeGroupIdOp = getVolumeGroupIdRelatedToVfModule(tempVnf, modelInfo,
cloudConfiguration.getCloudOwner(), cloudConfiguration.getLcpCloudRegionId(), lookupKeyMap);
if (volumeGroupIdOp.isPresent()) {
@@ -531,12 +579,25 @@ public class BBInputSetup implements JavaDelegate {
.getModelCustomizationId();
ModelInfo modelInfoVfModule = new ModelInfo();
modelInfoVfModule.setModelCustomizationId(vfModuleCustId);
- mapCatalogVfModule(vfModuleTemp, modelInfoVfModule, service, vnfModelCustomizationUUID);
+ if (isReplace && lookupKeyMap.get(ResourceKey.VF_MODULE_ID) != null
+ && vfModuleTemp.getVfModuleId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.VF_MODULE_ID))) {
+ mapCatalogVfModule(vfModuleTemp, modelInfoVfModule, serviceModel.getNewService(),
+ replaceVnfModelCustomizationUUID);
+ } else {
+ mapCatalogVfModule(vfModuleTemp, modelInfoVfModule, serviceModel.getCurrentService(),
+ vnfModelCustomizationUUID);
+ }
}
if (vfModule == null && bbName.equalsIgnoreCase(AssignFlows.VF_MODULE.toString())) {
vfModule = createVfModule(lookupKeyMap, resourceId, instanceName, instanceParams);
vnf.getVfModules().add(vfModule);
- mapCatalogVfModule(vfModule, modelInfo, service, vnfModelCustomizationUUID);
+ if (isReplace) {
+ mapCatalogVfModule(vfModule, modelInfo, serviceModel.getNewService(),
+ replaceVnfModelCustomizationUUID);
+ } else {
+ mapCatalogVfModule(vfModule, modelInfo, serviceModel.getCurrentService(),
+ vnfModelCustomizationUUID);
+ }
}
} else {
logger.debug("Related VNF instance Id not found: {}", lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID));
@@ -552,6 +613,7 @@ public class BBInputSetup implements JavaDelegate {
bbInputSetupUtils.getAAIVolumeGroup(cloudOwner, cloudRegionId, volumeGroup.getVolumeGroupId())
.getModelCustomizationId();
if (modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) {
+ logger.debug("Found volume group for vfModule: " + volumeGroup.getVolumeGroupId());
return Optional.of(volumeGroup.getVolumeGroupId());
}
}
@@ -705,11 +767,12 @@ public class BBInputSetup implements JavaDelegate {
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness, Service service, String bbName,
ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap,
RelatedInstanceList[] relatedInstanceList, String resourceId, String vnfType,
- List<Map<String, String>> instanceParams, String productFamilyId) {
+ List<Map<String, String>> instanceParams, String productFamilyId, String applicationId, boolean isReplace) {
GenericVnf vnf = null;
ModelInfo instanceGroupModelInfo = null;
String instanceGroupId = null;
String generatedVnfType = vnfType;
+ String replaceVnfModelCustomizationUUID = null;
if (generatedVnfType == null || generatedVnfType.isEmpty()) {
generatedVnfType = service.getModelName() + "/" + modelInfo.getModelCustomizationName();
}
@@ -720,6 +783,9 @@ public class BBInputSetup implements JavaDelegate {
instanceGroupModelInfo = relatedInstance.getModelInfo();
instanceGroupId = relatedInstance.getInstanceId();
}
+ if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf) && isReplace) {
+ replaceVnfModelCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId();
+ }
}
}
for (GenericVnf vnfTemp : serviceInstance.getVnfs()) {
@@ -727,6 +793,12 @@ public class BBInputSetup implements JavaDelegate {
&& vnfTemp.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
String vnfModelCustId =
bbInputSetupUtils.getAAIGenericVnf(vnfTemp.getVnfId()).getModelCustomizationId();
+ if (isReplace && replaceVnfModelCustomizationUUID != null
+ && vnfTemp.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
+ modelInfo.setModelCustomizationUuid(replaceVnfModelCustomizationUUID);
+ } else {
+ modelInfo.setModelCustomizationUuid(vnfModelCustId);
+ }
modelInfo.setModelCustomizationUuid(vnfModelCustId);
vnf = vnfTemp;
break;
@@ -734,7 +806,7 @@ public class BBInputSetup implements JavaDelegate {
}
if (vnf == null && bbName.equalsIgnoreCase(AssignFlows.VNF.toString())) {
vnf = createGenericVnf(lookupKeyMap, instanceName, platform, lineOfBusiness, resourceId, generatedVnfType,
- instanceParams, productFamilyId);
+ instanceParams, productFamilyId, applicationId);
serviceInstance.getVnfs().add(vnf);
mapVnfcCollectionInstanceGroup(vnf, modelInfo, service);
}
@@ -748,6 +820,13 @@ public class BBInputSetup implements JavaDelegate {
}
}
+ private void populatePnf(Pnfs pnf, String pnfId, ServiceInstance serviceInstance) {
+ Pnf genericPnf = new Pnf();
+ genericPnf.setPnfId(pnfId);
+ genericPnf.setPnfName(pnf.getInstanceName());
+ serviceInstance.getPnfs().add(genericPnf);
+ }
+
protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) {
for (InstanceGroup instanceGroup : vnf.getInstanceGroups()) {
if (instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) {
@@ -787,7 +866,7 @@ public class BBInputSetup implements JavaDelegate {
protected GenericVnf createGenericVnf(Map<ResourceKey, String> lookupKeyMap, String instanceName,
org.onap.so.serviceinstancebeans.Platform platform,
org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness, String vnfId, String vnfType,
- List<Map<String, String>> instanceParams, String productFamilyId) {
+ List<Map<String, String>> instanceParams, String productFamilyId, String applicationId) {
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnfId);
GenericVnf genericVnf = new GenericVnf();
genericVnf.setVnfId(vnfId);
@@ -796,6 +875,7 @@ public class BBInputSetup implements JavaDelegate {
genericVnf.setVnfType(vnfType);
genericVnf.setProvStatus(PREPROV);
genericVnf.setServiceId(productFamilyId);
+ genericVnf.setApplicationId(applicationId);
if (platform != null) {
genericVnf.setPlatform(this.mapperLayer.mapRequestPlatform(platform));
}
@@ -1232,23 +1312,29 @@ public class BBInputSetup implements JavaDelegate {
String serviceInstanceId = lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID);
RequestDetails requestDetails = executeBB.getRequestDetails();
GeneralBuildingBlock gBB = null;
+ Service service = null;
if (serviceInstanceId != null) {
aaiServiceInstance = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId);
+ if (aaiServiceInstance != null) {
+ service = bbInputSetupUtils.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ if (service == null) {
+ String message = String.format(
+ "Related service instance model not found in MSO CatalogDB: model-version-id=%s",
+ aaiServiceInstance.getModelVersionId());
+ throw new ServiceModelNotFoundException(message);
+ }
+ } else {
+ String message = String.format("Related service instance from AAI not found: service-instance-id=%s",
+ serviceInstanceId);
+ throw new NoServiceInstanceFoundException(message);
+ }
}
- Service service = null;
- if (aaiServiceInstance != null) {
- service = bbInputSetupUtils.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
- }
- if (aaiServiceInstance != null && service != null) {
- ServiceInstance serviceInstance = this.getExistingServiceInstance(aaiServiceInstance);
- serviceInstance.setModelInfoServiceInstance(this.mapperLayer.mapCatalogServiceIntoServiceInstance(service));
- gBB = populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, null);
- } else {
- logger.debug("Related Service Instance from AAI: {}", aaiServiceInstance);
- logger.debug("Related Service Instance Model Info from AAI: {}", service);
- throw new Exception("Could not find relevant information for related Service Instance");
- }
- ServiceInstance serviceInstance = gBB.getServiceInstance();
+
+ ServiceInstance serviceInstance = this.getExistingServiceInstance(aaiServiceInstance);
+ serviceInstance.setModelInfoServiceInstance(this.mapperLayer.mapCatalogServiceIntoServiceInstance(service));
+ gBB = populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, null);
+
+ serviceInstance = gBB.getServiceInstance();
CloudRegion cloudRegion = null;
if (cloudConfiguration == null) {
Optional<CloudRegion> cloudRegionOp = cloudInfoFromAAI.getCloudInfoFromAAI(serviceInstance);
@@ -1383,9 +1469,19 @@ public class BBInputSetup implements JavaDelegate {
this.bbInputSetupUtils.updateInfraActiveRequestVnfId(request, vnfId);
}
String productFamilyId = requestDetails.getRequestInfo().getProductFamilyId();
+ String applicationId = "";
+ if (vnfs.getApplicationId() != null) {
+ applicationId = vnfs.getApplicationId();
+ }
this.populateGenericVnf(vnfs.getModelInfo(), vnfs.getInstanceName(), vnfs.getPlatform(),
vnfs.getLineOfBusiness(), service, bbName, serviceInstance, lookupKeyMap, null, vnfId, vnfType,
- vnfs.getInstanceParams(), productFamilyId);
+ vnfs.getInstanceParams(), productFamilyId, applicationId, false);
+
+ } else if (bbName.contains(PNF)) {
+ String pnfId = lookupKeyMap.get(ResourceKey.PNF);
+ resources.getPnfs().stream()
+ .filter(pnf -> Objects.equals(key, pnf.getModelInfo().getModelCustomizationId())).findFirst()
+ .ifPresent(pnf -> this.populatePnf(pnf, pnfId, serviceInstance));
} else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) {
Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources);
if (vnfsAndVfModules != null) {
@@ -1406,8 +1502,10 @@ public class BBInputSetup implements JavaDelegate {
CloudConfiguration cloudConfig = new CloudConfiguration();
cloudConfig.setLcpCloudRegionId(cloudRegion.getLcpCloudRegionId());
cloudConfig.setCloudOwner(cloudRegion.getCloudOwner());
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
this.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, vfModuleId, null,
- vfModules.getInstanceName(), vfModules.getInstanceParams(), cloudConfig);
+ vfModules.getInstanceName(), vfModules.getInstanceParams(), cloudConfig, false, serviceModel);
}
} else if (bbName.contains(NETWORK)) {
networks = findNetworksByKey(key, resources);
@@ -1935,6 +2033,4 @@ public class BBInputSetup implements JavaDelegate {
}
return customer;
}
-
-
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index 573925ff3f..ea48c78dc0 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Optional;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.AggregateRoute;
import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
@@ -131,6 +132,10 @@ public class BBInputSetupMapperLayer {
return modelMapper.map(aaiSegmentationAssignment, SegmentationAssignment.class);
}
+ protected AggregateRoute mapAAIAggregateRoute(org.onap.aai.domain.yang.AggregateRoute aaiAggregateRoute) {
+ return modelMapper.map(aaiAggregateRoute, AggregateRoute.class);
+ }
+
protected CtagAssignment mapAAICtagAssignment(org.onap.aai.domain.yang.CtagAssignment aaiCtagAssignment) {
return modelMapper.map(aaiCtagAssignment, CtagAssignment.class);
}
@@ -262,10 +267,21 @@ public class BBInputSetupMapperLayer {
mapAllSubnetsIntoL3Network(aaiL3Network, network);
mapAllCtagAssignmentsIntoL3Network(aaiL3Network, network);
mapAllSegmentationAssignmentsIntoL3Network(aaiL3Network, network);
+ mapAllAggregateRoutesIntoL3Network(aaiL3Network, network);
network.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiL3Network.getOrchestrationStatus()));
return network;
}
+ protected void mapAllAggregateRoutesIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
+ L3Network network) {
+ if (aaiL3Network.getAggregateRoutes() != null) {
+ for (org.onap.aai.domain.yang.AggregateRoute aaiAggregateRoute : aaiL3Network.getAggregateRoutes()
+ .getAggregateRoute()) {
+ network.getAggregateRoutes().add(mapAAIAggregateRoute(aaiAggregateRoute));
+ }
+ }
+ }
+
protected void mapAllSegmentationAssignmentsIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
L3Network network) {
if (aaiL3Network.getSegmentationAssignments() != null) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
index dcb9e08d0b..ec7b613727 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
@@ -23,9 +23,7 @@
package org.onap.so.bpmn.servicedecomposition.tasks;
import java.io.IOException;
-import java.io.ObjectOutputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -76,12 +74,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.type.TypeFactory;
@Component("BBInputSetupUtils")
public class BBInputSetupUtils {
@@ -177,39 +174,32 @@ public class BBInputSetupUtils {
}
public InfraActiveRequests loadOriginalInfraActiveRequestById(String requestId) {
-
return this.requestsDbClient.getInfraActiveRequestbyRequestId(
this.requestsDbClient.getInfraActiveRequestbyRequestId(requestId).getOriginalRequestId());
}
public List<ExecuteBuildingBlock> loadOriginalFlowExecutionPath(String requestId) {
-
- List<ExecuteBuildingBlock> asList = null;
if (requestId != null) {
-
InfraActiveRequests request = loadInfraActiveRequestById(requestId);
-
if (request.getOriginalRequestId() != null) {
-
RequestProcessingData requestProcessingData =
this.requestsDbClient.getRequestProcessingDataBySoRequestIdAndName(
request.getOriginalRequestId(), PROCESSING_DATA_NAME_EXECUTION_FLOWS);
-
- ObjectMapper om = new ObjectMapper();
try {
- ExecuteBuildingBlock[] asArray =
- om.readValue(requestProcessingData.getValue(), ExecuteBuildingBlock[].class);
- asList = Arrays.asList(asArray);
+ ObjectMapper om = new ObjectMapper();
+ TypeFactory typeFactory = objectMapper.getTypeFactory();
+ return om.readValue(requestProcessingData.getValue(),
+ typeFactory.constructCollectionType(List.class, ExecuteBuildingBlock.class));
} catch (Exception e) {
logger.error(DATA_LOAD_ERROR, e);
+ throw new RuntimeException("Error Loading Original Request Data", e);
}
+ } else {
+ throw new RuntimeException("Original Request Id is null for record: " + requestId);
}
-
} else {
- logger.debug(REQUEST_ERROR);
+ throw new RuntimeException("Null Request Id Passed in");
}
-
- return asList;
}
public Service getCatalogServiceByModelUUID(String modelUUID) {
@@ -286,7 +276,7 @@ public class BBInputSetupUtils {
}
}
- protected InstanceGroup getAAIInstanceGroup(String instanceGroupId) {
+ public InstanceGroup getAAIInstanceGroup(String instanceGroupId) {
return injectionHelper.getAaiClient().get(InstanceGroup.class,
AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroupId)).orElse(null);
}
@@ -369,7 +359,7 @@ public class BBInputSetupUtils {
}
public Optional<ServiceInstance> getAAIServiceInstanceByName(String globalCustomerId, String serviceType,
- String serviceInstanceName) throws Exception {
+ String serviceInstanceName) throws MultipleObjectsFoundException {
ServiceInstance aaiServiceInstance = null;
ServiceInstances aaiServiceInstances = null;
aaiServiceInstances = getAAIServiceInstancesByName(globalCustomerId, serviceType, serviceInstanceName);
@@ -377,7 +367,10 @@ public class BBInputSetupUtils {
if (aaiServiceInstances == null) {
return Optional.empty();
} else if (aaiServiceInstances.getServiceInstance().size() > 1) {
- throw new Exception("Multiple Service Instances Returned");
+ String message = String.format(
+ "Multiple service instances found for customer-id: %s, service-type: %s and service-instance-name: %s.",
+ globalCustomerId, serviceType, serviceInstanceName);
+ throw new MultipleObjectsFoundException(message);
} else {
aaiServiceInstance = aaiServiceInstances.getServiceInstance().get(0);
}
@@ -482,7 +475,9 @@ public class BBInputSetupUtils {
if (serviceInstances.get().getServiceInstance().isEmpty()) {
throw new NoServiceInstanceFoundException("No ServiceInstances Returned");
} else if (serviceInstances.get().getServiceInstance().size() > 1) {
- throw new MultipleObjectsFoundException("Multiple ServiceInstances Returned");
+ String message = String.format("Mulitple service instances were found for instance-group-id: %s.",
+ instanceGroupId);
+ throw new MultipleObjectsFoundException(message);
} else {
serviceInstance = serviceInstances.get().getServiceInstance().get(0);
}
@@ -491,7 +486,7 @@ public class BBInputSetupUtils {
}
public Optional<L3Network> getRelatedNetworkByNameFromServiceInstance(String serviceInstanceId, String networkName)
- throws Exception {
+ throws MultipleObjectsFoundException {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
uri.relatedTo(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
Optional<L3Networks> networks = injectionHelper.getAaiClient().get(L3Networks.class, uri);
@@ -501,7 +496,10 @@ public class BBInputSetupUtils {
return Optional.empty();
} else {
if (networks.get().getL3Network().size() > 1) {
- throw new Exception("Multiple Networks Returned");
+ String message =
+ String.format("Multiple networks found for service-instance-id: %s and network-name: %s.",
+ serviceInstanceId, networkName);
+ throw new MultipleObjectsFoundException(message);
} else {
network = networks.get().getL3Network().get(0);
}
@@ -510,7 +508,7 @@ public class BBInputSetupUtils {
}
public Optional<GenericVnf> getRelatedVnfByNameFromServiceInstance(String serviceInstanceId, String vnfName)
- throws Exception {
+ throws MultipleObjectsFoundException {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
uri.relatedTo(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
Optional<GenericVnfs> vnfs = injectionHelper.getAaiClient().get(GenericVnfs.class, uri);
@@ -520,7 +518,9 @@ public class BBInputSetupUtils {
return Optional.empty();
} else {
if (vnfs.get().getGenericVnf().size() > 1) {
- throw new Exception("Multiple Vnfs Returned");
+ String message = String.format("Multiple vnfs found for service-instance-id: %s and vnf-name: %s.",
+ serviceInstanceId, vnfName);
+ throw new MultipleObjectsFoundException(message);
} else {
vnf = vnfs.get().getGenericVnf().get(0);
}
@@ -529,7 +529,7 @@ public class BBInputSetupUtils {
}
public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVnf(String vnfId, String volumeGroupName)
- throws Exception {
+ throws MultipleObjectsFoundException {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
@@ -539,7 +539,9 @@ public class BBInputSetupUtils {
return Optional.empty();
} else {
if (volumeGroups.get().getVolumeGroup().size() > 1) {
- throw new Exception("Multiple VolumeGroups Returned");
+ String message = String.format("Multiple volume-groups found for vnf-id: %s and volume-group-name: %s.",
+ vnfId, volumeGroupName);
+ throw new MultipleObjectsFoundException(message);
} else {
volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
}
@@ -547,8 +549,22 @@ public class BBInputSetupUtils {
}
}
+ public Optional<VolumeGroup> getRelatedVolumeGroupByIdFromVnf(String vnfId, String volumeGroupId) {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-id", volumeGroupId);
+ Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
+ VolumeGroup volumeGroup = null;
+ if (!volumeGroups.isPresent()) {
+ logger.debug("No VolumeGroups matched by id");
+ return Optional.empty();
+ } else {
+ volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
+ return Optional.of(volumeGroup);
+ }
+ }
+
public Optional<VolumeGroup> getRelatedVolumeGroupByNameFromVfModule(String vnfId, String vfModuleId,
- String volumeGroupName) throws Exception {
+ String volumeGroupName) throws MultipleObjectsFoundException {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP).queryParam("volume-group-name", volumeGroupName);
Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
@@ -558,6 +574,27 @@ public class BBInputSetupUtils {
return Optional.empty();
} else {
if (volumeGroups.get().getVolumeGroup().size() > 1) {
+ String message = String.format(
+ "Multiple voulme-groups found for vnf-id: %s, vf-module-id: %s and volume-group-name: %s.",
+ vnfId, vfModuleId, volumeGroupName);
+ throw new MultipleObjectsFoundException(message);
+ } else {
+ volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
+ }
+ return Optional.of(volumeGroup);
+ }
+ }
+
+ public Optional<VolumeGroup> getRelatedVolumeGroupFromVfModule(String vnfId, String vfModuleId) throws Exception {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
+ uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP);
+ Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri);
+ VolumeGroup volumeGroup = null;
+ if (!volumeGroups.isPresent()) {
+ logger.debug("VfModule does not have a volume group attached");
+ return Optional.empty();
+ } else {
+ if (volumeGroups.get().getVolumeGroup().size() > 1) {
throw new Exception("Multiple VolumeGroups Returned");
} else {
volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
@@ -597,6 +634,24 @@ public class BBInputSetupUtils {
return aaiRC.exists(l3networkUri);
}
+ public boolean existsAAIVfModuleGloballyByName(String vfModuleName) {
+ AAIResourceUri vfModuleUri =
+ AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE).queryParam("vf-module-name", vfModuleName);
+ return injectionHelper.getAaiClient().exists(vfModuleUri);
+ }
+
+ public boolean existsAAIConfigurationGloballyByName(String configurationName) {
+ AAIResourceUri configUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
+ .queryParam("configuration-name", configurationName);
+ return injectionHelper.getAaiClient().exists(configUri);
+ }
+
+ public boolean existsAAIVolumeGroupGloballyByName(String volumeGroupName) {
+ AAIResourceUri volumeGroupUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+ .queryParam("volume-group-name", volumeGroupName);
+ return injectionHelper.getAaiClient().exists(volumeGroupUri);
+ }
+
public GenericVnfs getAAIVnfsGloballyByName(String vnfName) {
return injectionHelper.getAaiClient()
@@ -609,7 +664,7 @@ public class BBInputSetupUtils {
}
public Optional<Configuration> getRelatedConfigurationByNameFromServiceInstance(String serviceInstanceId,
- String configurationName) throws Exception {
+ String configurationName) throws MultipleObjectsFoundException {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
uri.relatedTo(AAIObjectPlurals.CONFIGURATION).queryParam("configuration-name", configurationName);
Optional<Configurations> configurations = injectionHelper.getAaiClient().get(Configurations.class, uri);
@@ -619,7 +674,10 @@ public class BBInputSetupUtils {
return Optional.empty();
} else {
if (configurations.get().getConfiguration().size() > 1) {
- throw new Exception("Multiple Configurations Returned");
+ String message = String.format(
+ "Multiple configurations found for service-instance-d: %s and configuration-name: %s.",
+ serviceInstanceId, configurationName);
+ throw new MultipleObjectsFoundException(message);
} else {
configuration = configurations.get().getConfiguration().get(0);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
index 09a5424d47..ae7addcc57 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
@@ -25,6 +25,7 @@ package org.onap.so.bpmn.servicedecomposition.tasks;
import java.util.Map;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.logging.filter.base.ONAPComponentsList;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
@@ -35,8 +36,7 @@ import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.utils.TargetEntities;
-import org.onap.so.utils.TargetEntity;
+import org.onap.so.utils.Components;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -104,6 +104,7 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default serviceType value
+ logger.error("Exception in serviceType retrieval", ex);
}
String vnfType = ASTERISK;
try {
@@ -115,19 +116,21 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default vnfType value
+ logger.error("Exception in vnfType retrieval", ex);
}
String errorCode = ASTERISK;
- try {
+ if (workflowException != null) {
errorCode = "" + workflowException.getErrorCode();
- } catch (Exception ex) {
- // keep default errorCode value
+ } else {
+ logger.debug("WorkflowException is null, unable to get error code");
}
try {
errorCode = "" + (String) execution.getVariable("WorkflowExceptionCode");
} catch (Exception ex) {
// keep default errorCode value
+ logger.error("Exception in errorCode retrieval", ex);
}
String workStep = ASTERISK;
@@ -135,6 +138,7 @@ public class ExecuteBuildingBlockRainyDay {
workStep = workflowException.getWorkStep();
} catch (Exception ex) {
// keep default workStep value
+ logger.error("Exception in workStep retrieval", ex);
}
String errorMessage = ASTERISK;
@@ -142,6 +146,7 @@ public class ExecuteBuildingBlockRainyDay {
errorMessage = workflowException.getErrorMessage();
} catch (Exception ex) {
// keep default workStep value
+ logger.error("Exception in errorMessage retrieval", ex);
}
String serviceRole = ASTERISK;
@@ -177,14 +182,14 @@ public class ExecuteBuildingBlockRainyDay {
logger.error("Failed to update Request Db Infra Active Requests with Retry Status", ex);
}
}
- if (handlingCode.equals("RollbackToAssigned") && !aLaCarte) {
+ if ("RollbackToAssigned".equals(handlingCode) && !aLaCarte) {
handlingCode = "Rollback";
}
if (handlingCode.startsWith("Rollback")) {
String targetState = "";
- if (handlingCode.equalsIgnoreCase("RollbackToAssigned")) {
+ if ("RollbackToAssigned".equalsIgnoreCase(handlingCode)) {
targetState = Status.ROLLED_BACK_TO_ASSIGNED.toString();
- } else if (handlingCode.equalsIgnoreCase("RollbackToCreated")) {
+ } else if ("RollbackToCreated".equalsIgnoreCase(handlingCode)) {
targetState = Status.ROLLED_BACK_TO_CREATED.toString();
} else {
targetState = Status.ROLLED_BACK.toString();
@@ -204,7 +209,7 @@ public class ExecuteBuildingBlockRainyDay {
int envMaxRetries = Integer.parseInt(this.environment.getProperty(maxRetries));
execution.setVariable("maxRetries", envMaxRetries);
} catch (Exception ex) {
- logger.error("Could not read maxRetries from config file. Setting max to 5 retries");
+ logger.error("Could not read maxRetries from config file. Setting max to 5 retries", ex);
execution.setVariable("maxRetries", 5);
}
}
@@ -217,7 +222,7 @@ public class ExecuteBuildingBlockRainyDay {
try {
String requestId = (String) execution.getVariable("mso-request-id");
WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException");
- TargetEntities extSystemErrorSource = exception.getExtSystemErrorSource();
+ ONAPComponentsList extSystemErrorSource = exception.getExtSystemErrorSource();
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback");
if (isRollbackFailure == null) {
@@ -238,17 +243,16 @@ public class ExecuteBuildingBlockRainyDay {
} else if (isRollbackFailure) {
logger.debug(
"rollbackExtSystemErrorSource is null for isRollbackFailure. Setting rollbackExtSystemErrorSource to UNKNOWN");
- request.setRollbackExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ request.setRollbackExtSystemErrorSource(Components.UNKNOWN.toString());
} else {
logger.debug("extSystemErrorSource is null. Setting extSystemErrorSource to UNKNOWN");
- request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ request.setExtSystemErrorSource(Components.UNKNOWN.toString());
}
request.setLastModifiedBy("CamundaBPMN");
requestDbclient.updateInfraActiveRequests(request);
} catch (Exception e) {
- logger.error("Failed to update Request db with extSystemErrorSource or rollbackExtSystemErrorSource: "
- + e.getMessage());
+ logger.error("Failed to update Request db with extSystemErrorSource or rollbackExtSystemErrorSource: ", e);
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
index b2dbd97bfc..bb70853bbb 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
+ * Modifications Copyright (c) 2019 Nokia
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,31 +45,24 @@ public class ExtractPojosForBB {
private static final Logger logger = LoggerFactory.getLogger(ExtractPojosForBB.class);
public <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key) throws BBObjectNotFoundException {
- return extractByKey(execution, key, execution.getLookupMap().get(key));
- }
-
- protected <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key, String value)
- throws BBObjectNotFoundException {
-
Optional<T> result = Optional.empty();
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
+ String value = execution.getLookupMap().get(key);
try {
ServiceInstance serviceInstance;
GenericVnf vnf;
switch (key) {
case SERVICE_INSTANCE_ID:
- if (gBBInput.getCustomer().getServiceSubscription() == null
- && gBBInput.getServiceInstance() != null) {
- result = Optional.of((T) gBBInput.getServiceInstance());
- } else if (gBBInput.getCustomer().getServiceSubscription() != null) {
- result = lookupObjectInList(
- gBBInput.getCustomer().getServiceSubscription().getServiceInstances(), value);
- }
+ result = getServiceInstance(gBBInput, value);
break;
case GENERIC_VNF_ID:
serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
result = lookupObjectInList(serviceInstance.getVnfs(), value);
break;
+ case PNF:
+ serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
+ result = lookupObjectInList(serviceInstance.getPnfs(), value);
+ break;
case NETWORK_ID:
serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
result = lookupObjectInList(serviceInstance.getNetworks(), value);
@@ -90,7 +84,6 @@ public class ExtractPojosForBB {
result = lookupObjectInList(serviceInstance.getConfigurations(), value);
break;
case VPN_ID:
- serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
result = lookupObjectInList(gBBInput.getCustomer().getVpnBindings(), value);
break;
case VPN_BONDING_LINK_ID:
@@ -101,31 +94,27 @@ public class ExtractPojosForBB {
serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
result = lookupObjectInList(serviceInstance.getInstanceGroups(), value);
break;
- default:
- throw new BBObjectNotFoundException(key, value);
}
- } catch (BBObjectNotFoundException e) { // re-throw parent object not found
- throw e;
} catch (Exception e) { // convert all other exceptions to object not found
- logger.warn("BBObjectNotFoundException in ExtractPojosForBB",
- "BBObject " + key + " was not found in " + "gBBInput using reference value: " + value);
- throw new BBObjectNotFoundException(key, value);
- }
-
- if (result.isPresent()) {
- return result.get();
- } else {
+ logger.warn(
+ "BBObjectNotFoundException in ExtractPojosForBB, BBObject {} was not found in gBBInput using reference value: {} {}",
+ key, value, e);
throw new BBObjectNotFoundException(key, value);
}
+ return result.orElseThrow(() -> new BBObjectNotFoundException(key, value));
}
- protected <T> Optional<T> lookupObject(Object obj, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
- return findValue(obj, value);
+ private <T> Optional<T> getServiceInstance(GeneralBuildingBlock gBBInput, String value) throws Exception {
+ if (gBBInput.getCustomer().getServiceSubscription() == null && gBBInput.getServiceInstance() != null) {
+ return Optional.of((T) gBBInput.getServiceInstance());
+ } else if (gBBInput.getCustomer().getServiceSubscription() != null) {
+ return lookupObjectInList(gBBInput.getCustomer().getServiceSubscription().getServiceInstances(), value);
+ }
+ return Optional.empty();
}
- protected <T> Optional<T> lookupObjectInList(List<?> list, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ private <T> Optional<T> lookupObjectInList(List<?> list, String value)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Optional<T> result = Optional.empty();
for (Object obj : list) {
result = findValue(obj, value);
@@ -134,11 +123,10 @@ public class ExtractPojosForBB {
}
}
return result;
-
}
- protected <T> Optional<T> findValue(Object obj, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ private <T> Optional<T> findValue(Object obj, String value)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
for (Field field : obj.getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(Id.class)) {
String fieldName = field.getName();
@@ -149,7 +137,6 @@ public class ExtractPojosForBB {
}
}
}
-
return Optional.empty();
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundException.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundException.java
new file mode 100644
index 0000000000..b9daad6626
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundException.java
@@ -0,0 +1,15 @@
+package org.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+public class ServiceModelNotFoundException extends Exception {
+
+ private static final long serialVersionUID = -5551887892983898061L;
+
+ public ServiceModelNotFoundException() {
+ super();
+ }
+
+ public ServiceModelNotFoundException(String message) {
+ super(message);
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
index 5498b5be31..9741d4b6c2 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
@@ -24,7 +24,6 @@ package org.onap.so.client.cds;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
@@ -51,28 +50,29 @@ import io.grpc.Status;
*
*/
@Component
-public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
+public class AbstractCDSProcessingBBUtils {
private static final Logger logger = LoggerFactory.getLogger(AbstractCDSProcessingBBUtils.class);
private static final String SUCCESS = "Success";
private static final String FAILED = "Failed";
private static final String PROCESSING = "Processing";
+ private static final String RESPONSE_PAYLOAD = "CDSResponsePayload";
+ private static final String CDS_STATUS = "CDSStatus";
+ private static final String EXEC_INPUT = "executionServiceInput";
+
/**
* indicate exception thrown.
*/
private static final String EXCEPTION = "Exception";
-
- private final AtomicReference<String> cdsResponse = new AtomicReference<>();
-
@Autowired
private ExceptionBuilder exceptionUtil;
/**
* Extracting data from execution object and building the ExecutionServiceInput Object
- *
+ *
* @param execution DelegateExecution object
*/
public void constructExecutionServiceInputObject(DelegateExecution execution) {
@@ -105,7 +105,7 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
ExecutionServiceInput.newBuilder().setCommonHeader(commonHeader)
.setActionIdentifiers(actionIdentifiers).setPayload(struct.build()).build();
- execution.setVariable("executionServiceInput", executionServiceInput);
+ execution.setVariable(EXEC_INPUT, executionServiceInput);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
@@ -114,7 +114,7 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
/**
* get the executionServiceInput object from execution and send a request to CDS Client and wait for TIMEOUT period
- *
+ *
* @param execution DelegateExecution object
*/
public void sendRequestToCDSClient(DelegateExecution execution) {
@@ -127,10 +127,11 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
"No RestProperty.CDSProperties implementation found on classpath, can't create client.");
}
- ExecutionServiceInput executionServiceInput =
- (ExecutionServiceInput) execution.getVariable("executionServiceInput");
+ ExecutionServiceInput executionServiceInput = (ExecutionServiceInput) execution.getVariable(EXEC_INPUT);
+
+ CDSResponse cdsResponse = new CDSResponse();
- try (CDSProcessingClient cdsClient = new CDSProcessingClient(this)) {
+ try (CDSProcessingClient cdsClient = new CDSProcessingClient(new ResponseHandler(cdsResponse))) {
CountDownLatch countDownLatch = cdsClient.sendRequest(executionServiceInput);
countDownLatch.await(props.getTimeout(), TimeUnit.SECONDS);
} catch (InterruptedException ex) {
@@ -138,61 +139,82 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
Thread.currentThread().interrupt();
}
- if (cdsResponse != null) {
- String cdsResponseStatus = cdsResponse.get();
- execution.setVariable("CDSStatus", cdsResponseStatus);
+ String cdsResponseStatus = cdsResponse.status;
+
+ /**
+ * throw CDS failed exception.
+ */
+ if (!cdsResponseStatus.equals(SUCCESS)) {
+ throw new BadResponseException("CDS call failed with status: " + cdsResponse.status
+ + " and errorMessage: " + cdsResponse.errorMessage);
+ }
+
+ execution.setVariable(CDS_STATUS, cdsResponseStatus);
- /**
- * throw CDS failed exception.
- */
- if (cdsResponseStatus != SUCCESS) {
- throw new BadResponseException("CDS call failed with status: " + cdsResponseStatus);
- }
+ if (cdsResponse.payload != null) {
+ String payload = JsonFormat.printer().print(cdsResponse.payload);
+ execution.setVariable(RESPONSE_PAYLOAD, payload);
}
+
+
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
- /**
- * Get Response from CDS Client
- *
- */
- @Override
- public void onMessage(ExecutionServiceOutput message) {
- logger.info("Received notification from CDS: {}", message);
- EventType eventType = message.getStatus().getEventType();
-
- switch (eventType) {
-
- case EVENT_COMPONENT_FAILURE:
- // failed processing with failure
- cdsResponse.set(FAILED);
- break;
- case EVENT_COMPONENT_PROCESSING:
- // still processing
- cdsResponse.set(PROCESSING);
- break;
- case EVENT_COMPONENT_EXECUTED:
- // done with async processing
- cdsResponse.set(SUCCESS);
- break;
- default:
- cdsResponse.set(FAILED);
- break;
+ private class ResponseHandler implements CDSProcessingListener {
+
+ private CDSResponse cdsResponse;
+
+ ResponseHandler(CDSResponse cdsResponse) {
+ this.cdsResponse = cdsResponse;
}
- }
+ /**
+ * Get Response from CDS Client
+ */
+ @Override
+ public void onMessage(ExecutionServiceOutput message) {
+ logger.info("Received notification from CDS: {}", message);
+ EventType eventType = message.getStatus().getEventType();
+
+ switch (eventType) {
+ case EVENT_COMPONENT_PROCESSING:
+ cdsResponse.status = PROCESSING;
+ break;
+ case EVENT_COMPONENT_EXECUTED:
+ cdsResponse.status = SUCCESS;
+ break;
+ default:
+ cdsResponse.status = FAILED;
+ cdsResponse.errorMessage = message.getStatus().getErrorMessage();
+ break;
+ }
+ cdsResponse.payload = message.getPayload();
+ }
- /**
- * On error at CDS, log the error
- */
- @Override
- public void onError(Throwable t) {
- Status status = Status.fromThrowable(t);
- logger.error("Failed processing blueprint {}", status, t);
- cdsResponse.set(EXCEPTION);
+ /**
+ * On error at CDS, log the error
+ */
+ @Override
+ public void onError(Throwable t) {
+ Status status = Status.fromThrowable(t);
+ logger.error("Failed processing blueprint {}", status, t);
+ cdsResponse.status = EXCEPTION;
+ }
}
+ private class CDSResponse {
+
+ String status;
+ String errorMessage;
+ Struct payload;
+
+ @Override
+ public String toString() {
+ return "CDSResponse{" + "status='" + status + '\'' + ", errorMessage='" + errorMessage + '\'' + ", payload="
+ + payload + '}';
+ }
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForPnf.java
index b2e6ead36b..ad94421e5a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForPnf.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForPnf.java
@@ -48,7 +48,7 @@ public class ConfigAssignPropertiesForPnf {
private String pnfCustomizationUuid;
@JsonIgnore
- private Map<String, Object> userParam = new HashMap<String, Object>();
+ private Map<String, Object> userParam = new HashMap<>();
public String getServiceInstanceId() {
return serviceInstanceId;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForVnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForVnf.java
index 592b349215..acd60a4004 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForVnf.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/beans/ConfigAssignPropertiesForVnf.java
@@ -48,7 +48,7 @@ public class ConfigAssignPropertiesForVnf {
private String vnfCustomizationUuid;
@JsonIgnore
- private Map<String, Object> userParam = new HashMap<String, Object>();
+ private Map<String, Object> userParam = new HashMap<>();
public String getServiceInstanceId() {
return serviceInstanceId;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
index 100887dbbc..903280ce05 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
@@ -26,25 +26,25 @@ import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.onap.so.logger.LoggingAnchor;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.filter.base.ONAPComponentsList;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.logger.ErrorCode;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.onap.so.utils.TargetEntities;
-import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -92,7 +92,7 @@ public class ExceptionBuilder {
}
public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, Exception exception,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
String msg = "Exception in %s.%s ";
try {
logger.error("Exception occurred", exception);
@@ -156,7 +156,7 @@ public class ExceptionBuilder {
}
public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, Exception exception,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
String msg = "Exception in %s.%s ";
try {
logger.error("Exception occurred", exception);
@@ -187,6 +187,10 @@ public class ExceptionBuilder {
buildAndThrowWorkflowException(execution, errorCode, msg, extSystemErrorSource);
}
+ /**
+ * @deprecated Please utilize method that specifies where the failure occured
+ */
+ @Deprecated
public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, String errorMessage) {
if (execution instanceof DelegateExecutionImpl) {
buildAndThrowWorkflowException(((DelegateExecutionImpl) execution).getDelegateExecution(), errorCode,
@@ -195,7 +199,7 @@ public class ExceptionBuilder {
}
public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, String errorMessage,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
if (execution instanceof DelegateExecutionImpl) {
buildAndThrowWorkflowException(((DelegateExecutionImpl) execution).getDelegateExecution(), errorCode,
errorMessage, extSystemErrorSource);
@@ -215,7 +219,7 @@ public class ExceptionBuilder {
}
public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, String errorMessage,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
String processKey = getProcessKey(execution);
logger.info("Building a WorkflowException for Subflow");
@@ -244,9 +248,9 @@ public class ExceptionBuilder {
public void processAuditException(DelegateExecutionImpl execution, boolean flowShouldContinue) {
logger.debug("Processing Audit Results");
String auditListString = (String) execution.getVariable("auditInventoryResult");
+ String processKey = getProcessKey(execution.getDelegateExecution());
if (auditListString != null) {
StringBuilder errorMessage = new StringBuilder();
- String processKey = getProcessKey(execution.getDelegateExecution());
try {
ExtractPojosForBB extractPojosForBB = getExtractPojosForBB();
VfModule module = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
@@ -293,7 +297,7 @@ public class ExceptionBuilder {
execution.setVariable("StatusMessage", errorMessage.toString());
} else {
WorkflowException exception =
- new WorkflowException(processKey, 400, errorMessage.toString(), TargetEntity.SO);
+ new WorkflowException(processKey, 400, errorMessage.toString(), ONAPComponents.SO);
execution.setVariable("WorkflowException", exception);
execution.setVariable("WorkflowExceptionErrorMessage", errorMessage.toString());
logger.info("Outgoing WorkflowException is {}", exception);
@@ -302,7 +306,13 @@ public class ExceptionBuilder {
}
} else {
- logger.debug("Unable to process audit results due to auditInventoryResult being null");
+ String errorMessage = "Unable to process audit results due to auditInventoryResult being null";
+ WorkflowException exception = new WorkflowException(processKey, 400, errorMessage, ONAPComponents.SO);
+ execution.setVariable("WorkflowException", exception);
+ execution.setVariable("WorkflowExceptionErrorMessage", errorMessage);
+ logger.info("Outgoing WorkflowException is {}", exception);
+ logger.info("Throwing MSOWorkflowException");
+ throw new BpmnError("AAIInventoryFailure");
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
index 63c867f3c7..72bed98a5f 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_EsMs0HcuEeW2U_kkOHX1ZQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_EsMs0HcuEeW2U_kkOHX1ZQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="CompleteMsoProcess" name="CompleteMsoProcess" isExecutable="true">
<bpmn2:scriptTask id="preProcessRequest" name="Pre-Process Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_18</bpmn2:incoming>
@@ -10,8 +10,8 @@ preProcessRequestData.preProcessRequest(execution)
]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="preProcessRequest" targetRef="ExclusiveGateway_1r258d4" />
- <bpmn2:startEvent id="StartEvent_1" name="Start With message">
+ <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="preProcessRequest" targetRef="ScriptTask_3" />
+ <bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_18</bpmn2:outgoing>
<bpmn2:messageEventDefinition id="MessageEventDefinition_1" messageRef="Message_2" />
</bpmn2:startEvent>
@@ -34,136 +34,18 @@ preProcessRequestData.preProcessRequest(execution)
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1i1h3il" sourceRef="startEventExceptionCompleteMSO" targetRef="endEventExceptionCompleteMSO" />
</bpmn2:subProcess>
- <bpmn2:endEvent id="EndEvent_4">
- <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
- <bpmn2:errorEventDefinition id="ErrorEventDefinition_5" errorRef="Error_3" />
- </bpmn2:endEvent>
- <bpmn2:scriptTask id="ScriptTask_3" name="Prepare Infra&#10;&#10;Update DB Request" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_127i45q</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>
+ <bpmn2:scriptTask id="ScriptTask_3" name="&#10;MSO&#10;Update&#10;(infra active req)&#10;" scriptFormat="groovy">
+ <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_1oes9qv</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.*
def completeMsoProcess = new CompleteMsoProcess()
-completeMsoProcess.setUpdateDBstatustoSuccessPayload(execution)]]></bpmn2:script>
- </bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="ScriptTask_3" targetRef="updateInfraRequest" />
- <bpmn2:serviceTask id="updateInfraRequest" name="Update Infra DB status to SUCCESS">
- <bpmn2:extensionElements>
- <camunda:connector>
- <camunda:inputOutput>
- <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}]]></camunda:inputParameter>
- <camunda:inputParameter name="payload"><![CDATA[${execution.getVariable("CMSO_setUpdateDBstatustoSuccessPayload")}]]></camunda:inputParameter>
- <camunda:inputParameter name="headers">
- <camunda:map>
- <camunda:entry key="content-type">application/soap+xml</camunda:entry>
- <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry>
- <camunda:entry key="X-ONAP-RequestID">#{CMSO_request_id}</camunda:entry>
- </camunda:map>
- </camunda:inputParameter>
- <camunda:inputParameter name="method">POST</camunda:inputParameter>
- <camunda:outputParameter name="CMSO_updateRequestResponse"><![CDATA[${statusCode == null || statusCode == 204 ? "" : response}]]></camunda:outputParameter>
- <camunda:outputParameter name="CMSO_updateRequestResponseCode">${statusCode}</camunda:outputParameter>
- </camunda:inputOutput>
- <camunda:connectorId>soap-http-connector</camunda:connectorId>
- </camunda:connector>
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
- </bpmn2:serviceTask>
- <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="updateInfraRequest" targetRef="ExclusiveGateway_7" />
- <bpmn2:scriptTask id="BuildErrorMessage" name="Build Error Message" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_0mipf25</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
- <bpmn2:script><![CDATA[//println "INSIDE --> Build Error Message @@@@"
-//println "CMSO_updateRequestResponse IS --> " + execution.getVariable("CMSO_updateRequestResponse")
-import org.onap.so.bpmn.common.scripts.*
-def buildDataErrorMessage = new CompleteMsoProcess()
-buildDataErrorMessage.buildDataError(execution, "Complete MSO -- Update DB status to SUCCESS -- Failed")]]></bpmn2:script>
+completeMsoProcess.updateInfraRequestDB(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="BuildErrorMessage" targetRef="EndEvent_4" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_7" default="SequenceFlow_1">
- <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_03z8rch</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="ExclusiveGateway_7" targetRef="BuildErrorMessage" />
- <bpmn2:boundaryEvent id="BoundaryEvent_7" name="" attachedToRef="updateInfraRequest">
- <bpmn2:outgoing>SequenceFlow_0mipf25</bpmn2:outgoing>
- <bpmn2:errorEventDefinition id="_ErrorEventDefinition_84" errorRef="Error_1" camunda:errorCodeVariable="gJavaErrorCode" camunda:errorMessageVariable="gJavaErrorMessage" />
- </bpmn2:boundaryEvent>
<bpmn2:endEvent id="EndEvent_1">
- <bpmn2:incoming>SequenceFlow_1pzb94j</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1oes9qv</bpmn2:incoming>
<bpmn2:terminateEventDefinition id="_TerminateEventDefinition_2" />
</bpmn2:endEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_0mipf25" name="Connect Fault" sourceRef="BoundaryEvent_7" targetRef="BuildErrorMessage" />
- <bpmn2:callActivity id="CallActivity_101qf6x" name="Call Notification Service" calledElement="${UrnPropertiesReader.getVariable(&#34;mso.workflow.notification.name&#34;, execution)}">
- <bpmn2:extensionElements>
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
- <camunda:in variables="all" />
- <camunda:out variables="all" />
- <camunda:in businessKey="#{execution.processBusinessKey}" />
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_81</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_13qdn1s</bpmn2:outgoing>
- </bpmn2:callActivity>
- <bpmn2:sequenceFlow id="SequenceFlow_13qdn1s" sourceRef="CallActivity_101qf6x" targetRef="ParallelGateway_7" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_3" name="Active Request?" default="SequenceFlow_1dptl35">
- <bpmn2:incoming>SequenceFlow_067veaf</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_81</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_1dptl35</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:exclusiveGateway id="ParallelGateway_7">
- <bpmn2:incoming>SequenceFlow_1dptl35</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_13qdn1s</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1hpvwyt</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_81" name="Yes" sourceRef="ExclusiveGateway_3" targetRef="CallActivity_101qf6x">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CMSO_notification-url-Ok") ==true || execution.getVariable("CMSO_request_id-Ok") ==true}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="SequenceFlow_1dptl35" sourceRef="ExclusiveGateway_3" targetRef="ParallelGateway_7" />
- <bpmn2:parallelGateway id="ExclusiveGateway_1r258d4">
- <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_067veaf</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_0xe5zck</bpmn2:outgoing>
- </bpmn2:parallelGateway>
- <bpmn2:parallelGateway id="ExclusiveGateway_019d74x">
- <bpmn2:incoming>SequenceFlow_12he9a1</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_1hpvwyt</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1g8ig3h</bpmn2:outgoing>
- </bpmn2:parallelGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_1g8ig3h" sourceRef="ExclusiveGateway_019d74x" targetRef="ScriptTask_0vyk0lo" />
- <bpmn2:sequenceFlow id="SequenceFlow_067veaf" sourceRef="ExclusiveGateway_1r258d4" targetRef="ExclusiveGateway_3" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_08yqzk9" name="Infra Check Check" default="SequenceFlow_1ffkc0n">
- <bpmn2:incoming>SequenceFlow_0xe5zck</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_127i45q</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_1ffkc0n</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_0xe5zck" sourceRef="ExclusiveGateway_1r258d4" targetRef="ExclusiveGateway_08yqzk9" />
- <bpmn2:sequenceFlow id="SequenceFlow_127i45q" sourceRef="ExclusiveGateway_08yqzk9" targetRef="ScriptTask_3">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CMSO_request_id-Ok") ==false}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:exclusiveGateway id="ExclusiveGateway_1utv1g8">
- <bpmn2:incoming>SequenceFlow_03z8rch</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_1ffkc0n</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_12he9a1</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_03z8rch" sourceRef="ExclusiveGateway_7" targetRef="ExclusiveGateway_1utv1g8">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CMSO_updateRequestResponseCode")==200}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="SequenceFlow_1ffkc0n" sourceRef="ExclusiveGateway_08yqzk9" targetRef="ExclusiveGateway_1utv1g8" />
- <bpmn2:sequenceFlow id="SequenceFlow_12he9a1" sourceRef="ExclusiveGateway_1utv1g8" targetRef="ExclusiveGateway_019d74x" />
- <bpmn2:sequenceFlow id="SequenceFlow_1hpvwyt" sourceRef="ParallelGateway_7" targetRef="ExclusiveGateway_019d74x" />
- <bpmn2:scriptTask id="ScriptTask_0vyk0lo" name="Prepare Response" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1g8ig3h</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1pzb94j</bpmn2:outgoing>
- <bpmn2:script><![CDATA[println "INSIDE --> Complete MSO Process Done SUCCESSFULLY"
-import org.onap.so.bpmn.common.scripts.*
-def postProcessResponseData = new CompleteMsoProcess()
-postProcessResponseData.postProcessResponse(execution)
-println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("CompletionHandlerResponse")]]></bpmn2:script>
- </bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_1pzb94j" sourceRef="ScriptTask_0vyk0lo" targetRef="EndEvent_1" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1oes9qv" sourceRef="ScriptTask_3" targetRef="EndEvent_1" />
</bpmn2:process>
<bpmn2:message id="Message_2" name="CompleteMsoProcessRequest" />
<bpmn2:error id="Error_3" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
@@ -171,254 +53,64 @@ println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("Comple
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CompleteMsoProcess">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_41" bpmnElement="StartEvent_1">
- <dc:Bounds x="67" y="297" width="36" height="36" />
+ <dc:Bounds x="103" y="156" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="94" y="338" width="49" height="25" />
+ <dc:Bounds x="131" y="197" width="47" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_34" bpmnElement="preProcessRequest">
- <dc:Bounds x="167" y="275" width="100" height="80" />
+ <dc:Bounds x="293" y="134" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_34" targetElement="ParallelGateway_1domt5l_di">
- <di:waypoint xsi:type="dc:Point" x="267" y="316" />
- <di:waypoint xsi:type="dc:Point" x="322" y="316" />
+ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_34" targetElement="_BPMNShape_ScriptTask_88">
+ <di:waypoint xsi:type="dc:Point" x="393" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="440" y="174" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="295" y="301" width="0" height="0" />
+ <dc:Bounds x="371.5" y="159" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_18" sourceElement="_BPMNShape_StartEvent_41" targetElement="_BPMNShape_ScriptTask_34">
- <di:waypoint xsi:type="dc:Point" x="103" y="315" />
- <di:waypoint xsi:type="dc:Point" x="167" y="315" />
+ <di:waypoint xsi:type="dc:Point" x="139" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="293" y="174" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="135" y="300" width="0" height="0" />
+ <dc:Bounds x="171" y="159" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_51" bpmnElement="updateInfraRequest">
- <dc:Bounds x="657" y="451" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_SubProcess_13" bpmnElement="subProcessExceptionCompleteMSO" isExpanded="true">
- <dc:Bounds x="171" y="709" width="427" height="169" />
+ <dc:Bounds x="208" y="407" width="427" height="169" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_110" bpmnElement="endEventExceptionCompleteMSO">
- <dc:Bounds x="471" y="776" width="36" height="36" />
+ <dc:Bounds x="508" y="474" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="489" y="817" width="0" height="0" />
+ <dc:Bounds x="481" y="515" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_51" bpmnElement="startEventExceptionCompleteMSO">
- <dc:Bounds x="219" y="776" width="36" height="36" />
+ <dc:Bounds x="256" y="474" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="237" y="817" width="0" height="0" />
+ <dc:Bounds x="229" y="515" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_63" bpmnElement="ExclusiveGateway_7" isMarkerVisible="true">
- <dc:Bounds x="816" y="465" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="841" y="520" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_51" targetElement="_BPMNShape_ExclusiveGateway_63">
- <di:waypoint xsi:type="dc:Point" x="757" y="491" />
- <di:waypoint xsi:type="dc:Point" x="816" y="490" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="942" y="534" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_EndEvent_111" bpmnElement="EndEvent_4">
- <dc:Bounds x="953" y="578" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="971" y="619" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_76" bpmnElement="BuildErrorMessage">
- <dc:Bounds x="792" y="556" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_ExclusiveGateway_63" targetElement="_BPMNShape_ScriptTask_76">
- <di:waypoint xsi:type="dc:Point" x="841" y="515" />
- <di:waypoint xsi:type="dc:Point" x="842" y="556" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="886" y="342" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ScriptTask_76" targetElement="_BPMNShape_EndEvent_111">
- <di:waypoint xsi:type="dc:Point" x="892" y="596" />
- <di:waypoint xsi:type="dc:Point" x="953" y="596" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="923" y="596" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_128" bpmnElement="EndEvent_1">
- <dc:Bounds x="1270" y="297" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1288" y="338" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_29" bpmnElement="BoundaryEvent_7">
- <dc:Bounds x="686" y="513" width="36" height="36" />
+ <dc:Bounds x="699" y="156" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="979" y="395" width="0" height="0" />
+ <dc:Bounds x="672" y="197" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_88" bpmnElement="ScriptTask_3">
- <dc:Bounds x="506" y="451" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ScriptTask_88" targetElement="_BPMNShape_ScriptTask_51">
- <di:waypoint xsi:type="dc:Point" x="606" y="491" />
- <di:waypoint xsi:type="dc:Point" x="657" y="491" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="626" y="515" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0mipf25_di" bpmnElement="SequenceFlow_0mipf25">
- <di:waypoint xsi:type="dc:Point" x="704" y="549" />
- <di:waypoint xsi:type="dc:Point" x="704" y="596" />
- <di:waypoint xsi:type="dc:Point" x="792" y="596" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="623" y="563" width="68" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="CallActivity_101qf6x_di" bpmnElement="CallActivity_101qf6x">
- <dc:Bounds x="633" y="186" width="100" height="80" />
+ <dc:Bounds x="440" y="134" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_13qdn1s_di" bpmnElement="SequenceFlow_13qdn1s">
- <di:waypoint xsi:type="dc:Point" x="733" y="226" />
- <di:waypoint xsi:type="dc:Point" x="888" y="226" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="811" y="211" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1i1h3il_di" bpmnElement="SequenceFlow_1i1h3il">
- <di:waypoint xsi:type="dc:Point" x="255" y="794" />
- <di:waypoint xsi:type="dc:Point" x="471" y="794" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="363" y="779" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_60" bpmnElement="ExclusiveGateway_3" isMarkerVisible="true">
- <dc:Bounds x="394" y="201" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="326" y="196" width="80" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ParallelGateway_9" bpmnElement="ParallelGateway_7" isMarkerVisible="true">
- <dc:Bounds x="888" y="201" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="913" y="256" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_82" bpmnElement="SequenceFlow_81">
- <di:waypoint xsi:type="dc:Point" x="444" y="226" />
- <di:waypoint xsi:type="dc:Point" x="633" y="226" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="552" y="234" width="18" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1dptl35_di" bpmnElement="SequenceFlow_1dptl35">
- <di:waypoint xsi:type="dc:Point" x="419" y="251" />
- <di:waypoint xsi:type="dc:Point" x="419" y="333" />
- <di:waypoint xsi:type="dc:Point" x="913" y="333" />
- <di:waypoint xsi:type="dc:Point" x="913" y="251" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="448" y="273" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ParallelGateway_1domt5l_di" bpmnElement="ExclusiveGateway_1r258d4">
- <dc:Bounds x="322" y="291" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="347" y="341" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ParallelGateway_04tefv6_di" bpmnElement="ExclusiveGateway_019d74x">
- <dc:Bounds x="999" y="290" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1024" y="340" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1g8ig3h_di" bpmnElement="SequenceFlow_1g8ig3h">
- <di:waypoint xsi:type="dc:Point" x="1049" y="315" />
- <di:waypoint xsi:type="dc:Point" x="1104" y="315" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1077" y="300" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_067veaf_di" bpmnElement="SequenceFlow_067veaf">
- <di:waypoint xsi:type="dc:Point" x="347" y="291" />
- <di:waypoint xsi:type="dc:Point" x="347" y="226" />
- <di:waypoint xsi:type="dc:Point" x="394" y="226" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="362" y="258.5" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ExclusiveGateway_08yqzk9_di" bpmnElement="ExclusiveGateway_08yqzk9" isMarkerVisible="true">
- <dc:Bounds x="394" y="466" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="390" y="516" width="57" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0xe5zck_di" bpmnElement="SequenceFlow_0xe5zck">
- <di:waypoint xsi:type="dc:Point" x="347" y="341" />
- <di:waypoint xsi:type="dc:Point" x="347" y="491" />
- <di:waypoint xsi:type="dc:Point" x="394" y="491" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="362" y="416" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_127i45q_di" bpmnElement="SequenceFlow_127i45q">
- <di:waypoint xsi:type="dc:Point" x="444" y="491" />
- <di:waypoint xsi:type="dc:Point" x="473" y="491" />
- <di:waypoint xsi:type="dc:Point" x="473" y="491" />
- <di:waypoint xsi:type="dc:Point" x="506" y="491" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="488" y="491" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ExclusiveGateway_1utv1g8_di" bpmnElement="ExclusiveGateway_1utv1g8" isMarkerVisible="true">
- <dc:Bounds x="999" y="391" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1024" y="441" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_03z8rch_di" bpmnElement="SequenceFlow_03z8rch">
- <di:waypoint xsi:type="dc:Point" x="866" y="490" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="490" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="441" />
+ <di:waypoint xsi:type="dc:Point" x="292" y="492" />
+ <di:waypoint xsi:type="dc:Point" x="508" y="492" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="945" y="475" width="0" height="0" />
+ <dc:Bounds x="355" y="477" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1ffkc0n_di" bpmnElement="SequenceFlow_1ffkc0n">
- <di:waypoint xsi:type="dc:Point" x="419" y="466" />
- <di:waypoint xsi:type="dc:Point" x="419" y="416" />
- <di:waypoint xsi:type="dc:Point" x="999" y="416" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="434" y="441" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_12he9a1_di" bpmnElement="SequenceFlow_12he9a1">
- <di:waypoint xsi:type="dc:Point" x="1024" y="391" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="367" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="367" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="340" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1039" y="367" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1hpvwyt_di" bpmnElement="SequenceFlow_1hpvwyt">
- <di:waypoint xsi:type="dc:Point" x="938" y="226" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="226" />
- <di:waypoint xsi:type="dc:Point" x="1024" y="290" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="981" y="211" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_0vyk0lo_di" bpmnElement="ScriptTask_0vyk0lo">
- <dc:Bounds x="1104" y="275" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1pzb94j_di" bpmnElement="SequenceFlow_1pzb94j">
- <di:waypoint xsi:type="dc:Point" x="1204" y="315" />
- <di:waypoint xsi:type="dc:Point" x="1270" y="315" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1oes9qv_di" bpmnElement="SequenceFlow_1oes9qv">
+ <di:waypoint xsi:type="dc:Point" x="540" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="699" y="174" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1237" y="290" width="0" height="0" />
+ <dc:Bounds x="619.5" y="153" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn
index 6914e7575f..0c7a8ac063 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn
@@ -1,178 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_3SPHsLr9EeWak-hhutJWuQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_3SPHsLr9EeWak-hhutJWuQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="FalloutHandler" name="Fallout Handler" isExecutable="true">
- <bpmn2:parallelGateway id="ParallelGateway_1">
- <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_24</bpmn2:outgoing>
- </bpmn2:parallelGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ParallelGateway_1" targetRef="ExclusiveGateway_1" />
- <bpmn2:sequenceFlow id="SequenceFlow_24" name="" sourceRef="ParallelGateway_1" targetRef="ExclusiveGateway_6" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Notification URL exists?" default="SequenceFlow_23">
- <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_3" name="yes" sourceRef="ExclusiveGateway_1" targetRef="Task_0ixuwt5">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("FH_notification-url-Ok") ==true}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="SequenceFlow_23" name="no" sourceRef="ExclusiveGateway_1" targetRef="ParallelGateway_4" />
<bpmn2:scriptTask id="ScriptTask_8" name="Pre-Process Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_1kx7ea5</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.*
def preProcessRequestData = new FalloutHandler()
preProcessRequestData.preProcessRequest(execution)
]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="ScriptTask_8" targetRef="ParallelGateway_1" />
- <bpmn2:startEvent id="StartEvent_1" name="Start">
+ <bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="StartEvent_1" targetRef="ScriptTask_8" />
- <bpmn2:parallelGateway id="ParallelGateway_6">
- <bpmn2:incoming>SequenceFlow_37</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_38</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
- </bpmn2:parallelGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ParallelGateway_6" targetRef="ScriptTask_2" />
<bpmn2:scriptTask id="ScriptTask_2" name="Post Process Response" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1u8shdz</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.*
def falloutHandler = new FalloutHandler()
falloutHandler.postProcessResponse(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="ScriptTask_2" targetRef="EndEvent_6" />
- <bpmn2:exclusiveGateway id="ParallelGateway_4">
- <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_0m7gwor</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_38</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_38" name="" sourceRef="ParallelGateway_4" targetRef="ParallelGateway_6" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_6" default="SequenceFlow_26">
- <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_25</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_26</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_25" name="" sourceRef="ExclusiveGateway_6" targetRef="ServiceTask_3">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("FH_request_id-Ok") ==true}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="SequenceFlow_26" name="" sourceRef="ExclusiveGateway_6" targetRef="ServiceTask_2" />
- <bpmn2:serviceTask id="ServiceTask_3" name="Update Request Gamma">
- <bpmn2:extensionElements>
- <camunda:connector>
- <camunda:inputOutput>
- <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.db.att-endpoint", execution)}]]></camunda:inputParameter>
- <camunda:inputParameter name="method">POST</camunda:inputParameter>
- <camunda:inputParameter name="headers">
- <camunda:map>
- <camunda:entry key="content-type">application/soap+xml</camunda:entry>
- <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry>
- <camunda:entry key="X-ONAP-RequestID">#{FH_request_id}</camunda:entry>
- </camunda:map>
- </camunda:inputParameter>
- <camunda:inputParameter name="payload">
- <camunda:script scriptFormat="groovy"><![CDATA[//println"INSIDE --> update Request Gamma"
-import org.onap.so.bpmn.common.scripts.*
-def updateRequestGamma= new FalloutHandler()
-return updateRequestGamma.updateRequestGammaPayload(execution)]]></camunda:script>
- </camunda:inputParameter>
- <camunda:outputParameter name="FH_updateRequestGammaResponse"><![CDATA[${statusCode == null || statusCode == 204 ? "" : response}]]></camunda:outputParameter>
- <camunda:outputParameter name="FH_updateRequestGammaResponseCode">${statusCode}</camunda:outputParameter>
- </camunda:inputOutput>
- <camunda:connectorId>soap-http-connector</camunda:connectorId>
- </camunda:connector>
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_25</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_29</bpmn2:outgoing>
- </bpmn2:serviceTask>
- <bpmn2:sequenceFlow id="SequenceFlow_29" name="" sourceRef="ServiceTask_3" targetRef="ExclusiveGateway_7" />
- <bpmn2:boundaryEvent id="BoundaryEvent_2" name="Connect Fault" attachedToRef="ServiceTask_3">
- <bpmn2:outgoing>SequenceFlow_72</bpmn2:outgoing>
- <bpmn2:errorEventDefinition id="_ErrorEventDefinition_89" errorRef="Error_2" />
- </bpmn2:boundaryEvent>
- <bpmn2:exclusiveGateway id="ParallelGateway_5">
- <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_36</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_37</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_37" name="" sourceRef="ParallelGateway_5" targetRef="ParallelGateway_6" />
- <bpmn2:endEvent id="EndEvent_6" name="Normal End">
+ <bpmn2:endEvent id="EndEvent_6">
<bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
</bpmn2:endEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_72" name="" sourceRef="BoundaryEvent_2" targetRef="ScriptTask_6" />
- <bpmn2:scriptTask id="ScriptTask_6" name="Build Workflow Exception" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_72</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_79</bpmn2:outgoing>
+ <bpmn2:scriptTask id="ScriptTask_6" name="&#10;MSO&#10;Update&#10;(infra active req)&#10;" scriptFormat="groovy">
+ <bpmn2:incoming>SequenceFlow_1kx7ea5</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_1u8shdz</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.*
def falloutHandler = new FalloutHandler()
-falloutHandler.buildDBWorkflowException(execution, "FH_updateRequestGammaResponseCode")]]></bpmn2:script>
+falloutHandler.updateInfraRequestDB(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_79" name="" sourceRef="ScriptTask_6" targetRef="EndEvent_13" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_7" name="Update Success?" default="SequenceFlow_31">
- <bpmn2:incoming>SequenceFlow_29</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_31</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_31" name="" sourceRef="ExclusiveGateway_7" targetRef="ScriptTask_6" />
- <bpmn2:sequenceFlow id="SequenceFlow_35" name="" sourceRef="ExclusiveGateway_7" targetRef="ParallelGateway_5">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("FH_updateRequestGammaResponseCode")==200}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:scriptTask id="ScriptTask_7" name="Build Workflow Exception" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_32</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_80</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_73</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.*
-def falloutHandler = new FalloutHandler()
-falloutHandler.buildDBWorkflowException(execution, "FH_updateRequestInfraResponseCode")]]></bpmn2:script>
- </bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_73" name="" sourceRef="ScriptTask_7" targetRef="EndEvent_14" />
- <bpmn2:serviceTask id="ServiceTask_2" name="Update Request Infra">
- <bpmn2:extensionElements>
- <camunda:connector>
- <camunda:inputOutput>
- <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}]]></camunda:inputParameter>
- <camunda:inputParameter name="method">POST</camunda:inputParameter>
- <camunda:inputParameter name="headers">
- <camunda:map>
- <camunda:entry key="content-type">application/soap+xml</camunda:entry>
- <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry>
- <camunda:entry key="X-ONAP-RequestID">#{FH_request_id}</camunda:entry>
- </camunda:map>
- </camunda:inputParameter>
- <camunda:inputParameter name="payload">
- <camunda:script scriptFormat="groovy"><![CDATA[//println"INSIDE --> update Request Infra"
-import org.onap.so.bpmn.common.scripts.*
-def updateRequestInfra= new FalloutHandler()
-return updateRequestInfra.updateRequestInfraPayload(execution)]]></camunda:script>
- </camunda:inputParameter>
- <camunda:outputParameter name="FH_updateRequestInfraResponse"><![CDATA[${statusCode == null || statusCode == 204 ? "" : response}]]></camunda:outputParameter>
- <camunda:outputParameter name="FH_updateRequestInfraResponseCode">${statusCode}</camunda:outputParameter>
- </camunda:inputOutput>
- <camunda:connectorId>soap-http-connector</camunda:connectorId>
- </camunda:connector>
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_30</bpmn2:outgoing>
- </bpmn2:serviceTask>
- <bpmn2:sequenceFlow id="SequenceFlow_30" name="" sourceRef="ServiceTask_2" targetRef="ExclusiveGateway_8" />
- <bpmn2:exclusiveGateway id="ExclusiveGateway_8" name="Update Success?" default="SequenceFlow_32">
- <bpmn2:incoming>SequenceFlow_30</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing>
- <bpmn2:outgoing>SequenceFlow_36</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="ExclusiveGateway_8" targetRef="ScriptTask_7" />
- <bpmn2:sequenceFlow id="SequenceFlow_36" name="" sourceRef="ExclusiveGateway_8" targetRef="ParallelGateway_5">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("FH_updateRequestInfraResponseCode")==200}]]></bpmn2:conditionExpression>
- </bpmn2:sequenceFlow>
- <bpmn2:boundaryEvent id="BoundaryEvent_3" name="Connect Fault" attachedToRef="ServiceTask_2">
- <bpmn2:outgoing>SequenceFlow_80</bpmn2:outgoing>
- <bpmn2:errorEventDefinition id="_ErrorEventDefinition_90" errorRef="Error_2" camunda:errorCodeVariable="gJavaErrorCode" camunda:errorMessageVariable="gJavaErrorMessage" />
- </bpmn2:boundaryEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_80" name="" sourceRef="BoundaryEvent_3" targetRef="ScriptTask_7" />
<bpmn2:subProcess id="SubProcess_1" name="Event Handler" triggeredByEvent="true">
<bpmn2:scriptTask id="ScriptTask_4" name="Handle Event" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1ko8ggw</bpmn2:incoming>
@@ -200,345 +59,94 @@ execution.setVariable("FH_WorkflowException", wfe)]]></bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_1ko8ggw" sourceRef="StartEvent_2" targetRef="ScriptTask_4" />
<bpmn2:sequenceFlow id="SequenceFlow_1pm9r7h" sourceRef="ScriptTask_4" targetRef="EndEvent_2" />
</bpmn2:subProcess>
- <bpmn2:endEvent id="EndEvent_14">
- <bpmn2:incoming>SequenceFlow_73</bpmn2:incoming>
- <bpmn2:terminateEventDefinition />
- </bpmn2:endEvent>
- <bpmn2:endEvent id="EndEvent_13">
- <bpmn2:incoming>SequenceFlow_79</bpmn2:incoming>
- <bpmn2:terminateEventDefinition />
- </bpmn2:endEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_0m7gwor" sourceRef="Task_0ixuwt5" targetRef="ParallelGateway_4" />
- <bpmn2:callActivity id="Task_0ixuwt5" name="Call Notification Service" calledElement="${UrnPropertiesReader.getVariable(&#34;mso.workflow.notification.name&#34;, execution)}">
- <bpmn2:extensionElements>
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
- <camunda:in variables="all" />
- <camunda:out variables="all" />
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_0m7gwor</bpmn2:outgoing>
- </bpmn2:callActivity>
+ <bpmn2:sequenceFlow id="SequenceFlow_1kx7ea5" sourceRef="ScriptTask_8" targetRef="ScriptTask_6" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1u8shdz" sourceRef="ScriptTask_6" targetRef="ScriptTask_2" />
</bpmn2:process>
<bpmn2:error id="Error_1" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_2" name="Java Lang Exception" errorCode="java.lang.Exception" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="FalloutHandler">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_52" bpmnElement="StartEvent_1">
- <dc:Bounds x="139" y="263" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="145" y="300" width="23" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ParallelGateway_12" bpmnElement="ParallelGateway_1">
- <dc:Bounds x="342" y="255" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="367" y="310" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_74" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
- <dc:Bounds x="415" y="107" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="315" y="89" width="81" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ParallelGateway_12" targetElement="_BPMNShape_ExclusiveGateway_74">
- <di:waypoint xsi:type="dc:Point" x="367" y="255" />
- <di:waypoint xsi:type="dc:Point" x="367" y="132" />
- <di:waypoint xsi:type="dc:Point" x="415" y="132" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="438" y="212" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_ExclusiveGateway_74" targetElement="CallActivity_0jz0w0k_di">
- <di:waypoint xsi:type="dc:Point" x="440" y="107" />
- <di:waypoint xsi:type="dc:Point" x="440" y="65" />
- <di:waypoint xsi:type="dc:Point" x="553" y="65" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="475" y="70" width="18" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ParallelGateway_15" bpmnElement="ParallelGateway_4" isMarkerVisible="true">
- <dc:Bounds x="742" y="107" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="767" y="162" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ExclusiveGateway_74" targetElement="_BPMNShape_ParallelGateway_15">
- <di:waypoint xsi:type="dc:Point" x="440" y="157" />
- <di:waypoint xsi:type="dc:Point" x="441" y="198" />
- <di:waypoint xsi:type="dc:Point" x="767" y="198" />
- <di:waypoint xsi:type="dc:Point" x="767" y="157" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="452" y="173" width="12" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_79" bpmnElement="ExclusiveGateway_6" isMarkerVisible="true">
- <dc:Bounds x="412" y="468" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="437" y="523" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ParallelGateway_12" targetElement="_BPMNShape_ExclusiveGateway_79">
- <di:waypoint xsi:type="dc:Point" x="367" y="305" />
- <di:waypoint xsi:type="dc:Point" x="367" y="493" />
- <di:waypoint xsi:type="dc:Point" x="412" y="493" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="415" y="445" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_ExclusiveGateway_79" targetElement="_BPMNShape_ServiceTask_90">
- <di:waypoint xsi:type="dc:Point" x="437" y="468" />
- <di:waypoint xsi:type="dc:Point" x="437" y="402" />
- <di:waypoint xsi:type="dc:Point" x="492" y="402" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="437" y="444" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_ExclusiveGateway_79" targetElement="_BPMNShape_ServiceTask_91">
- <di:waypoint xsi:type="dc:Point" x="437" y="518" />
- <di:waypoint xsi:type="dc:Point" x="437" y="650" />
- <di:waypoint xsi:type="dc:Point" x="488" y="650" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="437" y="596" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_90" bpmnElement="ServiceTask_3">
- <dc:Bounds x="492" y="362" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_91" bpmnElement="ServiceTask_2">
- <dc:Bounds x="488" y="610" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_80" bpmnElement="ExclusiveGateway_7" isMarkerVisible="true">
- <dc:Bounds x="675" y="376" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="657" y="431" width="87" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ServiceTask_90" targetElement="_BPMNShape_ExclusiveGateway_80">
- <di:waypoint xsi:type="dc:Point" x="592" y="402" />
- <di:waypoint xsi:type="dc:Point" x="675" y="401" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="632" y="404" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_81" bpmnElement="ExclusiveGateway_8" isMarkerVisible="true">
- <dc:Bounds x="674" y="625" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="656" y="680" width="87" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ServiceTask_91" targetElement="_BPMNShape_ExclusiveGateway_81">
- <di:waypoint xsi:type="dc:Point" x="588" y="650" />
- <di:waypoint xsi:type="dc:Point" x="626" y="650" />
- <di:waypoint xsi:type="dc:Point" x="626" y="649" />
- <di:waypoint xsi:type="dc:Point" x="674" y="650" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="636" y="651" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_31" bpmnElement="SequenceFlow_31" sourceElement="_BPMNShape_ExclusiveGateway_80" targetElement="_BPMNShape_ScriptTask_252">
- <di:waypoint xsi:type="dc:Point" x="700" y="376" />
- <di:waypoint xsi:type="dc:Point" x="701" y="324" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="707" y="351" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ExclusiveGateway_81" targetElement="_BPMNShape_ScriptTask_253">
- <di:waypoint xsi:type="dc:Point" x="699" y="625" />
- <di:waypoint xsi:type="dc:Point" x="699" y="608" />
- <di:waypoint xsi:type="dc:Point" x="699" y="577" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="709" y="657" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ParallelGateway_16" bpmnElement="ParallelGateway_5" isMarkerVisible="true">
- <dc:Bounds x="853" y="468" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="878" y="523" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ExclusiveGateway_80" targetElement="_BPMNShape_ParallelGateway_16">
- <di:waypoint xsi:type="dc:Point" x="725" y="401" />
- <di:waypoint xsi:type="dc:Point" x="878" y="401" />
- <di:waypoint xsi:type="dc:Point" x="878" y="468" />
+ <dc:Bounds x="128" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="762" y="392" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="SequenceFlow_36" sourceElement="_BPMNShape_ExclusiveGateway_81" targetElement="_BPMNShape_ParallelGateway_16">
- <di:waypoint xsi:type="dc:Point" x="724" y="650" />
- <di:waypoint xsi:type="dc:Point" x="878" y="650" />
- <di:waypoint xsi:type="dc:Point" x="878" y="518" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="878" y="574" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_ParallelGateway_17" bpmnElement="ParallelGateway_6">
- <dc:Bounds x="957" y="254" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="982" y="309" width="0" height="0" />
+ <dc:Bounds x="134" y="199" width="24" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_37" bpmnElement="SequenceFlow_37" sourceElement="_BPMNShape_ParallelGateway_16" targetElement="_BPMNShape_ParallelGateway_17">
- <di:waypoint xsi:type="dc:Point" x="903" y="493" />
- <di:waypoint xsi:type="dc:Point" x="982" y="493" />
- <di:waypoint xsi:type="dc:Point" x="982" y="304" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="943" y="478" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_38" bpmnElement="SequenceFlow_38" sourceElement="_BPMNShape_ParallelGateway_15" targetElement="_BPMNShape_ParallelGateway_17">
- <di:waypoint xsi:type="dc:Point" x="792" y="132" />
- <di:waypoint xsi:type="dc:Point" x="982" y="132" />
- <di:waypoint xsi:type="dc:Point" x="982" y="254" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="887" y="117" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_StartEvent_52" targetElement="_BPMNShape_ScriptTask_99">
- <di:waypoint xsi:type="dc:Point" x="175" y="281" />
- <di:waypoint xsi:type="dc:Point" x="211" y="281" />
+ <di:waypoint xsi:type="dc:Point" x="164" y="180" />
+ <di:waypoint xsi:type="dc:Point" x="279" y="180" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="193" y="281" width="0" height="0" />
+ <dc:Bounds x="176.5" y="165" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_99" bpmnElement="ScriptTask_8">
- <dc:Bounds x="211" y="241" width="100" height="80" />
+ <dc:Bounds x="279" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_SubProcess_14" bpmnElement="SubProcess_1" isExpanded="true">
- <dc:Bounds x="146" y="759" width="329" height="167" />
+ <dc:Bounds x="220" y="365" width="329" height="167" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_100" bpmnElement="ScriptTask_4">
- <dc:Bounds x="259" y="803" width="100" height="80" />
+ <dc:Bounds x="333" y="409" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_2">
- <dc:Bounds x="175" y="825" width="36" height="36" />
+ <dc:Bounds x="249" y="431" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="193" y="869" width="0" height="0" />
+ <dc:Bounds x="222" y="475" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_101" bpmnElement="ScriptTask_2">
- <dc:Bounds x="1054" y="240" width="100" height="80" />
+ <dc:Bounds x="589" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ParallelGateway_17" targetElement="_BPMNShape_ScriptTask_101">
- <di:waypoint xsi:type="dc:Point" x="1007" y="279" />
- <di:waypoint xsi:type="dc:Point" x="1054" y="280" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1177" y="280" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ScriptTask_99" targetElement="_BPMNShape_ParallelGateway_12">
- <di:waypoint xsi:type="dc:Point" x="311" y="281" />
- <di:waypoint xsi:type="dc:Point" x="342" y="280" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="327" y="281" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_129" bpmnElement="EndEvent_6">
- <dc:Bounds x="1188" y="262" width="36" height="36" />
+ <dc:Bounds x="856" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1177" y="303" width="57" height="12" />
+ <dc:Bounds x="845" y="203" width="57" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ScriptTask_101" targetElement="_BPMNShape_EndEvent_129">
- <di:waypoint xsi:type="dc:Point" x="1154" y="280" />
- <di:waypoint xsi:type="dc:Point" x="1188" y="280" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1171" y="280" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_31" bpmnElement="BoundaryEvent_2">
- <dc:Bounds x="525" y="344" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="563" y="300" width="68" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_32" bpmnElement="BoundaryEvent_3">
- <dc:Bounds x="521" y="592" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="563" y="554" width="68" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_72" bpmnElement="SequenceFlow_72" sourceElement="_BPMNShape_BoundaryEvent_31" targetElement="_BPMNShape_ScriptTask_252">
- <di:waypoint xsi:type="dc:Point" x="543" y="344" />
- <di:waypoint xsi:type="dc:Point" x="543" y="284" />
- <di:waypoint xsi:type="dc:Point" x="651" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="689" y="180" />
+ <di:waypoint xsi:type="dc:Point" x="856" y="180" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="543" y="326" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_73" bpmnElement="SequenceFlow_73" sourceElement="_BPMNShape_ScriptTask_253">
- <di:waypoint xsi:type="dc:Point" x="750" y="537" />
- <di:waypoint xsi:type="dc:Point" x="790" y="537" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="770" y="522" width="0" height="0" />
+ <dc:Bounds x="727.5" y="165" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_252" bpmnElement="ScriptTask_6">
- <dc:Bounds x="651" y="244" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_253" bpmnElement="ScriptTask_7">
- <dc:Bounds x="650" y="497" width="100" height="80" />
+ <dc:Bounds x="431" y="141" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_79" bpmnElement="SequenceFlow_79" sourceElement="_BPMNShape_ScriptTask_252">
- <di:waypoint xsi:type="dc:Point" x="751" y="284" />
- <di:waypoint xsi:type="dc:Point" x="793" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="772" y="269" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_80" bpmnElement="SequenceFlow_80" sourceElement="_BPMNShape_BoundaryEvent_32" targetElement="_BPMNShape_ScriptTask_253">
- <di:waypoint xsi:type="dc:Point" x="539" y="592" />
- <di:waypoint xsi:type="dc:Point" x="539" y="537" />
- <di:waypoint xsi:type="dc:Point" x="650" y="537" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="567" y="537" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0b9vn2u_di" bpmnElement="EndEvent_2">
- <dc:Bounds x="403" y="825" width="36" height="36" />
+ <dc:Bounds x="477" y="431" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="399" y="869" width="47" height="12" />
+ <dc:Bounds x="473" y="475" width="47" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1fmpj5u_di" bpmnElement="EndEvent_14">
- <dc:Bounds x="790" y="519" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="808" y="560" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_0w1puhf_di" bpmnElement="EndEvent_13">
- <dc:Bounds x="793" y="266" width="36" height="36" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1ko8ggw_di" bpmnElement="SequenceFlow_1ko8ggw">
+ <di:waypoint xsi:type="dc:Point" x="285" y="449" />
+ <di:waypoint xsi:type="dc:Point" x="333" y="449" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="811" y="307" width="0" height="0" />
+ <dc:Bounds x="264" y="424" width="90" height="0" />
</bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0m7gwor_di" bpmnElement="SequenceFlow_0m7gwor">
- <di:waypoint xsi:type="dc:Point" x="654" y="65" />
- <di:waypoint xsi:type="dc:Point" x="767" y="65" />
- <di:waypoint xsi:type="dc:Point" x="767" y="107" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1pm9r7h_di" bpmnElement="SequenceFlow_1pm9r7h">
+ <di:waypoint xsi:type="dc:Point" x="433" y="449" />
+ <di:waypoint xsi:type="dc:Point" x="477" y="449" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="711" y="50" width="0" height="0" />
+ <dc:Bounds x="410" y="424" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1ko8ggw_di" bpmnElement="SequenceFlow_1ko8ggw">
- <di:waypoint xsi:type="dc:Point" x="211" y="843" />
- <di:waypoint xsi:type="dc:Point" x="259" y="843" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1kx7ea5_di" bpmnElement="SequenceFlow_1kx7ea5">
+ <di:waypoint xsi:type="dc:Point" x="379" y="180" />
+ <di:waypoint xsi:type="dc:Point" x="431" y="181" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="235" y="818" width="0" height="0" />
+ <dc:Bounds x="405" y="159.5" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1pm9r7h_di" bpmnElement="SequenceFlow_1pm9r7h">
- <di:waypoint xsi:type="dc:Point" x="359" y="843" />
- <di:waypoint xsi:type="dc:Point" x="403" y="843" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1u8shdz_di" bpmnElement="SequenceFlow_1u8shdz">
+ <di:waypoint xsi:type="dc:Point" x="531" y="181" />
+ <di:waypoint xsi:type="dc:Point" x="589" y="180" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="381" y="818" width="0" height="0" />
+ <dc:Bounds x="560" y="159.5" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="CallActivity_0jz0w0k_di" bpmnElement="Task_0ixuwt5">
- <dc:Bounds x="554" y="25" width="100" height="80" />
- </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtilsTest.groovy
index d7438f80f9..fda6b8e6e3 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtilsTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtilsTest.groovy
@@ -32,7 +32,7 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.skyscreamer.jsonassert.JSONAssert
import org.skyscreamer.jsonassert.JSONCompareMode
import org.springframework.core.env.Environment
@@ -127,7 +127,7 @@ class CatalogDbUtilsTest {
private void mockGetResponseFromCatalogDb(String queryEndpoint) {
Environment environmentMock = createEnvironmentMock()
when(environmentMock.getProperty("mso.catalog.db.endpoint")).thenReturn("http://testUrl")
- when(httpClientFactoryMock.newJsonClient(new URL(queryEndpoint), TargetEntity.CATALOG_DB)).thenReturn(httpClientMock)
+ when(httpClientFactoryMock.newJsonClient(new URL(queryEndpoint), ONAPComponents.CATALOG_DB)).thenReturn(httpClientMock)
Response responseMock = mock(Response.class)
when(httpClientMock.get()).thenReturn(responseMock)
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy
index 99c351c465..119159f458 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy
@@ -1,22 +1,22 @@
-/*-
- * ============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=========================================================
- */
+/*-
+ * ============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.bpmn.common.scripts
@@ -24,13 +24,17 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.junit.Before
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
+import org.mockito.Mock
import org.mockito.MockitoAnnotations
+import org.mockito.Spy
import org.mockito.runners.MockitoJUnitRunner
import org.onap.so.bpmn.core.WorkflowException
-
+import org.onap.so.db.request.beans.InfraActiveRequests
+import org.onap.so.db.request.client.RequestsDbClient
import static org.assertj.core.api.Assertions.assertThat
import static org.assertj.core.api.Assertions.assertThatThrownBy
import static org.mockito.ArgumentMatchers.eq
@@ -38,27 +42,20 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class CompleteMsoProcessTest {
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this)
- }
-
- private String completeMsoProcessRequest = """
- <sdncadapterworkflow:MsoCompletionRequest xmlns:ns="http://org.onap/so/request/types/v1" xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <ns:request-information>
- <ns:request-id>uCPE1020_STUW105_5002</ns:request-id>
- <ns:request-action>Layer3ServiceActivateRequest</ns:request-action>
- <ns:request-sub-action>COMPLETE</ns:request-sub-action>
- <ns:source>OMX</ns:source>
- <ns:notification-url>http://localhost:28090/CCD/StatusNotification</ns:notification-url>
- <ns:order-number>10205000</ns:order-number>
- <ns:order-version>1</ns:order-version>
- </ns:request-information>
- <sdncadapterworkflow:mso-bpel-name>UCPELayer3ServiceActivateV1</sdncadapterworkflow:mso-bpel-name>
- </sdncadapterworkflow:MsoCompletionRequest>
- """
-
- private String completeMsoNetworkProcessRequest = """
+
+ @Mock
+ RequestsDbClient requestsDbClient;
+
+ @Spy
+ CompleteMsoProcess completeMsoProcess;
+
+
+ @Before
+ public void init() {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ private String completeMsoNetworkProcessRequest = """
<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1">
<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
@@ -71,104 +68,39 @@ class CompleteMsoProcessTest {
<aetgt:mso-bpel-name>BPMN Network action: CREATE</aetgt:mso-bpel-name>
</aetgt:MsoCompletionRequest>"""
- @Test
- public void testPreProcessRequest() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoProcessRequest)
- when(mockExecution.getVariable("mso.adapters.db.auth")).thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C");
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
- CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
- completeMsoProcess.preProcessRequest(mockExecution)
-
- /* Initialize all the process request variables in this block */
- verify(mockExecution).setVariable("prefix","CMSO_")
- //verify(mockExecution).setVariable("getLayer3ServiceDetailsV1Response","")
- verify(mockExecution).setVariable("CMSO_request_id","")
- verify(mockExecution).setVariable("CMSO_notification-url","")
- verify(mockExecution).setVariable("CMSO_mso-bpel-name","")
- verify(mockExecution).setVariable("CMSO_request_action","")
-
- verify(mockExecution).setVariable("CMSO_notification-url-Ok", false)
- verify(mockExecution).setVariable("CMSO_request_id-Ok", false)
-
- //updateRequest Adapter process variables
- verify(mockExecution).setVariable("CMSO_updateRequestResponse", "")
- verify(mockExecution).setVariable("CMSO_updateRequestResponseCode", "")
- verify(mockExecution).setVariable("CMSO_updateFinalNotifyAckStatusFailedPayload", "")
-
- //Set DB adapter variables here
- verify(mockExecution).setVariable("CMSO_updateDBStatusToSuccessPayload", "")
- verify(mockExecution).setVariable("CMSO_updateInfraRequestDBPayload", "")
- verify(mockExecution).setVariable("CMSO_setUpdateDBstatustoSuccessPayload", "")
-
- //Auth variables
- verify(mockExecution).setVariable("BasicAuthHeaderValue","")
-
- //Response variables
- verify(mockExecution).setVariable("CompletionHandlerResponse","")
- verify(mockExecution).setVariable("CMSO_ErrorResponse", null)
- verify(mockExecution).setVariable("CMSO_ResponseCode", "")
-
- verify(mockExecution).setVariable("CMSO_notification-url-Ok",true)
- verify(mockExecution).setVariable("CMSO_request_id-Ok",true)
- verify(mockExecution).setVariable("CMSO_notification-url","http://localhost:28090/CCD/StatusNotification")
- verify(mockExecution).setVariable("CMSO_request_id","uCPE1020_STUW105_5002")
- verify(mockExecution).setVariable("CMSO_request_action","Layer3ServiceActivateRequest")
- verify(mockExecution).setVariable("CMSO_source","OMX")
-
- }
-
- private String setUpdateDBstatustoSuccessPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <statusMessage>Resource Completed Successfully</statusMessage>
- <requestStatus>COMPLETE</requestStatus>
- <progress>100</progress>
- <networkId>bd631913-cfc6-488b-ba22-6b98504f703d</networkId>
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- @Test
- public void testsetUpdateDBstatustoSuccessPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("CMSO_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("BPEL")
- when(mockExecution.getVariable("mso.adapters.db.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC");
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
- when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoNetworkProcessRequest);
-
- CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess()
- completeMsoProcess.setUpdateDBstatustoSuccessPayload(mockExecution)
-
- verify(mockExecution).setVariable("CMSO_setUpdateDBstatustoSuccessPayload",setUpdateDBstatustoSuccessPayload)
- }
-
- private String msoCompletionResponse = """onse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <sdncadapterworkflow:out>BPEL BPEL-NAME FAILED</sdncadapterworkflow:out>
-</sdncadapterworkflow:MsoCompletionResponse>"""
-
-
- @Test
- void postProcessResponse_successful() {
- DelegateExecution mockExecution = mock(DelegateExecution.class)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("mso-bpel-test")
- new CompleteMsoProcess().postProcessResponse(mockExecution)
-
- String expectedResponse = "<sdncadapterworkflow:MsoCompletionResponse xmlns:sdncadapterworkflow=\"http://ecomp.com/mso/workflow/schema/v1\">\n" +
- " <sdncadapterworkflow:out>BPEL mso-bpel-test completed</sdncadapterworkflow:out>\n" +
- "</sdncadapterworkflow:MsoCompletionResponse>"
-
- verify(mockExecution).setVariable("WorkflowResponse", expectedResponse)
- verify(mockExecution).setVariable("CompleteMsoProcessResponse", expectedResponse)
- verify(mockExecution).setVariable("CMSO_ResponseCode", "200")
- }
+ @Test
+ public void testPreProcessRequest() {
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoNetworkProcessRequest)
+
+ completeMsoProcess.preProcessRequest(mockExecution)
+
+ verify(mockExecution).setVariable("CMSO_request_id", "bd631913-cfc6-488b-ba22-6b98504f703d")
+ }
+
+
+ @Test
+ public void testUpdateInfraRequestDB(){
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getVariable("CMSO_request_id")).thenReturn("testReqId")
+ when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoNetworkProcessRequest);
+ when(completeMsoProcess.getDbClient()).thenReturn(requestsDbClient)
+ completeMsoProcess.updateInfraRequestDB(mockExecution)
+
+ InfraActiveRequests request = new InfraActiveRequests()
+ request.setRequestId("testReqId")
+
+ completeMsoProcess.updateInfraRequestDB(mockExecution)
+
+ request.setRequestStatus("COMPLETED")
+ request.setStatusMessage("Resource Completed Successfully")
+ request.setProgress(100)
+ request.setLastModifiedBy("BPMN")
+ request.setNetworkId("bd631913-cfc6-488b-ba22-6b98504f703d")
+
+
+ verify(requestsDbClient, times(2)).updateInfraActiveRequests(request, null, null)
+ }
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy
index 837bc77f19..7abfcffb13 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy
@@ -26,7 +26,7 @@ import org.junit.Test
import org.onap.logging.ref.slf4j.ONAPLogConstants
import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.springframework.http.HttpStatus
import javax.ws.rs.core.MediaType
@@ -53,7 +53,7 @@ class ExternalAPIUtilTest {
HttpClient httpClient = mock(HttpClient.class)
given(httpClient.get()).willReturn(expectedResponse)
HttpClientFactory httpClientFactory = mock(HttpClientFactory.class)
- given(httpClientFactory.newJsonClient(new URL(URL), TargetEntity.EXTERNAL)).willReturn(httpClient)
+ given(httpClientFactory.newJsonClient(new URL(URL), ONAPComponents.EXTERNAL)).willReturn(httpClient)
// WHEN
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), new ExceptionUtil())
@@ -75,7 +75,7 @@ class ExternalAPIUtilTest {
HttpClient httpClient = mock(HttpClient.class)
willThrow(new RuntimeException("error occurred")).given(httpClient).get()
HttpClientFactory httpClientFactory = mock(HttpClientFactory.class)
- given(httpClientFactory.newJsonClient(new URL(URL), TargetEntity.EXTERNAL)).willReturn(httpClient)
+ given(httpClientFactory.newJsonClient(new URL(URL), ONAPComponents.EXTERNAL)).willReturn(httpClient)
DelegateExecution delegateExecution = createDelegateExecution()
DummyExceptionUtil exceptionUtil = new DummyExceptionUtil()
@@ -97,7 +97,7 @@ class ExternalAPIUtilTest {
HttpClient httpClient = mock(HttpClient.class)
willThrow(new RuntimeException("error occurred")).given(httpClient).post(BODY_PAYLOAD)
HttpClientFactory httpClientFactory = mock(HttpClientFactory.class)
- given(httpClientFactory.newJsonClient(new URL(URL), TargetEntity.AAI)).willReturn(httpClient)
+ given(httpClientFactory.newJsonClient(new URL(URL), ONAPComponents.AAI)).willReturn(httpClient)
DelegateExecution delegateExecution = createDelegateExecution()
DummyExceptionUtil exceptionUtil = new DummyExceptionUtil()
@@ -120,7 +120,7 @@ class ExternalAPIUtilTest {
HttpClient httpClient = mock(HttpClient.class)
given(httpClient.post(BODY_PAYLOAD)).willReturn(expectedResponse)
HttpClientFactory httpClientFactory = mock(HttpClientFactory.class)
- given(httpClientFactory.newJsonClient(new URL(URL), TargetEntity.AAI)).willReturn(httpClient)
+ given(httpClientFactory.newJsonClient(new URL(URL), ONAPComponents.AAI)).willReturn(httpClient)
// WHEN
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), new ExceptionUtil())
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy
index 25f62a6555..6cae293971 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy
@@ -1,22 +1,22 @@
-/*-
- * ============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=========================================================
- */
+/*-
+ * ============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.bpmn.common.scripts
@@ -29,31 +29,41 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor;
+import org.mockito.Mock
import org.mockito.MockitoAnnotations
+import org.mockito.Spy
import org.mockito.runners.MockitoJUnitRunner
import org.onap.so.bpmn.common.scripts.MsoUtils;
+import org.onap.so.db.request.beans.InfraActiveRequests
+import org.onap.so.db.request.client.RequestsDbClient
import org.onap.so.bpmn.common.scripts.FalloutHandler;
@RunWith(MockitoJUnitRunner.class)
class FalloutHandlerTest {
-
- public MsoUtils utils = new MsoUtils()
-
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this)
- }
- private String falloutHandlerRequest = """
+ public MsoUtils utils = new MsoUtils()
+
+ @Spy
+ FalloutHandler falloutHandler = new FalloutHandler()
+
+ @Mock
+ RequestsDbClient requestsDbClient;
+
+ @Before
+ public void init() {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ private String falloutHandlerRequest = """
<sdncadapterworkflow:FalloutHandlerRequest xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" xmlns:ns7="http://org.onap/so/request/types/v1">
- <ns7:request-information>
+ <ns7:request-info>
<ns7:request-id>uCPE1020_STUW105_5002</ns7:request-id>
<ns7:request-action>Layer3ServiceActivateRequest</ns7:request-action>
<ns7:request-sub-action>CANCEL</ns7:request-sub-action>
<ns7:source>OMX</ns7:source>
<ns7:order-number>10205000</ns7:order-number>
<ns7:order-version>1</ns7:order-version>
- </ns7:request-information>
+ </ns7:request-info>
<sdncadapterworkflow:WorkflowException>
<sdncadapterworkflow:ErrorMessage>Some Error Message - Fallout Handler</sdncadapterworkflow:ErrorMessage>
<sdncadapterworkflow:ErrorCode>Some Error Code - Fallout Handler</sdncadapterworkflow:ErrorCode>
@@ -62,251 +72,64 @@ class FalloutHandlerTest {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
- private String falloutHandlerResponse = """<workflow:FalloutHandlerResponse xmlns:workflow="http://org.onap/so/workflow/schema/v1">
+ private String falloutHandlerResponse = """<workflow:FalloutHandlerResponse xmlns:workflow="http://org.onap/so/workflow/schema/v1">
<workflow:out>Fallout Handler Failed</workflow:out>
</workflow:FalloutHandlerResponse>"""
- @Test
- public void testPreProcessRequest() {
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- when(mockExecution.getVariable("FalloutHandlerRequest")).thenReturn(falloutHandlerRequest)
- when(mockExecution.getVariable("mso.adapters.db.auth")).thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C");
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.preProcessRequest(mockExecution)
-
- /* Initialize all the process request variables in this block */
- verify(mockExecution).setVariable("prefix","FH_")
- //verify(mockExecution).setVariable("getLayer3ServiceDetailsV1Response","")
+ @Test
+ public void testPreProcessRequest() {
- //These variables are form the input Message to the BPMN
- verify(mockExecution).setVariable("FH_request_id","")
- verify(mockExecution).setVariable("FH_request_action","")
- verify(mockExecution).setVariable("FH_notification-url","")
- verify(mockExecution).setVariable("FH_mso-bpel-name","")
- verify(mockExecution).setVariable("FH_ErrorCode", "")
- verify(mockExecution).setVariable("FH_ErrorMessage", "")
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- verify(mockExecution).setVariable("FH_notification-url-Ok", false)
- verify(mockExecution).setVariable("FH_request_id-Ok", false)
+ when(mockExecution.getVariable("FalloutHandlerRequest")).thenReturn(falloutHandlerRequest)
- //These variables are for Get Mso Aai Password Adapter
- verify(mockExecution).setVariable("FH_deliveryStatus", true)
+ falloutHandler.preProcessRequest(mockExecution)
- //update Response Status to pending ...Adapter variables
- verify(mockExecution).setVariable("FH_updateResponseStatusPayload", null)
- verify(mockExecution).setVariable("FH_updateResponseStatusResponse", null)
+ verify(mockExecution).setVariable("FH_success", true)
+ verify(mockExecution).setVariable("FH_request_id","uCPE1020_STUW105_5002")
+ verify(mockExecution).setVariable("FH_ErrorCode","Some Error Code - Fallout Handler")
+ verify(mockExecution).setVariable("FH_ErrorMessage","Some Error Message - Fallout Handler")
+ }
- //update Request Gamma ...Adapter variables
- verify(mockExecution).setVariable("FH_updateRequestGammaPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestGammaResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestGammaResponseCode", null)
+ @Test
+ public void testpostProcessResponse(){
- //update Request Infra ...Adapter variables
- verify(mockExecution).setVariable("FH_updateRequestInfraPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestInfraResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestInfraResponseCode", null)
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- //assign False to success variable
- verify(mockExecution).setVariable("FH_success", true)
+ when(mockExecution.getVariable("FH_success")).thenReturn(false)
- //Set notify status to Failed variable
- verify(mockExecution).setVariable("FH_NOTIFY_STATUS", "SUCCESS")
+ falloutHandler.postProcessResponse(mockExecution)
- //Set DB update variable
- verify(mockExecution).setVariable("FH_updateRequestPayload", "")
- verify(mockExecution).setVariable("FH_updateRequestResponse", null)
- verify(mockExecution).setVariable("FH_updateRequestResponseCode", null)
+ // Capture the arguments to setVariable
+ ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
+ ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
- //Auth variables
- verify(mockExecution).setVariable("BasicAuthHeaderValue","")
+ verify(mockExecution, times(4)).setVariable(captor1.capture(), captor2.capture())
+ List<String> arg2List = captor2.getAllValues()
+ String payloadResponseActual = arg2List.get(1)
- //Response variables
- verify(mockExecution).setVariable("FalloutHandlerResponse","")
- verify(mockExecution).setVariable("FH_ErrorResponse", null)
- verify(mockExecution).setVariable("FH_ResponseCode", "")
+ assertEquals(falloutHandlerResponse.replaceAll("\\s+", ""), payloadResponseActual.replaceAll("\\s+", ""))
- verify(mockExecution).setVariable("FH_request_id-Ok",true)
- verify(mockExecution).setVariable("FH_request_id","uCPE1020_STUW105_5002")
- verify(mockExecution).setVariable("FH_request_action","Layer3ServiceActivateRequest")
- verify(mockExecution).setVariable("FH_source","OMX")
- verify(mockExecution).setVariable("FH_ErrorCode","Some Error Code - Fallout Handler")
- verify(mockExecution).setVariable("FH_ErrorMessage","Some Error Message - Fallout Handler")
+ verify(mockExecution).setVariable("FH_ResponseCode","500")
+ }
- }
- @Test
- public void testpostProcessResponse(){
+ @Test
+ public void testUpdateInfraRequestDB(){
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
+ when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
+ when(falloutHandler.getDbClient()).thenReturn(requestsDbClient)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("FH_success")).thenReturn(false)
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.postProcessResponse(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(4)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadResponseActual = arg2List.get(1)
-
- assertEquals(falloutHandlerResponse.replaceAll("\\s+", ""), payloadResponseActual.replaceAll("\\s+", ""))
-
- verify(mockExecution).setVariable("FH_ResponseCode","500")
- }
-
- private String updateRequestPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>ErrorMessage</finalErrorMessage>
- <finalErrorCode>ErrorCode</finalErrorCode>
- <status>FAILED</status>
- <responseStatus>NotifyStatus</responseStatus>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
- when(mockExecution.getVariable("FH_ErrorCode")).thenReturn("ErrorCode")
- when(mockExecution.getVariable("FH_NOTIFY_STATUS")).thenReturn("NotifyStatus")
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
- private String updateRequestInfraPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateInfraRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <statusMessage>ErrorMessage</statusMessage>
- <requestStatus>FAILED</requestStatus>
- <progress>100</progress>
- </req:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestInfraPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestInfraPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestInfraPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
- private String updateRequestGammaPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateRequest>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <finalErrorMessage>ErrorMessage</finalErrorMessage>
- <finalErrorCode>ErrorCode</finalErrorCode>
- <status>FAILED</status>
- </req:updateRequest>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateRequestGammaPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
- when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage")
- when(mockExecution.getVariable("FH_ErrorCode")).thenReturn("ErrorCode")
- when(mockExecution.getVariable("mso.default.adapter.namespace")).thenReturn("http://org.onap.so");
-
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateRequestGammaPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadRequestActual = arg2List.get(0)
-
- assertEquals(updateRequestGammaPayload.replaceAll("\\s+", ""), payloadRequestActual.replaceAll("\\s+", ""))
- }
-
-
- String updateResponseStatusPayload = """
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.onap.so/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <req:updateResponseStatus>
- <requestId>testReqId</requestId>
- <lastModifiedBy>BPEL</lastModifiedBy>
- <responseStatus>SENDING_FINAL_NOTIFY</responseStatus>
- </req:updateResponseStatus>
- </soapenv:Body>
- </soapenv:Envelope>
- """
-
- @Test
- public void testupdateResponseStatusPayload(){
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId")
+ falloutHandler.updateInfraRequestDB(mockExecution)
- FalloutHandler falloutHandler = new FalloutHandler()
- falloutHandler.updateResponseStatusPayload(mockExecution)
-
- // Capture the arguments to setVariable
- ArgumentCaptor<String> captor1 = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor<String> captor2 = ArgumentCaptor.forClass(String.class);
-
- verify(mockExecution, times(1)).setVariable(captor1.capture(), captor2.capture())
- List<String> arg2List = captor2.getAllValues()
- String payloadResponseActual = arg2List.get(0)
-
- assertEquals(updateResponseStatusPayload.replaceAll("\\s+", ""), payloadResponseActual.replaceAll("\\s+", ""))
- }
+ InfraActiveRequests infraRequest = new InfraActiveRequests();
+ infraRequest.setLastModifiedBy("BPMN")
+ infraRequest.setStatusMessage("ErrorMessage")
+ infraRequest.setRequestStatus("FAILED")
+ infraRequest.setProgress(100)
+ verify(requestsDbClient, times(1)).updateInfraActiveRequests(infraRequest, null, null)
+ }
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy
index de44caa120..525307a5df 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy
@@ -1,22 +1,22 @@
-/*-
- * ============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=========================================================
- */
+/*-
+ * ============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.bpmn.common.scripts
@@ -32,6 +32,7 @@ import org.junit.runner.RunWith
import org.mockito.junit.MockitoJUnitRunner
import org.onap.aai.domain.yang.GenericVnf
import org.onap.so.bpmn.mock.FileUtil
+import org.onap.so.client.HttpClient
import org.onap.so.client.aai.AAIObjectPlurals
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
@@ -47,54 +48,56 @@ abstract class MsoGroovyTest {
@Rule
public ExpectedException thrown = ExpectedException.none()
- protected ExecutionEntity mockExecution
- protected AAIResourcesClient client
+ protected ExecutionEntity mockExecution
+ protected AAIResourcesClient client
protected AllottedResourceUtils allottedResourceUtils_MOCK
- protected final String SEARCH_RESULT_AAI_WITH_RESULTDATA =
- FileUtil.readResourceFile("__files/aai/searchResults.json")
- protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString();
-
- protected void init(String procName){
- mockExecution = setupMock(procName)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- client = mock(AAIResourcesClient.class)
- }
-
- protected ExecutionEntity setupMock(String procName) {
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn(procName)
-
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName)
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
-
- ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
-
- return mockExecution
- }
-
- protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) {
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
-
- when(mockExecution.getVariable("prefix")).thenReturn(prefix)
-
- ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class)
- RepositoryService repositoryService = mock(RepositoryService.class)
- ProcessDefinition processDefinition = mock(ProcessDefinition.class)
-
- when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices)
- when(processEngineServices.getRepositoryService()).thenReturn(repositoryService)
- when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition)
- when(processDefinition.getKey()).thenReturn(procName)
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- return mockExecution
- }
-
+ protected final String SEARCH_RESULT_AAI_WITH_RESULTDATA =
+ FileUtil.readResourceFile("__files/aai/searchResults.json")
+ protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString();
+
+ protected void init(String procName){
+ mockExecution = setupMock(procName)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ client = mock(AAIResourcesClient.class)
+ }
+
+ protected ExecutionEntity setupMock(String procName) {
+ ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
+ when(mockProcessDefinition.getKey()).thenReturn(procName)
+
+ RepositoryService mockRepositoryService = mock(RepositoryService.class)
+ when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
+ when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName)
+ when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
+
+ ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
+ when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
+
+ HttpClient httpClient = mock(HttpClient.class)
+
+ return mockExecution
+ }
+
+ protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) {
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+
+ when(mockExecution.getVariable("prefix")).thenReturn(prefix)
+
+ ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class)
+ RepositoryService repositoryService = mock(RepositoryService.class)
+ ProcessDefinition processDefinition = mock(ProcessDefinition.class)
+
+ when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices)
+ when(processEngineServices.getRepositoryService()).thenReturn(repositoryService)
+ when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition)
+ when(processDefinition.getKey()).thenReturn(procName)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ return mockExecution
+ }
+
protected <T> Optional<T> getAAIObjectFromJson(Class<T> clazz , String file){
String json = FileUtil.readResourceFile(file)
AAIResultWrapper resultWrapper = new AAIResultWrapper(json)
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java
index e9d8a5dee9..c421a67e7b 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java
@@ -26,7 +26,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.assertj.core.util.Arrays;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl;
import org.junit.Before;
@@ -65,9 +64,6 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.BBObjectNotFoundException;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
-import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoAllottedResource;
-import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy;
public class BuildingBlockTestDataSetup {
private int collectionCounter;
@@ -80,7 +76,6 @@ public class BuildingBlockTestDataSetup {
private int pnfCounter;
private int projectCounter;
private int serviceInstanceCounter;
- private int serviceProxyCounter;
private int serviceSubscriptionCounter;
private int vfModuleCounter;
private int volumeGroupCounter;
@@ -112,7 +107,6 @@ public class BuildingBlockTestDataSetup {
pnfCounter = 0;
projectCounter = 0;
serviceInstanceCounter = 0;
- serviceProxyCounter = 0;
serviceSubscriptionCounter = 0;
vfModuleCounter = 0;
volumeGroupCounter = 0;
@@ -145,14 +139,6 @@ public class BuildingBlockTestDataSetup {
return userInput;
}
- public Map<String, String> setUserInput() {
- Map<String, String> userInput = buildUserInput();
-
- gBBInput.setUserInput(userInput);
-
- return userInput;
- }
-
public RequestContext buildRequestContext() {
RequestContext requestContext = new RequestContext();
requestContext.setMsoRequestId(UUID.randomUUID().toString());
@@ -216,14 +202,6 @@ public class BuildingBlockTestDataSetup {
return orchestrationContext;
}
- public OrchestrationContext setOrchestrationContext() {
- OrchestrationContext orchestrationContext = buildOrchestrationContext();
-
- gBBInput.setOrchContext(orchestrationContext);
-
- return orchestrationContext;
- }
-
public Collection buildCollection() {
collectionCounter++;
@@ -350,7 +328,7 @@ public class BuildingBlockTestDataSetup {
Collection collection = new Collection();
collection.setId("testId");
- ServiceInstance serviceInstance = null;
+ ServiceInstance serviceInstance;
try {
serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
@@ -363,30 +341,6 @@ public class BuildingBlockTestDataSetup {
return collection;
}
- public InstanceGroup setInstanceGroup() {
- InstanceGroup instanceGroup = new InstanceGroup();
- instanceGroup.setId("testId");
- instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction");
-
- Collection collection = null;
-
- try {
- ServiceInstance serviceInstance =
- extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- collection = serviceInstance.getCollection();
-
- if (collection == null) {
- collection = setCollection();
- }
- } catch (BBObjectNotFoundException e) {
- collection = setCollection();
- }
-
- collection.setInstanceGroup(instanceGroup);
-
- return instanceGroup;
- }
-
public VpnBinding buildVpnBinding() {
vpnBindingCounter++;
@@ -398,21 +352,6 @@ public class BuildingBlockTestDataSetup {
return vpnBinding;
}
- public VpnBinding setVpnBinding() {
- VpnBinding vpnBinding = buildVpnBinding();
-
- Customer customer = gBBInput.getCustomer();
-
- if (customer == null) {
- customer = buildCustomer();
- }
-
- customer.getVpnBindings().add(vpnBinding);
- lookupKeyMap.put(ResourceKey.VPN_ID, vpnBinding.getVpnId());
-
- return vpnBinding;
- }
-
public InstanceGroup buildInstanceGroup() {
instanceGroupCounter++;
@@ -529,7 +468,7 @@ public class BuildingBlockTestDataSetup {
public VfModule setVfModule() {
VfModule vfModule = buildVfModule();
- GenericVnf genericVnf = null;
+ GenericVnf genericVnf;
try {
genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
@@ -582,8 +521,6 @@ public class BuildingBlockTestDataSetup {
}
public ServiceProxy buildServiceProxy() {
- serviceProxyCounter++;
-
ServiceProxy serviceProxy = new ServiceProxy();
serviceProxy.setServiceInstance(buildServiceInstance());
serviceProxy.getServiceInstance().getVnfs().add(buildGenericVnf());
@@ -617,86 +554,4 @@ public class BuildingBlockTestDataSetup {
return vpnBondingLink;
}
-
- public VpnBondingLink setVpnBondingLink() {
- VpnBondingLink vpnBondingLink = buildVpnBondingLink();
-
- ServiceInstance serviceInstance = null;
-
- try {
- serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- } catch (BBObjectNotFoundException e) {
- serviceInstance = setServiceInstance();
- }
-
- serviceInstance.getVpnBondingLinks().add(vpnBondingLink);
- lookupKeyMap.put(ResourceKey.VPN_BONDING_LINK_ID, vpnBondingLink.getVpnBondingLinkId());
-
-
- return vpnBondingLink;
- }
-
- public Customer setAvpnCustomer() {
- Customer customer = buildCustomer();
-
- gBBInput.setCustomer(customer);
-
- return customer;
- }
-
- public ServiceProxy setServiceProxy(String uniqueIdentifier, String type) {
- ServiceProxy serviceProxy = new ServiceProxy();
- serviceProxy.setId("testProxyId" + uniqueIdentifier);
- serviceProxy.setType(type);
-
- ModelInfoServiceProxy modelInfo = new ModelInfoServiceProxy();
- modelInfo.setModelInvariantUuid("testProxyModelInvariantUuid" + uniqueIdentifier);
- modelInfo.setModelName("testProxyModelName" + uniqueIdentifier);
- modelInfo.setModelUuid("testProxyModelUuid" + uniqueIdentifier);
- modelInfo.setModelVersion("testProxyModelVersion" + uniqueIdentifier);
- modelInfo.setModelInstanceName("testProxyInstanceName" + uniqueIdentifier);
-
- serviceProxy.setModelInfoServiceProxy(modelInfo);
-
- return serviceProxy;
- }
-
- public AllottedResource setAllottedResource(String uniqueIdentifier) {
- AllottedResource ar = new AllottedResource();
- ar.setId("testAllottedResourceId" + uniqueIdentifier);
-
- ModelInfoAllottedResource modelInfo = new ModelInfoAllottedResource();
- modelInfo.setModelInvariantUuid("testAllottedModelInvariantUuid" + uniqueIdentifier);
- modelInfo.setModelName("testAllottedModelName" + uniqueIdentifier);
- modelInfo.setModelUuid("testAllottedModelUuid" + uniqueIdentifier);
- modelInfo.setModelVersion("testAllottedModelVersion" + uniqueIdentifier);
- modelInfo.setModelInstanceName("testAllottedInstanceName" + uniqueIdentifier);
-
- ar.setModelInfoAllottedResource(modelInfo);
-
- return ar;
- }
-
- public Configuration setConfiguration() {
- Configuration config = new Configuration();
- config.setConfigurationId("testConfigurationId");
- ModelInfoConfiguration modelInfoConfig = new ModelInfoConfiguration();
- modelInfoConfig.setModelCustomizationId("modelCustomizationId");
- modelInfoConfig.setModelVersionId("modelVersionId");
- modelInfoConfig.setModelInvariantId("modelInvariantId");
- modelInfoConfig.setPolicyName("policyName");
- config.setModelInfoConfiguration(modelInfoConfig);
-
- List<Configuration> configurations = new ArrayList<>();
- configurations.add(config);
- ServiceInstance serviceInstance = new ServiceInstance();
- try {
- serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- } catch (BBObjectNotFoundException e) {
- serviceInstance = setServiceInstance();
- }
- lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, "testConfigurationId");
- serviceInstance.setConfigurations(configurations);
- return config;
- }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/SerializableChecker.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/SerializableChecker.java
deleted file mode 100644
index 47ddea1b4f..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/SerializableChecker.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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;
-
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public final class SerializableChecker {
- public static class SerializationFailure {
- private final String mContainingClass;
- private final String mMemberName;
-
- public SerializationFailure(String inNonSerializableClass, String inMemberName) {
- mContainingClass = inNonSerializableClass;
- mMemberName = inMemberName;
- }
-
- public String getContainingClass() {
- return mContainingClass;
- }
-
- public String getMemberName() {
- return mMemberName;
- }
-
- public String getBadMemberString() {
- if (mMemberName == null)
- return mContainingClass;
- return mContainingClass + "." + mMemberName;
- }
-
- @Override
- public String toString() {
- return "SerializationFailure [mNonSerializableClass=" + mContainingClass + ", mMemberName=" + mMemberName
- + "]";
- }
- }
-
- private static class SerializationCheckerData {
- private Set<Class<?>> mSerializableClasses;
-
- SerializationCheckerData() {
- mSerializableClasses = new HashSet<Class<?>>();
- }
-
- boolean isAlreadyChecked(Class<?> inClass) {
- return mSerializableClasses.contains(inClass);
- }
-
- void addSerializableClass(Class<?> inClass) {
- mSerializableClasses.add(inClass);
- }
- }
-
- private SerializableChecker() {}
-
- public static SerializationFailure isFullySerializable(Class<?> inClass) {
- if (!isSerializable(inClass))
- return new SerializationFailure(inClass.getName(), null);
-
- return isFullySerializable(inClass, new SerializationCheckerData());
- }
-
- private static SerializationFailure isFullySerializable(Class<?> inClass,
- SerializationCheckerData inSerializationCheckerData) {
- for (Field field : declaredFields(inClass)) {
- Class<?> fieldDeclaringClass = field.getType();
-
- if (field.getType() == Object.class)
- continue;
-
- if (Modifier.isStatic(field.getModifiers()))
- continue;
-
- if (field.isSynthetic())
- continue;
-
- if (fieldDeclaringClass.isInterface() || fieldDeclaringClass.isPrimitive())
- continue;
-
- if (Modifier.isAbstract(field.getType().getModifiers()))
- continue;
-
- if (inSerializationCheckerData.isAlreadyChecked(fieldDeclaringClass))
- continue;
-
- if (isSerializable(fieldDeclaringClass)) {
- inSerializationCheckerData.addSerializableClass(inClass);
-
- SerializationFailure failure = isFullySerializable(field.getType(), inSerializationCheckerData);
- if (failure != null)
- return failure;
- else
- continue;
- }
-
- if (Modifier.isTransient(field.getModifiers()))
- continue;
-
- return new SerializationFailure(field.getDeclaringClass().getName(), field.getName());
- }
- return null;
- }
-
- private static boolean isSerializable(Class<?> inClass) {
- Set<Class<?>> interfaces = getInterfaces(inClass);
- if (interfaces == null)
- return false;
- boolean isSerializable = interfaces.contains(Serializable.class);
- if (isSerializable)
- return true;
-
- for (Class<?> classInterface : interfaces) {
- if (isSerializable(classInterface))
- return true;
- }
-
- if (inClass.getSuperclass() != null && isSerializable(inClass.getSuperclass()))
- return true;
-
- return false;
- }
-
- private static Set<Class<?>> getInterfaces(Class<?> inFieldDeclaringClass) {
- return new HashSet<Class<?>>(Arrays.asList(inFieldDeclaringClass.getInterfaces()));
- }
-
- private static List<Field> declaredFields(Class<?> inClass) {
- List<Field> fields = new ArrayList<Field>(Arrays.asList(inClass.getDeclaredFields()));
-
- Class<?> parentClasses = inClass.getSuperclass();
-
- if (parentClasses == null)
- return fields;
- fields.addAll(declaredFields(parentClasses));
-
- return fields;
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/BuildingBlockValidatorRunnerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/BuildingBlockValidatorRunnerTest.java
index 2c0377d11c..f4fe6d7158 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/BuildingBlockValidatorRunnerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/BuildingBlockValidatorRunnerTest.java
@@ -47,7 +47,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {ValidationConfig.class})
-public class BuildingBlockValidatorRunnerTest {
+public class BuildingBlockValidatorRunnerTest extends BuildingBlockValidatorRunner {
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/WorkflowValidatorRunnerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/WorkflowValidatorRunnerTest.java
index 0143e567af..596eced1d1 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/WorkflowValidatorRunnerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/WorkflowValidatorRunnerTest.java
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {ValidationConfig.class})
-public class WorkflowValidatorRunnerTest {
+public class WorkflowValidatorRunnerTest extends WorkflowValidatorRunner {
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/MyDisabledValidator.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/MyDisabledValidator.java
index af64ed2de6..544d370a3c 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/MyDisabledValidator.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/MyDisabledValidator.java
@@ -23,8 +23,8 @@ package org.onap.so.bpmn.common.listener.validation;
import java.util.Collections;
import java.util.Optional;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.Skip;
import org.onap.so.bpmn.common.listener.validation.PreBuildingBlockValidator;
+import org.onap.so.listener.Skip;
import org.springframework.stereotype.Component;
@Component
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/ValidationConfig.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/ValidationConfig.java
index 068f433dd5..a3692a50b7 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/ValidationConfig.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/listener/validation/ValidationConfig.java
@@ -21,13 +21,13 @@
package org.onap.so.bpmn.common.listener.validation;
import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator;
-import org.onap.so.bpmn.common.listener.ListenerRunner;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.listener.ListenerRunner;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
-@ComponentScan(basePackageClasses = {ExceptionBuilder.class, ListenerRunner.class},
+@ComponentScan(basePackageClasses = {ExceptionBuilder.class, ListenerRunner.class, WorkflowValidatorRunner.class},
nameGenerator = DefaultToShortClassNameBeanNameGenerator.class)
public class ValidationConfig {
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/util/CryptoHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/util/CryptoHandlerTest.java
deleted file mode 100644
index 273e9f0e3c..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/util/CryptoHandlerTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 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.bpmn.common.util;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-
-public class CryptoHandlerTest {
- private static final String plainPswd = "mso0206";
- private CryptoHandler cryptoHandler;
- private static String encryptPwd;
-
-
- @Before
- public void setup() {
- cryptoHandler = new CryptoHandler();
- encryptPwd = cryptoHandler.encryptMsoPassword(plainPswd);
- }
-
- @Test
- @Ignore // ignored until we can mock the properties file.
- public void getMsoAaiPasswordTest() {
- assertEquals(plainPswd, cryptoHandler.getMsoAaiPassword());
- }
-
- @Test
- public void encryptMsoPasswordTest() {
- assertEquals(plainPswd, cryptoHandler.decryptMsoPassword(cryptoHandler.encryptMsoPassword(plainPswd)));
- }
-
- @Test
- public void decryptMsoPasswordTest() {
- assertEquals(plainPswd, cryptoHandler.decryptMsoPassword(encryptPwd));
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
index 7bd2beeb92..dbd5000387 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
@@ -115,6 +115,12 @@ public class ExtractPojosForBBTest extends BaseTest {
instanceGroupsPend.add(instanceGroupPend);
lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroupPend.getId());
+ List<Pnf> pnfsPend = serviceInstancePend.getPnfs();
+ Pnf pnfPend = new Pnf();
+ pnfPend.setPnfId("abc");
+ pnfsPend.add(pnfPend);
+ lookupKeyMap.put(ResourceKey.PNF, pnfPend.getPnfId());
+
customer.getServiceSubscription().getServiceInstances().add(serviceInstancePend);
gBBInput.setCustomer(customer);
@@ -143,89 +149,49 @@ public class ExtractPojosForBBTest extends BaseTest {
InstanceGroup extractInstanceGroupPend = extractPojos.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID);
assertEquals(instanceGroupPend.getId(), extractInstanceGroupPend.getId());
+
+ Pnf extractPnfPend = extractPojos.extractByKey(execution, ResourceKey.PNF);
+ assertEquals(extractPnfPend.getPnfId(), pnfPend.getPnfId());
}
@Test
public void siError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
-
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
-
- extractPojos.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.SERVICE_INSTANCE_ID);
}
@Test
public void vnfError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
-
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.GENERIC_VNF_ID);
}
@Test
public void vfModuleError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
-
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.VF_MODULE_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.VF_MODULE_ID);
}
@Test
public void configurationError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
-
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.CONFIGURATION_ID);
}
@Test
public void allotedError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
-
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.ALLOTTED_RESOURCE_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.ALLOTTED_RESOURCE_ID);
}
@Test
public void vpnBindingError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.VPN_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.VPN_ID);
}
@Test
public void vpnBondingLinkError() throws BBObjectNotFoundException {
- expectedException.expect(BBObjectNotFoundException.class);
- Customer customer = new Customer();
- customer.setServiceSubscription(new ServiceSubscription());
- ServiceInstance serviceInstance = new ServiceInstance();
- customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
- gBBInput.setCustomer(customer);
- extractPojos.extractByKey(execution, ResourceKey.VPN_BONDING_LINK_ID);
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.VPN_BONDING_LINK_ID);
+ }
+
+ @Test
+ public void pnfError() throws BBObjectNotFoundException {
+ assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey.PNF);
}
@Test
@@ -239,4 +205,19 @@ public class ExtractPojosForBBTest extends BaseTest {
ServiceInstance extractServPend = extractPojos.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
assertEquals(extractServPend.getServiceInstanceId(), serviceInstancePend.getServiceInstanceId());
}
+
+ private void assertThrowsBBObjectNotFoundForResource_WhenServiceEmpty(ResourceKey key)
+ throws BBObjectNotFoundException {
+ expectedException.expect(BBObjectNotFoundException.class);
+ setCustomerWithEmptyServiceInstance();
+ extractPojos.extractByKey(execution, key);
+ }
+
+ private void setCustomerWithEmptyServiceInstance() {
+ Customer customer = new Customer();
+ customer.setServiceSubscription(new ServiceSubscription());
+ ServiceInstance serviceInstance = new ServiceInstance();
+ customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
+ gBBInput.setCustomer(customer);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/SerializationTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/SerializationTest.java
index b970b95b97..e9e83a59ae 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/SerializationTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/SerializationTest.java
@@ -20,7 +20,6 @@
package org.onap.so.bpmn.servicedecomposition;
-import static org.junit.Assert.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.Externalizable;
import java.io.File;
@@ -33,8 +32,7 @@ import java.util.Map;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl;
import org.junit.Test;
-import org.onap.so.SerializableChecker;
-import org.onap.so.SerializableChecker.SerializationFailure;
+import static org.junit.Assert.assertEquals;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
index c90ebfb973..e0ee918ead 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
@@ -34,6 +34,7 @@ import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -45,9 +46,12 @@ import java.util.Optional;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
+import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
@@ -75,6 +79,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.entities.ServiceModel;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
@@ -85,6 +90,8 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.ServiceModelNotFoundException;
import org.onap.so.client.aai.AAICommonObjectMapperProvider;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
@@ -107,6 +114,7 @@ import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.client.RequestsDbClient;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
@@ -128,8 +136,10 @@ public class BBInputSetupTest {
protected ObjectMapper mapper = new ObjectMapper();
private static final String CLOUD_OWNER = "CloudOwner";
+ private static final String REQUEST_ID = "b20bbd26-af25-4a50-a9fe-222a3c0f9771";
@Spy
+ @InjectMocks
private BBInputSetup SPY_bbInputSetup = new BBInputSetup();
@Mock
@@ -141,6 +151,12 @@ public class BBInputSetupTest {
@Spy
private BBInputSetupMapperLayer bbInputSetupMapperLayer;
+ @Mock
+ private RequestsDbClient requestsDbClient;
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
@Before
public void setup() {
SPY_bbInputSetup.setBbInputSetupUtils(SPY_bbInputSetupUtils);
@@ -430,6 +446,8 @@ public class BBInputSetupTest {
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
String requestAction = "createInstance";
Service service = Mockito.mock(Service.class);
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
ServiceInstance serviceInstance = Mockito.mock(ServiceInstance.class);
String resourceId = "123";
String vnfType = "vnfType";
@@ -441,8 +459,9 @@ public class BBInputSetupTest {
.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("instanceId");
- doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(requestDetails, service, "bbName",
- serviceInstance, lookupKeyMap, resourceId, vnfType, null, null);
+ doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(eq(requestDetails), eq(service),
+ eq("bbName"), eq(serviceInstance), eq(lookupKeyMap), eq(resourceId), eq(vnfType), eq(null), eq(null),
+ eq(false), isA(ServiceModel.class));
doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance,
executeBB, requestAction, null);
@@ -453,19 +472,95 @@ public class BBInputSetupTest {
assertThat(actual, sameBeanAs(expected));
}
- @Test(expected = Exception.class)
+ @Test
+ public void testGetGBBALaCarteNonServiceIsReplace() throws Exception {
+ GeneralBuildingBlock expected = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"),
+ GeneralBuildingBlock.class);
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper.readValue(
+ new File(RESOURCE_PATH + "RequestDetailsInput_withRelatedInstanceList.json"), RequestDetails.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ String requestAction = "replaceInstance";
+ Service service = Mockito.mock(Service.class);
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
+ ServiceInstance serviceInstance = Mockito.mock(ServiceInstance.class);
+ String resourceId = "123";
+ String vnfType = "vnfType";
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ aaiServiceInstance.setModelVersionId("modelVersionId");
+ org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = Mockito.mock(org.onap.aai.domain.yang.CloudRegion.class);
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "instanceId");
+ doReturn(service).when(SPY_bbInputSetupUtils)
+ .getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ doReturn(service).when(SPY_bbInputSetupUtils).getCatalogServiceByModelUUID("modelUUID");
+ doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("instanceId");
+
+ doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(eq(requestDetails), eq(service),
+ eq("bbName"), eq(serviceInstance), eq(lookupKeyMap), eq(resourceId), eq(vnfType), eq(null), eq(null),
+ eq(true), isA(ServiceModel.class));
+ doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
+ doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance,
+ executeBB, requestAction, null);
+
+ GeneralBuildingBlock actual = SPY_bbInputSetup.getGBBALaCarteNonService(executeBB, requestDetails, lookupKeyMap,
+ requestAction, resourceId, vnfType);
+
+ verify(SPY_bbInputSetup, times(1)).populateObjectsOnAssignAndCreateFlows(eq(requestDetails), eq(service),
+ eq("bbName"), eq(serviceInstance), eq(lookupKeyMap), eq(resourceId), eq(vnfType), eq(null), eq(null),
+ eq(true), isA(ServiceModel.class));
+
+ verify(SPY_bbInputSetupUtils, times(1)).getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ verify(SPY_bbInputSetupUtils, times(1)).getCatalogServiceByModelUUID("modelUUID");
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
+ @Test
public void testGetGBBALaCarteNonServiceWithoutServiceModelInfo() throws Exception {
ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
ExecuteBuildingBlock.class);
RequestDetails requestDetails = mapper.readValue(
new File(RESOURCE_PATH + "RequestDetailsInput_withRelatedInstanceList.json"), RequestDetails.class);
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "si123");
String requestAction = "createInstance";
org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
aaiServiceInstance.setModelVersionId("modelVersionId");
String resourceId = "123";
String vnfType = "vnfType";
+ doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("si123");
+ doReturn(null).when(SPY_bbInputSetupUtils).getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+
+ expectedException.expect(ServiceModelNotFoundException.class);
+ expectedException.expectMessage(
+ "Related service instance model not found in MSO CatalogDB: model-version-id=modelVersionId");
+
+ SPY_bbInputSetup.getGBBALaCarteNonService(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId,
+ vnfType);
+ }
+
+ @Test
+ public void testGetGBBALaCarteNonServiceServiceInstanceNotFoundInAAI() throws Exception {
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper.readValue(
+ new File(RESOURCE_PATH + "RequestDetailsInput_withRelatedInstanceList.json"), RequestDetails.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "si123");
+ String requestAction = "createInstance";
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ aaiServiceInstance.setModelVersionId("modelVersionId");
+ String resourceId = "123";
+ String vnfType = "vnfType";
+
+ doReturn(null).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("si123");
+
+ expectedException.expect(NoServiceInstanceFoundException.class);
+ expectedException.expectMessage("Related service instance from AAI not found: service-instance-id=si123");
+
SPY_bbInputSetup.getGBBALaCarteNonService(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId,
vnfType);
}
@@ -481,6 +576,8 @@ public class BBInputSetupTest {
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
String requestAction = "createInstance";
Service service = Mockito.mock(Service.class);
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
String resourceId = "123";
ServiceInstance serviceInstance = Mockito.mock(ServiceInstance.class);
org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
@@ -492,8 +589,9 @@ public class BBInputSetupTest {
.getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("instanceId");
- doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(requestDetails, service, "bbName",
- serviceInstance, lookupKeyMap, resourceId, vnfType, null, null);
+ doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(eq(requestDetails), eq(service),
+ eq("bbName"), eq(serviceInstance), eq(lookupKeyMap), eq(resourceId), eq(vnfType), eq(null), eq(null),
+ eq(false), isA(ServiceModel.class));
doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance,
@@ -770,7 +868,10 @@ public class BBInputSetupTest {
String vnfType = "vnfType";
String resourceId = "networkId";
String productFamilyId = "productFamilyId";
+ String applicationId = "applicationId";
Service service = Mockito.mock(Service.class);
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
ServiceInstance serviceInstance = Mockito.mock(ServiceInstance.class);
RequestDetails requestDetails = Mockito.mock(RequestDetails.class);
ModelInfo modelInfo = Mockito.mock(ModelInfo.class);
@@ -793,10 +894,11 @@ public class BBInputSetupTest {
doReturn(lineOfBusiness).when(requestDetails).getLineOfBusiness();
doReturn(relatedInstanceList).when(requestDetails).getRelatedInstanceList();
doReturn(cloudConfiguration).when(requestDetails).getCloudConfiguration();
+ doReturn(applicationId).when(requestInfo).getApplicationId();
doReturn(ModelType.network).when(modelInfo).getModelType();
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType, null, null);
+ lookupKeyMap, resourceId, vnfType, null, null, false, serviceModel);
verify(SPY_bbInputSetup, times(1)).populateL3Network(instanceName, modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, null);
assertEquals("NetworkId populated", true,
@@ -804,14 +906,16 @@ public class BBInputSetupTest {
doReturn(ModelType.vnf).when(modelInfo).getModelType();
resourceId = "vnfId";
+
doNothing().when(SPY_bbInputSetup).populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness,
service, bbName, serviceInstance, lookupKeyMap, relatedInstanceList, resourceId, vnfType, null,
- productFamilyId);
+ productFamilyId, applicationId, false);
+
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType, null, null);
+ lookupKeyMap, resourceId, vnfType, null, null, false, serviceModel);
verify(SPY_bbInputSetup, times(1)).populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness,
service, bbName, serviceInstance, lookupKeyMap, relatedInstanceList, resourceId, vnfType, null,
- productFamilyId);
+ productFamilyId, applicationId, false);
assertEquals("VnfId populated", true,
lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID).equalsIgnoreCase(resourceId));
@@ -820,7 +924,7 @@ public class BBInputSetupTest {
doNothing().when(SPY_bbInputSetup).populateVolumeGroup(modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType, null, null);
+ lookupKeyMap, resourceId, vnfType, null, null, false, serviceModel);
verify(SPY_bbInputSetup, times(1)).populateVolumeGroup(modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
assertEquals("VolumeGroupId populated", true,
@@ -829,13 +933,25 @@ public class BBInputSetupTest {
doReturn(ModelType.vfModule).when(modelInfo).getModelType();
resourceId = "vfModuleId";
doNothing().when(SPY_bbInputSetup).populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap,
- resourceId, relatedInstanceList, instanceName, null, cloudConfiguration);
+ resourceId, relatedInstanceList, instanceName, null, cloudConfiguration, false, serviceModel);
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType, null, null);
+ lookupKeyMap, resourceId, vnfType, null, null, false, serviceModel);
verify(SPY_bbInputSetup, times(1)).populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap,
- resourceId, relatedInstanceList, instanceName, null, cloudConfiguration);
+ resourceId, relatedInstanceList, instanceName, null, cloudConfiguration, false, serviceModel);
assertEquals("VfModuleId populated", true,
lookupKeyMap.get(ResourceKey.VF_MODULE_ID).equalsIgnoreCase(resourceId));
+
+ String bbNameAssignVolume = AssignFlows.VOLUME_GROUP.toString();
+ doReturn(ModelType.vfModule).when(modelInfo).getModelType();
+ resourceId = "vfModuleId";
+ doNothing().when(SPY_bbInputSetup).populateVolumeGroup(modelInfo, service, bbNameAssignVolume, serviceInstance,
+ lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
+ SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbNameAssignVolume,
+ serviceInstance, lookupKeyMap, resourceId, vnfType, null, null, false, serviceModel);
+ verify(SPY_bbInputSetup, times(1)).populateVolumeGroup(modelInfo, service, bbNameAssignVolume, serviceInstance,
+ lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
+ assertEquals("VolumeGroupId populated", true,
+ lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID).equalsIgnoreCase(resourceId));
}
@Test
@@ -1294,6 +1410,7 @@ public class BBInputSetupTest {
Configuration configuration = new Configuration();
configuration.setConfigurationId("configurationId");
configuration.setConfigurationName("configurationName");
+ configuration.setConfigurationSubType("Fabric Config");
serviceInstance.getConfigurations().add(configuration);
String resourceId = "configurationId";
String vnfcName = "vnfcName";
@@ -1343,6 +1460,7 @@ public class BBInputSetupTest {
vnf.setVnfName("vnfName");
serviceInstance.getVnfs().add(vnf);
String vnfType = "vnfType";
+ String applicationId = "applicationId";
RequestDetails requestDetails =
mapper.readValue(new File(RESOURCE_PATH + "RequestDetails_CreateVnf.json"), RequestDetails.class);
@@ -1369,20 +1487,20 @@ public class BBInputSetupTest {
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(vnf, modelInfo, service);
instanceName = "vnfName2";
GenericVnf vnf2 = SPY_bbInputSetup.createGenericVnf(lookupKeyMap, instanceName, platform, lineOfBusiness,
- resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId());
+ resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId(), applicationId);
doReturn(vnf2).when(SPY_bbInputSetup).createGenericVnf(lookupKeyMap, instanceName, platform, lineOfBusiness,
- resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId());
+ resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId(), applicationId);
doNothing().when(SPY_bbInputSetup).mapNetworkCollectionInstanceGroup(vnf2, "{instanceGroupId}");
doNothing().when(SPY_bbInputSetup).mapVnfcCollectionInstanceGroup(vnf2, modelInfo, service);
@@ -1390,7 +1508,7 @@ public class BBInputSetupTest {
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
verify(SPY_bbInputSetup, times(2)).mapCatalogVnf(vnf2, modelInfo, service);
verify(SPY_bbInputSetup, times(2)).mapNetworkCollectionInstanceGroup(vnf2, "{instanceGroupId}");
verify(SPY_bbInputSetup, times(2)).mapVnfcCollectionInstanceGroup(vnf2, modelInfo, service);
@@ -1452,6 +1570,7 @@ public class BBInputSetupTest {
Platform expectedPlatform = new Platform();
LineOfBusiness expectedLineOfBusiness = new LineOfBusiness();
String resourceId = "123";
+ String applicationId = "applicationId";
doReturn(expectedPlatform).when(bbInputSetupMapperLayer).mapRequestPlatform(platform);
doReturn(expectedLineOfBusiness).when(bbInputSetupMapperLayer).mapRequestLineOfBusiness(lineOfBusiness);
org.onap.aai.domain.yang.GenericVnf vnfAAI = new org.onap.aai.domain.yang.GenericVnf();
@@ -1466,18 +1585,18 @@ public class BBInputSetupTest {
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(vnf, modelInfo, service);
instanceName = "vnfName2";
GenericVnf vnf2 = SPY_bbInputSetup.createGenericVnf(lookupKeyMap, instanceName, platform, lineOfBusiness,
- resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId());
+ resourceId, vnfType, null, requestDetails.getRequestInfo().getProductFamilyId(), applicationId);
org.onap.aai.domain.yang.GenericVnf vnf2AAI = new org.onap.aai.domain.yang.GenericVnf();
vnfAAI.setModelCustomizationId("modelCustId2");
@@ -1486,7 +1605,7 @@ public class BBInputSetupTest {
doNothing().when(SPY_bbInputSetup).mapNetworkCollectionInstanceGroup(vnf2, "{instanceGroupId}");
SPY_bbInputSetup.populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness, service, bbName,
serviceInstance, lookupKeyMap, requestDetails.getRelatedInstanceList(), resourceId, vnfType, null,
- requestDetails.getRequestInfo().getProductFamilyId());
+ requestDetails.getRequestInfo().getProductFamilyId(), applicationId, false);
verify(SPY_bbInputSetup, times(2)).mapCatalogVnf(vnf2, modelInfo, service);
verify(SPY_bbInputSetup, times(2)).mapNetworkCollectionInstanceGroup(vnf2, "{instanceGroupId}");
verify(SPY_bbInputSetup, times(1)).mapVnfcCollectionInstanceGroup(vnf2, modelInfo, service);
@@ -1867,6 +1986,7 @@ public class BBInputSetupTest {
String serviceInstanceId = "serviceInstanceId";
String networkId = "networkId";
String vnfId = "vnfId";
+ String pnfId = "pnfId";
String vfModuleId = "vfModuleId";
String volumeGroupId = "volumeGroupId";
String configurationId = "configurationId";
@@ -1875,6 +1995,7 @@ public class BBInputSetupTest {
expected.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstanceId);
expected.put(ResourceKey.NETWORK_ID, networkId);
expected.put(ResourceKey.GENERIC_VNF_ID, vnfId);
+ expected.put(ResourceKey.PNF, pnfId);
expected.put(ResourceKey.VF_MODULE_ID, vfModuleId);
expected.put(ResourceKey.VOLUME_GROUP_ID, volumeGroupId);
expected.put(ResourceKey.CONFIGURATION_ID, configurationId);
@@ -1884,6 +2005,7 @@ public class BBInputSetupTest {
workflowResourceIds.setServiceInstanceId(serviceInstanceId);
workflowResourceIds.setNetworkId(networkId);
workflowResourceIds.setVnfId(vnfId);
+ workflowResourceIds.setPnfId(pnfId);
workflowResourceIds.setVfModuleId(vfModuleId);
workflowResourceIds.setVolumeGroupId(volumeGroupId);
workflowResourceIds.setConfigurationId(configurationId);
@@ -1922,7 +2044,6 @@ public class BBInputSetupTest {
configResourceKeys.setVfModuleCustomizationUUID("vfModuleCustomizationUUID");
configResourceKeys.setVnfResourceCustomizationUUID("vnfResourceCustomizationUUID");
executeBB.setConfigurationResourceKeys(configResourceKeys);
-
executeBB.setRequestDetails(requestDetails);
doReturn(gBB).when(SPY_bbInputSetup).getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap,
requestAction, lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
@@ -1948,7 +2069,7 @@ public class BBInputSetupTest {
isA(org.onap.so.serviceinstancebeans.Platform.class),
isA(org.onap.so.serviceinstancebeans.LineOfBusiness.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), any(), any(String.class), any(String.class), any(),
- any(String.class));
+ any(String.class), any(String.class), Mockito.anyBoolean());
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VF_MODULE.toString());
@@ -1956,7 +2077,7 @@ public class BBInputSetupTest {
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(1)).populateVfModule(isA(ModelInfo.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), any(String.class), any(), any(String.class), any(),
- isA(CloudConfiguration.class));
+ isA(CloudConfiguration.class), Mockito.anyBoolean(), isA(ServiceModel.class));
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VOLUME_GROUP.toString());
@@ -2207,7 +2328,6 @@ public class BBInputSetupTest {
Service service = Mockito.mock(Service.class);
String requestAction = "createInstance";
-
executeBB.setRequestDetails(requestDetails);
doReturn(gBB).when(SPY_bbInputSetup).getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap,
requestAction, lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
@@ -2232,7 +2352,7 @@ public class BBInputSetupTest {
isA(org.onap.so.serviceinstancebeans.Platform.class),
isA(org.onap.so.serviceinstancebeans.LineOfBusiness.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), ArgumentMatchers.isNull(), any(String.class),
- ArgumentMatchers.isNull(), any(), any(String.class));
+ ArgumentMatchers.isNull(), any(), any(String.class), any(), Mockito.anyBoolean());
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VF_MODULE.toString());
@@ -2240,7 +2360,7 @@ public class BBInputSetupTest {
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(1)).populateVfModule(isA(ModelInfo.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), any(String.class), any(), any(String.class), any(),
- isA(CloudConfiguration.class));
+ isA(CloudConfiguration.class), Mockito.anyBoolean(), isA(ServiceModel.class));
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VOLUME_GROUP.toString());
@@ -2297,7 +2417,7 @@ public class BBInputSetupTest {
isA(org.onap.so.serviceinstancebeans.Platform.class),
isA(org.onap.so.serviceinstancebeans.LineOfBusiness.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), any(), any(String.class), any(String.class), any(),
- any(String.class));
+ any(String.class), any(String.class), Mockito.anyBoolean());
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VF_MODULE.toString());
@@ -2305,7 +2425,7 @@ public class BBInputSetupTest {
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(1)).populateVfModule(isA(ModelInfo.class), isA(Service.class), any(String.class),
isA(ServiceInstance.class), any(), any(String.class), any(), any(String.class), any(),
- isA(CloudConfiguration.class));
+ isA(CloudConfiguration.class), Mockito.anyBoolean(), isA(ServiceModel.class));
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, null);
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.VOLUME_GROUP.toString());
@@ -2657,6 +2777,48 @@ public class BBInputSetupTest {
}
@Test
+ public void testGetGBBMacroExistingServiceServiceinstancenotFoundInAai() throws Exception {
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "si123");
+
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setLcpCloudRegionId("cloudRegionId");
+
+ doReturn(null).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("si123");
+
+ expectedException.expect(NoServiceInstanceFoundException.class);
+ expectedException.expectMessage("Related service instance from AAI not found: service-instance-id=si123");
+
+ SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap, "AssignVnfBB", "assign",
+ cloudConfiguration);
+ }
+
+ @Test
+ public void testGetGBBMacroExistingServiceServiceModelNotFound() throws Exception {
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "si123");
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ aaiServiceInstance.setModelVersionId("modelVersionId");
+
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setLcpCloudRegionId("cloudRegionId");
+
+ doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("si123");
+ doReturn(null).when(SPY_bbInputSetupUtils).getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+
+ expectedException.expect(ServiceModelNotFoundException.class);
+ expectedException.expectMessage(
+ "Related service instance model not found in MSO CatalogDB: model-version-id=modelVersionId");
+
+ SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap, "AssignVnfBB", "assign",
+ cloudConfiguration);
+ }
+
+ @Test
public void testGetVnfId() {
String expected = "vnfId";
ExecuteBuildingBlock executeBB = new ExecuteBuildingBlock();
@@ -2756,6 +2918,7 @@ public class BBInputSetupTest {
String platformName = "platformName";
String lineOfBusinessName = "lineOfBusinessName";
String productFamilyId = "productFamilyId";
+ String applicationId = "applicationId";
Platform platform = new Platform();
platform.setPlatformName(platformName);
LineOfBusiness lineOfBusiness = new LineOfBusiness();
@@ -2772,6 +2935,7 @@ public class BBInputSetupTest {
expected.setLineOfBusiness(lineOfBusiness);
expected.setProvStatus("PREPROV");
expected.setServiceId(productFamilyId);
+ expected.setApplicationId(applicationId);
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
List<Map<String, String>> instanceParams = new ArrayList<>();
instanceParams.add(cloudParams);
@@ -2785,14 +2949,14 @@ public class BBInputSetupTest {
doReturn(lineOfBusiness).when(bbInputSetupMapperLayer).mapRequestLineOfBusiness(requestLineOfBusiness);
GenericVnf actual = SPY_bbInputSetup.createGenericVnf(lookupKeyMap, instanceName, requestPlatform,
- requestLineOfBusiness, vnfId, vnfType, instanceParams, productFamilyId);
+ requestLineOfBusiness, vnfId, vnfType, instanceParams, productFamilyId, applicationId);
assertThat(actual, sameBeanAs(expected));
assertEquals("LookupKeyMap is populated", vnfId, lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID));
expected.getCloudParams().clear();
actual = SPY_bbInputSetup.createGenericVnf(lookupKeyMap, instanceName, requestPlatform, requestLineOfBusiness,
- vnfId, vnfType, null, productFamilyId);
+ vnfId, vnfType, null, productFamilyId, applicationId);
assertThat(actual, sameBeanAs(expected));
}
@@ -2835,6 +2999,8 @@ public class BBInputSetupTest {
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationId(vfModuleCustomizationId);
Service service = new Service();
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(service);
String bbName = AssignFlows.VF_MODULE.toString();
ServiceInstance serviceInstance = new ServiceInstance();
GenericVnf vnf = new GenericVnf();
@@ -2874,7 +3040,7 @@ public class BBInputSetupTest {
isA(Service.class), isA(String.class));
SPY_bbInputSetup.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
- relatedInstanceList, instanceName, instanceParams, cloudConfiguration);
+ relatedInstanceList, instanceName, instanceParams, cloudConfiguration, false, serviceModel);
verify(SPY_bbInputSetup, times(3)).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
isA(Service.class), isA(String.class));
@@ -2885,6 +3051,162 @@ public class BBInputSetupTest {
}
@Test
+ public void testPopulateVfModuleIsReplaceCorrectPopulationOfVfs() throws Exception {
+ String vnfId = "vnfId";
+ String vfModuleId = "vfModuleId";
+ String volumeGroupId = "volumeGroupId";
+ String vfModuleCustomizationId = "vfModuleCustomizationId";
+ ModelInfo modelInfo = new ModelInfo();
+ modelInfo.setModelCustomizationId(vfModuleCustomizationId);
+ Service currentService = new Service();
+ currentService.setModelUUID("currentUUID");
+ Service newService = new Service();
+ newService.setModelUUID("newUUID");
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(currentService);
+ serviceModel.setNewService(newService);
+ String bbName = "ActivateVfModuleBB";
+ ServiceInstance serviceInstance = new ServiceInstance();
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId(vnfId);
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId(volumeGroupId);
+ vnf.getVolumeGroups().add(volumeGroup);
+ serviceInstance.getVnfs().add(vnf);
+ VfModule vfModule1 = new VfModule();
+ vfModule1.setVfModuleId("vfModuleId1");
+ VfModule vfModule2 = new VfModule();
+ vfModule2.setVfModuleId("vfModuleId2");
+ vnf.getVfModules().add(vfModule1);
+ vnf.getVfModules().add(vfModule2);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnfId);
+ lookupKeyMap.put(ResourceKey.VF_MODULE_ID, "vfModuleId1");
+ String resourceId = vfModuleId;
+ RelatedInstanceList[] relatedInstanceList = new RelatedInstanceList[1];
+ RelatedInstanceList relatedInstanceListObj = new RelatedInstanceList();
+ RelatedInstance relatedInstance = new RelatedInstance();
+ relatedInstance.setInstanceId(vnfId);
+
+ ModelInfo vnfModelInfo = new ModelInfo();
+ vnfModelInfo.setModelCustomizationId("vnfCustomizationId");
+ vnfModelInfo.setModelType(ModelType.vnf);
+ relatedInstance.setModelInfo(vnfModelInfo);
+ relatedInstanceListObj.setRelatedInstance(relatedInstance);
+ relatedInstanceList[0] = relatedInstanceListObj;
+
+ String instanceName = "vfModuleName";
+ List<Map<String, String>> instanceParams = null;
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+
+ org.onap.aai.domain.yang.GenericVnf vnfAAI = new org.onap.aai.domain.yang.GenericVnf();
+ vnfAAI.setModelCustomizationId("vnfModelCustId");
+ org.onap.aai.domain.yang.VolumeGroup volumeGroupAAI = new org.onap.aai.domain.yang.VolumeGroup();
+ volumeGroupAAI.setModelCustomizationId(vfModuleCustomizationId);
+ org.onap.aai.domain.yang.VfModule vfModuleAAI = new org.onap.aai.domain.yang.VfModule();
+ vfModuleAAI.setModelCustomizationId(vfModuleCustomizationId);
+
+ doReturn(vnfAAI).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId());
+ doReturn(volumeGroupAAI).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(CLOUD_OWNER,
+ cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId());
+ doReturn(vfModuleAAI).when(SPY_bbInputSetupUtils).getAAIVfModule(isA(String.class), isA(String.class));
+ doNothing().when(SPY_bbInputSetup).mapCatalogVnf(isA(GenericVnf.class), isA(ModelInfo.class),
+ isA(Service.class));
+ doNothing().when(SPY_bbInputSetup).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
+ isA(Service.class), isA(String.class));
+
+ SPY_bbInputSetup.populateVfModule(modelInfo, newService, bbName, serviceInstance, lookupKeyMap, resourceId,
+ relatedInstanceList, instanceName, instanceParams, cloudConfiguration, true, serviceModel);
+
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
+ eq(currentService), eq("vnfModelCustId"));
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class), eq(newService),
+ eq("vnfCustomizationId"));
+ assertEquals("Lookup Key Map populated with VfModule Id", "vfModuleId1",
+ lookupKeyMap.get(ResourceKey.VF_MODULE_ID));
+ assertEquals("Lookup Key Map populated with VolumeGroup Id", volumeGroupId,
+ lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID));
+ }
+
+ @Test
+ public void testPopulateVfModuleIsReplace() throws Exception {
+ String vnfId = "vnfId";
+ String vfModuleId = "vfModuleId";
+ String volumeGroupId = "volumeGroupId";
+ String vfModuleCustomizationId = "vfModuleCustomizationId";
+ ModelInfo modelInfo = new ModelInfo();
+ modelInfo.setModelCustomizationId(vfModuleCustomizationId);
+ Service currentService = new Service();
+ Service newService = new Service();
+ ServiceModel serviceModel = new ServiceModel();
+ serviceModel.setCurrentService(currentService);
+ currentService.setModelUUID("currentUUID");
+ serviceModel.setNewService(newService);
+ currentService.setModelUUID("newUUID");
+ String bbName = AssignFlows.VF_MODULE.toString();
+ ServiceInstance serviceInstance = new ServiceInstance();
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId(vnfId);
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId(volumeGroupId);
+ vnf.getVolumeGroups().add(volumeGroup);
+ serviceInstance.getVnfs().add(vnf);
+ VfModule vfModule1 = new VfModule();
+ vfModule1.setVfModuleId("vfModuleId1");
+ VfModule vfModule2 = new VfModule();
+ vfModule2.setVfModuleId("vfModuleId2");
+ vnf.getVfModules().add(vfModule1);
+ vnf.getVfModules().add(vfModule2);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnfId);
+ lookupKeyMap.put(ResourceKey.VF_MODULE_ID, vfModuleId);
+ String resourceId = vfModuleId;
+ RelatedInstanceList[] relatedInstanceList = new RelatedInstanceList[1];
+ RelatedInstanceList relatedInstanceListObj = new RelatedInstanceList();
+ RelatedInstance relatedInstance = new RelatedInstance();
+ relatedInstance.setInstanceId(vnfId);
+
+ ModelInfo vnfModelInfo = new ModelInfo();
+ vnfModelInfo.setModelCustomizationId("vnfCustomizationId");
+ vnfModelInfo.setModelType(ModelType.vnf);
+ relatedInstance.setModelInfo(vnfModelInfo);
+ relatedInstanceListObj.setRelatedInstance(relatedInstance);
+ relatedInstanceList[0] = relatedInstanceListObj;
+
+ String instanceName = "vfModuleName";
+ List<Map<String, String>> instanceParams = null;
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+
+ org.onap.aai.domain.yang.GenericVnf vnfAAI = new org.onap.aai.domain.yang.GenericVnf();
+ vnfAAI.setModelCustomizationId("vnfModelCustId");
+ org.onap.aai.domain.yang.VolumeGroup volumeGroupAAI = new org.onap.aai.domain.yang.VolumeGroup();
+ volumeGroupAAI.setModelCustomizationId(vfModuleCustomizationId);
+ org.onap.aai.domain.yang.VfModule vfModuleAAI = new org.onap.aai.domain.yang.VfModule();
+ vfModuleAAI.setModelCustomizationId(vfModuleCustomizationId);
+
+ doReturn(vnfAAI).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId());
+ doReturn(volumeGroupAAI).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(CLOUD_OWNER,
+ cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId());
+ doReturn(vfModuleAAI).when(SPY_bbInputSetupUtils).getAAIVfModule(isA(String.class), isA(String.class));
+ doNothing().when(SPY_bbInputSetup).mapCatalogVnf(isA(GenericVnf.class), isA(ModelInfo.class),
+ isA(Service.class));
+ doNothing().when(SPY_bbInputSetup).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
+ isA(Service.class), isA(String.class));
+
+ SPY_bbInputSetup.populateVfModule(modelInfo, newService, bbName, serviceInstance, lookupKeyMap, resourceId,
+ relatedInstanceList, instanceName, instanceParams, cloudConfiguration, true, serviceModel);
+
+ verify(SPY_bbInputSetup, times(2)).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
+ eq(serviceModel.getCurrentService()), isA(String.class));
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(isA(VfModule.class), isA(ModelInfo.class),
+ eq(serviceModel.getNewService()), isA(String.class));
+ assertEquals("Lookup Key Map populated with VfModule Id", vfModuleId,
+ lookupKeyMap.get(ResourceKey.VF_MODULE_ID));
+ assertEquals("Lookup Key Map populated with VolumeGroup Id", volumeGroupId,
+ lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID));
+ }
+
+ @Test
public void testGettingVnfcToConfiguration() throws Exception {
String vnfcName = "vnfcName";
@@ -2901,6 +3223,4 @@ public class BBInputSetupTest {
vnfc = SPY_bbInputSetup.getVnfcToConfiguration(vnfcName);
Assert.assertNotNull(vnfc);
}
-
-
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
index 7780837714..3fdbf39756 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.servicedecomposition.tasks;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
@@ -480,7 +481,9 @@ public class BBInputSetupUtilsTest {
@Test
public void testGetOptionalAAIServiceInstanceByNameException() throws Exception {
- expectedException.expect(Exception.class);
+ expectedException.expect(MultipleObjectsFoundException.class);
+ expectedException.expectMessage(containsString(
+ "Multiple service instances found for customer-id: globalCustomerId, service-type: serviceType and service-instance-name: serviceInstanceId."));
String globalCustomerId = "globalCustomerId";
String serviceType = "serviceType";
@@ -628,7 +631,9 @@ public class BBInputSetupUtilsTest {
@Test
public void getRelatedNetworkByNameFromServiceInstanceMultipleNetworksExceptionTest() throws Exception {
- expectedException.expect(Exception.class);
+ expectedException.expect(MultipleObjectsFoundException.class);
+ expectedException.expectMessage(containsString(
+ "Multiple networks found for service-instance-id: serviceInstanceId and network-name: networkName."));
String serviceInstanceId = "serviceInstanceId";
String networkName = "networkName";
@@ -637,11 +642,12 @@ public class BBInputSetupUtilsTest {
network.setNetworkId("id123");
network.setNetworkName("name123");
- L3Networks expected = new L3Networks();
- expected.getL3Network().add(network);
- expected.getL3Network().add(network);
+ L3Networks l3Networks = new L3Networks();
+ l3Networks.getL3Network().add(network);
+ l3Networks.getL3Network().add(network);
+ Optional<L3Networks> optNetworks = Optional.of(l3Networks);
- doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class), any(AAIResourceUri.class));
+ doReturn(optNetworks).when(MOCK_aaiResourcesClient).get(eq(L3Networks.class), any(AAIResourceUri.class));
bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance(serviceInstanceId, networkName);
}
@@ -711,7 +717,9 @@ public class BBInputSetupUtilsTest {
@Test
public void getRelatedVnfByNameFromServiceInstanceMultipleVnfsExceptionTest() throws Exception {
- expectedException.expect(Exception.class);
+ expectedException.expect(MultipleObjectsFoundException.class);
+ expectedException.expectMessage(containsString(
+ "Multiple vnfs found for service-instance-id: serviceInstanceId and vnf-name: vnfName."));
String serviceInstanceId = "serviceInstanceId";
String vnfName = "vnfName";
@@ -720,11 +728,13 @@ public class BBInputSetupUtilsTest {
vnf.setVnfId("id123");
vnf.setVnfName("name123");
- GenericVnfs expectedVnf = new GenericVnfs();
- expectedVnf.getGenericVnf().add(vnf);
- expectedVnf.getGenericVnf().add(vnf);
+ GenericVnfs vnfs = new GenericVnfs();
+ vnfs.getGenericVnf().add(vnf);
+ vnfs.getGenericVnf().add(vnf);
+
+ Optional<GenericVnfs> optVnfs = Optional.of(vnfs);
- doReturn(expectedVnf).when(MOCK_aaiResourcesClient).get(eq(GenericVnfs.class), any(AAIResourceUri.class));
+ doReturn(optVnfs).when(MOCK_aaiResourcesClient).get(eq(GenericVnfs.class), any(AAIResourceUri.class));
bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(serviceInstanceId, vnfName);
}
@@ -756,7 +766,10 @@ public class BBInputSetupUtilsTest {
@Test
public void getRelatedVolumeGroupByNameFromVnfMultipleVolumeGroupsExceptionTest() throws Exception {
- expectedException.expect(Exception.class);
+ expectedException.expect(MultipleObjectsFoundException.class);
+ expectedException.expectMessage(containsString(
+ "Multiple volume-groups found for vnf-id: vnfId and volume-group-name: volumeGroupName."));
+
String vnfId = "vnfId";
String volumeGroupName = "volumeGroupName";
@@ -765,12 +778,12 @@ public class BBInputSetupUtilsTest {
volumeGroup.setVolumeGroupId("id123");
volumeGroup.setVolumeGroupName("name123");
- VolumeGroups expectedVolumeGroup = new VolumeGroups();
- expectedVolumeGroup.getVolumeGroup().add(volumeGroup);
- expectedVolumeGroup.getVolumeGroup().add(volumeGroup);
+ VolumeGroups volumeGroups = new VolumeGroups();
+ volumeGroups.getVolumeGroup().add(volumeGroup);
+ volumeGroups.getVolumeGroup().add(volumeGroup);
+ Optional<VolumeGroups> optVolumeGroups = Optional.of(volumeGroups);
- doReturn(expectedVolumeGroup).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class),
- any(AAIResourceUri.class));
+ doReturn(optVolumeGroups).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(vnfId, volumeGroupName);
}
@@ -802,12 +815,11 @@ public class BBInputSetupUtilsTest {
}
@Test
- public void getRelatedVolumeGroupByNameFromVfModuleMultipleVolumeGroupsExceptionTest() throws Exception {
+ public void getRelatedVolumeGroupFromVfModuleMultipleVolumeGroupsExceptionTest() throws Exception {
expectedException.expect(Exception.class);
String vnfId = "vnfId";
String volumeGroupId = "volumeGroupId";
- String volumeGroupName = "volumeGroupName";
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("id123");
@@ -820,6 +832,54 @@ public class BBInputSetupUtilsTest {
doReturn(expectedVolumeGroup).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class),
any(AAIResourceUri.class));
+ bbInputSetupUtils.getRelatedVolumeGroupFromVfModule(vnfId, volumeGroupId);
+ }
+
+ @Test
+ public void getRelatedVolumeGroupFromVfModuleNotFoundTest() throws Exception {
+ String vnfId = "vnfId";
+ String volumeGroupId = "volumeGroupId";
+
+ doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
+
+ Optional<VolumeGroup> actualVolumeGroup =
+ bbInputSetupUtils.getRelatedVolumeGroupFromVfModule(vnfId, volumeGroupId);
+
+ assertEquals(actualVolumeGroup, Optional.empty());
+ }
+
+ @Test
+ public void getRelatedVolumeGroupFromVfModuleTest() throws Exception {
+ Optional<VolumeGroups> expected = Optional.of(new VolumeGroups());
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("id123");
+ expected.get().getVolumeGroup().add(volumeGroup);
+ doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
+ Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupFromVfModule("id123", "id123");
+ assertEquals(actual.get().getVolumeGroupId(), expected.get().getVolumeGroup().get(0).getVolumeGroupId());
+ }
+
+ @Test
+ public void getRelatedVolumeGroupByNameFromVfModuleMultipleVolumeGroupsExceptionTest() throws Exception {
+ expectedException.expect(MultipleObjectsFoundException.class);
+ expectedException.expectMessage(containsString(
+ "Multiple voulme-groups found for vnf-id: vnfId, vf-module-id: volumeGroupId and volume-group-name: volumeGroupName."));
+ String vnfId = "vnfId";
+ String volumeGroupId = "volumeGroupId";
+ String volumeGroupName = "volumeGroupName";
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("id123");
+ volumeGroup.setVolumeGroupName("name123");
+
+ VolumeGroups volumeGroups = new VolumeGroups();
+ volumeGroups.getVolumeGroup().add(volumeGroup);
+ volumeGroups.getVolumeGroup().add(volumeGroup);
+
+ Optional<VolumeGroups> optVolumeGroups = Optional.of(volumeGroups);
+
+ doReturn(optVolumeGroups).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class));
+
bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupId, volumeGroupName);
}
@@ -837,6 +897,7 @@ public class BBInputSetupUtilsTest {
assertEquals(actualVolumeGroup, Optional.empty());
}
+
@Test
public void loadOriginalFlowExecutionPathTest() throws Exception {
@@ -867,6 +928,33 @@ public class BBInputSetupUtilsTest {
}
@Test
+ public void getRelatedConfigurationByNameFromServiceInstanceExceptionTest() throws Exception {
+ Configuration configuration = new Configuration();
+ configuration.setConfigurationId("id123");
+
+ Configurations configurations = new Configurations();
+ configurations.getConfiguration().add(configuration);
+ configurations.getConfiguration().add(configuration);
+
+ Optional<Configurations> optConfigurations = Optional.of(configurations);
+
+ doReturn(optConfigurations).when(MOCK_aaiResourcesClient).get(eq(Configurations.class),
+ any(AAIResourceUri.class));
+
+ expectedException.expect(MultipleObjectsFoundException.class);
+ this.bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("id123", "name123");
+ }
+
+ @Test
+ public void getRelatedConfigurationByNameFromServiceInstanceNotFoundTest() throws Exception {
+ doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(eq(Configurations.class),
+ any(AAIResourceUri.class));
+ Optional<Configuration> actualConfiguration =
+ bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance("id123", "name123");
+ assertEquals(actualConfiguration, Optional.empty());
+ }
+
+ @Test
public void getRelatedConfigurationByNameFromServiceInstanceTest() throws Exception {
Optional<Configurations> expected = Optional.of(new Configurations());
Configuration configuration = new Configuration();
@@ -878,4 +966,35 @@ public class BBInputSetupUtilsTest {
assertEquals(actual.get().getConfigurationId(), expected.get().getConfiguration().get(0).getConfigurationId());
}
+ @Test
+ public void existsAAIVfModuleGloballyByNameTest() throws Exception {
+ AAIResourceUri expectedUri =
+ AAIUriFactory.createNodesUri(AAIObjectPlurals.VF_MODULE).queryParam("vf-module-name", "testVfModule");
+ bbInputSetupUtils.existsAAIVfModuleGloballyByName("testVfModule");
+ verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri);
+ }
+
+ @Test
+ public void existsAAIConfigurationGloballyByNameTest() throws Exception {
+ AAIResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.CONFIGURATION)
+ .queryParam("configuration-name", "testConfig");
+ bbInputSetupUtils.existsAAIConfigurationGloballyByName("testConfig");
+ verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri);
+ }
+
+ @Test
+ public void existsAAINetworksGloballyByNameTest() throws Exception {
+ AAIResourceUri expectedUri =
+ AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", "testNetwork");
+ bbInputSetupUtils.existsAAINetworksGloballyByName("testNetwork");
+ verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri);
+ }
+
+ @Test
+ public void existsAAIVolumeGroupGloballyByNameTest() throws Exception {
+ AAIResourceUri expectedUri = AAIUriFactory.createNodesUri(AAIObjectPlurals.VOLUME_GROUP)
+ .queryParam("volume-group-name", "testVoumeGroup");
+ bbInputSetupUtils.existsAAIVolumeGroupGloballyByName("testVoumeGroup");
+ verify(MOCK_aaiResourcesClient, times(1)).exists(expectedUri);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java
index 6a48558d11..6d5ce622d9 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java
@@ -33,10 +33,11 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.utils.TargetEntity;
+import org.onap.so.utils.Components;
@RunWith(MockitoJUnitRunner.class)
public class ExecuteBuildingBlockRainyDayUnitTest {
@@ -57,7 +58,7 @@ public class ExecuteBuildingBlockRainyDayUnitTest {
@Before
public void setup() {
- exception = new WorkflowException("Test exception", 7000, "", "", TargetEntity.SDNC);
+ exception = new WorkflowException("Test exception", 7000, "", "", ONAPComponents.SDNC);
noExtSystemErrorSourceException =
new WorkflowException("Test exception without extsystemErrorSource", 7000, "", "");
@@ -75,7 +76,7 @@ public class ExecuteBuildingBlockRainyDayUnitTest {
execution.setVariable("isRollback", false);
execution.setVariable("WorkflowException", exception);
executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
- request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+ request.setExtSystemErrorSource(ONAPComponents.SDNC.toString());
verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
}
@@ -87,42 +88,42 @@ public class ExecuteBuildingBlockRainyDayUnitTest {
execution.setVariable("isRollback", true);
execution.setVariable("WorkflowException", exception);
executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
- request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+ request.setExtSystemErrorSource(ONAPComponents.SDNC.toString());
verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
}
@Test
- public void updateExtSystemErrorSourceisRollbackTargetEntityNullTest() {
+ public void updateExtSystemErrorSourceisRollbackONAPComponentsNullTest() {
doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
execution.setVariable("isRollback", true);
execution.setVariable("WorkflowException", noExtSystemErrorSourceException);
executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
- request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ request.setExtSystemErrorSource(Components.UNKNOWN.toString());
verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
}
@Test
- public void updateExtSystemErrorSourceTargetEntityNullTest() {
+ public void updateExtSystemErrorSourceONAPComponentsNullTest() {
doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
execution.setVariable("isRollback", false);
execution.setVariable("WorkflowException", noExtSystemErrorSourceException);
executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
- request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ request.setExtSystemErrorSource(Components.UNKNOWN.toString());
verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
}
@Test
- public void updateExtSystemErrorSourceTargetEntityisRollbackNullTest() {
+ public void updateExtSystemErrorSourceONAPComponentsisRollbackNullTest() {
doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
executionNullisRollback.setVariable("WorkflowException", exception);
executeBuildingBlockRainyDay.updateExtSystemErrorSource(executionNullisRollback);
- request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+ request.setExtSystemErrorSource(ONAPComponents.SDNC.toString());
verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundExceptionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundExceptionTest.java
new file mode 100644
index 0000000000..1ab1d7aa9a
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/ServiceModelNotFoundExceptionTest.java
@@ -0,0 +1,19 @@
+package org.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+
+public class ServiceModelNotFoundExceptionTest {
+
+ @Test
+ public void testRequestValidationException() {
+
+ ServiceModelNotFoundException serviceModelNotFoundException = new ServiceModelNotFoundException();
+ Assert.assertNull(serviceModelNotFoundException.getMessage());
+
+ serviceModelNotFoundException = new ServiceModelNotFoundException("test message");
+ Assert.assertEquals("test message", serviceModelNotFoundException.getMessage());
+
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java
index b109ae258d..5baafbba67 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java
@@ -39,7 +39,7 @@ import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
@RunWith(MockitoJUnitRunner.class)
public class ExceptionBuilderUnitTest {
@@ -67,12 +67,12 @@ public class ExceptionBuilderUnitTest {
String expectedErrorMessage =
"Exception in org.onap.so.client.exception.ExceptionBuilder.buildAndThrowWorkflowException failure message";
doNothing().when(exceptionBuilder).buildAndThrowWorkflowException(execution, 7000, expectedErrorMessage,
- TargetEntity.SDNC);
+ ONAPComponents.SDNC);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, TargetEntity.SDNC);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, ONAPComponents.SDNC);
verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(execution, 7000, expectedErrorMessage,
- TargetEntity.SDNC);
+ ONAPComponents.SDNC);
}
@Test
@@ -80,12 +80,12 @@ public class ExceptionBuilderUnitTest {
String expectedErrorMessage =
"Exception in org.onap.so.client.exception.ExceptionBuilder.buildAndThrowWorkflowException failure message";
doNothing().when(exceptionBuilder).buildAndThrowWorkflowException(buildingBlockExecution, 7000,
- expectedErrorMessage, TargetEntity.SDNC);
+ expectedErrorMessage, ONAPComponents.SDNC);
- exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 7000, e, TargetEntity.SDNC);
+ exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 7000, e, ONAPComponents.SDNC);
verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(buildingBlockExecution, 7000,
- expectedErrorMessage, TargetEntity.SDNC);
+ expectedErrorMessage, ONAPComponents.SDNC);
}
@Test
@@ -93,6 +93,6 @@ public class ExceptionBuilderUnitTest {
doReturn("Process key").when(exceptionBuilder).getProcessKey(execution);
thrown.expect(BpmnError.class);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.SDNC);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), ONAPComponents.SDNC);
}
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/Client/InfraActiveRequestExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/Client/InfraActiveRequestExpected.json
index fe58357d53..45812c1c45 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/Client/InfraActiveRequestExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/Client/InfraActiveRequestExpected.json
@@ -1,7 +1,5 @@
{
"requestId": "00032ab7-3fb3-42e5-965d-8ea592502017",
- "clientRequestId": "00032ab7-3fb3-42e5-965d-8ea592502016",
- "action": "deleteInstance",
"requestStatus": "COMPLETE",
"statusMessage": "Vf Module has been deleted successfully.",
"progress": 100,
@@ -12,23 +10,19 @@
"vnfName": null,
"vnfType": null,
"serviceType": null,
- "aicNodeClli": null,
"tenantId": "6accefef3cb442ff9e644d589fb04107",
- "provStatus": null,
"vnfParams": null,
"vnfOutputs": null,
"requestBody": "{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"vSAMP10aDEV::base::module-0\"},\"requestInfo\":{\"source\":\"VID\"},\"cloudConfiguration\":{\"tenantId\":\"6accefef3cb442ff9e644d589fb04107\",\"lcpCloudRegionId\":\"mtn6\"}}",
"responseBody": null,
"lastModifiedBy": "BPMN",
"modifyTime": 1482451228000,
- "requestType": null,
"volumeGroupId": null,
"volumeGroupName": null,
"vfModuleId": "c7d527b1-7a91-49fd-b97d-1c8c0f4a7992",
"vfModuleName": null,
"vfModuleModelName": "vSAMP10aDEV::base::module-0",
- "aaiServiceId": null,
- "aicCloudRegion": "mtn6",
+ "cloudRegion": "mtn6",
"callBackUrl": null,
"correlator": null,
"serviceInstanceId": "e3b5744d-2ad1-4cdd-8390-c999a38829bc",
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/InfraActiveRequestExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/InfraActiveRequestExpected.json
index dd4dc65190..b70fd4c42a 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/InfraActiveRequestExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/InfraActiveRequestExpected.json
@@ -1,7 +1,5 @@
{
"requestId": "00032ab7-3fb3-42e5-965d-8ea592502017",
- "clientRequestId": "00032ab7-3fb3-42e5-965d-8ea592502016",
- "action": "deleteInstance",
"requestStatus": "COMPLETE",
"statusMessage": "Vf Module has been deleted successfully.",
"progress": 100,
@@ -12,23 +10,19 @@
"vnfName": null,
"vnfType": null,
"serviceType": null,
- "aicNodeClli": null,
"tenantId": "6accefef3cb442ff9e644d589fb04107",
- "provStatus": null,
"vnfParams": null,
"vnfOutputs": null,
"requestBody": "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"vSAMP10aDEV::base::module-0\"},\"requestInfo\":{\"source\":\"VID\"},\"cloudConfiguration\":{\"tenantId\":\"6accefef3cb442ff9e644d589fb04107\",\"lcpCloudRegionId\":\"mtn6\"}}}",
"responseBody": null,
"lastModifiedBy": "BPMN",
"modifyTime": 1482451228000,
- "requestType": null,
"volumeGroupId": null,
"volumeGroupName": null,
"vfModuleId": "c7d527b1-7a91-49fd-b97d-1c8c0f4a7992",
"vfModuleName": null,
"vfModuleModelName": "vSAMP10aDEV::base::module-0",
- "aaiServiceId": null,
- "aicCloudRegion": "mtn6",
+ "cloudRegion": "mtn6",
"callBackUrl": null,
"correlator": null,
"serviceInstanceId": "e3b5744d-2ad1-4cdd-8390-c999a38829bc",
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
index 418396f290..9b32a4c446 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
@@ -69,5 +69,15 @@
}
]
},
+ "aggregateRoutes": {
+ "aggregateRoute": [
+ {
+ "routeId": "routeId",
+ "networkStartAddress": "10.80.12.0",
+ "cidrMask": "23",
+ "ipVersion": "4"
+ }
+ ]
+ },
"relationshipList": null
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
index ccefe195c9..f65fe17a2e 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
@@ -52,5 +52,13 @@
"segmentation-id": "segmentationId"
}
],
+ "aggregate-routes": [
+ {
+ "route-id": "routeId",
+ "network-start-address": "10.80.12.0",
+ "cidr-mask": "23",
+ "ip-version": "4"
+ }
+ ],
"model-info-network": null
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/response/infraActiveRequestsResponse.json b/bpmn/MSOCommonBPMN/src/test/resources/response/infraActiveRequestsResponse.json
index 9cc84f2cd4..45812c1c45 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/response/infraActiveRequestsResponse.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/response/infraActiveRequestsResponse.json
@@ -1,7 +1,5 @@
{
"requestId": "00032ab7-3fb3-42e5-965d-8ea592502017",
- "clientRequestId": "00032ab7-3fb3-42e5-965d-8ea592502016",
- "action": "deleteInstance",
"requestStatus": "COMPLETE",
"statusMessage": "Vf Module has been deleted successfully.",
"progress": 100,
@@ -12,23 +10,19 @@
"vnfName": null,
"vnfType": null,
"serviceType": null,
- "aicNodeClli": null,
"tenantId": "6accefef3cb442ff9e644d589fb04107",
- "provStatus": null,
"vnfParams": null,
"vnfOutputs": null,
"requestBody": "{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"vSAMP10aDEV::base::module-0\"},\"requestInfo\":{\"source\":\"VID\"},\"cloudConfiguration\":{\"tenantId\":\"6accefef3cb442ff9e644d589fb04107\",\"lcpCloudRegionId\":\"mtn6\"}}",
"responseBody": null,
"lastModifiedBy": "BPMN",
"modifyTime": 1482451228000,
- "requestType": null,
"volumeGroupId": null,
"volumeGroupName": null,
"vfModuleId": "c7d527b1-7a91-49fd-b97d-1c8c0f4a7992",
"vfModuleName": null,
"vfModuleModelName": "vSAMP10aDEV::base::module-0",
- "aaiServiceId": null,
- "aicCloudRegion": "mtn6",
+ "cloudRegion": "mtn6",
"callBackUrl": null,
"correlator": null,
"serviceInstanceId": "e3b5744d-2ad1-4cdd-8390-c999a38829bc",
@@ -43,4 +37,4 @@
"configurationName": null,
"operationalEnvId": null,
"operationalEnvName": null
-} \ No newline at end of file
+}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
index 21847e1c4e..f8dfad61f2 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
@@ -21,7 +21,7 @@
package org.onap.so.bpmn.core;
import java.io.Serializable;
-import org.onap.so.utils.TargetEntities;
+import org.onap.logging.filter.base.ONAPComponentsList;
/**
* An object that represents a workflow exception.
@@ -33,7 +33,7 @@ public class WorkflowException implements Serializable {
private final int errorCode;
private final String errorMessage;
private final String workStep;
- private transient TargetEntities extSystemErrorSource;
+ private ONAPComponentsList extSystemErrorSource;
/**
* Constructor
@@ -50,7 +50,7 @@ public class WorkflowException implements Serializable {
}
public WorkflowException(String processKey, int errorCode, String errorMessage,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
this.processKey = processKey;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
@@ -66,7 +66,7 @@ public class WorkflowException implements Serializable {
}
public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep,
- TargetEntities extSystemErrorSource) {
+ ONAPComponentsList extSystemErrorSource) {
this.processKey = processKey;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
@@ -102,7 +102,7 @@ public class WorkflowException implements Serializable {
return workStep;
}
- public TargetEntities getExtSystemErrorSource() {
+ public ONAPComponentsList getExtSystemErrorSource() {
return extSystemErrorSource;
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java
index 7523c378e9..d036ce5f2f 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.core.domain;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml
index 25913eabba..c3c26ef5e7 100644
--- a/bpmn/mso-infrastructure-bpmn/pom.xml
+++ b/bpmn/mso-infrastructure-bpmn/pom.xml
@@ -93,10 +93,19 @@
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
- <id>tests</id>
+ <id>tests-jar</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
@@ -295,5 +304,16 @@
<version>1.7.0</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.aaf.authz</groupId>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <version>2.1.9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</project>
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
index 5f70ab5924..3a1e126fef 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
@@ -82,7 +82,7 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
String correlationValue = messageId;
callback.handleCallback(method, message, messageEventName, messageVariable, correlationVariable,
- correlationValue, logMarker);
+ correlationValue, logMarker, null);
}
@WebMethod(operationName = "queryVnfNotification")
@@ -117,7 +117,7 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
message.setOutputs(outputs);
callback.handleCallback(method, message, messageEventName, messageVariable, correlationVariable,
- correlationValue, logMarker);
+ correlationValue, logMarker, null);
}
@WebMethod(operationName = "createVnfNotification")
@@ -150,7 +150,7 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
message.setRollback(rollback);
callback.handleCallback(method, message, messageEventName, messageVariable, correlationVariable,
- correlationValue, logMarker);
+ correlationValue, logMarker, null);
}
@WebMethod(operationName = "updateVnfNotification")
@@ -181,7 +181,7 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
message.setRollback(rollback);
callback.handleCallback(method, message, messageEventName, messageVariable, correlationVariable,
- correlationValue, logMarker);
+ correlationValue, logMarker, null);
}
@WebMethod(operationName = "deleteVnfNotification")
@@ -208,6 +208,6 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
message.setErrorMessage(errorMessage);
callback.handleCallback(method, message, messageEventName, messageVariable, correlationVariable,
- correlationValue, logMarker);
+ correlationValue, logMarker, null);
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
index ace6e1937d..4fb63651eb 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
@@ -102,7 +102,11 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, getRequestId(inputVariables));
processor.startProcess(processKey, variableMap);
WorkflowResponse response = waitForResponse(inputVariables);
- return Response.status(202).entity(response).build();
+ if (response.getMessageCode() == 500) {
+ return Response.status(500).entity(response).build();
+ } else {
+ return Response.status(202).entity(response).build();
+ }
} catch (WorkflowProcessorException e) {
WorkflowResponse response = e.getWorkflowResponse();
return Response.status(500).entity(response).build();
@@ -112,7 +116,7 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
}
}
- private WorkflowResponse waitForResponse(Map<String, Object> inputVariables) throws Exception {
+ protected WorkflowResponse waitForResponse(Map<String, Object> inputVariables) throws Exception {
String requestId = getRequestId(inputVariables);
long currentWaitTime = 0;
long waitTime = getWaitTime(inputVariables);
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
index d33e7aed0c..70365b744c 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
@@ -85,12 +85,14 @@ public class WorkflowProcessor extends ProcessEngineAwareService {
Map<String, Object> inputVariables = new HashMap<>();
@SuppressWarnings("unchecked")
Map<String, Object> vMap = (Map<String, Object>) variableMap.get("variables");
- for (Map.Entry<String, Object> entry : vMap.entrySet()) {
- String vName = entry.getKey();
- Object value = entry.getValue();
- @SuppressWarnings("unchecked")
- Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
- inputVariables.put(vName, valueMap.get("value"));
+ if (vMap != null) {
+ for (Map.Entry<String, Object> entry : vMap.entrySet()) {
+ String vName = entry.getKey();
+ Object value = entry.getValue();
+ @SuppressWarnings("unchecked")
+ Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
+ inputVariables.put(vName, valueMap.get("value"));
+ }
}
return inputVariables;
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
index bcc3739c32..6debcfbff6 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
@@ -333,8 +333,6 @@ public class WorkflowResource extends ProcessEngineAwareService {
public void run() {
setLogContext(processKey, inputVariables);
- long startTime = System.currentTimeMillis();
-
try {
RuntimeService runtimeService = getProcessEngineServices().getRuntimeService();
@@ -557,7 +555,6 @@ public class WorkflowResource extends ProcessEngineAwareService {
// TODO filter only set of variables
WorkflowResponse response = new WorkflowResponse();
- long startTime = System.currentTimeMillis();
try {
ProcessEngineServices engine = getProcessEngineServices();
List<HistoricVariableInstance> variables = engine.getHistoryService().createHistoricVariableInstanceQuery()
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutorListener.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutorListener.java
new file mode 100644
index 0000000000..94f4b313d4
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/AsyncTaskExecutorListener.java
@@ -0,0 +1,42 @@
+package org.onap.so.bpmn.core.plugins;
+
+import org.camunda.bpm.engine.RepositoryService;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.ExecutionListener;
+import org.onap.so.bpmn.common.listener.validation.WorkflowActionListenerRunner;
+import org.onap.so.spring.SpringContextHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AsyncTaskExecutorListener implements ExecutionListener {
+ private final Logger logger = LoggerFactory.getLogger(AsyncTaskExecutorListener.class);
+
+
+ private WorkflowActionListenerRunner listenerRunner;
+
+ @Override
+ public void notify(DelegateExecution execution) throws Exception {
+ if (!isBlank(execution.getCurrentActivityName())) {
+ try {
+ String id = execution.getId();
+ if (id != null) {
+ RepositoryService repositoryService = execution.getProcessEngineServices().getRepositoryService();
+ String processName = repositoryService.createProcessDefinitionQuery()
+ .processDefinitionId(execution.getProcessDefinitionId()).singleResult().getName();
+ logger.info("ProcessName : {}", processName);
+ if (processName != null) {
+ listenerRunner =
+ SpringContextHelper.getAppContext().getBean(WorkflowActionListenerRunner.class);
+ listenerRunner.executeAsyncListeners(processName, execution, ExecutionListener.EVENTNAME_END);
+ }
+ }
+ } catch (Exception e) {
+ logger.error("Error occured in executing Complete Task Listeners", e);
+ }
+ }
+ }
+
+ private boolean isBlank(Object object) {
+ return object == null || "".equals(object.toString().trim());
+ }
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
index 251464a34d..6de22825b7 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
@@ -37,8 +37,10 @@ import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl;
import org.camunda.bpm.engine.impl.pvm.process.TransitionImpl;
import org.camunda.bpm.engine.impl.util.xml.Element;
import org.camunda.bpm.engine.impl.variable.VariableDeclaration;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -50,6 +52,9 @@ import org.springframework.stereotype.Component;
@Component
public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin {
+ public static final String SERVICE_INSTANCE_ID = "ServiceInstanceId";
+ public static final String SERVICE_NAME = "ServiceName";
+
@Autowired
private LoggingParseListener loggingParseListener;
@@ -294,6 +299,13 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin {
String requestId = (String) execution.getVariable("mso-request-id");
String svcid = (String) execution.getVariable("mso-service-instance-id");
+ try {
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
+ MDC.put(SERVICE_INSTANCE_ID, svcid);
+ MDC.put(SERVICE_NAME, processName);
+ } catch (Exception e) {
+ logger.error("Error trying to add variables to MDC", e);
+ }
}
} catch (Exception e) {
logger.error("Exception occurred", e);
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
index a049f81906..03feda6d0f 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
@@ -38,9 +38,7 @@ import org.onap.so.bpmn.common.workflow.service.WorkflowMessageResource;
import org.onap.so.bpmn.common.workflow.service.WorkflowResource;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
-import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -65,7 +63,7 @@ public class CXFConfiguration {
private WorkflowAsyncResource workflowAsyncResource;
@Autowired
- private JaxRsFilterLogging jaxRsFilterLogging;
+ private SOAuditLogContainerFilter soAuditLogContainerFilter;
@Autowired
private ObjectMapper mapper;
@@ -108,7 +106,7 @@ public class CXFConfiguration {
endpoint.setServiceBeans(Arrays.<Object>asList(wmr, workflowResource, workflowAsyncResource));
endpoint.setAddress("/");
endpoint.setFeatures(Arrays.asList(createSwaggerFeature(), new LoggingFeature()));
- endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), jaxRsFilterLogging));
+ endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper), soAuditLogContainerFilter));
return endpoint.create();
}
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 093fba089d..29fc4e93fc 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
@@ -33,7 +33,7 @@ import org.camunda.bpm.engine.repository.DeploymentBuilder;
import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator;
import org.onap.so.db.catalog.beans.Workflow;
import org.onap.so.db.catalog.client.CatalogDbClient;
-import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
+import org.onap.logging.filter.spring.MDCTaskDecorator;;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -99,7 +99,7 @@ public class MSOInfrastructureApplication {
DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
deployCustomWorkflows(deploymentBuilder);
} catch (Exception e) {
- logger.warn("Unable to invoke deploymentBuilder: " + e.getMessage());
+ logger.warn("Unable to invoke deploymentBuilder ", e);
}
}
@@ -136,11 +136,11 @@ public class MSOInfrastructureApplication {
deploymentBuilder.addString(workflowName, workflowBody);
}
deploymentBuilder.enableDuplicateFiltering(true);
- deploymentBuilder.deploy();
}
+ deploymentBuilder.deploy();
}
} catch (Exception e) {
- logger.warn("Unable to deploy custom workflows, " + e.getMessage());
+ logger.warn("Unable to deploy custom workflows ", e);
}
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
deleted file mode 100644
index 1ed3214214..0000000000
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.bpmn.infrastructure;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/async/services/**", "/workflow/services/*", "/SDNCAdapterCallbackService",
- "/WorkflowMessage", "/vnfAdapterNotify", "/vnfAdapterRestNotify")
- .hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and().httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-aaf.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-aaf.yaml
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-basic.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-basic.yaml
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
index a94713e9e0..7a50e5f9d3 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
@@ -155,24 +155,11 @@ public class BPMNUtil {
}
}
- private static String getProcessInstanceId(HistoryService historyService, String processDefinitionID) {
- List<HistoricProcessInstance> historyList = historyService.createHistoricProcessInstanceQuery().list();
- String pID = null;
- for (HistoricProcessInstance hInstance : historyList) {
- if (hInstance.getProcessDefinitionKey().equals(processDefinitionID)) {
- pID = hInstance.getId();
- break;
- }
- }
- return pID;
- }
-
public static boolean isProcessInstanceFinished(ProcessEngineServices processEngineServices, String pid) {
return processEngineServices.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(pid)
.finished().count() == 1 ? true : false;
}
-
private static void buildVariable(String key, String value, Map<String, Object> variableValueType) {
Map<String, Object> host = new HashMap<>();
host.put("value", value);
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
index e71404a2ff..93f98a34a6 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
@@ -1384,172 +1384,6 @@ public abstract class WorkflowTest {
}
/**
- * Runs a program to inject sniro workflow messages into the test environment. A program is essentially just a list
- * of keys that identify event data to be injected, in sequence. For more details, see injectSNIROCallbacks(String
- * contentType, String messageType, String content, long timeout)
- *
- * Errors are handled with junit assertions and will cause the test to fail. NOTE: Each callback must have a
- * workflow message type associated with it.
- *
- * @param callbacks an object containing event data for the program
- * @param program the program to execute
- */
- protected void injectSNIROCallbacks(CallbackSet callbacks, String program) {
-
- String[] cmds = program.replaceAll("\\s+", "").split(",");
-
- for (String cmd : cmds) {
- String action = cmd;
- String modifier = "STD";
-
- if (cmd.contains(":")) {
- String[] parts = cmd.split(":");
- action = parts[0];
- modifier = parts[1];
- }
-
- String messageType = null;
- String content = null;
- String contentType = null;
-
- if ("STD".equals(modifier)) {
- CallbackData callbackData = callbacks.get(action);
-
- if (callbackData == null) {
- String msg = "No '" + action + "' workflow message callback is defined";
- logger.debug(msg);
- fail(msg);
- }
-
- messageType = callbackData.getMessageType();
-
- if (messageType == null || messageType.trim().equals("")) {
- String msg = "No workflow message type is defined in the '" + action + "' callback";
- logger.debug(msg);
- fail(msg);
- }
-
- content = callbackData.getContent();
- contentType = callbackData.getContentType();
- } else {
- String msg = "Invalid workflow message program modifier: '" + modifier + "'";
- logger.debug(msg);
- fail(msg);
- }
-
- if (!injectSNIROCallbacks(contentType, messageType, content, 10000)) {
- fail("Failed to inject '" + action + "' workflow message");
- }
-
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- fail("Interrupted after injection of '" + action + "' workflow message");
- }
- }
- }
-
- /**
- * Injects a sniro workflow message. The specified callback response may contain the placeholder strings
- * ((CORRELATOR)) and ((SERVICE_RESOURCE_ID)) The ((CORRELATOR)) is replaced with the actual correlator value from
- * the request. The ((SERVICE_RESOURCE_ID)) is replaced with the actual serviceResourceId value from the sniro
- * request. Currently this only works with sniro request that contain only 1 resource.
- *
- * @param contentType the HTTP contentType for the message (possibly null)
- * @param messageType the message type
- * @param content the message content (possibly null)
- * @param timeout the timeout in milliseconds
- * @return true if the message could be injected, false otherwise
- */
- protected boolean injectSNIROCallbacks(String contentType, String messageType, String content, long timeout) {
- String correlator = (String) getProcessVariable("ReceiveWorkflowMessage", messageType + "_CORRELATOR", timeout);
-
- if (correlator == null) {
- return false;
- }
- if (content != null) {
- content = content.replace("((CORRELATOR))", correlator);
- if (messageType.equalsIgnoreCase("SNIROResponse")) {
- ServiceDecomposition decomp =
- (ServiceDecomposition) getProcessVariable("Homing", "serviceDecomposition", timeout);
- List<Resource> resourceList = decomp.getServiceResources();
- if (resourceList.size() == 1) {
- String resourceId = "";
- for (Resource resource : resourceList) {
- resourceId = resource.getResourceId();
- }
- String homingList = getJsonValue(content, "solutionInfo.placementInfo");
- JSONArray placementArr = null;
- try {
- placementArr = new JSONArray(homingList);
- } catch (Exception e) {
- return false;
- }
- if (placementArr.length() == 1) {
- content = content.replace("((SERVICE_RESOURCE_ID))", resourceId);
- }
- String licenseInfoList = getJsonValue(content, "solutionInfo.licenseInfo");
- JSONArray licenseArr = null;
- try {
- licenseArr = new JSONArray(licenseInfoList);
- } catch (Exception e) {
- return false;
- }
- if (licenseArr.length() == 1) {
- content = content.replace("((SERVICE_RESOURCE_ID))", resourceId);
- }
- } else {
- try {
- String homingList = getJsonValue(content, "solutionInfo.placementInfo");
- String licenseInfoList = getJsonValue(content, "solutionInfo.licenseInfo");
- JSONArray placementArr = new JSONArray(homingList);
- JSONArray licenseArr = new JSONArray(licenseInfoList);
- for (Resource resource : resourceList) {
- String resourceModuleName = resource.getModelInfo().getModelInstanceName();
- String resourceId = resource.getResourceId();
-
- for (int i = 0; i < placementArr.length(); i++) {
- JSONObject placementObj = placementArr.getJSONObject(i);
- String placementModuleName = placementObj.getString("resourceModuleName");
- if (placementModuleName.equalsIgnoreCase(resourceModuleName)) {
- String placementString = placementObj.toString();
- placementString = placementString.replace("((SERVICE_RESOURCE_ID))", resourceId);
- JSONObject newPlacementObj = new JSONObject(placementString);
- placementArr.put(i, newPlacementObj);
- }
- }
-
- for (int i = 0; i < licenseArr.length(); i++) {
- JSONObject licenseObj = licenseArr.getJSONObject(i);
- String licenseModuleName = licenseObj.getString("resourceModuleName");
- if (licenseModuleName.equalsIgnoreCase(resourceModuleName)) {
- String licenseString = licenseObj.toString();
- licenseString = licenseString.replace("((SERVICE_RESOURCE_ID))", resourceId);
- JSONObject newLicenseObj = new JSONObject(licenseString);
- licenseArr.put(i, newLicenseObj);
- }
- }
- }
- String newPlacementInfos = placementArr.toString();
- String newLicenseInfos = licenseArr.toString();
- content = updJsonValue(content, "solutionInfo.placementInfo", newPlacementInfos);
- content = updJsonValue(content, "solutionInfo.licenseInfo", newLicenseInfos);
- } catch (Exception e) {
- return false;
- }
-
- }
- }
- }
- logger.debug("Injecting " + messageType + " message");
-
- Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content);
- logger.debug("Workflow response to {} message: {}", messageType, response);
- return true;
- }
-
-
- /**
* Wait for the process to end.
*
* @param businessKey the process business key
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImplTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImplTest.java
new file mode 100644
index 0000000000..d15d71a9e9
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImplTest.java
@@ -0,0 +1,118 @@
+package org.onap.so.bpmn.common.workflow.service;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.common.adapter.vnf.CreateVnfNotification;
+import org.onap.so.bpmn.common.adapter.vnf.DeleteVnfNotification;
+import org.onap.so.bpmn.common.adapter.vnf.MsoExceptionCategory;
+import org.onap.so.bpmn.common.adapter.vnf.QueryVnfNotification;
+import org.onap.so.bpmn.common.adapter.vnf.RollbackVnfNotification;
+import org.onap.so.bpmn.common.adapter.vnf.UpdateVnfNotification;
+import org.onap.so.bpmn.common.adapter.vnf.VnfRollback;
+import org.onap.so.bpmn.common.adapter.vnf.VnfStatus;
+import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackResult;
+
+@RunWith(MockitoJUnitRunner.class)
+public class VnfAdapterNotifyServiceImplTest {
+
+
+ @InjectMocks
+ @Spy
+ private VnfAdapterNotifyServiceImpl vnfAdapterNotifyServiceImpl;
+
+ @Mock
+ private CallbackHandlerService callbackHandlerService;
+
+ @Mock
+ private CallbackResult callbackResult;
+
+ protected CreateVnfNotification.Outputs outputs = new CreateVnfNotification.Outputs();
+ protected QueryVnfNotification.Outputs queryOutputs = new QueryVnfNotification.Outputs();
+ protected UpdateVnfNotification.Outputs updateOutputs = new UpdateVnfNotification.Outputs();
+
+ protected VnfRollback vnfRollback = new VnfRollback();
+
+ @Test
+ public void rollbackVnfNotificationTest() {
+ doReturn(callbackResult).when(callbackHandlerService).handleCallback(eq("rollbackVnfNotification"),
+ any(RollbackVnfNotification.class), eq("rollbackVnfNotificationCallback"),
+ eq("rollbackVnfNotificationCallback"), eq("VNFRB_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+
+ vnfAdapterNotifyServiceImpl.rollbackVnfNotification("messageId", true, MsoExceptionCategory.OPENSTACK,
+ "Error creating stack");
+
+ verify(callbackHandlerService, times(1)).handleCallback(eq("rollbackVnfNotification"),
+ any(RollbackVnfNotification.class), eq("rollbackVnfNotificationCallback"),
+ eq("rollbackVnfNotificationCallback"), eq("VNFRB_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+ }
+
+ @Test
+ public void queryVnfNotificationTest() {
+ doReturn(callbackResult).when(callbackHandlerService).handleCallback(eq("queryVnfNotification"),
+ any(QueryVnfNotification.class), eq("queryVnfNotificationCallback"), eq("queryVnfNotificationCallback"),
+ eq("VNFQ_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"), eq(null));
+
+ vnfAdapterNotifyServiceImpl.queryVnfNotification("messageId", true, MsoExceptionCategory.OPENSTACK, "",
+ Boolean.TRUE, "vnfid", VnfStatus.ACTIVE, queryOutputs);
+
+ verify(callbackHandlerService, times(1)).handleCallback(eq("queryVnfNotification"),
+ any(QueryVnfNotification.class), eq("queryVnfNotificationCallback"), eq("queryVnfNotificationCallback"),
+ eq("VNFQ_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"), eq(null));
+ }
+
+ @Test
+ public void createVnfNotificationTest() {
+ doReturn(callbackResult).when(callbackHandlerService).handleCallback(eq("createVnfNotification"),
+ any(CreateVnfNotification.class), eq("createVnfNotificationCallback"),
+ eq("createVnfNotificationCallback"), eq("VNFC_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+
+ vnfAdapterNotifyServiceImpl.createVnfNotification("messageId", true, MsoExceptionCategory.OPENSTACK, "",
+ "vnfId", outputs, vnfRollback);
+
+ verify(callbackHandlerService, times(1)).handleCallback(eq("createVnfNotification"),
+ any(CreateVnfNotification.class), eq("createVnfNotificationCallback"),
+ eq("createVnfNotificationCallback"), eq("VNFC_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+ }
+
+ @Test
+ public void updateVnfNotificationTest() {
+ doReturn(callbackResult).when(callbackHandlerService).handleCallback(eq("updateVnfNotification"),
+ any(UpdateVnfNotification.class), eq("updateVnfNotificationCallback"),
+ eq("updateVnfNotificationCallback"), eq("VNFU_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+
+ vnfAdapterNotifyServiceImpl.updateVnfNotification("messageId", true, MsoExceptionCategory.OPENSTACK, "",
+ updateOutputs, vnfRollback);
+
+ verify(callbackHandlerService, times(1)).handleCallback(eq("updateVnfNotification"),
+ any(UpdateVnfNotification.class), eq("updateVnfNotificationCallback"),
+ eq("updateVnfNotificationCallback"), eq("VNFU_messageId"), eq("messageId"), eq("[VNF-NOTIFY]"),
+ eq(null));
+ }
+
+ @Test
+ public void deleteVnfNotificationTest() {
+ doReturn(callbackResult).when(callbackHandlerService).handleCallback(eq("deleteVnfNotification"),
+ any(DeleteVnfNotification.class), eq("deleteVnfACallback"), eq("deleteVnfACallback"), eq("VNFDEL_uuid"),
+ eq("messageId"), eq("[VNF-NOTIFY]"), eq(null));
+
+ vnfAdapterNotifyServiceImpl.deleteVnfNotification("messageId", true, MsoExceptionCategory.OPENSTACK, "");
+
+ verify(callbackHandlerService, times(1)).handleCallback(eq("deleteVnfNotification"),
+ any(DeleteVnfNotification.class), eq("deleteVnfACallback"), eq("deleteVnfACallback"), eq("VNFDEL_uuid"),
+ eq("messageId"), eq("[VNF-NOTIFY]"), eq(null));
+ }
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceTest.java
new file mode 100644
index 0000000000..df9a23019a
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResourceTest.java
@@ -0,0 +1,59 @@
+package org.onap.so.bpmn.common.workflow.service;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.ArgumentMatchers.anyMap;
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.core.Response;
+import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.common.workflow.context.WorkflowResponse;
+
+@RunWith(MockitoJUnitRunner.class)
+public class WorkflowAsyncResourceTest {
+
+ @InjectMocks
+ @Spy
+ private WorkflowAsyncResource workflowAsyncResource;
+
+ @Mock
+ private WorkflowProcessor processor;
+
+ private WorkflowResponse workflowResponse;
+ private VariableMapImpl varMap;
+
+ @Before
+ public void before() {
+ workflowResponse = new WorkflowResponse();
+ varMap = new VariableMapImpl();
+ Map<String, Object> variables = new HashMap<String, Object>();
+ Map<String, Object> requestIdMap = new HashMap<String, Object>();
+ requestIdMap.put("value", "123");
+ requestIdMap.put("type", "String");
+ variables.put("mso-request-id", requestIdMap);
+ varMap.put("variables", variables);
+ }
+
+ @Test
+ public void startProcessInstanceByKey200Test() throws Exception {
+ workflowResponse.setMessageCode(200);
+ doReturn(workflowResponse).when(workflowAsyncResource).waitForResponse(anyMap());
+ Response response = workflowAsyncResource.startProcessInstanceByKey("123", varMap);
+ assertEquals(202, response.getStatus());
+ }
+
+ @Test
+ public void startProcessInstanceByKey500Test() throws Exception {
+ workflowResponse.setMessageCode(500);
+ doReturn(workflowResponse).when(workflowAsyncResource).waitForResponse(anyMap());
+ Response response = workflowAsyncResource.startProcessInstanceByKey("123", varMap);
+ assertEquals(500, response.getStatus());
+ }
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
index dd993bca51..43fbc59b3d 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
@@ -20,9 +20,8 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
-import java.util.HashMap;
+import java.util.Map;
import java.util.Objects;
-import java.util.Optional;
import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@@ -35,8 +34,7 @@ public class DmaapClientTestImpl implements DmaapClient {
private Runnable informConsumer;
@Override
- public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer,
- Optional<HashMap<String, String>> updateInfo) {
+ public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
this.pnfCorrelationId = pnfCorrelationId;
this.informConsumer = informConsumer;
}
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn
index 4ea6bb10b1..496fcb1784 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="DistributeTrafficActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskDistributeTraffic" targetRef="DistributeTrafficActivity_End" />
- <bpmn:serviceTask id="TaskDistributeTraffic" name="Distribute Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionDistributeTraffic&#34;))}">
+ <bpmn:serviceTask id="TaskDistributeTraffic" name="Distribute Traffic" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskDistributeTraffic" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;DistributeTraffic&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn
index 19a4972187..a5bde79237 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/DistributeTrafficCheckActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="DistributeTrafficCheckActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskDistributeTrafficCheck" targetRef="DistributeTrafficCheckActivity_End" />
- <bpmn:serviceTask id="TaskDistributeTrafficCheck" name="Distribute Traffic Check" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionDistributeTrafficCheck&#34;))}">
+ <bpmn:serviceTask id="TaskDistributeTrafficCheck" name="Distribute Traffic Check" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskDistributeTrafficCheck" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;DistributeTrafficCheck&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn
index 9ac0f38835..50fc40f450 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckClosedLoopDisabledFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.9.0">
- <bpmn:process id="VNFCheckClosedLoopDisabledFlagActivity" name="VNFCheckClosedLoopDisabledFlagActivity&#10;" isExecutable="true">
+<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.4.0">
+ <bpmn:process id="VNFCheckClosedLoopDisabledFlagActivity" name="VNFCheckClosedLoopDisabledFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFCheckClosedLoopDisabledFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_01c8z5u</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn
index 8709f399a5..ed6b10feed 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckInMaintFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.9.0">
- <bpmn:process id="VNFCheckInMaintFlagActivity" name="VNFCheckInMaintFlagActivity&#10;" isExecutable="true">
+ <bpmn:process id="VNFCheckInMaintFlagActivity" name="VNFCheckInMaintFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFCheckInMaintFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_0h1gkvd</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn
index 9c327a4da9..49777daa02 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFCheckPserversLockedFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.9.0">
- <bpmn:process id="VNFCheckPserversLockedFlagActivity" name="VNFCheckInMaintFlagActivity&#10;" isExecutable="true">
+ <bpmn:process id="VNFCheckPserversLockedFlagActivity" name="VNFCheckPserversLockedFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFCheckPserversLockedFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_0a56huh</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn
index 2e97206867..2e66f6c948 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFHealthCheckActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskHealthCheck" targetRef="VNFHealthCheckActivity_End" />
- <bpmn:serviceTask id="TaskHealthCheck" name="VNF Health Check" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionHealthCheck&#34;))}">
+ <bpmn:serviceTask id="TaskHealthCheck" name="VNF Health Check" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskHealthCheck" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;HealthCheck&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn
index 1aaa920ef8..43f2f4d6d3 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFLockActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskLock" targetRef="VNFLockActivity_End" />
- <bpmn:serviceTask id="TaskLock" name="VNF Lock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionLock&#34;))}">
+ <bpmn:serviceTask id="TaskLock" name="VNF Lock" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskLock" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;Lock&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn
index ac09674884..d0073803e9 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFQuiesceTrafficActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskQuiesceTraffic" targetRef="VNFQuiesceTrafficActivity_End" />
- <bpmn:serviceTask id="TaskQuiesceTraffic" name="VNF Quiesce Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionQuiesceTraffic&#34;))}">
+ <bpmn:serviceTask id="TaskQuiesceTraffic" name="VNF Quiesce Traffic" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskQuiesceTraffic" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;QuiesceTraffic&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn
index c21072a32a..888ce18467 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFResumeTrafficActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskResumeTraffic" targetRef="VNFResumeTrafficActivity_End" />
- <bpmn:serviceTask id="TaskResumeTraffic" name="VNF Resume Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionResumeTraffic&#34;))}">
+ <bpmn:serviceTask id="TaskResumeTraffic" name="VNF Resume Traffic" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskResumeTraffic" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;ResumeTraffic&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn
index f356634106..c02161eb61 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetClosedLoopDisabledFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.9.0">
- <bpmn:process id="VNFSetClosedLoopDisabledFlagActivity" name="VNFSetClosedLoopDisabledFlagActivity&#10;" isExecutable="true">
+ <bpmn:process id="VNFSetClosedLoopDisabledFlagActivity" name="VNFSetClosedLoopDisabledFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFSetClosedLoopDisabledFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_0pp6ze7</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn
index 2bdb1d7533..a0d0cbd5d7 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.4.0">
- <bpmn:process id="VNFSetInMaintFlagActivity" name="VNFSetInMaintFlagActivity&#10;" isExecutable="true">
+ <bpmn:process id="VNFSetInMaintFlagActivity" name="VNFSetInMaintFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFSetInMaintFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_0zaz9o2</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn
index 8115f694c2..f7bf835bd9 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn
@@ -5,19 +5,44 @@
<bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:endEvent id="VNFSnapShotActivity_End">
- <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_048qlth</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_17zvrl5</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFSnapShotActivity_Start" targetRef="TaskPreProcessActivity" />
- <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskSnapShot" targetRef="VNFSnapShotActivity_End" />
- <bpmn:serviceTask id="TaskSnapShot" name="VNF SnapShot" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionSnapshot&#34;))}">
- <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+ <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskSnapShot" targetRef="ExclusiveGateway_0u10l8w" />
+ <bpmn:serviceTask id="TaskSnapShot" name="VM SnapShot" camunda:type="external" camunda:topic="AppcService">
+ <bpmn:incoming>SequenceFlow_041lqrr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;Snapshot&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskSnapShot" />
+ <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="ExclusiveGateway_0ivqnoj" />
+ <bpmn:sequenceFlow id="SequenceFlow_041lqrr" sourceRef="TaskPreProcessVM" targetRef="TaskSnapShot" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0ivqnoj" name="Are there VMs?" default="SequenceFlow_048qlth">
+ <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0aachpx</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_048qlth</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_0aachpx" name="yes" sourceRef="ExclusiveGateway_0ivqnoj" targetRef="TaskPreProcessVM">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("vmIdListSize") > 0}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_048qlth" name="no" sourceRef="ExclusiveGateway_0ivqnoj" targetRef="VNFSnapShotActivity_End" />
+ <bpmn:serviceTask id="TaskPreProcessVM" name="PreProcess VM" camunda:expression="${AppcOrchestratorPreProcessor.addVmInfoToAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_0aachpx</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_12eenwu</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_041lqrr</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0u10l8w" name="Any more VMs?" default="SequenceFlow_17zvrl5">
+ <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_17zvrl5</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_12eenwu</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_17zvrl5" name="no" sourceRef="ExclusiveGateway_0u10l8w" targetRef="VNFSnapShotActivity_End" />
+ <bpmn:sequenceFlow id="SequenceFlow_12eenwu" name="yes" sourceRef="ExclusiveGateway_0u10l8w" targetRef="TaskPreProcessVM">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("vmIndex") < execution.getVariable("vmIdListSize")}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFSnapShotActivity">
@@ -25,9 +50,9 @@
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFSnapShotActivity_End">
- <dc:Bounds x="561" y="102" width="36" height="36" />
+ <dc:Bounds x="1047" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="579" y="138" width="0" height="0" />
+ <dc:Bounds x="1065" y="138" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
@@ -38,25 +63,79 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
- <di:waypoint xsi:type="dc:Point" x="497" y="120" />
- <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="850" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="911" y="120" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="529" y="105" width="0" height="0" />
+ <dc:Bounds x="881" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskSnapShot">
- <dc:Bounds x="397" y="80" width="100" height="80" />
+ <dc:Bounds x="750" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
<dc:Bounds x="255" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
<di:waypoint xsi:type="dc:Point" x="355" y="120" />
- <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="430" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="393" y="105" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_041lqrr_di" bpmnElement="SequenceFlow_041lqrr">
+ <di:waypoint xsi:type="dc:Point" x="667" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="750" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="709" y="105" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0ivqnoj_di" bpmnElement="ExclusiveGateway_0ivqnoj" isMarkerVisible="true">
+ <dc:Bounds x="430" y="95" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="417" y="59" width="76" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0aachpx_di" bpmnElement="SequenceFlow_0aachpx">
+ <di:waypoint xsi:type="dc:Point" x="480" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="567" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="515" y="105" width="18" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_048qlth_di" bpmnElement="SequenceFlow_048qlth">
+ <di:waypoint xsi:type="dc:Point" x="455" y="145" />
+ <di:waypoint xsi:type="dc:Point" x="455" y="243" />
+ <di:waypoint xsi:type="dc:Point" x="1065" y="243" />
+ <di:waypoint xsi:type="dc:Point" x="1065" y="138" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="754" y="228" width="12" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_12efz54_di" bpmnElement="TaskPreProcessVM">
+ <dc:Bounds x="567" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0u10l8w_di" bpmnElement="ExclusiveGateway_0u10l8w" isMarkerVisible="true">
+ <dc:Bounds x="911" y="95" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="897" y="145" width="78" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_17zvrl5_di" bpmnElement="SequenceFlow_17zvrl5">
+ <di:waypoint xsi:type="dc:Point" x="961" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="1047" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="998" y="95" width="12" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_12eenwu_di" bpmnElement="SequenceFlow_12eenwu">
+ <di:waypoint xsi:type="dc:Point" x="936" y="95" />
+ <di:waypoint xsi:type="dc:Point" x="936" y="-10" />
+ <di:waypoint xsi:type="dc:Point" x="617" y="-10" />
+ <di:waypoint xsi:type="dc:Point" x="617" y="80" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="376" y="105" width="0" height="0" />
+ <dc:Bounds x="768" y="-25" width="18" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn
index f0490a9b61..da1e4a3630 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStartActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStart" targetRef="VNFStartActivity_End" />
- <bpmn:serviceTask id="TaskStart" name="VNF Start" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStart&#34;))}">
+ <bpmn:serviceTask id="TaskStart" name="VNF Start" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStart" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;Start&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn
index 0e02295631..93d442eaa5 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStopActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStop" targetRef="VNFStopActivity_End" />
- <bpmn:serviceTask id="TaskStop" name="VNF Stop" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStop&#34;))}">
+ <bpmn:serviceTask id="TaskStop" name="VNF Stop" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStop" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;Stop&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn
index 6d1b68cb7b..ef4162c60e 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUnlockActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUnlock" targetRef="VNFUnlockActivity_End" />
- <bpmn:serviceTask id="TaskUnlock" name="VNF Unlock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUnlock&#34;))}">
+ <bpmn:serviceTask id="TaskUnlock" name="VNF Unlock" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUnlock" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;Unlock&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn
index d70e103009..575e3124fa 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetClosedLoopDisabledFlagActivity.bpmn
@@ -44,4 +44,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn
index 05d3fcfa27..59eb80c16e 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn
@@ -1,6 +1,6 @@
<?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.4.0">
- <bpmn:process id="VNFUnsetInMaintFlagActivity" name="VNFUnsetInMaintFlagActivity&#10;" isExecutable="true">
+ <bpmn:process id="VNFUnsetInMaintFlagActivity" name="VNFUnsetInMaintFlagActivity" isExecutable="true">
<bpmn:startEvent id="VNFUnsetInMaintFlagActivity_Start">
<bpmn:outgoing>SequenceFlow_0zaz9o2</bpmn:outgoing>
</bpmn:startEvent>
@@ -47,4 +47,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn
index dfcf9974ee..1b37867ecf 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradeBackupActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradeBackup" targetRef="VNFUpgradeBackupActivity_End" />
- <bpmn:serviceTask id="TaskUpgradeBackup" name="VNF UpgradeBackup" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradeBackup&#34;))}">
+ <bpmn:serviceTask id="TaskUpgradeBackup" name="VNF UpgradeBackup" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradeBackup" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;UpgradeBackup&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn
index 56c24dabc9..b9c4d89be9 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradePostCheckActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradePostCheck" targetRef="VNFUpgradePostCheckActivity_End" />
- <bpmn:serviceTask id="TaskUpgradePostCheck" name="VNF Upgrade PostCheck " camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradePostCheck&#34;))}">
+ <bpmn:serviceTask id="TaskUpgradePostCheck" name="VNF Upgrade PostCheck " camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradePostCheck" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;UpgradePostCheck&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn
index 1ec0a18dd5..33886e358d 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradePreCheckActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradePreCheck" targetRef="VNFUpgradePreCheckActivity_End" />
- <bpmn:serviceTask id="TaskUpgradePreCheck" name="VNF Upgrade PreCheck " camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradePreCheck&#34;))}">
+ <bpmn:serviceTask id="TaskUpgradePreCheck" name="VNF Upgrade PreCheck " camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradePreCheck" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;UpgradePreCheck&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn
index 89481a5640..16df667f6a 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn
@@ -9,12 +9,12 @@
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradeSoftwareActivity_Start" targetRef="TaskPreProcessActivity" />
<bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradeSoftware" targetRef="VNFUpgradeSoftwareActivity_End" />
- <bpmn:serviceTask id="TaskUpgradeSoftware" name="VNF Upgrade Software" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradeSoftware&#34;))}">
+ <bpmn:serviceTask id="TaskUpgradeSoftware" name="VNF Upgrade Software" camunda:type="external" camunda:topic="AppcService">
<bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradeSoftware" />
- <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;UpgradeSoftware&#34;)}">
<bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
</bpmn:serviceTask>
@@ -59,4 +59,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn
new file mode 100644
index 0000000000..930f666bf0
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn
@@ -0,0 +1,125 @@
+<?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:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1a52v2f" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0">
+ <bpmn:collaboration id="Collaboration_0go8wi3">
+ <bpmn:participant id="Participant_1dwc5st" name="SO&#10;Assign PNF" processRef="AssignPnfBB" />
+ <bpmn:participant id="Participant_0gycee4" name="AAI" />
+ <bpmn:messageFlow id="MessageFlow_0xh6bkn" sourceRef="CreatePnfEntryInAai" targetRef="Participant_0gycee4" />
+ <bpmn:messageFlow id="MessageFlow_0cnehf5" sourceRef="Participant_0gycee4" targetRef="CheckAaiForPnfCorrelationId" />
+ <bpmn:messageFlow id="MessageFlow_1e1pjve" sourceRef="CheckAaiForPnfCorrelationId" targetRef="Participant_0gycee4" />
+ </bpmn:collaboration>
+ <bpmn:process id="AssignPnfBB" name="AssignPnfBB" isExecutable="true">
+ <bpmn:startEvent id="AssignPnf_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1fu9o4x</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="CheckAaiForPnfCorrelationId" name="Check AAI for pnf_correlation_id" camunda:expression="${CheckAaiForPnfCorrelationId.execute(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_1fu9o4x</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_081rs5d</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:exclusiveGateway id="DoesAaiContainInfoAboutPnf" name="Does AAI contain info about pnf?">
+ <bpmn:incoming>SequenceFlow_081rs5d</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0fn5kgz</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1ewfz8r</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:serviceTask id="CreatePnfEntryInAai" name="Create Pnf entry in AAI" camunda:expression="${CreatePnfEntryInAai.execute(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_0fn5kgz</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0l6rtzy</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:endEvent id="AaiEntryExists" name="AAI entry exists">
+ <bpmn:incoming>SequenceFlow_1ewfz8r</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0l6rtzy</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_081rs5d" sourceRef="CheckAaiForPnfCorrelationId" targetRef="DoesAaiContainInfoAboutPnf" />
+ <bpmn:sequenceFlow id="SequenceFlow_0fn5kgz" name="No" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="CreatePnfEntryInAai">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{!aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1ewfz8r" name="Yes&#10;&#10;" sourceRef="DoesAaiContainInfoAboutPnf" targetRef="AaiEntryExists">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{aaiContainsInfoAboutPnf}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_0l6rtzy" sourceRef="CreatePnfEntryInAai" targetRef="AaiEntryExists" />
+ <bpmn:sequenceFlow id="SequenceFlow_1fu9o4x" sourceRef="AssignPnf_StartEvent" targetRef="CheckAaiForPnfCorrelationId" />
+ <bpmn:textAnnotation id="TextAnnotation_184cxp4">
+ <bpmn:text>Inputs:
+ - pnfCorrelationId - String
+ - uuid - String</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_1le3nwi" sourceRef="AssignPnf_StartEvent" targetRef="TextAnnotation_184cxp4" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0go8wi3">
+ <bpmndi:BPMNShape id="Participant_1dwc5st_di" bpmnElement="Participant_1dwc5st" isHorizontal="true">
+ <dc:Bounds x="160" y="80" width="1100" height="390" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Participant_0gycee4_di" bpmnElement="Participant_0gycee4" isHorizontal="true">
+ <dc:Bounds x="590" y="570" width="502" height="60" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1ix8822_di" bpmnElement="CreatePnfEntryInAai">
+ <dc:Bounds x="920" y="247" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1l92fkt_di" bpmnElement="DoesAaiContainInfoAboutPnf" isMarkerVisible="true">
+ <dc:Bounds x="795" y="262" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="777" y="322" width="85" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0ebur3y_di" bpmnElement="CheckAaiForPnfCorrelationId">
+ <dc:Bounds x="640" y="247" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="StartEvent_1g3euow_di" bpmnElement="AssignPnf_StartEvent">
+ <dc:Bounds x="219" y="269" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="TextAnnotation_184cxp4_di" bpmnElement="TextAnnotation_184cxp4">
+ <dc:Bounds x="236" y="150" width="243" height="53" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_081rs5d_di" bpmnElement="SequenceFlow_081rs5d">
+ <di:waypoint x="740" y="287" />
+ <di:waypoint x="795" y="287" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0fn5kgz_di" bpmnElement="SequenceFlow_0fn5kgz">
+ <di:waypoint x="845" y="287" />
+ <di:waypoint x="920" y="287" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="854" y="290" width="15" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="MessageFlow_0xh6bkn_di" bpmnElement="MessageFlow_0xh6bkn">
+ <di:waypoint x="970" y="327" />
+ <di:waypoint x="970" y="570" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="MessageFlow_0cnehf5_di" bpmnElement="MessageFlow_0cnehf5">
+ <di:waypoint x="710" y="570" />
+ <di:waypoint x="710" y="327" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="MessageFlow_1e1pjve_di" bpmnElement="MessageFlow_1e1pjve">
+ <di:waypoint x="671" y="327" />
+ <di:waypoint x="671" y="570" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Association_1le3nwi_di" bpmnElement="Association_1le3nwi">
+ <di:waypoint x="237" y="269" />
+ <di:waypoint x="237" y="203" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_1wfgsdz_di" bpmnElement="AaiEntryExists">
+ <dc:Bounds x="1152" y="269" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1133" y="312" width="77" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ewfz8r_di" bpmnElement="SequenceFlow_1ewfz8r">
+ <di:waypoint x="820" y="262" />
+ <di:waypoint x="820" y="170" />
+ <di:waypoint x="1170" y="170" />
+ <di:waypoint x="1170" y="269" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="822" y="240" width="19" height="40" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0l6rtzy_di" bpmnElement="SequenceFlow_0l6rtzy">
+ <di:waypoint x="1020" y="287" />
+ <di:waypoint x="1152" y="287" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1fu9o4x_di" bpmnElement="SequenceFlow_1fu9o4x">
+ <di:waypoint x="255" y="287" />
+ <di:waypoint x="640" y="287" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn
index 512cb7b45e..7a05163b0f 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn
@@ -9,7 +9,7 @@
<bpmn:outgoing>SequenceFlow_0nhd7b7</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_1mc3d3f" sourceRef="deleteNetwork_startEvent" targetRef="deleteNetworkAIC" />
- <bpmn:serviceTask id="deleteNetworkAIC" name="&#10;AIC&#10;Delete&#10;(network)&#10;" camunda:expression="${NetworkAdapterDeleteTasks.deleteNetwork(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="deleteNetworkAIC" name="&#10;Prepare&#10;Request&#10;" camunda:expression="${NetworkAdapterDeleteTasks.deleteNetwork(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_1mc3d3f</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_16ti327</bpmn:outgoing>
</bpmn:serviceTask>
@@ -17,7 +17,7 @@
<bpmn:incoming>SequenceFlow_0nhd7b7</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_0nhd7b7" sourceRef="updateNetworkAAI" targetRef="deleteNetwork_endEvent" />
- <bpmn:callActivity id="CallActivity_1a77pxk" name="Call NetworkAdapterRestV1" calledElement="NetworkAdapterRestV1">
+ <bpmn:callActivity id="CallActivity_1a77pxk" name="AIC &#10;Delete&#10;(network)&#10;" calledElement="NetworkAdapterRestV1">
<bpmn:extensionElements>
<camunda:in source="networkAdapterRequest" target="networkAdapterRequest" />
<camunda:out source="WorkflowException" target="WorkflowException" />
@@ -43,52 +43,52 @@
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteNetworkBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="deleteNetwork_startEvent">
- <dc:Bounds x="173" y="102" width="36" height="36" />
+ <dc:Bounds x="156" y="125" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="166" y="138" width="50" height="12" />
+ <dc:Bounds x="129" y="161" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0zd65z2_di" bpmnElement="updateNetworkAAI">
- <dc:Bounds x="644" y="80" width="100" height="80" />
+ <dc:Bounds x="626" y="103" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1mc3d3f_di" bpmnElement="SequenceFlow_1mc3d3f">
- <di:waypoint xsi:type="dc:Point" x="209" y="120" />
- <di:waypoint xsi:type="dc:Point" x="317" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="192" y="143" />
+ <di:waypoint xsi:type="dc:Point" x="312" y="143" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="218" y="99" width="90" height="12" />
+ <dc:Bounds x="207" y="122" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1gcfuzf_di" bpmnElement="deleteNetworkAIC">
- <dc:Bounds x="317" y="80" width="100" height="80" />
+ <dc:Bounds x="312" y="103" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_02vxchc_di" bpmnElement="deleteNetwork_endEvent">
- <dc:Bounds x="806" y="102" width="36" height="36" />
+ <dc:Bounds x="862" y="125" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="801" y="142" width="46" height="12" />
+ <dc:Bounds x="835" y="165" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0nhd7b7_di" bpmnElement="SequenceFlow_0nhd7b7">
- <di:waypoint xsi:type="dc:Point" x="744" y="120" />
- <di:waypoint xsi:type="dc:Point" x="806" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="726" y="143" />
+ <di:waypoint xsi:type="dc:Point" x="862" y="143" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="730" y="99" width="90" height="12" />
+ <dc:Bounds x="749" y="122" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_1a77pxk_di" bpmnElement="CallActivity_1a77pxk">
- <dc:Bounds x="481" y="80" width="100" height="80" />
+ <dc:Bounds x="470" y="103" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_16ti327_di" bpmnElement="SequenceFlow_16ti327">
- <di:waypoint xsi:type="dc:Point" x="417" y="120" />
- <di:waypoint xsi:type="dc:Point" x="481" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="412" y="143" />
+ <di:waypoint xsi:type="dc:Point" x="470" y="143" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="449" y="99" width="0" height="12" />
+ <dc:Bounds x="396" y="122" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0gnafn2_di" bpmnElement="SequenceFlow_0gnafn2">
- <di:waypoint xsi:type="dc:Point" x="581" y="120" />
- <di:waypoint xsi:type="dc:Point" x="644" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="570" y="143" />
+ <di:waypoint xsi:type="dc:Point" x="626" y="143" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="612.5" y="99" width="0" height="12" />
+ <dc:Bounds x="553" y="122" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
index efdee8601e..f2e0ce29ff 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
@@ -1,6 +1,9 @@
<?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="2.0.3">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2">
<bpmn:process id="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true">
+ <bpmn:extensionElements>
+ <camunda:executionListener class="org.onap.so.bpmn.core.plugins.AsyncTaskExecutorListener" event="end" />
+ </bpmn:extensionElements>
<bpmn:startEvent id="Start_WorkflowActionBB" name="start">
<bpmn:outgoing>SequenceFlow_15s0okp</bpmn:outgoing>
</bpmn:startEvent>
@@ -54,7 +57,7 @@
</bpmn:serviceTask>
<bpmn:serviceTask id="Task_SendSync" name="Send Sync Ack API Handler" camunda:asyncAfter="true" camunda:expression="${WorkflowActionBBTasks.sendSyncAck(execution)}">
<bpmn:incoming>SequenceFlow_0sckerv</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1wb59ic</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1lrz41x</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="Task_UpdateRequestComplete" name="Update Request To Complete" camunda:expression="${WorkflowActionBBTasks.updateRequestStatusToComplete(execution)}">
<bpmn:incoming>SequenceFlow_0kf5sen</bpmn:incoming>
@@ -86,7 +89,7 @@
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isTopLevelFlow")==true&amp;&amp;execution.getVariable("sentSyncResponse")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0eana0l" sourceRef="Task_SendSyncAckError" targetRef="Task_UpdateDb" />
- <bpmn:serviceTask id="Task_SendSyncAckError" name="Send Sync Ack API Handler" camunda:asyncAfter="true" camunda:expression="${WorkflowActionBBTasks.sendSyncAck(execution)}">
+ <bpmn:serviceTask id="Task_SendSyncAckError" name="Send Sync Ack API Handler" camunda:asyncAfter="true" camunda:expression="${WorkflowActionBBTasks.sendErrorSyncAck(execution)}">
<bpmn:incoming>SequenceFlow_0vi883o</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0eana0l</bpmn:outgoing>
</bpmn:serviceTask>
@@ -115,7 +118,6 @@
<bpmn:incoming>SequenceFlow_1r570x3</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1p8yxu6" sourceRef="Task_AbortAndCallErrorHandling" targetRef="EndEvent_0lzz1ya" />
- <bpmn:sequenceFlow id="SequenceFlow_1wb59ic" sourceRef="Task_SendSync" targetRef="Task_PreValidateWorkflow" />
<bpmn:sequenceFlow id="SequenceFlow_01j184u" sourceRef="ExclusiveGateway_Finished" targetRef="Task_0a31dkf" />
<bpmn:serviceTask id="Task_0a31dkf" name="Check Retry Status" camunda:expression="${WorkflowActionBBTasks.checkRetryStatus(execution)}">
<bpmn:incoming>SequenceFlow_01j184u</bpmn:incoming>
@@ -186,7 +188,7 @@
<bpmn:sequenceFlow id="SequenceFlow_1tfizxf" sourceRef="Task_PreValidateWorkflow" targetRef="Task_SelectBB" />
<bpmn:serviceTask id="Task_PreValidateWorkflow" name="PreValidate Workflow" camunda:expression="${WorkflowValidatorRunner.preValidate(execution.getVariable(&#34;requestAction&#34;), execution)}">
<bpmn:incoming>SequenceFlow_0unbew4</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_1wb59ic</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0etawv5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1tfizxf</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="ServiceTask_0lbkcyp" name="Post Processing Execute BB" camunda:expression="${WorkflowActionBBTasks.postProcessingExecuteBB(execution)}">
@@ -196,389 +198,426 @@
<bpmn:sequenceFlow id="SequenceFlow_1hsqed1" sourceRef="Call_ExecuteBB" targetRef="ServiceTask_0lbkcyp" />
<bpmn:sequenceFlow id="SequenceFlow_1fftixk" sourceRef="ServiceTask_0lbkcyp" targetRef="ExclusiveGateway_Finished" />
<bpmn:sequenceFlow id="SequenceFlow_1pnkpim" sourceRef="Task_0a31dkf" targetRef="Task_SelectBB" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1dez26n" name="Generated Id&#39;s?">
+ <bpmn:incoming>SequenceFlow_1lrz41x</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0etawv5</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0ilo6lo</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1lrz41x" sourceRef="Task_SendSync" targetRef="ExclusiveGateway_1dez26n" />
+ <bpmn:sequenceFlow id="SequenceFlow_0etawv5" name="no" sourceRef="ExclusiveGateway_1dez26n" targetRef="Task_PreValidateWorkflow">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("generateIdsOnly") == null || execution.getVariable("generateIdsOnly")==false}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:endEvent id="EndEvent_12f15tu" name="End">
+ <bpmn:incoming>SequenceFlow_0ilo6lo</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_0ilo6lo" name="yes" sourceRef="ExclusiveGateway_1dez26n" targetRef="EndEvent_12f15tu" />
</bpmn:process>
<bpmn:error id="Error_0kd2o2a" name="java.lang.Exception" errorCode="java.lang.Exception" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="WorkflowActionBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start_WorkflowActionBB">
- <dc:Bounds x="-434" y="102" width="36" height="36" />
+ <dc:Bounds x="156" y="378" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-426" y="138" width="22" height="12" />
+ <dc:Bounds x="164" y="414" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1uv6erv_di" bpmnElement="End_WorkflowActionBB">
- <dc:Bounds x="1304" y="147" width="36" height="36" />
+ <dc:Bounds x="1894" y="423" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1313" y="127" width="18" height="12" />
+ <dc:Bounds x="1903" y="403" width="19" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_15s0okp_di" bpmnElement="SequenceFlow_15s0okp">
- <di:waypoint x="-398" y="120" />
- <di:waypoint x="-365" y="120" />
+ <di:waypoint x="192" y="396" />
+ <di:waypoint x="225" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-381" y="99" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_03m7z4y_di" bpmnElement="Call_ExecuteBB">
- <dc:Bounds x="560" y="80" width="100" height="80" />
+ <dc:Bounds x="1150" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0mqrkxv_di" bpmnElement="SequenceFlow_0mqrkxv">
- <di:waypoint x="339" y="120" />
- <di:waypoint x="400" y="120" />
+ <di:waypoint x="929" y="396" />
+ <di:waypoint x="990" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="324.5" y="105" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1snenqk_di" bpmnElement="Task_SelectBB">
- <dc:Bounds x="239" y="80" width="100" height="80" />
+ <dc:Bounds x="829" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0m1zt0q_di" bpmnElement="ExclusiveGateway_Finished" isMarkerVisible="true">
- <dc:Bounds x="911" y="95" width="50" height="50" />
+ <dc:Bounds x="1501" y="371" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="850" y="42" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1m2eezj_di" bpmnElement="SequenceFlow_1m2eezj">
- <di:waypoint x="949" y="132" />
- <di:waypoint x="980" y="165" />
- <di:waypoint x="1060" y="165" />
+ <di:waypoint x="1539" y="408" />
+ <di:waypoint x="1570" y="441" />
+ <di:waypoint x="1650" y="441" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="968" y="168" width="83" height="12" />
+ <dc:Bounds x="1557" y="444" width="85" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0kn8jt8_di" bpmnElement="Task_RetrieveBBExectuionList">
- <dc:Bounds x="-365" y="80" width="100" height="80" />
+ <dc:Bounds x="225" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0654g3m_di" bpmnElement="Task_SendSync">
- <dc:Bounds x="-132" y="-6" width="100" height="80" />
+ <dc:Bounds x="490" y="200" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0wzh11j_di" bpmnElement="Task_UpdateRequestComplete">
- <dc:Bounds x="1161" y="206" width="100" height="80" />
+ <dc:Bounds x="1751" y="482" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1pz6edz_di" bpmnElement="SequenceFlow_1pz6edz">
- <di:waypoint x="1261" y="246" />
- <di:waypoint x="1322" y="246" />
- <di:waypoint x="1322" y="183" />
+ <di:waypoint x="1851" y="522" />
+ <di:waypoint x="1912" y="522" />
+ <di:waypoint x="1912" y="459" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1247" y="231" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_18226x4_di" bpmnElement="SubProcess_18226x4" isExpanded="true">
- <dc:Bounds x="498" y="444" width="438" height="297" />
+ <dc:Bounds x="1088" y="720" width="438" height="297" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_184g7f3_di" bpmnElement="ErrorStart">
- <dc:Bounds x="520" y="639" width="36" height="36" />
+ <dc:Bounds x="1110" y="915" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="526" y="682" width="24" height="12" />
+ <dc:Bounds x="1116" y="958" width="24" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0l4edvr_di" bpmnElement="ErrorEnd">
- <dc:Bounds x="880" y="639" width="36" height="36" />
+ <dc:Bounds x="1470" y="915" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="890" y="681" width="18" height="12" />
+ <dc:Bounds x="1480" y="957" width="19" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0v588sm_di" bpmnElement="SequenceFlow_0v588sm">
- <di:waypoint x="936" y="145" />
- <di:waypoint x="936" y="262" />
- <di:waypoint x="339" y="262" />
+ <di:waypoint x="1526" y="421" />
+ <di:waypoint x="1526" y="538" />
+ <di:waypoint x="929" y="538" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="769.202380952381" y="272" width="73" height="12" />
+ <dc:Bounds x="1359" y="548" width="74" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1atzsgn_di" bpmnElement="SequenceFlow_1atzsgn">
- <di:waypoint x="289" y="222" />
- <di:waypoint x="289" y="160" />
+ <di:waypoint x="879" y="498" />
+ <di:waypoint x="879" y="436" />
<bpmndi:BPMNLabel>
<dc:Bounds x="259" y="191" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_19t1oyr_di" bpmnElement="Task_RollbackExecutionPath">
- <dc:Bounds x="239" y="222" width="100" height="80" />
+ <dc:Bounds x="829" y="498" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0vc9go9_di" bpmnElement="SequenceFlow_0vc9go9">
- <di:waypoint x="-265" y="120" />
- <di:waypoint x="-228" y="120" />
+ <di:waypoint x="325" y="396" />
+ <di:waypoint x="362" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-246" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_11530ei_di" bpmnElement="SequenceFlow_11530ei">
- <di:waypoint x="946" y="105" />
- <di:waypoint x="983" y="44" />
- <di:waypoint x="1060" y="45" />
+ <di:waypoint x="1536" y="381" />
+ <di:waypoint x="1573" y="320" />
+ <di:waypoint x="1650" y="321" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="975" y="17" width="58" height="12" />
+ <dc:Bounds x="1565" y="293" width="58" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0jo36ez_di" bpmnElement="Task_AbortAndCallErrorHandling">
- <dc:Bounds x="1176" y="-76" width="100" height="80" />
+ <dc:Bounds x="1766" y="200" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0lzz1ya_di" bpmnElement="EndEvent_0lzz1ya">
- <dc:Bounds x="1386" y="27" width="36" height="36" />
+ <dc:Bounds x="1976" y="303" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1395" y="67" width="18" height="12" />
+ <dc:Bounds x="1985" y="343" width="19" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1p8yxu6_di" bpmnElement="SequenceFlow_1p8yxu6">
- <di:waypoint x="1276" y="-36" />
- <di:waypoint x="1359" y="-36" />
- <di:waypoint x="1359" y="45" />
- <di:waypoint x="1386" y="45" />
+ <di:waypoint x="1866" y="240" />
+ <di:waypoint x="1949" y="240" />
+ <di:waypoint x="1949" y="321" />
+ <di:waypoint x="1976" y="321" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1329" y="5" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1wb59ic_di" bpmnElement="SequenceFlow_1wb59ic">
- <di:waypoint x="-32" y="34" />
- <di:waypoint x="32" y="34" />
- <di:waypoint x="32" y="120" />
- <di:waypoint x="80" y="120" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="47" y="77" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_01j184u_di" bpmnElement="SequenceFlow_01j184u">
- <di:waypoint x="936" y="95" />
- <di:waypoint x="936" y="55" />
- <di:waypoint x="936" y="55" />
- <di:waypoint x="936" y="4" />
+ <di:waypoint x="1526" y="371" />
+ <di:waypoint x="1526" y="331" />
+ <di:waypoint x="1526" y="331" />
+ <di:waypoint x="1526" y="280" />
<bpmndi:BPMNLabel>
<dc:Bounds x="906" y="49" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1c1v3p1_di" bpmnElement="Task_0a31dkf">
- <dc:Bounds x="886" y="-76" width="100" height="80" />
+ <dc:Bounds x="1476" y="200" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0ptb1yi_di" bpmnElement="ExclusiveGateway_isTopLevelFlow" isMarkerVisible="true">
- <dc:Bounds x="-228" y="95" width="50" height="50" />
+ <dc:Bounds x="362" y="371" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-235" y="145" width="63" height="24" />
+ <dc:Bounds x="357" y="421" width="60" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0sckerv_di" bpmnElement="SequenceFlow_0sckerv">
- <di:waypoint x="-202" y="96" />
- <di:waypoint x="-202" y="34" />
- <di:waypoint x="-132" y="34" />
+ <di:waypoint x="388" y="372" />
+ <di:waypoint x="388" y="240" />
+ <di:waypoint x="490" y="240" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-195" y="55.55555555555556" width="18" height="12" />
+ <dc:Bounds x="396" y="294" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0unbew4_di" bpmnElement="SequenceFlow_0unbew4">
- <di:waypoint x="-178" y="120" />
- <di:waypoint x="80" y="120" />
+ <di:waypoint x="412" y="396" />
+ <di:waypoint x="670" y="396" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-87" y="99.95468180757382" width="12" height="12" />
+ <dc:Bounds x="503" y="376" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_001g41v_di" bpmnElement="ExclusiveGateway_isTopLevelFlowAbort" isMarkerVisible="true">
- <dc:Bounds x="1060" y="20" width="50" height="50" />
+ <dc:Bounds x="1650" y="296" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1055" y="70" width="61" height="24" />
+ <dc:Bounds x="1646" y="346" width="60" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_02ksbt0_di" bpmnElement="SequenceFlow_02ksbt0">
- <di:waypoint x="1085" y="20" />
- <di:waypoint x="1085" y="-37" />
- <di:waypoint x="1176" y="-37" />
+ <di:waypoint x="1675" y="296" />
+ <di:waypoint x="1675" y="239" />
+ <di:waypoint x="1766" y="239" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1091" y="-8" width="19" height="12" />
+ <dc:Bounds x="1682" y="268" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1r570x3_di" bpmnElement="SequenceFlow_1r570x3">
- <di:waypoint x="1110" y="45" />
- <di:waypoint x="1386" y="45" />
+ <di:waypoint x="1700" y="321" />
+ <di:waypoint x="1976" y="321" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1242" y="20" width="12" height="12" />
+ <dc:Bounds x="1832" y="296" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_1er1kam_di" bpmnElement="ExclusiveGateway_isTopLevelFlowC" isMarkerVisible="true">
- <dc:Bounds x="1060" y="140" width="50" height="50" />
+ <dc:Bounds x="1650" y="416" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1055" y="108" width="61" height="24" />
+ <dc:Bounds x="1646" y="384" width="60" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0x4urgp_di" bpmnElement="SequenceFlow_0x4urgp">
- <di:waypoint x="1110" y="165" />
- <di:waypoint x="1220" y="165" />
- <di:waypoint x="1220" y="165" />
- <di:waypoint x="1304" y="165" />
+ <di:waypoint x="1700" y="441" />
+ <di:waypoint x="1810" y="441" />
+ <di:waypoint x="1810" y="441" />
+ <di:waypoint x="1894" y="441" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1256" y="140" width="12" height="12" />
+ <dc:Bounds x="1846" y="416" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1q8eh5e_di" bpmnElement="End_RollbackFailed">
- <dc:Bounds x="1159" y="347" width="36" height="36" />
+ <dc:Bounds x="1749" y="623" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1177" y="399" width="18" height="12" />
+ <dc:Bounds x="1767" y="675" width="19" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11dlyzt_di" bpmnElement="SequenceFlow_11dlyzt">
- <di:waypoint x="289" y="302" />
- <di:waypoint x="289" y="368" />
- <di:waypoint x="960" y="368" />
+ <di:waypoint x="879" y="578" />
+ <di:waypoint x="879" y="644" />
+ <di:waypoint x="1550" y="644" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="381.45685840707966" y="325" width="63" height="24" />
+ <dc:Bounds x="972" y="601" width="63" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1h154rn_di" bpmnElement="Task_UpdateDb">
- <dc:Bounds x="713" y="617" width="100" height="80" />
+ <dc:Bounds x="1303" y="893" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1t8n9gd_di" bpmnElement="Task_UpdateRequestToFailed">
- <dc:Bounds x="960" y="325" width="100" height="80" />
+ <dc:Bounds x="1550" y="601" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0l7kaba_di" bpmnElement="SequenceFlow_0l7kaba">
- <di:waypoint x="942" y="139" />
- <di:waypoint x="976" y="252" />
- <di:waypoint x="1016" y="252" />
- <di:waypoint x="1016" y="325" />
+ <di:waypoint x="1532" y="415" />
+ <di:waypoint x="1566" y="528" />
+ <di:waypoint x="1606" y="528" />
+ <di:waypoint x="1606" y="601" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="959" y="255" width="52" height="24" />
+ <dc:Bounds x="1548" y="531" width="54" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1edjl5x_di" bpmnElement="SequenceFlow_1edjl5x">
- <di:waypoint x="556" y="657" />
- <di:waypoint x="602" y="657" />
+ <di:waypoint x="1146" y="933" />
+ <di:waypoint x="1192" y="933" />
<bpmndi:BPMNLabel>
<dc:Bounds x="534" y="636" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0wvzfgf_di" bpmnElement="SequenceFlow_0wvzfgf">
- <di:waypoint x="813" y="657" />
- <di:waypoint x="880" y="657" />
+ <di:waypoint x="1403" y="933" />
+ <di:waypoint x="1470" y="933" />
<bpmndi:BPMNLabel>
<dc:Bounds x="801.5" y="636" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1ui67mc_di" bpmnElement="SequenceFlow_1ui67mc">
- <di:waypoint x="1060" y="365" />
- <di:waypoint x="1134" y="365" />
- <di:waypoint x="1134" y="365" />
- <di:waypoint x="1159" y="365" />
+ <di:waypoint x="1650" y="641" />
+ <di:waypoint x="1724" y="641" />
+ <di:waypoint x="1724" y="641" />
+ <di:waypoint x="1749" y="641" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1104" y="359" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_10q79b6_di" bpmnElement="ExclusiveGateway_10q79b6" isMarkerVisible="true">
- <dc:Bounds x="602" y="632" width="50" height="50" />
+ <dc:Bounds x="1192" y="908" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="584" y="686" width="86" height="36" />
+ <dc:Bounds x="1174" y="962" width="86" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_024g0d1_di" bpmnElement="SequenceFlow_024g0d1">
- <di:waypoint x="652" y="657" />
- <di:waypoint x="683" y="657" />
- <di:waypoint x="683" y="657" />
- <di:waypoint x="713" y="657" />
+ <di:waypoint x="1242" y="933" />
+ <di:waypoint x="1273" y="933" />
+ <di:waypoint x="1273" y="933" />
+ <di:waypoint x="1303" y="933" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="677" y="634" width="12" height="12" />
+ <dc:Bounds x="1267" y="910" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0vi883o_di" bpmnElement="SequenceFlow_0vi883o">
- <di:waypoint x="627" y="632" />
- <di:waypoint x="627" y="548" />
- <di:waypoint x="713" y="548" />
+ <di:waypoint x="1217" y="908" />
+ <di:waypoint x="1217" y="824" />
+ <di:waypoint x="1303" y="824" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="633" y="584" width="18" height="12" />
+ <dc:Bounds x="1223" y="860" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0eana0l_di" bpmnElement="SequenceFlow_0eana0l">
- <di:waypoint x="763" y="588" />
- <di:waypoint x="763" y="617" />
+ <di:waypoint x="1353" y="864" />
+ <di:waypoint x="1353" y="893" />
<bpmndi:BPMNLabel>
<dc:Bounds x="778" y="596.5" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_10hs368_di" bpmnElement="Task_SendSyncAckError">
- <dc:Bounds x="713" y="508" width="100" height="80" />
+ <dc:Bounds x="1303" y="784" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_0fuugr9_di" bpmnElement="SubProcess_0fuugr9" isExpanded="true">
- <dc:Bounds x="515" y="792" width="404" height="165" />
+ <dc:Bounds x="1105" y="1068" width="404" height="165" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_15qkxd7_di" bpmnElement="StartEvent_runtimeError">
- <dc:Bounds x="570" y="857" width="36" height="36" />
+ <dc:Bounds x="1160" y="1133" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="577" y="900" width="24" height="12" />
+ <dc:Bounds x="1167" y="1176" width="24" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1p4kxh2_di" bpmnElement="ServiceTask_HandleRuntimeError">
- <dc:Bounds x="690" y="835" width="100" height="80" />
+ <dc:Bounds x="1280" y="1111" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_09e3lu5_di" bpmnElement="EndEvent__runtimeError">
- <dc:Bounds x="856" y="857" width="36" height="36" />
+ <dc:Bounds x="1446" y="1133" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="784" y="897" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11d126w_di" bpmnElement="SequenceFlow_11d126w">
- <di:waypoint x="606" y="875" />
- <di:waypoint x="690" y="875" />
+ <di:waypoint x="1196" y="1151" />
+ <di:waypoint x="1280" y="1151" />
<bpmndi:BPMNLabel>
<dc:Bounds x="603" y="854" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0w4sx88_di" bpmnElement="SequenceFlow_0w4sx88">
- <di:waypoint x="790" y="875" />
- <di:waypoint x="856" y="875" />
+ <di:waypoint x="1380" y="1151" />
+ <di:waypoint x="1446" y="1151" />
<bpmndi:BPMNLabel>
<dc:Bounds x="778" y="854" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0e2p0xs_di" bpmnElement="ServiceTask_0e2p0xs">
- <dc:Bounds x="400" y="80" width="100" height="80" />
+ <dc:Bounds x="990" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0mew9im_di" bpmnElement="SequenceFlow_0mew9im">
- <di:waypoint x="500" y="120" />
- <di:waypoint x="560" y="120" />
+ <di:waypoint x="1090" y="396" />
+ <di:waypoint x="1150" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="530" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0kf5sen_di" bpmnElement="SequenceFlow_0kf5sen">
- <di:waypoint x="1085" y="190" />
- <di:waypoint x="1085" y="246" />
- <di:waypoint x="1161" y="246" />
+ <di:waypoint x="1675" y="466" />
+ <di:waypoint x="1675" y="522" />
+ <di:waypoint x="1751" y="522" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1091" y="218" width="19" height="12" />
+ <dc:Bounds x="1682" y="494" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1tfizxf_di" bpmnElement="SequenceFlow_1tfizxf">
- <di:waypoint x="180" y="120" />
- <di:waypoint x="211" y="120" />
- <di:waypoint x="211" y="120" />
- <di:waypoint x="239" y="120" />
+ <di:waypoint x="770" y="396" />
+ <di:waypoint x="801" y="396" />
+ <di:waypoint x="801" y="396" />
+ <di:waypoint x="829" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="226" y="120" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0m5xr0e_di" bpmnElement="Task_PreValidateWorkflow">
- <dc:Bounds x="80" y="80" width="100" height="80" />
+ <dc:Bounds x="670" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0lbkcyp_di" bpmnElement="ServiceTask_0lbkcyp">
- <dc:Bounds x="735" y="80" width="100" height="80" />
+ <dc:Bounds x="1325" y="356" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1hsqed1_di" bpmnElement="SequenceFlow_1hsqed1">
- <di:waypoint x="660" y="120" />
- <di:waypoint x="735" y="120" />
+ <di:waypoint x="1250" y="396" />
+ <di:waypoint x="1325" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="697.5" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1fftixk_di" bpmnElement="SequenceFlow_1fftixk">
- <di:waypoint x="835" y="120" />
- <di:waypoint x="911" y="120" />
+ <di:waypoint x="1425" y="396" />
+ <di:waypoint x="1501" y="396" />
<bpmndi:BPMNLabel>
<dc:Bounds x="873" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1pnkpim_di" bpmnElement="SequenceFlow_1pnkpim">
- <di:waypoint x="886" y="-36" />
- <di:waypoint x="289" y="-36" />
- <di:waypoint x="289" y="80" />
+ <di:waypoint x="1476" y="240" />
+ <di:waypoint x="879" y="240" />
+ <di:waypoint x="879" y="356" />
<bpmndi:BPMNLabel>
<dc:Bounds x="587.5" y="-57" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1dez26n_di" bpmnElement="ExclusiveGateway_1dez26n" isMarkerVisible="true">
+ <dc:Bounds x="695" y="215" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="745" y="228" width="78" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1lrz41x_di" bpmnElement="SequenceFlow_1lrz41x">
+ <di:waypoint x="590" y="240" />
+ <di:waypoint x="695" y="240" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="52.5" y="-57" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0etawv5_di" bpmnElement="SequenceFlow_0etawv5">
+ <di:waypoint x="720" y="265" />
+ <di:waypoint x="720" y="356" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="729" y="305" width="13" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_12f15tu_di" bpmnElement="EndEvent_12f15tu">
+ <dc:Bounds x="702" y="106" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="710" y="81" width="20" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0ilo6lo_di" bpmnElement="SequenceFlow_0ilo6lo">
+ <di:waypoint x="720" y="215" />
+ <di:waypoint x="720" y="142" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="727" y="173" width="18" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java
deleted file mode 100644
index 47ddea1b4f..0000000000
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/SerializableChecker.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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;
-
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public final class SerializableChecker {
- public static class SerializationFailure {
- private final String mContainingClass;
- private final String mMemberName;
-
- public SerializationFailure(String inNonSerializableClass, String inMemberName) {
- mContainingClass = inNonSerializableClass;
- mMemberName = inMemberName;
- }
-
- public String getContainingClass() {
- return mContainingClass;
- }
-
- public String getMemberName() {
- return mMemberName;
- }
-
- public String getBadMemberString() {
- if (mMemberName == null)
- return mContainingClass;
- return mContainingClass + "." + mMemberName;
- }
-
- @Override
- public String toString() {
- return "SerializationFailure [mNonSerializableClass=" + mContainingClass + ", mMemberName=" + mMemberName
- + "]";
- }
- }
-
- private static class SerializationCheckerData {
- private Set<Class<?>> mSerializableClasses;
-
- SerializationCheckerData() {
- mSerializableClasses = new HashSet<Class<?>>();
- }
-
- boolean isAlreadyChecked(Class<?> inClass) {
- return mSerializableClasses.contains(inClass);
- }
-
- void addSerializableClass(Class<?> inClass) {
- mSerializableClasses.add(inClass);
- }
- }
-
- private SerializableChecker() {}
-
- public static SerializationFailure isFullySerializable(Class<?> inClass) {
- if (!isSerializable(inClass))
- return new SerializationFailure(inClass.getName(), null);
-
- return isFullySerializable(inClass, new SerializationCheckerData());
- }
-
- private static SerializationFailure isFullySerializable(Class<?> inClass,
- SerializationCheckerData inSerializationCheckerData) {
- for (Field field : declaredFields(inClass)) {
- Class<?> fieldDeclaringClass = field.getType();
-
- if (field.getType() == Object.class)
- continue;
-
- if (Modifier.isStatic(field.getModifiers()))
- continue;
-
- if (field.isSynthetic())
- continue;
-
- if (fieldDeclaringClass.isInterface() || fieldDeclaringClass.isPrimitive())
- continue;
-
- if (Modifier.isAbstract(field.getType().getModifiers()))
- continue;
-
- if (inSerializationCheckerData.isAlreadyChecked(fieldDeclaringClass))
- continue;
-
- if (isSerializable(fieldDeclaringClass)) {
- inSerializationCheckerData.addSerializableClass(inClass);
-
- SerializationFailure failure = isFullySerializable(field.getType(), inSerializationCheckerData);
- if (failure != null)
- return failure;
- else
- continue;
- }
-
- if (Modifier.isTransient(field.getModifiers()))
- continue;
-
- return new SerializationFailure(field.getDeclaringClass().getName(), field.getName());
- }
- return null;
- }
-
- private static boolean isSerializable(Class<?> inClass) {
- Set<Class<?>> interfaces = getInterfaces(inClass);
- if (interfaces == null)
- return false;
- boolean isSerializable = interfaces.contains(Serializable.class);
- if (isSerializable)
- return true;
-
- for (Class<?> classInterface : interfaces) {
- if (isSerializable(classInterface))
- return true;
- }
-
- if (inClass.getSuperclass() != null && isSerializable(inClass.getSuperclass()))
- return true;
-
- return false;
- }
-
- private static Set<Class<?>> getInterfaces(Class<?> inFieldDeclaringClass) {
- return new HashSet<Class<?>>(Arrays.asList(inFieldDeclaringClass.getInterfaces()));
- }
-
- private static List<Field> declaredFields(Class<?> inClass) {
- List<Field> fields = new ArrayList<Field>(Arrays.asList(inClass.getDeclaredFields()));
-
- Class<?> parentClasses = inClass.getSuperclass();
-
- if (parentClasses == null)
- return fields;
- fields.addAll(declaredFields(parentClasses));
-
- return fields;
- }
-}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
index ff987b75d4..5b7fe66f54 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
@@ -19,6 +19,7 @@
*/
package org.onap.so.bpmn;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,6 +27,8 @@ import java.util.Map;
import org.camunda.bpm.engine.ExternalTaskService;
import org.camunda.bpm.engine.RepositoryService;
import org.camunda.bpm.engine.RuntimeService;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.extension.mockito.mock.FluentJavaDelegateMock;
import org.camunda.bpm.model.bpmn.Bpmn;
import org.camunda.bpm.model.bpmn.BpmnModelInstance;
@@ -49,6 +52,7 @@ import org.onap.so.bpmn.infrastructure.adapter.network.tasks.NetworkAdapterUpdat
import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterCreateTasks;
import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterDeleteTasks;
import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterImpl;
+import org.onap.so.bpmn.infrastructure.appc.tasks.AppcOrchestratorPreProcessor;
import org.onap.so.bpmn.infrastructure.appc.tasks.AppcRunTasks;
import org.onap.so.bpmn.infrastructure.audit.AuditTasks;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.ActivateVfModule;
@@ -131,6 +135,9 @@ public abstract class BaseBPMNTest {
protected AppcRunTasks appcRunTasks;
@MockBean
+ protected AppcOrchestratorPreProcessor appcOrchestratorPreProcessor;
+
+ @MockBean
protected SDNCActivateTasks sdncActivateTasks;
@MockBean
@@ -299,4 +306,17 @@ public abstract class BaseBPMNTest {
mockedSubprocessList.add(repositoryService.createDeployment()
.addModelInstance(fileName + ".bpmn", modelInstance).deploy().getId());
}
+
+ protected void processExternalTasks(ProcessInstance pi, String taskName) {
+ assertThat(pi).isWaitingAt(taskName);
+ List<LockedExternalTask> tasks =
+ externalTaskService.fetchAndLock(100, "externalWorkerId").topic("AppcService", 60L * 1000L).execute();
+ while (!tasks.isEmpty()) {
+ for (LockedExternalTask task : tasks) {
+ externalTaskService.complete(task.getId(), "externalWorkerId");
+ }
+ tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("AppcService", 60L * 1000L)
+ .execute();
+ }
+ }
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java
index 8306de4794..dae430e400 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class DistributeTrafficActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayDistributeTrafficActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskDistributeTraffic");
assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity",
"TaskDistributeTraffic", "DistributeTrafficActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class DistributeTrafficActivityTest extends BaseBPMNTest {
@Test
public void rainyDayDistributeTrafficActivity_Test() throws Exception {
- variables.put("actionDistributeTraffic", Action.DistributeTraffic);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity", "TaskDistributeTraffic")
- .hasNotPassed("DistributeTrafficActivity_End");
+ .hasPassedInOrder("DistributeTrafficActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskDistributeTraffic", "DistributeTrafficActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java
index 195a1ed809..7c18a20604 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DistributeTrafficCheckActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class DistributeTrafficCheckActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayDistributeTrafficCheckActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskDistributeTrafficCheck");
assertThat(pi).isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start", "TaskPreProcessActivity",
"TaskDistributeTrafficCheck", "DistributeTrafficCheckActivity_End");
assertThat(pi).isEnded();
@@ -42,14 +44,12 @@ public class DistributeTrafficCheckActivityTest extends BaseBPMNTest {
@Test
public void rainyDayDistributeTrafficActivity_Test() throws Exception {
- variables.put("actionDistributeTrafficCheck", Action.DistributeTrafficCheck);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DistributeTrafficCheckActivity", variables);
- assertThat(pi)
- .isNotNull().isStarted().hasPassedInOrder("DistributeTrafficCheckActivity_Start",
- "TaskPreProcessActivity", "TaskDistributeTrafficCheck")
- .hasNotPassed("DistributeTrafficCheckActivity_End");
+ assertThat(pi).isNotNull().isStarted()
+ .hasPassedInOrder("DistributeTrafficCheckActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskDistributeTrafficCheck", "DistributeTrafficCheckActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java
index c0b0094f20..48104017a5 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java
@@ -29,7 +29,6 @@ import org.camunda.bpm.engine.TaskService;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.runtime.Job;
import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.task.Task;
import org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions;
import org.junit.Test;
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
index 0b17e3e099..10040b813c 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFHealthCheckActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskHealthCheck");
assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity",
"TaskHealthCheck", "VNFHealthCheckActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class VNFHealthCheckActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFHealthCheckActivity_Test() throws Exception {
- variables.put("actionHealthCheck", Action.HealthCheck);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity", "TaskHealthCheck")
- .hasNotPassed("VNFHealthCheckActivity_End");
+ .hasPassedInOrder("VNFHealthCheckActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskHealthCheck", "VNFHealthCheckActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java
index 45cf44848f..a174bbb90c 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFLockActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFLockActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskLock");
assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock",
"VNFLockActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,11 @@ public class VNFLockActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFLockActivity_Test() throws Exception {
- variables.put("actionLock", Action.Lock);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
- assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity", "TaskLock")
- .hasNotPassed("VNFLockActivity_End");
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFLockActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskLock", "VNFLockActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
index fb462bc02f..b1229cdfdf 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskQuiesceTraffic");
assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity",
"TaskQuiesceTraffic", "VNFQuiesceTrafficActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception {
- variables.put("actionQuiesceTraffic", Action.QuiesceTraffic);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity", "TaskQuiesceTraffic")
- .hasNotPassed("VNFQuiesceTrafficActivity_End");
+ .hasPassedInOrder("VNFQuiesceTrafficActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskQuiesceTraffic", "VNFQuiesceTrafficActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
index 61d88a5770..ae61f3c46e 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFResumeTrafficActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskResumeTraffic");
assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity",
"TaskResumeTraffic", "VNFResumeTrafficActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class VNFResumeTrafficActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFResumeTrafficActivity_Test() throws Exception {
- variables.put("actionResumeTraffic", Action.ResumeTraffic);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity", "TaskResumeTraffic")
- .hasNotPassed("VNFResumeTrafficActivity_End");
+ .hasPassedInOrder("VNFResumeTrafficActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskResumeTraffic", "VNFResumeTrafficActivity_End");
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java
index 001dc70b54..513afd35e5 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
-import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doThrow;
import org.camunda.bpm.engine.delegate.BpmnError;
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java
index 6f1e076c02..b883f1cb28 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java
@@ -28,27 +28,27 @@ import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFSnapShotActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException {
+ variables.put("vmIdListSize", 0);
+ variables.put("vmIdList", null);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity",
- "TaskSnapShot", "VNFSnapShotActivity_End");
+ assertThat(pi).isStarted()
+ .hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", "VNFSnapShotActivity_End")
+ .hasNotPassed("TaskSnapShot");
assertThat(pi).isEnded();
}
@Test
public void rainyDayVNFSnapShotActivity_Test() throws Exception {
- variables.put("actionSnapshot", Action.Snapshot);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
- assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity", "TaskSnapShot")
- .hasNotPassed("VNFSnapShotActivity_End");
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFSnapShotActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskSnapShot", "VNFSnapShotActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java
index 2163e0b7a8..0a700c5fa1 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFStartActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFStartActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskStart");
assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart",
"VNFStartActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,11 @@ public class VNFStartActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFStartActivity_Test() throws Exception {
- variables.put("actionStart", Action.Start);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
- assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity", "TaskStart")
- .hasNotPassed("VNFStartActivity_End");
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStartActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskStart", "VNFStartActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java
index 58dfff8bd7..89cc13f0f0 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFStopActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFStopActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskStop");
assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop",
"VNFStopActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,11 @@ public class VNFStopActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFStopActivity_Test() throws Exception {
- variables.put("actionStop", Action.Stop);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
- assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity", "TaskStop")
- .hasNotPassed("VNFStopActivity_End");
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStopActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskStop", "VNFStopActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java
index c5ddd56880..0dbde4b62c 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFUnlockActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskUnlock");
assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock",
"VNFUnlockActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,11 @@ public class VNFUnlockActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFUnlockActivity_Test() throws Exception {
- variables.put("actionUnlock", Action.Unlock);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
- assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity", "TaskUnlock")
- .hasNotPassed("VNFUnlockActivity_End");
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUnlockActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskUnlock", "VNFUnlockActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java
index 4d99147761..2d4a11c17e 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java
@@ -23,18 +23,20 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFUpgradeBackupActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskUpgradeBackup");
assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity",
"TaskUpgradeBackup", "VNFUpgradeBackupActivity_End");
assertThat(pi).isEnded();
@@ -42,14 +44,12 @@ public class VNFUpgradeBackupActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception {
- variables.put("actionUpgradeBackup", Action.UpgradeBackup);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted()
- .hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity", "TaskUpgradeBackup")
- .hasNotPassed("VNFUpgradeBackupActivity_End");
+ assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskUpgradeBackup", "VNFUpgradeBackupActivity_End");
assertThat(pi).isEnded();
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
index c87cc44f29..dfb6bc1d9c 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
@@ -20,20 +20,22 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
+ processExternalTasks(pi, "TaskUpgradePostCheck");
assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start",
"TaskPreProcessActivity", "TaskUpgradePostCheck", "VNFUpgradePostCheckActivity_End");
@@ -41,14 +43,12 @@ public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception {
- variables.put("actionUpgradePostCheck", Action.UpgradePostCheck);
-
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePostCheck")
- .hasNotPassed("VNFUpgradePostCheckActivity_End");
+ .hasPassedInOrder("VNFUpgradePostCheckActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskUpgradePostCheck", "VNFUpgradePostCheckActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
index 79fc43396d..9854bd8860 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskUpgradePreCheck");
assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity",
"TaskUpgradePreCheck", "VNFUpgradePreCheckActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception {
- variables.put("actionUpgradePreCheck", Action.UpgradePreCheck);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity", "TaskUpgradePreCheck")
- .hasNotPassed("VNFUpgradePreCheckActivity_End");
+ .hasPassedInOrder("VNFUpgradePreCheckActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskUpgradePreCheck", "VNFUpgradePreCheckActivity_End");
}
}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
index b550185702..de999e1074 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
@@ -20,21 +20,23 @@
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
-import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.BaseBPMNTest;
-import org.onap.appc.client.lcm.model.Action;
public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest {
@Test
public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
assertThat(pi).isNotNull();
+ processExternalTasks(pi, "TaskUpgradeSoftware");
assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity",
"TaskUpgradeSoftware", "VNFUpgradeSoftwareActivity_End");
assertThat(pi).isEnded();
@@ -42,13 +44,12 @@ public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest {
@Test
public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception {
- variables.put("actionUpgradeSoftware", Action.UpgradeSoftware);
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
- .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity", "TaskUpgradeSoftware")
- .hasNotPassed("VNFUpgradeSoftwareActivity_End");
+ .hasPassedInOrder("VNFUpgradeSoftwareActivity_Start", "TaskPreProcessActivity")
+ .hasNotPassed("TaskUpgradeSoftware", "VNFUpgradeSoftwareActivity_End");
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
index 573cd0a533..b855e936d0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory
* flow for SDNC Network Resource Activate
*/
public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class)
String Prefix = "ACTSDNCRES_"
@@ -135,7 +135,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -148,12 +148,12 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String customizeResourceParam(String networkInputParametersJson) {
List<Map<String, Object>> paramList = new ArrayList()
- JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson)
Iterator iterator = jsonObject.keys()
while (iterator.hasNext()) {
String key = iterator.next()
HashMap<String, String> hashMap = new HashMap()
- hashMap.put("name", key);
+ hashMap.put("name", key)
hashMap.put("value", jsonObject.get(key))
paramList.add(hashMap)
}
@@ -186,7 +186,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -478,4 +478,4 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
logger.info("exited send sync Resp")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
index 608bf66da9..df11549ff4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -19,9 +19,9 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
@@ -55,7 +55,7 @@ import groovy.json.*
* @param - WorkflowException
*/
public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CompareModelofE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CompareModelofE2EServiceInstance.class)
String Prefix="CMPMDSI_"
private static final String DebugFlag = "isDebugEnabled"
@@ -64,7 +64,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -128,7 +128,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("operationType", "CompareModel")
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -137,7 +137,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit preProcessRequest ")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
logger.trace("sendSyncResponse ")
try {
@@ -155,7 +155,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit sendSyncResopnse ")
}
- public void sendSyncError (DelegateExecution execution) {
+ void sendSyncError (DelegateExecution execution) {
logger.trace("sendSyncError ")
try {
@@ -182,7 +182,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
}
- public void prepareCompletionRequest (DelegateExecution execution) {
+ void prepareCompletionRequest (DelegateExecution execution) {
logger.trace("prepareCompletion ")
try {
@@ -214,7 +214,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit prepareCompletionRequest ")
}
- public void prepareFalloutRequest(DelegateExecution execution){
+ void prepareFalloutRequest(DelegateExecution execution){
logger.trace("prepareFalloutRequest ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index 8bb48a203b..ced1b928fc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -72,7 +72,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( Create3rdONAPE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( Create3rdONAPE2EServiceInstance.class)
public void checkSPPartnerInfo (DelegateExecution execution) {
logger.info(" ***** Started checkSPPartnerInfo *****")
@@ -312,7 +312,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// Put TP Link info into serviceParameters
JSONObject inputParameters = new JSONObject(execution.getVariable(Prefix + "ServiceParameters"))
if(inputParameters.has("remote-access-provider-id")) {
- Map<String, Object> crossTPs = new HashMap<String, Object>();
+ Map<String, Object> crossTPs = new HashMap<String, Object>()
crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"))
crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"))
crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
index 2abee7caaa..cae629fdf0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -39,7 +39,7 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
@@ -56,7 +56,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String Prefix="CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( CreateCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateCustomE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
@@ -154,7 +154,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
//execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams"))
//execution.setVariable("failExists", true)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.debug(msg)
@@ -332,7 +332,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
logger.trace("finished prepareInitServiceOperationStatus")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index bcd33530b1..4b3c1aa7b4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory
*/
public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CreateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateSDNCNetworkResource.class)
String Prefix="CRESDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -120,20 +120,20 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
String customizeResourceParam(String networkInputParametersJson) {
- List<Map<String, Object>> paramList = new ArrayList();
- JSONObject jsonObject = new JSONObject(networkInputParametersJson);
- Iterator iterator = jsonObject.keys();
+ List<Map<String, Object>> paramList = new ArrayList()
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson)
+ Iterator iterator = jsonObject.keys()
while (iterator.hasNext()) {
- String key = iterator.next();
- HashMap<String, String> hashMap = new HashMap();
- hashMap.put("name", key);
+ String key = iterator.next()
+ HashMap<String, String> hashMap = new HashMap()
+ hashMap.put("name", key)
hashMap.put("value", jsonObject.get(key))
paramList.add(hashMap)
}
- Map<String, List<Map<String, Object>>> paramMap = new HashMap();
- paramMap.put("param", paramList);
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap()
+ paramMap.put("param", paramList)
- return new JSONObject(paramMap).toString();
+ return new JSONObject(paramMap).toString()
}
private List<Metadatum> getMetaDatum(String customerId,
@@ -347,7 +347,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -357,7 +357,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
//here convert json string to xml string
String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(networkInputParametersJson)))
// 1. prepare assign topology via SDNC Adapter SUBFLOW call
- String sdncTopologyCreateRequest = "";
+ String sdncTopologyCreateRequest = ""
String modelType = resourceInputObj.getResourceModelInfo().getModelType()
@@ -641,7 +641,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
@@ -674,7 +674,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -724,7 +724,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
try {
String operationStatus = "finished"
// RESTResponse for main flow
- String vnfid=execution.getVariable("resourceInstanceId");
+ String vnfid=execution.getVariable("resourceInstanceId")
String resourceOperationResp = """{"operationStatus":"${operationStatus}","vnf-id":"${vnfid}"}""".trim()
logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 433a8d0bb9..2e664d90da 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -25,7 +25,7 @@ package org.onap.so.bpmn.infrastructure.scripts
import org.onap.so.client.HttpClientFactory
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
@@ -37,14 +37,14 @@ import org.slf4j.LoggerFactory
import org.onap.so.bpmn.core.UrnPropertiesReader
import javax.ws.rs.core.Response
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
/**
* This groovy class supports the <class>DoCreateVFCNetworkServiceInstance.bpmn</class> process.
* flow for VFC Network Service Create
*/
public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CreateVFCNSResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVFCNSResource.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -77,7 +77,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")
logger.info("globalSubscriberId:" + globalSubscriberId)
//set local globalSubscriberId variable
- execution.setVariable("globalSubscriberId", globalSubscriberId);
+ execution.setVariable("globalSubscriberId", globalSubscriberId)
String serviceType = execution.getVariable("serviceType")
logger.info("serviceType:" + serviceType)
@@ -110,9 +110,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
"operationId":"${operationId}",
"nodeTemplateUUID":"${nodeTemplateUUID}"
}"""
- execution.setVariable("nsOperationKey", nsOperationKey);
+ execution.setVariable("nsOperationKey", nsOperationKey)
execution.setVariable("nsParameters", nsParameters)
- execution.setVariable("nsServiceModelUUID", nsServiceModelUUID);
+ execution.setVariable("nsServiceModelUUID", nsServiceModelUUID)
String vfcAdapterUrl = UrnPropertiesReader.getVariable("mso.adapters.vfc.rest.endpoint", execution)
@@ -128,7 +128,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
execution.setVariable("vfcAdapterUrl", vfcAdapterUrl)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -143,9 +143,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
public void createNetworkService(DelegateExecution execution) {
logger.trace("createNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
- String nsOperationKey = execution.getVariable("nsOperationKey");
- String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID");
- String nsParameters = execution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
+ String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID")
+ String nsParameters = execution.getVariable("nsParameters")
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
String locationConstraints = jsonUtil.getJsonValue(nsParameters, "locationConstraints")
@@ -163,7 +163,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = postRequest(execution, vfcAdapterUrl + "/ns", reqBody)
String returnCode = apiResponse.getStatus ()
String aaiResponseAsString = apiResponse.readEntity(String.class)
- String nsInstanceId = "";
+ String nsInstanceId = ""
if(returnCode== "200" || returnCode == "201"){
nsInstanceId = jsonUtil.getJsonValue(aaiResponseAsString, "nsInstanceId")
}
@@ -177,8 +177,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
public void instantiateNetworkService(DelegateExecution execution) {
logger.trace("instantiateNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
- String nsOperationKey = execution.getVariable("nsOperationKey");
- String nsParameters = execution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
+ String nsParameters = execution.getVariable("nsParameters")
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
String reqBody ="""{
@@ -192,7 +192,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = postRequest(execution, url, reqBody)
String returnCode = apiResponse.getStatus()
String aaiResponseAsString = apiResponse.readEntity(String.class)
- String jobId = "";
+ String jobId = ""
if(returnCode== "200"|| returnCode == "201"){
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
@@ -207,7 +207,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
logger.trace("queryNSProgress ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
- String nsOperationKey = execution.getVariable("nsOperationKey");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
String url = vfcAdapterUrl + "/jobs/" + jobId
Response apiResponse = postRequest(execution, url, nsOperationKey)
String returnCode = apiResponse.getStatus()
@@ -225,9 +225,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
*/
public void timeDelay(DelegateExecution execution) {
try {
- Thread.sleep(5000);
+ Thread.sleep(5000)
} catch(InterruptedException e) {
- logger.error("Time Delay exception" + e.getMessage());
+ logger.error("Time Delay exception" + e.getMessage())
}
}
@@ -252,7 +252,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
getAAIClient().connect(nsUri,relatedServiceUri)
logger.info("NS relationship to Service added successfully")
}catch(Exception e){
- logger.error("Exception occured while Creating NS relationship."+ e.getMessage());
+ logger.error("Exception occured while Creating NS relationship."+ e.getMessage())
throw new BpmnError("MSOWorkflowException")
}
}
@@ -268,12 +268,12 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = null
try{
- URL url = new URL(urlString);
+ URL url = new URL(urlString)
// Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
// user 'bepl' authHeader is the same with mso.db.auth
String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Accept", "application/json")
httpClient.addAdditionalHeader("Authorization", basicAuthValuedb)
@@ -282,7 +282,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
logger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
}catch(Exception e){
- logger.error("VFC Aatpter Post Call Exception:" + e.getMessage());
+ logger.error("VFC Aatpter Post Call Exception:" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "VFC Aatpter Post Call Exception")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index 097a1be291..1a689d426c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory
* flow for SDNC Network Resource Activate
*/
public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DeActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeActivateSDNCNetworkResource.class)
String Prefix = "DEACTSDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -53,7 +53,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
MsoUtils msoUtils = new MsoUtils()
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
logger.info(" ***** Started preProcessRequest *****")
@@ -96,7 +96,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
execution.setVariable("mso-request-id", requestId)
execution.setVariable("mso-service-instance-id", resourceInputObj.getServiceInstanceId())
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.debug(msg)
@@ -104,7 +104,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
}
}
- public void prepareSDNCRequest(DelegateExecution execution) {
+ void prepareSDNCRequest(DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
try {
@@ -127,7 +127,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -390,7 +390,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- public void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
+ void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
String resourceInput = execution.getVariable("resourceInput")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String operType = resourceInputObj.getOperationType()
@@ -418,7 +418,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -429,7 +429,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
- public void postDeactivateSDNCCall(DelegateExecution execution) {
+ void postDeactivateSDNCCall(DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
@@ -438,7 +438,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- public void sendSyncResponse(DelegateExecution execution) {
+ void sendSyncResponse(DelegateExecution execution) {
logger.debug(" *** sendSyncResponse *** ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index 64ae3dfbef..da486bb1c3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -60,7 +60,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( Delete3rdONAPE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( Delete3rdONAPE2EServiceInstance.class)
public void checkSPPartnerInfoFromAAI (DelegateExecution execution) {
logger.info(" ***** Started checkSPPartnerInfo *****")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index a9b1fdaac3..2a65ae97a2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -8,7 +8,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -22,9 +22,9 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
@@ -38,7 +38,7 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.springframework.web.util.UriUtils;
+import org.springframework.web.util.UriUtils
import groovy.json.*
@@ -52,7 +52,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
index 7abdd49d1d..1d3b2757e7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
@@ -52,7 +52,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import javax.ws.rs.core.MediaType
import org.apache.commons.codec.binary.Base64
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
/**
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 7c8b7eb7cc..61b1250522 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -67,7 +67,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
MsoUtils msoUtils = new MsoUtils()
- public void preProcessRequest(DelegateExecution execution){
+ void preProcessRequest(DelegateExecution execution){
logger.info(" ***** Started preProcessRequest *****")
try {
@@ -184,7 +184,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
* generate the nsOperationKey
* generate the nsParameters
*/
- public void prepareSDNCRequest (DelegateExecution execution) {
+ void prepareSDNCRequest (DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
try {
@@ -475,7 +475,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
- public void prepareUpdateBeforeDeleteSDNCResource(DelegateExecution execution) {
+ void prepareUpdateBeforeDeleteSDNCResource(DelegateExecution execution) {
logger.debug(" *** prepareUpdateBeforeDeleteSDNCResource *** ")
String resourceInput = execution.getVariable(Prefix + "resourceInput");
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
@@ -511,7 +511,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
- public void prepareUpdateAfterDeleteSDNCResource(DelegateExecution execution) {
+ void prepareUpdateAfterDeleteSDNCResource(DelegateExecution execution) {
logger.debug(" *** prepareUpdateAfterDeleteSDNCResource *** ")
String resourceInput = execution.getVariable(Prefix + "resourceInput");
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
@@ -546,7 +546,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.debug(" ***** Exit prepareUpdateAfterDeleteSDNCResource *****")
}
- public void postDeleteSDNCCall(DelegateExecution execution){
+ void postDeleteSDNCCall(DelegateExecution execution){
logger.info(" ***** Started postDeleteSDNCCall *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
@@ -555,7 +555,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.info(" ***** Exit postDeleteSDNCCall *****")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
logger.debug( " *** sendSyncResponse *** ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
index 9b269c734f..642609a970 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
@@ -63,14 +63,14 @@ public class DeleteVFCNSResource extends AbstractServiceTaskProcessor {
logger.info(" ***** end preProcessRequest *****")
}
- public void postProcessRequest (DelegateExecution execution) {
+ void postProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
logger.info(" ***** start postProcessRequest *****")
logger.info(" ***** end postProcessRequest *****")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.debug( " *** sendSyncResponse *** ")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
index fff2503308..324e6b42ba 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -19,9 +19,9 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.Resource
@@ -52,7 +52,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
String Prefix="DCMPMDV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( DoCompareModelVersions.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCompareModelVersions.class)
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
@@ -196,8 +196,8 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
ServiceDecomposition serviceDecomposition_Target = execution.getVariable("serviceDecomposition_Target")
ServiceDecomposition serviceDecomposition_Original = execution.getVariable("serviceDecomposition_Original")
- List<Resource> allSR_target = serviceDecomposition_Target.getServiceResources();
- List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources();
+ List<Resource> allSR_target = serviceDecomposition_Target.getServiceResources()
+ List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources()
List<Resource> addResourceList = new ArrayList<String>()
List<Resource> delResourceList = new ArrayList<String>()
@@ -214,8 +214,8 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
if(rc_o.getModelInfo().getModelUuid() == muuid
&& rc_o.getModelInfo().getModelInvariantUuid() == mIuuid
&& rc_o.getModelInfo().getModelCustomizationUuid() == mCuuid) {
- addResourceList.remove(rc_t);
- delResourceList.remove(rc_o);
+ addResourceList.remove(rc_t)
+ delResourceList.remove(rc_o)
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index 0191439dac..15b91e5221 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -26,9 +26,9 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import org.onap.so.logger.LoggingAnchor
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import javax.ws.rs.NotFoundException
@@ -83,7 +83,7 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
*
*/
public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class)
String Prefix="DCRESI_"
@@ -165,7 +165,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceData", si)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -210,7 +210,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
//we need a service plugin platform here.
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest);
+ String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", newUuiRequest)
}
@@ -218,7 +218,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
//we need a service plugin platform here.
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest);
+ String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", newUuiRequest)
}
@@ -254,7 +254,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
logger.info(msg)
@@ -276,7 +276,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
client.create(uri, si)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
//start rollback set up
RollbackData rollbackData = new RollbackData()
@@ -310,11 +310,11 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
AAIResultWrapper aaiResult = client.get(uri,NotFoundException.class)
Map<String, Object> result = aaiResult.asMap()
List<Object> resources =
- (List<Object>) result.getOrDefault("result-data", Collections.emptyList());
+ (List<Object>) result.getOrDefault("result-data", Collections.emptyList())
if(resources.size()>0) {
String relationshipUrl = ((Map<String, Object>) resources.get(0)).get("resource-link")
- final Relationship body = new Relationship();
+ final Relationship body = new Relationship()
body.setRelatedLink(relationshipUrl)
createRelationShipInAAI(execution, body)
@@ -329,7 +329,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage()
@@ -349,7 +349,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
client.create(uri, relationship)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateE2EServiceInstance.createRelationShipInAAI. " + ex.getMessage()
@@ -362,9 +362,9 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
private String isNeedProcessCustomRelationship(String uuiRequest) {
String requestInput = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs")
- Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class);
+ Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class)
if (requestInputObject == null) {
- return null;
+ return null
}
Optional<Map.Entry> firstKey =
@@ -380,15 +380,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
private static <T> T getJsonObject(String jsonstr, Class<T> type) {
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+ ObjectMapper mapper = new ObjectMapper()
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true)
try {
- return mapper.readValue(jsonstr, type);
+ return mapper.readValue(jsonstr, type)
} catch (IOException e) {
logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e)
}
- return null;
+ return null
}
@@ -409,7 +409,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
}catch(BpmnError e) {
- throw e;
+ throw e
}catch(Exception ex) {
String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
@@ -449,7 +449,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
logger.info(msg)
@@ -462,12 +462,12 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("preProcessRollback ")
try {
- Object workflowException = execution.getVariable("WorkflowException");
+ Object workflowException = execution.getVariable("WorkflowException")
if (workflowException instanceof WorkflowException) {
logger.info("Prev workflowException: " + workflowException.getErrorMessage())
- execution.setVariable("prevWorkflowException", workflowException);
- //execution.setVariable("WorkflowException", null);
+ execution.setVariable("prevWorkflowException", workflowException)
+ //execution.setVariable("WorkflowException", null)
}
} catch (BpmnError e) {
logger.info("BPMN Error during preProcessRollback")
@@ -482,15 +482,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("postProcessRollback ")
String msg = ""
try {
- Object workflowException = execution.getVariable("prevWorkflowException");
+ Object workflowException = execution.getVariable("prevWorkflowException")
if (workflowException instanceof WorkflowException) {
logger.info("Setting prevException to WorkflowException: ")
- execution.setVariable("WorkflowException", workflowException);
+ execution.setVariable("WorkflowException", workflowException)
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
logger.info("BPMN Error during postProcessRollback")
- throw b;
+ throw b
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
logger.info(msg)
@@ -547,19 +547,19 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing preInitResourcesOperStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), e);
+ ErrorCode.UnknownError.getValue(), e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
logger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
- // if site location is in local Operator, create all resources in local ONAP;
+ // if site location is in local Operator, create all resources in local ONAP
// if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
public void doProcessSiteLocation(DelegateExecution execution){
logger.trace("======== Start doProcessSiteLocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
+ uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", uuiRequest)
execution.setVariable("serviceDecomposition", serviceDecomposition)
@@ -571,7 +571,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("======== Start doTPResourcesAllocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
+ uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest)
execution.setVariable("uuiRequest", uuiRequest)
logger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
index 41a302f5f1..e34e505e55 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
@@ -35,7 +35,7 @@ import org.onap.so.bpmn.common.scripts.NetworkUtils
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import javax.ws.rs.core.Response
import org.camunda.bpm.engine.delegate.BpmnError
@@ -199,7 +199,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "urlRollbackPoNetwork", urlRollbackPoNetwork)
URL url = new URL(urlRollbackPoNetwork)
- HttpClient httpClient = new HttpClientFactory().newXmlClient(url, TargetEntity.OPENSTACK_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.OPENSTACK_ADAPTER)
httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO"))
Response response = httpClient.delete(rollbackNetworkRequest)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index b1356b9fb6..bc26aa10ec 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -72,13 +72,13 @@ import java.lang.reflect.Type
* @param - WorkflowException
*/
public class DoCreateResources extends AbstractServiceTaskProcessor{
- private static final Logger logger = LoggerFactory.getLogger( DoCreateResources.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateResources.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
logger.trace("preProcessRequest ")
String msg = ""
@@ -95,7 +95,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("Exit preProcessRequest ")
}
- public void sequenceResoure(DelegateExecution execution) {
+ void sequenceResoure(DelegateExecution execution) {
logger.trace("Start sequenceResoure Process ")
String incomingRequest = execution.getVariable("uuiRequest")
@@ -170,7 +170,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
String isContainsWanResource = networkResourceList.isEmpty() ? "false" : "true"
//if no networkResource, get SDNC config from properties file
if( "false".equals(isContainsWanResource)) {
- String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need";
+ String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need"
isContainsWanResource = BPMNProperties.getProperty(serviceNeedSDNC, isContainsWanResource)
}
@@ -181,7 +181,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED sequenceResoure Process ")
}
- public prepareServiceTopologyRequest(DelegateExecution execution) {
+ void prepareServiceTopologyRequest(DelegateExecution execution) {
logger.trace("======== Start prepareServiceTopologyRequest Process ======== ")
@@ -201,7 +201,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("======== End prepareServiceTopologyRequest Process ======== ")
}
- public void getCurrentResoure(DelegateExecution execution){
+ void getCurrentResoure(DelegateExecution execution){
logger.trace("Start getCurrentResoure Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
@@ -211,7 +211,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED getCurrentResource Process ")
}
- public void parseNextResource(DelegateExecution execution){
+ void parseNextResource(DelegateExecution execution){
logger.trace("Start parseNextResource Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
@@ -225,7 +225,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED parseNextResource Process ")
}
- public void prepareResourceRecipeRequest(DelegateExecution execution){
+ void prepareResourceRecipeRequest(DelegateExecution execution){
logger.trace("Start prepareResourceRecipeRequest Process ")
ResourceInput resourceInput = new ResourceInput()
String serviceInstanceName = execution.getVariable("serviceInstanceName")
@@ -242,7 +242,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
resourceInput.setServiceType(serviceType)
resourceInput.setServiceInstanceId(serviceInstanceId)
resourceInput.setOperationId(operationId)
- resourceInput.setOperationType(operationType);
+ resourceInput.setOperationType(operationType)
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
@@ -284,7 +284,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED prepareResourceRecipeRequest Process ")
}
- public void executeResourceRecipe(DelegateExecution execution){
+ void executeResourceRecipe(DelegateExecution execution){
logger.trace("Start executeResourceRecipe Process ")
try {
@@ -338,7 +338,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
}
}
- public void postConfigRequest(DelegateExecution execution){
+ void postConfigRequest(DelegateExecution execution){
//now do noting
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
for (VnfResource resource : serviceDecomposition.vnfResources) {
@@ -346,4 +346,4 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
}
execution.setVariable("serviceDecomposition", serviceDecomposition)
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index bf52b11de2..64d9827c7c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -83,7 +83,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
logger.trace("preProcessRequest")
@@ -286,7 +286,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessRequest")
}
- public void getAAICustomerById (DelegateExecution execution) {
+ void getAAICustomerById (DelegateExecution execution) {
// https://{aaiEP}/aai/v8/business/customers/customer/{globalCustomerId}
try {
@@ -306,7 +306,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
- public void putServiceInstance(DelegateExecution execution) {
+ void putServiceInstance(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("putServiceInstance")
String msg = ""
@@ -380,7 +380,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit putServiceInstance")
}
- public void preProcessSDNCAssignRequest(DelegateExecution execution) {
+ void preProcessSDNCAssignRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
logger.trace("preProcessSDNCAssignRequest")
@@ -479,7 +479,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessSDNCAssignRequest")
}
- public void postProcessSDNCAssign (DelegateExecution execution) {
+ void postProcessSDNCAssign (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessSDNCAssign")
try {
@@ -518,7 +518,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessSDNCAssign")
}
- public void postProcessAAIGET2(DelegateExecution execution) {
+ void postProcessAAIGET2(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessAAIGET2")
String msg = ""
@@ -561,7 +561,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessAAIGET2")
}
- public void preProcessRollback (DelegateExecution execution) {
+ void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("preProcessRollback")
try {
@@ -582,7 +582,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessRollback")
}
- public void postProcessRollback (DelegateExecution execution) {
+ void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessRollback")
String msg = ""
@@ -603,7 +603,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessRollback")
}
- public void createProject(DelegateExecution execution) {
+ void createProject(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("createProject")
@@ -631,7 +631,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit createProject")
}
- public void createOwningEntity(DelegateExecution execution) {
+ void createOwningEntity(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("createOwningEntity")
String msg = "";
@@ -679,7 +679,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
// Build Error Section
// *******************************
- public void processJavaException(DelegateExecution execution){
+ void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try{
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
index 1eeba493f4..af82bf091a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
@@ -69,7 +69,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
String Prefix="DCRESIRB_"
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -139,7 +139,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.trace("Exit preProcessRequest")
}
- public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
+ void validateSDNCResponse(DelegateExecution execution, String response, String method) {
logger.trace("validateSDNCResponse")
String msg = ""
@@ -172,7 +172,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.trace("Exit validateSDNCResponse")
}
- public void postProcessRequest(DelegateExecution execution) {
+ void postProcessRequest(DelegateExecution execution) {
logger.trace("postProcessRequest")
String msg = ""
@@ -206,7 +206,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
}
- public void processRollbackException(DelegateExecution execution){
+ void processRollbackException(DelegateExecution execution){
logger.trace("processRollbackException")
try{
@@ -224,7 +224,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.debug("Exit processRollbackException")
}
- public void processRollbackJavaException(DelegateExecution execution){
+ void processRollbackJavaException(DelegateExecution execution){
logger.trace("processRollbackJavaException")
try{
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
index eab99df9b2..2def9e2d06 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
@@ -39,7 +39,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import javax.ws.rs.core.Response
@@ -61,7 +61,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* generate the nsOperationKey
* generate the nsParameters
*/
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
String msg = ""
logger.trace("preProcessRequest()")
try {
@@ -130,7 +130,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* create NS task
*/
- public void createNetworkService(DelegateExecution execution) {
+ void createNetworkService(DelegateExecution execution) {
logger.trace("createNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -157,7 +157,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* instantiate NS task
*/
- public void instantiateNetworkService(DelegateExecution execution) {
+ void instantiateNetworkService(DelegateExecution execution) {
logger.trace("instantiateNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -186,7 +186,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* query NS task
*/
- public void queryNSProgress(DelegateExecution execution) {
+ void queryNSProgress(DelegateExecution execution) {
logger.trace("queryNSProgress")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
@@ -206,7 +206,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* delay 5 sec
*/
- public void timeDelay(DelegateExecution execution) {
+ void timeDelay(DelegateExecution execution) {
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
@@ -217,7 +217,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* finish NS task
*/
- public void addNSRelationship(DelegateExecution execution) {
+ void addNSRelationship(DelegateExecution execution) {
logger.trace("addNSRelationship")
String nsInstanceId = execution.getVariable("nsInstanceId")
if(nsInstanceId == null || nsInstanceId == ""){
@@ -258,7 +258,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
// Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
// user 'bepl' authHeader is the same with mso.db.auth
String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Accept", "application/json")
httpClient.addAdditionalHeader("Authorization", basicAuthValuedb)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
index 731c5b8dc5..dafc4b5470 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
@@ -67,7 +67,7 @@ import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.w3c.dom.NamedNodeMap
@@ -698,7 +698,7 @@ public class DoCreateVfModule extends VfModuleBase {
String endPoint = aaiUriUtil.createAaiUri(uri)
try {
- HttpClient client = httpClientFactory.newXmlClient(new URL(endPoint), TargetEntity.AAI)
+ HttpClient client = httpClientFactory.newXmlClient(new URL(endPoint), ONAPComponents.AAI)
client.addAdditionalHeader('X-TransactionId', UUID.randomUUID().toString())
client.addAdditionalHeader('X-FromAppId', 'MSO')
client.addAdditionalHeader('Content-Type', MediaType.APPLICATION_XML)
@@ -781,7 +781,7 @@ public class DoCreateVfModule extends VfModuleBase {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, vnfId).queryParam("vf-module-name",vfModuleName)
String endPoint = aaiUriUtil.createAaiUri(uri)
- HttpClient client = httpClientFactory.newXmlClient(new URL(endPoint), TargetEntity.AAI)
+ HttpClient client = httpClientFactory.newXmlClient(new URL(endPoint), ONAPComponents.AAI)
client.addAdditionalHeader('X-TransactionId', UUID.randomUUID().toString())
client.addAdditionalHeader('X-FromAppId', 'MSO')
client.addAdditionalHeader('Content-Type', MediaType.APPLICATION_XML)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
index cf3a0ef56f..a88becad1a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -25,7 +25,7 @@ package org.onap.so.bpmn.infrastructure.scripts
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.ErrorCode
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
@@ -33,8 +33,8 @@ import javax.xml.parsers.DocumentBuilderFactory
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.json.JSONArray;
-import org.json.JSONObject;
+import org.json.JSONArray
+import org.json.JSONObject
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
@@ -44,7 +44,7 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.springframework.web.util.UriUtils;
+import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.w3c.dom.Node
@@ -79,7 +79,7 @@ import groovy.json.*
* Rollback - Deferred
*/
public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstance.class)
String Prefix="DDELSI_"
@@ -151,7 +151,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("siParamsXml", siParamsXml)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -271,7 +271,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
logger.info("sdncDelete:\n" + sdncDelete)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
logger.info(msg)
@@ -302,7 +302,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch(Exception ex) {
msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
logger.info(msg)
@@ -337,8 +337,8 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
//Confirm there are no related service instances (vnf/network or volume)
if (utils.nodeExists(siData, "relationship-list")) {
logger.info("SI Data relationship-list exists:")
- InputSource source = new InputSource(new StringReader(siData));
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ InputSource source = new InputSource(new StringReader(siData))
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance()
DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
Document serviceXml = docBuilder.parse(source)
serviceXml.getDocumentElement().normalize()
@@ -433,7 +433,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
logger.info("Service-instance NOT found in AAI. Silent Success")
}
}catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
logger.info(msg)
@@ -452,7 +452,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourcesClient resourceClient = new AAIResourcesClient()
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
@@ -535,7 +535,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing preInitResourcesOperStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), e);
+ ErrorCode.UnknownError.getValue(), e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
logger.trace("COMPLETED preInitResourcesOperStatus Process ")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index 481a79a7ef..a24bc4411e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -54,7 +54,7 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.springframework.web.util.UriUtils
import javax.ws.rs.NotFoundException
@@ -90,7 +90,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String Prefix="DDEESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( DoDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
@@ -158,7 +158,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("siParamsXml", siParamsXml)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.error(msg)
@@ -243,7 +243,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
// for sp-partner and others
else if (eKey.endsWith("-id")) {
jObj.put("resourceInstanceId", eValue)
- String resourceName = rt + eValue;
+ String resourceName = rt + eValue
jObj.put("resourceType", resourceName)
}
jObj.put("resourceLinkUrl", rl)
@@ -388,7 +388,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceAaiPath = "${aai_endpoint}${urlLink}"
URL url = new URL(serviceAaiPath)
- HttpClient client = new HttpClientFactory().newXmlClient(url, TargetEntity.AAI)
+ HttpClient client = new HttpClientFactory().newXmlClient(url, ONAPComponents.AAI)
client.addBasicAuthHeader(UrnPropertiesReader.getVariable("aai.auth", execution), UrnPropertiesReader.getVariable("mso.msoKey", execution))
client.addAdditionalHeader("X-FromAppId", "MSO")
client.addAdditionalHeader("X-TransactionId", utils.getRequestID())
@@ -520,12 +520,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) {
resource.setResourceId(obj.get("resourceInstanceId"))
//deleteRealResourceList.add(resource)
- matches = true;
+ matches = true
} else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId")) || modelUuid.equals(obj.get("model-version-id")) ) {
resource.setResourceId(obj.get("resourceInstanceId"))
resource.setResourceInstanceName(obj.get("resourceType"))
//deleteRealResourceList.add(resource)
- matches = true;
+ matches = true
}
return matches
}
@@ -646,7 +646,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourcesClient resourceClient = new AAIResourcesClient()
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
index df8735aaaa..09eb7994a8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
@@ -51,7 +51,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import groovy.json.JsonOutput
import javax.ws.rs.core.Response
@@ -455,7 +455,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
String vnfAdapterRequest = execution.getVariable(Prefix + "deleteNetworkRequest")
URL url = new URL(vnfAdapterUrl)
- HttpClient httpClient = new HttpClientFactory().newXmlClient(url, TargetEntity.OPENSTACK_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.OPENSTACK_ADAPTER)
httpClient.accept = "application/xml"
httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO"))
Response response = httpClient.delete(vnfAdapterRequest)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
index 00244aded0..28f4460d71 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
@@ -34,7 +34,7 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.bpmn.core.UrnPropertiesReader
import javax.ws.rs.core.Response
@@ -226,7 +226,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
// Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
// user 'bepl' authHeader is the same with mso.db.auth
String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
- HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Accept", "application/json")
httpClient.addAdditionalHeader("Authorization", basicAuthValuedb)
@@ -257,7 +257,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
// Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
// user 'bepl' authHeader is the same with mso.db.auth
String basicAuthValuedb = UrnPropertiesReader.getVariable("mso.db.auth", execution)
- HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Accept", "application/json")
httpClient.addAdditionalHeader("Authorization", basicAuthValuedb)
httpClient.addAdditionalHeader("Content-Type", "application/json")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
index 2a8cc08cdf..367975e003 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
@@ -51,7 +51,7 @@ import org.onap.so.bpmn.infrastructure.vfcmodel.LocationConstraint
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
@@ -209,7 +209,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
try{
URL url = new URL(urlString);
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.VNF_ADAPTER)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.VNF_ADAPTER)
httpClient.addAdditionalHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk")
apiResponse = httpClient.post(requestBody)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
index 75ac6900fa..cfdba89db7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
@@ -45,7 +45,7 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.onap.so.utils.TargetEntity
+import org.onap.logging.filter.base.ONAPComponents;
/**
* This class supports the VID Flow
@@ -164,7 +164,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
logger.debug("AAI endPoint: " + endPoint)
try {
- HttpClient client = new HttpClientFactory().newXmlClient(new URL(endPoint), TargetEntity.AAI)
+ HttpClient client = new HttpClientFactory().newXmlClient(new URL(endPoint), ONAPComponents.AAI)
client.addAdditionalHeader('X-TransactionId', UUID.randomUUID().toString())
client.addAdditionalHeader('X-FromAppId', 'MSO')
client.addAdditionalHeader('Content-Type', 'application/xml')
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
index cbeb1d3d69..97eb3b3960 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2017 - 2019 Huawei Intellectual Property. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -34,7 +34,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
public class HandlePNF extends AbstractServiceTaskProcessor{
- private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class);
+ private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -95,7 +95,7 @@ public class HandlePNF extends AbstractServiceTaskProcessor{
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
logger.debug("body: "+body)
setProgressUpdateVariables(execution, body)
logger.debug("exit postProcess for HandlePNF")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
index d401522800..ce53044052 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -25,13 +25,15 @@ import java.util.Map;
import java.util.Optional;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class AAICreateResources extends AAIResource {
+ private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class);
public void createAAIProject(String projectName, String serviceInstance) {
AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
@@ -89,6 +91,7 @@ public class AAICreateResources extends AAIResource {
Optional<GenericVnf> vnf = aaiResponse.asBean(GenericVnf.class);
return vnf;
} catch (Exception ex) {
+ logger.error("Exception in getVnfInstance", ex);
return Optional.empty();
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
index 2526ca5c25..c489ef29ce 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -24,13 +24,19 @@ import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-import org.springframework.stereotype.Component;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate {
+ private static final Logger logger = LoggerFactory.getLogger(AAIDeleteServiceInstance.class);
+
+ private static final String ERROR_MESSAGE =
+ "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI.";
+
ExceptionUtil exceptionUtil = new ExceptionUtil();
public void execute(DelegateExecution execution) throws Exception {
@@ -41,9 +47,8 @@ public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegat
getAaiClient().delete(serviceInstanceURI);
execution.setVariable("GENDS_SuccessIndicator", true);
} catch (Exception ex) {
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."
- + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ logger.error(ERROR_MESSAGE, ex);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ERROR_MESSAGE + ex.getMessage());
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
index 493340c9ef..216f426ec0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
@@ -62,6 +62,7 @@ public class CheckAaiForPnfCorrelationIdDelegate implements JavaDelegate {
logger.debug("AAI entry is found for pnf correlation id {}: {}", PNF_CORRELATION_ID, isEntry);
execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, isEntry);
} catch (IOException e) {
+ logger.error("Exception in check AAI for pnf_correlation_id execution", e);
new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage());
}
}
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 d67e6ef0db..ee86ca4292 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
@@ -45,7 +45,7 @@ public class ConfigCheckerDelegate implements JavaDelegate {
private Logger logger = LoggerFactory.getLogger(ConfigCheckerDelegate.class);
// ERROR CODE for variable not found in the delegation Context
- private static int ERROR_CODE = 601;
+ private static final int ERROR_CODE = 601;
@Autowired
protected ExceptionBuilder exceptionUtil;
@@ -65,7 +65,7 @@ public class ConfigCheckerDelegate implements JavaDelegate {
delegateExecution.setVariable(MODEL_UUID, serviceModelUuid);
List<PnfResourceCustomization> pnfCustomizations =
catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
- if (pnfCustomizations != null && pnfCustomizations.size() >= 1) {
+ if (pnfCustomizations != null && !pnfCustomizations.isEmpty()) {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf();
delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION,
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
index 6d73b61ab2..781ee5cda4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
@@ -48,6 +48,7 @@ public class CreateRelation implements JavaDelegate {
try {
pnfManagementImpl.createRelation(serviceInstanceId, pnfName);
} catch (Exception e) {
+ logger.error("An exception occurred when making service and pnf relation. Exception:", e);
new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999,
"An exception occurred when making service and pnf relation. Exception: " + e.getMessage());
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
index 2ababac7e3..5cbd530a93 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -23,49 +23,21 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.camunda.bpm.engine.runtime.Execution;
-import org.onap.aai.domain.yang.v13.Metadatum;
-import org.onap.so.bpmn.common.recipe.ResourceInput;
-import org.onap.so.bpmn.common.resource.ResourceRequestBuilder;
-import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.HashMap;
-import java.util.Optional;
@Component
public class InformDmaapClient implements JavaDelegate {
- private Logger logger = LoggerFactory.getLogger(getClass());
private DmaapClient dmaapClient;
@Override
public void execute(DelegateExecution execution) {
String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID);
RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
- String processBusinessKey = execution.getProcessBusinessKey();
- HashMap<String, String> updateInfo = createUpdateInfo(execution);
- updateInfo.put("pnfCorrelationId", pnfCorrelationId);
- dmaapClient
- .registerForUpdate(pnfCorrelationId,
- () -> runtimeService.createMessageCorrelation("WorkflowMessage")
- .processInstanceBusinessKey(processBusinessKey).correlateWithResult(),
- Optional.of(updateInfo));
- }
-
- private HashMap<String, String> createUpdateInfo(DelegateExecution execution) {
- HashMap<String, String> map = new HashMap();
-
- ResourceInput resourceInputObj = ResourceRequestBuilder
-
- .getJsonObject((String) execution.getVariable("resourceInput"), ResourceInput.class);
- map.put("globalSubscriberID", resourceInputObj.getGlobalSubscriberId());
- map.put("serviceType", resourceInputObj.getServiceType());
- map.put("serviceInstanceId", resourceInputObj.getServiceInstanceId());
- return map;
+ dmaapClient.registerForUpdate(pnfCorrelationId, () -> runtimeService.createMessageCorrelation("WorkflowMessage")
+ .processInstanceBusinessKey(execution.getProcessBusinessKey()).correlateWithResult());
}
@Autowired
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
index d513684659..fd7eb153b6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019 Nokia.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,13 +21,9 @@
package org.onap.so.bpmn.infrastructure.pnf.dmaap;
-import java.util.HashMap;
-import java.util.Optional;
-
public interface DmaapClient {
- void registerForUpdate(String pnfCorrelationId, Runnable informConsumer,
- Optional<HashMap<String, String>> updateInfo);
+ void registerForUpdate(String pnfCorrelationId, Runnable informConsumer);
Runnable unregister(String pnfCorrelationId);
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
index 8010ce62ab..a932e4ac50 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
@@ -28,6 +28,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Spliterator;
@@ -41,6 +42,9 @@ public final class JsonUtilForPnfCorrelationId {
}
static List<String> parseJsonToGelAllPnfCorrelationId(String json) {
+ if (json == null || json.isEmpty()) {
+ return Collections.emptyList();
+ }
JsonElement je = new JsonParser().parse(json);
JsonArray array = je.getAsJsonArray();
List<String> list = new ArrayList<>();
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
index 357b571a5c..a2c73ca639 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -23,7 +23,9 @@
package org.onap.so.bpmn.infrastructure.pnf.dmaap;
import java.io.IOException;
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -38,10 +40,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-import org.onap.so.client.aai.AAIResourcesClient;
-import org.onap.so.client.aai.AAIObjectType;
@Component
public class PnfEventReadyDmaapClient implements DmaapClient {
@@ -55,8 +53,6 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
private volatile ScheduledThreadPoolExecutor executor;
private volatile boolean dmaapThreadListenerIsRunning;
- public volatile List<HashMap<String, String>> updateInfoMap;
-
@Autowired
public PnfEventReadyDmaapClient(Environment env) {
httpClient = HttpClientBuilder.create().build();
@@ -68,19 +64,11 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
.port(env.getProperty("pnf.dmaap.port", Integer.class)).path(env.getProperty("pnf.dmaap.topicName"))
.path(env.getProperty("pnf.dmaap.consumerGroup")).path(env.getProperty("pnf.dmaap.consumerId"))
.build());
- updateInfoMap = new ArrayList<>();
}
@Override
- public synchronized void registerForUpdate(String pnfCorrelationId, Runnable informConsumer,
- Optional<HashMap<String, String>> updateInfo) {
+ public synchronized void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
logger.debug("registering for pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId);
- HashMap<String, String> map = updateInfo.get();
- if (map != null && map.size() > 0) {
- synchronized (updateInfoMap) {
- updateInfoMap.add(map);
- }
- }
pnfCorrelationIdToThreadMap.put(pnfCorrelationId, informConsumer);
if (!dmaapThreadListenerIsRunning) {
startDmaapThreadListener();
@@ -90,17 +78,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
@Override
public synchronized Runnable unregister(String pnfCorrelationId) {
logger.debug("unregistering from pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId);
- Runnable runnable = runnable = pnfCorrelationIdToThreadMap.remove(pnfCorrelationId);
- synchronized (updateInfoMap) {
- for (int i = updateInfoMap.size() - 1; i >= 0; i--) {
- if (!updateInfoMap.get(i).containsKey("pnfCorrelationId"))
- continue;
- String id = updateInfoMap.get(i).get("pnfCorrelationId");
- if (id != pnfCorrelationId)
- continue;
- updateInfoMap.remove(i);
- }
- }
+ Runnable runnable = pnfCorrelationIdToThreadMap.remove(pnfCorrelationId);
if (pnfCorrelationIdToThreadMap.isEmpty()) {
stopDmaapThreadListener();
}
@@ -133,17 +111,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
try {
logger.debug("dmaap listener starts listening pnf ready dmaap topic");
HttpResponse response = httpClient.execute(getRequest);
- List<String> idList = getPnfCorrelationIdListFromResponse(response);
-
- // idList is never null
- if (!idList.isEmpty()) {
- // send only body of response
- registerClientResponse(idList.get(0), EntityUtils.toString(response.getEntity(), "UTF-8"));
- }
-
- if (idList != null) {
- idList.forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
- }
+ getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
} catch (IOException e) {
logger.error("Exception caught during sending rest request to dmaap for listening event topic", e);
} finally {
@@ -168,36 +136,6 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
runnable.run();
}
}
-
- private void registerClientResponse(String pnfCorrelationId, String response) {
-
- String customerId = null;
- String serviceType = null;
- String serId = null;
- synchronized (updateInfoMap) {
- for (HashMap<String, String> map : updateInfoMap) {
- if (!map.containsKey("pnfCorrelationId"))
- continue;
- if (pnfCorrelationId != map.get("pnfCorrelationId"))
- continue;
- if (!map.containsKey("globalSubscriberID"))
- continue;
- if (!map.containsKey("serviceType"))
- continue;
- if (!map.containsKey("serviceInstanceId"))
- continue;
- customerId = map.get("pnfCorrelationId");
- serviceType = map.get("serviceType");
- serId = map.get("serviceInstanceId");
- }
- }
- if (customerId == null || serviceType == null || serId == null)
- return;
- AAIResourcesClient client = new AAIResourcesClient();
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE_METADATA, customerId,
- serviceType, serId);
- client.update(uri, response);
- }
-
}
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationId.java
new file mode 100644
index 0000000000..29914252d8
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationId.java
@@ -0,0 +1,45 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import joptsimple.internal.Strings;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import java.io.IOException;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+
+@Component
+public class CheckAaiForPnfCorrelationId extends PnfBaseTasks {
+ private static final Logger logger = LoggerFactory.getLogger(CheckAaiForPnfCorrelationId.class);
+
+ @Override
+ public void execute(BuildingBlockExecution execution) {
+ try {
+ String pnfCorrelationId = extractPnf(execution).getPnfName();
+ checkIfPnfCorrelationIdPresent(execution, pnfCorrelationId);
+ checkIfPnfExistsInAai(execution, pnfCorrelationId);
+ } catch (BBObjectNotFoundException e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
+ }
+
+ }
+
+ private void checkIfPnfCorrelationIdPresent(BuildingBlockExecution execution, String pnfCorrelationId) {
+ if (Strings.isNullOrEmpty(pnfCorrelationId)) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, PNF_CORRELATION_ID + " is not set");
+ }
+ }
+
+ private void checkIfPnfExistsInAai(BuildingBlockExecution execution, String pnfCorrelationId) {
+ try {
+ boolean isEntry = pnfManagement.getEntryFor(pnfCorrelationId).isPresent();
+ logger.debug("AAI entry is found for pnf correlation id {}: {}", PNF_CORRELATION_ID, isEntry);
+ execution.setVariable(AAI_CONTAINS_INFO_ABOUT_PNF, isEntry);
+ } catch (IOException e) {
+ logger.error("Exception in check AAI for pnf_correlation_id execution", e);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e);
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAai.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAai.java
new file mode 100644
index 0000000000..6e86ad619e
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAai.java
@@ -0,0 +1,34 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CreatePnfEntryInAai extends PnfBaseTasks {
+ private static final Logger logger = LoggerFactory.getLogger(CreatePnfEntryInAai.class);
+
+ @Override
+ public void execute(BuildingBlockExecution execution) throws Exception {
+ try {
+ org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf = extractPnf(execution);
+ String pnfCorrelationId = pnf.getPnfName();
+ pnfManagement.createEntry(pnfCorrelationId, preparePnfForAai(pnf));
+ logger.debug("AAI entry is created for pnf correlation id: {}, pnf uuid: {}", pnfCorrelationId,
+ pnf.getPnfId());
+ } catch (BBObjectNotFoundException e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
+ }
+ }
+
+ private Pnf preparePnfForAai(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf) {
+ Pnf pnfAai = new Pnf();
+ pnfAai.setPnfId(pnf.getPnfId());
+ pnfAai.setPnfName(pnf.getPnfName());
+ return pnfAai;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfBaseTasks.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfBaseTasks.java
new file mode 100644
index 0000000000..d8e3379afb
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfBaseTasks.java
@@ -0,0 +1,29 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.pnf.management.PnfManagement;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public abstract class PnfBaseTasks {
+ protected PnfManagement pnfManagement;
+ @Autowired
+ protected ExceptionBuilder exceptionUtil;
+ @Autowired
+ protected ExtractPojosForBB extractPojosForBB;
+
+ @Autowired
+ public void setPnfManagement(PnfManagement pnfManagement) {
+ this.pnfManagement = pnfManagement;
+ }
+
+ public abstract void execute(BuildingBlockExecution execution) throws Exception;
+
+ protected Pnf extractPnf(BuildingBlockExecution execution) throws BBObjectNotFoundException {
+ return extractPojosForBB.extractByKey(execution, ResourceKey.PNF);
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
index 579e7b72df..7f2cd5c071 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
@@ -50,6 +50,7 @@ import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -98,8 +99,7 @@ public class ServicePluginFactory {
new String[] {VS_MONITORED, VS_UNMONITORED, TS_MONITORED, TS_UNMONITORED};
static {
- try {
- InputStream is = ClassLoader.class.getResourceAsStream("/application.properties");
+ try (InputStream is = ClassLoader.class.getResourceAsStream("/application.properties")) {
if (null != is) {
Properties prop = new Properties();
prop.load(is);
@@ -832,7 +832,7 @@ public class ServicePluginFactory {
return mapper.readValue(jsonstr, type);
} catch (IOException e) {
logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcessError.getValue(), e);
}
return null;
}
@@ -855,31 +855,29 @@ public class ServicePluginFactory {
HttpRequestBase method = null;
HttpResponse httpResponse = null;
- try {
+ try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
int timeout = DEFAULT_TIME_OUT;
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
.setConnectionRequestTimeout(timeout).build();
- HttpClient client = HttpClientBuilder.create().build();
-
- if ("POST".equals(methodType.toUpperCase())) {
+ if ("POST".equalsIgnoreCase(methodType)) {
HttpPost httpPost = new HttpPost(msbUrl);
httpPost.setConfig(requestConfig);
httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
method = httpPost;
- } else if ("PUT".equals(methodType.toUpperCase())) {
+ } else if ("PUT".equalsIgnoreCase(methodType)) {
HttpPut httpPut = new HttpPut(msbUrl);
httpPut.setConfig(requestConfig);
httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
method = httpPut;
- } else if ("GET".equals(methodType.toUpperCase())) {
+ } else if ("GET".equalsIgnoreCase(methodType)) {
HttpGet httpGet = new HttpGet(msbUrl);
httpGet.setConfig(requestConfig);
httpGet.addHeader("X-FromAppId", "MSO");
httpGet.addHeader("Accept", "application/json");
method = httpGet;
- } else if ("DELETE".equals(methodType.toUpperCase())) {
+ } else if ("DELETE".equalsIgnoreCase(methodType)) {
HttpDelete httpDelete = new HttpDelete(msbUrl);
httpDelete.setConfig(requestConfig);
method = httpDelete;
@@ -902,9 +900,6 @@ public class ServicePluginFactory {
method = null;
return responseContent;
- } catch (SocketTimeoutException | ConnectTimeoutException e) {
- return null;
-
} catch (Exception e) {
return null;
@@ -913,13 +908,14 @@ public class ServicePluginFactory {
try {
EntityUtils.consume(httpResponse.getEntity());
} catch (Exception e) {
+ logger.debug("Exception while executing finally block", e);
}
}
if (method != null) {
try {
method.reset();
} catch (Exception e) {
-
+ logger.debug("Exception while executing finally block", e);
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy
index afbace76d6..715a7dff6d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.so.bpmn.infrastructure.scripts
import org.camunda.bpm.engine.delegate.BpmnError
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
deleted file mode 100644
index 1ed3214214..0000000000
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.bpmn.infrastructure;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/async/services/**", "/workflow/services/*", "/SDNCAdapterCallbackService",
- "/WorkflowMessage", "/vnfAdapterNotify", "/vnfAdapterRestNotify")
- .hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and().httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
index bfaf9cfee0..c2e87d57bf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
@@ -32,7 +32,7 @@ public class CancelDmaapSubscriptionTest {
private static final String TEST_PNF_CORRELATION_ID = "testPnfCorrelationId";
@Test
- public void shouldCancelSubscription() throws Exception {
+ public void shouldCancelSubscription() {
// given
CancelDmaapSubscription delegate = new CancelDmaapSubscription();
DmaapClientTestImpl dmaapClientTest = new DmaapClientTestImpl();
@@ -42,7 +42,7 @@ public class CancelDmaapSubscriptionTest {
.thenReturn(TEST_PNF_CORRELATION_ID);
when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
dmaapClientTest.registerForUpdate("testPnfCorrelationId", () -> {
- }, null);
+ });
// when
delegate.execute(delegateExecution);
// then
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
index 2634f03d4b..0ec0ac8214 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019 Nokia.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +21,8 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
-import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
-import java.util.HashMap;
import java.util.Objects;
-import java.util.Optional;
+import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
public class DmaapClientTestImpl implements DmaapClient {
@@ -31,8 +30,7 @@ public class DmaapClientTestImpl implements DmaapClient {
private Runnable informConsumer;
@Override
- public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer,
- Optional<HashMap<String, String>> updateInfo) {
+ public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) {
this.pnfCorrelationId = pnfCorrelationId;
this.informConsumer = informConsumer;
}
@@ -48,19 +46,15 @@ public class DmaapClientTestImpl implements DmaapClient {
return null;
}
- public String getPnfCorrelationId() {
+ String getPnfCorrelationId() {
return pnfCorrelationId;
}
- public Runnable getInformConsumer() {
+ Runnable getInformConsumer() {
return informConsumer;
}
- public void sendMessage() {
- informConsumer.run();
- }
-
- public boolean haveRegisteredConsumer() {
+ boolean haveRegisteredConsumer() {
return pnfCorrelationId != null;
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
index 93a71b31ec..94aa1427a4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
@@ -34,8 +34,6 @@ import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InOrder;
-import org.onap.so.bpmn.common.recipe.ResourceInput;
-import org.onap.so.bpmn.common.resource.ResourceRequestBuilder;
public class InformDmaapClientTest {
@Before
@@ -76,41 +74,11 @@ public class InformDmaapClientTest {
inOrder.verify(messageCorrelationBuilder).correlateWithResult();
}
- private ResourceInput getUpdateResInputObj(String modelName) {
-
- String resourceInput = "{\n" + "\t\"resourceInstanceName\": \"SotnFc-wan-connection_wanconnection-37\",\n"
- + "\t\"resourceInstanceDes\": null,\n" + "\t\"globalSubscriberId\": \"sdwandemo\",\n"
- + "\t\"serviceType\": \"CCVPN\",\n" + "\t\"operationId\": \"df3387b5-4fbf-41bd-82a0-13a955ac178a\",\n"
- + "\t\"serviceModelInfo\": {\n" + "\t\t\"modelName\": \"WanConnectionSvc03\",\n"
- + "\t\t\"modelUuid\": \"198b066c-0771-4157-9594-1824adfdda7e\",\n"
- + "\t\t\"modelInvariantUuid\": \"43fb5165-7d03-4009-8951-a8f45d3f0148\",\n"
- + "\t\t\"modelVersion\": \"1.0\",\n" + "\t\t\"modelCustomizationUuid\": \"\",\n"
- + "\t\t\"modelCustomizationName\": \"\",\n" + "\t\t\"modelInstanceName\": \"\",\n"
- + "\t\t\"modelType\": \"\"\n" + "\t},\n" + "\t\"resourceModelInfo\": {\n" + "\t\t\"modelName\": \""
- + modelName + "\",\n" + "\t\t\"modelUuid\": \"6a0bf88b-343c-415b-88c1-6f73702452c4\",\n"
- + "\t\t\"modelInvariantUuid\": \"50bc3415-2e01-4e50-a9e1-ec9584599bb3\",\n"
- + "\t\t\"modelCustomizationUuid\": \"b205d620-84bd-4058-afa0-e3aeee8bb712\",\n"
- + "\t\t\"modelCustomizationName\": \"\",\n"
- + "\t\t\"modelInstanceName\": \"SotnFc-wan-connection 0\",\n" + "\t\t\"modelType\": \"\"\n" + "\t},\n"
- + "\t\"resourceInstancenUuid\": null,\n"
- + "\t\"resourceParameters\": \"{\\n\\\"locationConstraints\\\":[],\\n\\\"requestInputs\\\":{\\\"sotnfcspecwanconnection0_route-objective-function\\\":null,\\\"sotnfcspecwanconnection0_colorAware\\\":null,\\\"3rdctlspecwanconnection0_thirdPartyAdaptorRpc\\\":null,\\\"sotnfcspecwanconnection0_couplingFlag\\\":null,\\\"sotnfcspecwanconnection0_pbs\\\":null,\\\"3rdctlspecwanconnection0_thirdPartySdncId\\\":null,\\\"sotnfcspecwanconnection0_cbs\\\":null,\\\"3rdctlspecwanconnection0_thirdpartySdncName\\\":null,\\\"sotnfcspecwanconnection0_total-size\\\":null,\\\"3rdctlspecwanconnection0_templateFileName\\\":\\\"sotn_create_zte_template.json\\\",\\\"fcwanconnection0_type\\\":null,\\\"sotnfcspecwanconnection0_cir\\\":null,\\\"fcwanconnection0_uuid\\\":null,\\\"sotnfcspecwanconnection0_diversity-policy\\\":null,\\\"nf_naming\\\":true,\\\"multi_stage_design\\\":false,\\\"availability_zone_max_count\\\":1,\\\"3rdctlspecwanconnection0_restapiUrl\\\":\\\"http://10.80.80.21:8443/restconf/operations/ZTE-API-ConnectivityService:create-connectivity-service\\\",\\\"max_instances\\\":null,\\\"sotnfcspecwanconnection0_reroute\\\":null,\\\"fcwanconnection0_name\\\":null,\\\"sotnfcspecwanconnection0_dualLink\\\":null,\\\"min_instances\\\":null,\\\"sotnfcspecwanconnection0_pir\\\":null,\\\"sotnfcspecwanconnection0_service-type\\\":null}\\n}\",\n"
- + "\t\"operationType\": \"createInstance\",\n"
- + "\t\"serviceInstanceId\": \"ffa07ae4-f820-45af-9439-1416b3bc1d39\",\n"
- + "\t\"requestsInputs\": \"{\\r\\n\\t\\\"service\\\": {\\r\\n\\t\\t\\\"name\\\": \\\"wanconnection-37\\\",\\r\\n\\t\\t\\\"description\\\": \\\"deafe\\\",\\r\\n\\t\\t\\\"serviceInvariantUuid\\\": \\\"43fb5165-7d03-4009-8951-a8f45d3f0148\\\",\\r\\n\\t\\t\\\"serviceUuid\\\": \\\"198b066c-0771-4157-9594-1824adfdda7e\\\",\\r\\n\\t\\t\\\"globalSubscriberId\\\": \\\"sdwandemo\\\",\\r\\n\\t\\t\\\"serviceType\\\": \\\"CCVPN\\\",\\r\\n\\t\\t\\\"parameters\\\": {\\r\\n\\t\\t\\t\\\"resources\\\": [\\r\\n\\t\\t\\t],\\r\\n\\t\\t\\t\\\"requestInputs\\\": {\\r\\n\\t\\t\\t\\t\\\"sotnfcwanconnection0_3rdctlspecwanconnection0_restapiUrl\\\": \\\"http://10.80.80.21:8443/restconf/operations/ZTE-API-ConnectivityService:create-connectivity-service\\\",\\r\\n\\t\\t\\t\\t\\\"sotnfcwanconnection0_3rdctlspecwanconnection0_templateFileName\\\": \\\"sotn_create_zte_template.json\\\",\\r\\n\\t\\t\\t\\t\\\"sdwanfcwanconnection0_3rdctlspecwanconnection0_restapiUrl\\\": \\\"http://10.80.80.21:8443/restconf/operations/ZTE-API-ConnectivityService:create-connectivity-service\\\",\\r\\n\\t\\t\\t\\t\\\"sdwanfcwanconnection0_3rdctlspecwanconnection0_templateFileName\\\": \\\"sdwan_create_zte_template.json\\\",\\\"ont_ont_manufacturer\\\":\\\"huawei\\\",\\\"ont_ont_serial_num\\\":\\\"123\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\"\n"
- + "}";
-
- ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class);
- return resourceInputObj;
- }
-
private DelegateExecution mockDelegateExecution() {
- ResourceInput input = getUpdateResInputObj("OLT");
DelegateExecution delegateExecution = mock(DelegateExecution.class);
-
when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID)))
.thenReturn("testPnfCorrelationId");
when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
- when(delegateExecution.getVariable("resourceInput")).thenReturn(input.toString());
ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class);
when(delegateExecution.getProcessEngineServices()).thenReturn(processEngineServices);
RuntimeService runtimeService = mock(RuntimeService.class);
@@ -118,7 +86,6 @@ public class InformDmaapClientTest {
messageCorrelationBuilder = mock(MessageCorrelationBuilder.class);
when(runtimeService.createMessageCorrelation(any())).thenReturn(messageCorrelationBuilder);
when(messageCorrelationBuilder.processInstanceBusinessKey(any())).thenReturn(messageCorrelationBuilder);
-
return delegateExecution;
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
index 8741208d26..4edee24531 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
@@ -63,4 +63,13 @@ public class JsonUtilForPnfCorrelationIdTest {
assertThat(expectedResult).isEmpty();
}
+ @Test
+ public void shouldReturnEmptyListWhenInputIsNull() {
+ assertThat(JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(null)).isEmpty();
+ }
+
+ @Test
+ public void shouldReturnEmptyListWhenInputIsEmpty() {
+ assertThat(JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId("")).isEmpty();
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
index 19e08d9d59..cccfe0c762 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
@@ -30,8 +30,8 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -41,7 +41,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
-import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.InputStreamEntity;
import org.apache.http.message.BasicHttpResponse;
import org.junit.Before;
import org.junit.Test;
@@ -182,8 +182,8 @@ public class PnfEventReadyDmaapClientTest {
threadRunFlag.setAccessible(false);
}
- private HttpResponse createResponse(String json) throws UnsupportedEncodingException {
- HttpEntity entity = new StringEntity(json);
+ private HttpResponse createResponse(String json) {
+ HttpEntity entity = new InputStreamEntity(new ByteArrayInputStream(json.getBytes()));
ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1);
HttpResponse response = new BasicHttpResponse(protocolVersion, 1, "");
response.setEntity(entity);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationIdTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationIdTest.java
new file mode 100644
index 0000000000..3fa9fbf3b5
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CheckAaiForPnfCorrelationIdTest.java
@@ -0,0 +1,129 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementThrowingException;
+import org.onap.so.bpmn.infrastructure.pnf.management.PnfManagement;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import java.io.IOException;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl.ID_WITHOUT_ENTRY;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl.ID_WITH_ENTRY;
+import static org.onap.so.bpmn.infrastructure.pnf.tasks.PnfTasksUtils.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.tasks.PnfTasksUtils.preparePnf;
+
+@RunWith(Enclosed.class)
+public class CheckAaiForPnfCorrelationIdTest {
+
+ @RunWith(MockitoJUnitRunner.class)
+ public static class ConnectionOkTests {
+
+ @Mock
+ private ExtractPojosForBB extractPojosForBB;
+ @Mock
+ private ExceptionBuilder exceptionUtil;
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ @InjectMocks
+ private CheckAaiForPnfCorrelationId task = new CheckAaiForPnfCorrelationId();
+ private PnfManagement pnfManagementTest = new PnfManagementTestImpl();
+
+ @Before
+ public void setUp() {
+ task.setPnfManagement(pnfManagementTest);
+ }
+
+ @Test
+ public void shouldThrowExceptionWhenPnfCorrelationIdIsNotSet() throws Exception {
+ // given
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.PNF))).thenReturn(preparePnf(null, PNF_UUID));
+ BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
+ doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(eq(execution),
+ anyInt(), anyString());
+ // when, then
+ expectedException.expect(BpmnError.class);
+ task.execute(execution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(eq(execution), anyInt(), anyString());
+ }
+
+ @Test
+ public void shouldSetCorrectVariablesWhenAaiDoesNotContainInfoAboutPnf() throws Exception {
+ // given
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.PNF)))
+ .thenReturn(preparePnf(ID_WITHOUT_ENTRY, PNF_UUID));
+ BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
+ // when
+ task.execute(execution);
+ // then
+ verify(execution).setVariable(AAI_CONTAINS_INFO_ABOUT_PNF, false);
+ }
+
+ @Test
+ public void shouldSetCorrectVariablesWhenAaiContainsInfoAboutPnfWithoutIp() throws Exception {
+ // given
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.PNF)))
+ .thenReturn(preparePnf(ID_WITH_ENTRY, PNF_UUID));
+ BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
+ // when
+ task.execute(execution);
+ // then
+ verify(execution).setVariable(AAI_CONTAINS_INFO_ABOUT_PNF, true);
+ }
+ }
+
+ @RunWith(MockitoJUnitRunner.class)
+ public static class NoConnectionTests {
+
+ @Mock
+ private ExtractPojosForBB extractPojosForBB;
+ @Mock
+ private ExceptionBuilder exceptionUtil;
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ @InjectMocks
+ private CheckAaiForPnfCorrelationId task = new CheckAaiForPnfCorrelationId();
+ private PnfManagement pnfManagementTest = new PnfManagementThrowingException();
+
+ @Before
+ public void setUp() throws Exception {
+ task.setPnfManagement(pnfManagementTest);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.PNF)))
+ .thenReturn(preparePnf(PNF_CORRELATION_ID, PNF_UUID));
+ }
+
+ @Test
+ public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() {
+ // given
+ BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
+ doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(eq(execution),
+ anyInt(), any(IOException.class));
+ // when, then
+ expectedException.expect(BpmnError.class);
+ task.execute(execution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(eq(execution), anyInt(), any(IOException.class));
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAaiTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAaiTest.java
new file mode 100644
index 0000000000..ed8dd82efb
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/CreatePnfEntryInAaiTest.java
@@ -0,0 +1,50 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+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.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.pnf.tasks.PnfTasksUtils.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.tasks.PnfTasksUtils.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.tasks.PnfTasksUtils.preparePnf;
+
+@RunWith(MockitoJUnitRunner.class)
+public class CreatePnfEntryInAaiTest {
+
+ @Mock
+ private ExtractPojosForBB extractPojosForBB;
+ @InjectMocks
+ private CreatePnfEntryInAai task = new CreatePnfEntryInAai();
+ private PnfManagementTestImpl pnfManagementTest = new PnfManagementTestImpl();
+
+ @Before
+ public void setUp() throws Exception {
+ task.setPnfManagement(pnfManagementTest);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.PNF)))
+ .thenReturn(preparePnf(PNF_CORRELATION_ID, PNF_UUID));
+ }
+
+ @Test
+ public void shouldSetPnfIdAndPnfName() throws Exception {
+ // when
+ task.execute(mock(BuildingBlockExecution.class));
+ // then
+ Pnf createdEntry = pnfManagementTest.getCreated().get(PNF_CORRELATION_ID);
+ assertThat(createdEntry.getPnfId()).isEqualTo(PNF_UUID);
+ assertThat(createdEntry.getPnfName()).isEqualTo(PNF_CORRELATION_ID);
+ assertThat(createdEntry.isInMaint()).isNull();
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfTasksUtils.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfTasksUtils.java
new file mode 100644
index 0000000000..49fe96c3d9
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/tasks/PnfTasksUtils.java
@@ -0,0 +1,17 @@
+package org.onap.so.bpmn.infrastructure.pnf.tasks;
+
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
+import java.util.UUID;
+
+public class PnfTasksUtils {
+ static final String PNF_UUID = UUID.nameUUIDFromBytes("testUuid".getBytes()).toString();
+ static final String PNF_CORRELATION_ID = "testPnfCorrelationId";
+
+ public static Pnf preparePnf(String pnfName, String pnfUuid) {
+ Pnf pnf = new Pnf();
+ pnf.setPnfName(pnfName);
+ pnf.setPnfId(pnfUuid);
+ return pnf;
+ }
+
+}
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 5b095a9983..1cd8295fa2 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
@@ -43,6 +43,7 @@ import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceIn
import org.onap.so.BaseBPMNTest;
import org.onap.so.GrpcNettyServer;
import org.onap.so.bpmn.mock.FileUtil;
+import org.onap.so.client.aai.AAIVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -60,7 +61,7 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
private static final int DMAAP_DELAY_TIME_MS = 2000;
private static final String TEST_PROCESSINSTANCE_KEY = "CreateVcpeResCustService_simplified";
-
+ private static final AAIVersion VERSION = AAIVersion.LATEST;
private String testBusinessKey;
private String requestObject;
private String responseObject;
@@ -230,7 +231,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
String aaiResponse = "{\n" + " \"results\": [\n" + " {\n"
+ " \"resource-type\": \"service-instance\",\n"
- + " \"resource-link\": \"https://localhost:8443/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n"
+ + " \"resource-link\": \"https://localhost:8443/aai/" + VERSION
+ + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n"
+ " }\n" + " ]\n" + "}";
String aaiPnfEntry = "{ \n" + " \"pnf-name\":\"PNFDemo\",\n" + " \"pnf-id\":\"testtest\",\n"
@@ -240,52 +242,55 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
/**
* Get the AAI entry for globalCustomerId as specified in the request file.
*/
- wireMockServer.stubFor(
- get(urlPathMatching("/aai/v15/business/customers/customer/ADemoCustomerInCiti.*")).willReturn(ok()));
+ wireMockServer
+ .stubFor(get(urlPathMatching("/aai/" + VERSION + "/business/customers/customer/ADemoCustomerInCiti.*"))
+ .willReturn(ok()));
/**
* PUT the service to AAI with globalCustomerId, service type as specified in the request file. Service instance
* id is generated during runtime, REGEX is used to represent the information.
*/
- wireMockServer.stubFor(put(urlPathMatching(
- "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")));
+ wireMockServer.stubFor(put(urlPathMatching("/aai/" + VERSION
+ + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")));
- wireMockServer.stubFor(get(urlPathMatching(
- "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))
+ wireMockServer.stubFor(get(urlPathMatching("/aai/" + VERSION
+ + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))
.willReturn(okJson(aaiResponse)));
/**
* Get the service from AAI
*/
- wireMockServer.stubFor(get(urlPathMatching("/aai/v15/nodes/service-instances/service-instance/.*"))
+ wireMockServer.stubFor(get(urlPathMatching("/aai/" + VERSION + "/nodes/service-instances/service-instance/.*"))
.willReturn(okJson(aaiResponse)));
/**
* Put the project as specified in the request file to AAI.
*/
- wireMockServer.stubFor(put(urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration")));
+ wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/business/projects/project/Project-Demonstration")));
/**
* GET the project as specified in the request file to AAI.
*/
- wireMockServer.stubFor(
- get(urlPathMatching("/aai/v15/business/projects/project/Project-Demonstration")).willReturn(ok()));
+ wireMockServer
+ .stubFor(get(urlPathMatching("/aai/" + VERSION + "/business/projects/project/Project-Demonstration"))
+ .willReturn(ok()));
/**
* PUT the PNF correlation ID to AAI.
*/
- wireMockServer.stubFor(put(urlEqualTo("/aai/v15/network/pnfs/pnf/PNFDemo")));
+ wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")));
/**
* Get the PNF entry from AAI.
*/
- wireMockServer.stubFor(get(urlEqualTo("/aai/v15/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
/**
* Put the PNF relationship
*/
- wireMockServer.stubFor(put(
- urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration/relationship-list/relationship")));
+ wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION
+ + "/business/projects/project/Project-Demonstration/relationship-list/relationship")));
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
index 4e74e5d414..c223d3ff11 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
@@ -2,14 +2,15 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) Copyright (C) 2018 Bell Canada.
+ * Copyright (C) 2018 Bell Canada.
+ * Copyright (C) 2019 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.
@@ -20,7 +21,6 @@
package org.onap.so.bpmn.buildingblock;
-import java.util.Map;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -28,37 +28,37 @@ import org.springframework.stereotype.Component;
@Component
public class HomingV2 {
- @Autowired
- private OofHomingV2 oofHomingV2;
- @Autowired
+ static final String HOMING_SNIRO = "sniro";
+ static final String HOMING_OOF = "oof";
+ static final String HOMING_SOLUTION = "Homing_Solution";
+
private SniroHomingV2 sniroHomingV2;
+ private OofHomingV2 oofHomingV2;
- private static final String HOMINGSOLUTION = "Homing_Solution";
+ @Autowired
+ public HomingV2(OofHomingV2 oofHomingV2, SniroHomingV2 sniroHomingV2) {
+ this.oofHomingV2 = oofHomingV2;
+ this.sniroHomingV2 = sniroHomingV2;
+ }
public void callHoming(BuildingBlockExecution execution) {
- if (isOof(execution)) {
- oofHomingV2.callOof(execution);
- } else {
+ if (isSniro(execution)) {
sniroHomingV2.callSniro(execution);
+ } else {
+ oofHomingV2.callOof(execution);
}
}
public void processSolution(BuildingBlockExecution execution, String asyncResponse) {
- if (isOof(execution)) {
- oofHomingV2.processSolution(execution, asyncResponse);
- } else {
+ if (isSniro(execution)) {
sniroHomingV2.processSolution(execution, asyncResponse);
+ } else {
+ oofHomingV2.processSolution(execution, asyncResponse);
}
}
- // Default solution is SNIRO. OOF gets called only if specified.
- private boolean isOof(BuildingBlockExecution execution) {
- for (Map<String, Object> params : execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters()
- .getUserParams()) {
- if (params.containsKey(HOMINGSOLUTION) && ("oof").equals(params.get(HOMINGSOLUTION))) {
- return true;
- }
- }
- return false;
+ private boolean isSniro(BuildingBlockExecution execution) {
+ return execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters().getUserParams().stream()
+ .anyMatch(params -> HOMING_SNIRO.equals(params.get(HOMING_SOLUTION)));
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index f1fd23fe82..f10b503ed3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -65,7 +65,7 @@ import org.onap.so.client.sniro.beans.ServiceInfo;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
import org.onap.so.client.sniro.beans.SubscriberInfo;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -162,14 +162,14 @@ public class SniroHomingV2 {
} catch (BpmnError e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage(),
- TargetEntity.SNIRO);
+ ONAPComponents.SNIRO);
} catch (BadResponseException e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), TargetEntity.SNIRO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), ONAPComponents.SNIRO);
} catch (Exception e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
- "Internal Error - occurred while preparing sniro request: " + e.getMessage(), TargetEntity.SO);
+ "Internal Error - occurred while preparing sniro request: " + e.getMessage(), ONAPComponents.SO);
}
}
@@ -214,15 +214,15 @@ public class SniroHomingV2 {
} catch (BpmnError e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage(),
- TargetEntity.SNIRO);
+ ONAPComponents.SNIRO);
} catch (BadResponseException e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), TargetEntity.SNIRO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), ONAPComponents.SNIRO);
} catch (Exception e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
"Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage(),
- TargetEntity.SO);
+ ONAPComponents.SO);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 68cfd487b3..b9f73f3f0e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -71,6 +71,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
+import com.google.common.base.Strings;
@Component
public class AAICreateTasks {
@@ -184,24 +185,35 @@ public class AAICreateTasks {
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
OwningEntity owningEntity = serviceInstance.getOwningEntity();
- String owningEntityId = owningEntity.getOwningEntityId();
- String owningEntityName = owningEntity.getOwningEntityName();
- if (owningEntityId == null || "".equals(owningEntityId)) {
- String msg = "Exception in AAICreateOwningEntity. OwningEntityId is null.";
+ if (Strings.isNullOrEmpty(owningEntity.getOwningEntityId())
+ && Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
+ String msg = "Exception in AAICreateOwningEntity. OwningEntityId and Name are null.";
execution.setVariable("ErrorCreateOEAAI", msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ } else if (Strings.isNullOrEmpty(owningEntity.getOwningEntityId())
+ && !Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
+ if (aaiSIResources.existsOwningEntityName(owningEntity.getOwningEntityName())) {
+ org.onap.aai.domain.yang.OwningEntity aaiEntity =
+ aaiSIResources.getOwningEntityByName(owningEntity.getOwningEntityName());
+ owningEntity.setOwningEntityId(aaiEntity.getOwningEntityId());
+ owningEntity.setOwningEntityName(owningEntity.getOwningEntityName());
+ aaiSIResources.connectOwningEntityandServiceInstance(owningEntity, serviceInstance);
+ } else {
+ owningEntity.setOwningEntityId(UUID.randomUUID().toString());
+ aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance);
+ }
} else {
if (aaiSIResources.existsOwningEntity(owningEntity)) {
aaiSIResources.connectOwningEntityandServiceInstance(owningEntity, serviceInstance);
} else {
- if (owningEntityName == null || "".equals(owningEntityName)) {
+ if (Strings.isNullOrEmpty(owningEntity.getOwningEntityName())) {
String msg =
"Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName.";
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue(), msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
} else {
- if (aaiSIResources.existsOwningEntityName(owningEntityName)) {
+ if (aaiSIResources.existsOwningEntityName(owningEntity.getOwningEntityName())) {
String msg =
"Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)";
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg,
@@ -360,6 +372,7 @@ public class AAICreateTasks {
logger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup");
}
if (volumeGroup != null) {
+ logger.debug("Connecting VfModule to VolumGroup");
aaiVfModuleResources.connectVfModuleToVolumeGroup(vnf, vfModule, volumeGroup,
execution.getGeneralBuildingBlock().getCloudRegion());
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
index 18ba91263b..15f8c5e4ef 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
@@ -80,6 +80,16 @@ public class AAIDeleteTasks {
@Autowired
private AAIInstanceGroupResources aaiInstanceGroupResources;
+ /**
+ * BPMN access method to delete the VfModule from A&AI.
+ *
+ * It will extract the genericVnf & VfModule from the BBObject.
+ *
+ * Before deleting it set the aaiVfModuleRollback as false & then it will delete the VfModule.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteVfModule(BuildingBlockExecution execution) throws Exception {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
@@ -89,10 +99,21 @@ public class AAIDeleteTasks {
aaiVfModuleResources.deleteVfModule(vfModule, genericVnf);
execution.setVariable("aaiVfModuleRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteVfModule process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the Vnf from A&AI.
+ *
+ * It will extract the genericVnf from the BBObject.
+ *
+ * Before deleting it set the aaiVnfRollback as false & then it will delete the Vnf.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteVnf(BuildingBlockExecution execution) throws Exception {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
@@ -101,79 +122,154 @@ public class AAIDeleteTasks {
aaiVnfResources.deleteVnf(genericVnf);
execution.setVariable("aaiVnfRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteVnf process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the ServiceInstance from A&AI.
+ *
+ * It will extract the serviceInstance from the BBObject.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteServiceInstance(BuildingBlockExecution execution) throws Exception {
try {
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiSIResources.deleteServiceInstance(serviceInstance);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteServiceInstance process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the l3network from A&AI.
+ *
+ * It will extract the l3network from the BBObject.
+ *
+ * After deleting the l3network it set the isRollbackNeeded as true.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteNetwork(BuildingBlockExecution execution) throws Exception {
try {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
aaiNetworkResources.deleteNetwork(l3network);
execution.setVariable("isRollbackNeeded", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteNetwork process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the Collection from A&AI.
+ *
+ * It will extract the serviceInstance from the BBObject.
+ *
+ * Then it will get the collection from serviceinstance.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteCollection(BuildingBlockExecution execution) throws Exception {
try {
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiNetworkResources.deleteCollection(serviceInstance.getCollection());
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteCollection process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the InstanceGroup from A&AI.
+ *
+ * It will extract the serviceInstance from the BBObject.
+ *
+ * Then it will get the Instance group from serviceInstance.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteInstanceGroup(BuildingBlockExecution execution) throws Exception {
try {
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiNetworkResources.deleteNetworkInstanceGroup(serviceInstance.getCollection().getInstanceGroup());
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteInstanceGroup process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the VolumeGroup from A&AI.
+ *
+ * It will extract the volumeGroup from the BBObject and cloudRegion from execution object .
+ *
+ * Then it will delete from A&AI.
+ *
+ * @param execution
+ * @throws Exception
+ */
public void deleteVolumeGroup(BuildingBlockExecution execution) {
try {
VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
CloudRegion cloudRegion = execution.getGeneralBuildingBlock().getCloudRegion();
aaiVolumeGroupResources.deleteVolumeGroup(volumeGroup, cloudRegion);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteVolumeGroup process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the Configuration from A&AI.
+ *
+ * It will extract the configuration from the BBObject.
+ *
+ * Then it will delete from A&AI.
+ *
+ * @param execution
+ */
public void deleteConfiguration(BuildingBlockExecution execution) {
try {
Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
aaiConfigurationResources.deleteConfiguration(configuration);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteConfiguration process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * BPMN access method to delete the InstanceGroupVnf from A&AI.
+ *
+ * It will extract the instanceGroup from the BBObject.
+ *
+ * Then it will delete from A&AI.
+ *
+ * @param execution
+ */
public void deleteInstanceGroupVnf(BuildingBlockExecution execution) {
try {
InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID);
aaiInstanceGroupResources.deleteInstanceGroup(instanceGroup);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIDeleteTasks deleteInstanceGroupVnf process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+
public void deleteNetworkPolicies(BuildingBlockExecution execution) {
try {
String fqdns = execution.getVariable(contrailNetworkPolicyFqdnList);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
index 1add5e6d24..997d20036f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
@@ -35,6 +35,8 @@ import org.springframework.stereotype.Component;
@Component
public class AAIFlagTasks {
+ private static final Logger logger = LoggerFactory.getLogger(AAIFlagTasks.class);
+
@Autowired
private AAIVnfResources aaiVnfResources;
@@ -107,7 +109,7 @@ public class AAIFlagTasks {
String vnfId = vnf.getVnfId();
inPserversLocked = aaiVnfResources.checkVnfPserversLockedFlag(vnfId);
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ logger.warn("Exception on checking pservers: " + ex.getMessage());
}
if (inPserversLocked) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "VNF PServers in Locked in A&AI");
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index 20f4443291..86645391b4 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -92,6 +92,7 @@ public class AAIUpdateTasks {
OrchestrationStatus.ASSIGNED);
execution.setVariable("aaiServiceInstanceRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedService", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -108,6 +109,7 @@ public class AAIUpdateTasks {
aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance,
OrchestrationStatus.ACTIVE);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveService", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -122,6 +124,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -136,6 +139,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ACTIVE);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -155,6 +159,7 @@ public class AAIUpdateTasks {
aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
OrchestrationStatus.ASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVolumeGroup", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -174,6 +179,7 @@ public class AAIUpdateTasks {
aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
OrchestrationStatus.ACTIVE);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveVolumeGroup", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -193,6 +199,7 @@ public class AAIUpdateTasks {
aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion,
OrchestrationStatus.CREATED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusCreatedVolumeGroup", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -215,6 +222,7 @@ public class AAIUpdateTasks {
aaiVolumeGroupResources.updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateHeatStackIdVolumeGroup", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -231,6 +239,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -247,6 +256,7 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf,
OrchestrationStatus.PENDING_ACTIVATION);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusPendingActivationVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -273,6 +283,9 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
}
} catch (Exception ex) {
+ logger.error(
+ "Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedOrPendingActivationVfModule",
+ ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -281,7 +294,7 @@ public class AAIUpdateTasks {
* BPMN access method to update status of VfModule to Created in AAI
*
* @param execution
- *
+ *
*/
public void updateOrchestrationStatusCreatedVfModule(BuildingBlockExecution execution) {
try {
@@ -289,6 +302,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusCreatedVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -307,6 +321,7 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED);
execution.setVariable("aaiDeactivateVfModuleRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeactivateVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -346,6 +361,7 @@ public class AAIUpdateTasks {
L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
updateNetworkAAI(l3Network, status);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -386,6 +402,7 @@ public class AAIUpdateTasks {
aaiCollectionResources.updateCollection(copiedNetworkCollection);
execution.setVariable("aaiNetworkCollectionActivateRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveNetworkCollection", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -403,6 +420,7 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ACTIVE);
execution.setVariable("aaiActivateVfModuleRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivateVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -423,6 +441,7 @@ public class AAIUpdateTasks {
vfModule.setHeatStackId(heatStackId);
aaiVfModuleResources.updateHeatStackIdVfModule(vfModule, vnf);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateHeatStackIdVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -466,6 +485,7 @@ public class AAIUpdateTasks {
execution.setVariable("aaiNetworkActivateRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateNetworkCreated", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -495,6 +515,7 @@ public class AAIUpdateTasks {
}
}
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateNetworkUpdated", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -509,6 +530,7 @@ public class AAIUpdateTasks {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
aaiNetworkResources.updateNetwork(l3network);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateObjectNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -524,6 +546,7 @@ public class AAIUpdateTasks {
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiServiceInstanceResources.updateServiceInstance(serviceInstance);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateServiceInstance", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -538,6 +561,7 @@ public class AAIUpdateTasks {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateObjectVnf(genericVnf);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateObjectVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -559,6 +583,7 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED);
execution.setVariable("aaiDeleteVfModuleRollback", true);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeleteVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -574,6 +599,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVfModuleResources.changeAssignVfModule(vfModule, vnf);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateModelVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -589,6 +615,7 @@ public class AAIUpdateTasks {
aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration,
OrchestrationStatus.ASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignFabricConfiguration", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -603,6 +630,8 @@ public class AAIUpdateTasks {
Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivateFabricConfiguration",
+ ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -618,6 +647,8 @@ public class AAIUpdateTasks {
aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration,
OrchestrationStatus.ASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeactivateFabricConfiguration",
+ ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -640,6 +671,7 @@ public class AAIUpdateTasks {
aaiVnfResources.updateObjectVnf(copiedGenericVnf);
}
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateIpv4OamAddressVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -662,6 +694,7 @@ public class AAIUpdateTasks {
aaiVnfResources.updateObjectVnf(copiedGenericVnf);
}
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateManagementV6AddressVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -681,6 +714,7 @@ public class AAIUpdateTasks {
aaiVfModuleResources.updateContrailServiceInstanceFqdnVfModule(vfModule, vnf);
}
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateContrailServiceInstanceFqdnVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -695,6 +729,7 @@ public class AAIUpdateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGASSIGNED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigAssignedVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -704,12 +739,13 @@ public class AAIUpdateTasks {
*
* @param execution
*/
- public void updateOrchestrationStausConfigDeployConfigureVnf(BuildingBlockExecution execution) {
+ public void updateOrchestrationStatusConfigDeployConfigureVnf(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURE);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfigureVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
@@ -720,12 +756,13 @@ public class AAIUpdateTasks {
*
* @param execution
*/
- public void updateOrchestrationStausConfigDeployConfiguredVnf(BuildingBlockExecution execution) {
+ public void updateOrchestrationStatusConfigDeployConfiguredVnf(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURED);
} catch (Exception ex) {
+ logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfiguredVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
index 9340609ffc..0c31dfa16f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
@@ -33,6 +33,7 @@ import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables;
import org.camunda.bpm.engine.variable.VariableMap;
import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBFailure;
import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBTasks;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
@@ -79,6 +80,8 @@ public class ExecuteActivity implements JavaDelegate {
@Autowired
private ExceptionBuilder exceptionBuilder;
@Autowired
+ private WorkflowActionBBFailure workflowActionBBFailure;
+ @Autowired
private WorkflowActionBBTasks workflowActionBBTasks;
@Override
@@ -135,7 +138,9 @@ public class ExecuteActivity implements JavaDelegate {
execution.setVariable(WORKFLOW_EXCEPTION, workflowException);
} catch (Exception e) {
- buildAndThrowException(execution, e.getMessage());
+ logger.error("BPMN exception on activity execution: " + e.getMessage());
+ workflowException = new WorkflowException(EXECUTE_BUILDING_BLOCK, 7000, e.getMessage());
+ handlingCode = ABORT_HANDLING_CODE;
}
if (workflowException != null && handlingCode != null && handlingCode.equals(ABORT_HANDLING_CODE)) {
@@ -178,13 +183,15 @@ public class ExecuteActivity implements JavaDelegate {
protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) {
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue(), msg, ex);
- execution.setVariable("ExecuteActivityErrorMessage", msg);
+ execution.setVariable(EXECUTE_ACTIVITY_ERROR_MESSAGE, msg);
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
protected void buildAndThrowException(DelegateExecution execution, String msg) {
logger.error(msg);
execution.setVariable(EXECUTE_ACTIVITY_ERROR_MESSAGE, msg);
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
index e9d33f46ab..2705d00d6b 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
@@ -38,11 +38,12 @@ import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.NetworkAdapterResources;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.onap.so.utils.Components;
@Component
public class NetworkAdapterRestV1 {
@@ -94,7 +95,7 @@ public class NetworkAdapterRestV1 {
throw new Exception("No Network Request was created. networkAdapterRequest was null.");
}
} catch (Exception ex) {
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
}
@@ -139,7 +140,7 @@ public class NetworkAdapterRestV1 {
}
} catch (Exception e) {
logger.error("Error in Openstack Adapter callback", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.OPENSTACK);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), Components.OPENSTACK);
}
}
@@ -152,7 +153,7 @@ public class NetworkAdapterRestV1 {
public void handleTimeOutException(DelegateExecution execution) {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Error timed out waiting on Openstack Async-Response", TargetEntity.SO);
+ "Error timed out waiting on Openstack Async-Response", ONAPComponents.SO);
}
public void handleSyncError(DelegateExecution execution) {
@@ -160,6 +161,6 @@ public class NetworkAdapterRestV1 {
String responseString = (String) execution.getVariable(NETWORK_SYNC_RESPONSE);
String errorMessage = "Error with Openstack Adapter Sync Request: StatusCode = " + statusCode + " Response = "
+ responseString;
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage, TargetEntity.OPENSTACK);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage, Components.OPENSTACK);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index 9396f9dbfc..4285e9aa84 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -47,6 +47,7 @@ import static org.apache.commons.lang3.StringUtils.*;
@Component
public class VnfAdapterCreateTasks {
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class);
public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_";
private static final String VNFREST_REQUEST = "VNFREST_Request";
@@ -85,7 +86,9 @@ public class VnfAdapterCreateTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BBObjectNotFoundException bbException) {
- // If there is not a vf module in the general building block (in aLaCarte case), we will not retrieve
+ logger.error("Exception occurred", bbException);
+ // If there is not a vf module in the general building block (in aLaCarte case),
+ // we will not retrieve
// the SDNCQueryResponse and proceed as normal without throwing an error
}
@@ -94,6 +97,7 @@ public class VnfAdapterCreateTasks {
genericVnf, volumeGroup, sdncVfModuleQueryResponse);
execution.setVariable(VNFREST_REQUEST, createVolumeGroupRequest.toXmlString());
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -117,6 +121,8 @@ public class VnfAdapterCreateTasks {
try {
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
} catch (BBObjectNotFoundException bbException) {
+ logger.error("Exception occurred if bb objrct not found in VnfAdapterCreateTasks createVfModule ",
+ bbException);
}
CloudRegion cloudRegion = gBBInput.getCloudRegion();
RequestContext requestContext = gBBInput.getRequestContext();
@@ -129,9 +135,9 @@ public class VnfAdapterCreateTasks {
volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString());
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
-
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
index c112d200e3..9f85feac07 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
@@ -60,5 +60,8 @@ public class Constants {
public static final String OPERATION_STATUS_PARAM_NAME = "operationStatus";
+ public static final String EXT_VIRTUAL_LINKS = "extVirtualLinks";
+ public static final String ADDITIONAL_PARAMS = "additionalParams";
+
private Constants() {}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTask.java
index 661fdb258b..877d065085 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTask.java
@@ -21,12 +21,17 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.INPUT_PARAMETER;
import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter;
import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParametersProvider;
import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.NullInputParameter;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.BBObjectNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,14 +47,18 @@ public class InputParameterRetrieverTask {
private static final Logger LOGGER = LoggerFactory.getLogger(InputParameterRetrieverTask.class);
- private final InputParametersProvider inputParametersProvider;
+ private final InputParametersProvider<GenericVnf> sdncInputParametersProvider;
private final ExtractPojosForBB extractPojosForBB;
+ private final InputParametersProvider<Map<String, Object>> userParamInputParametersProvider;
+
@Autowired
- public InputParameterRetrieverTask(final InputParametersProvider inputParametersProvider,
+ public InputParameterRetrieverTask(final InputParametersProvider<GenericVnf> inputParametersProvider,
+ final InputParametersProvider<Map<String, Object>> userParamInputParametersProvider,
final ExtractPojosForBB extractPojosForBB) {
- this.inputParametersProvider = inputParametersProvider;
+ this.sdncInputParametersProvider = inputParametersProvider;
+ this.userParamInputParametersProvider = userParamInputParametersProvider;
this.extractPojosForBB = extractPojosForBB;
}
@@ -57,17 +66,56 @@ public class InputParameterRetrieverTask {
try {
LOGGER.debug("Executing getInputParameters ...");
- final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
- final InputParameter inputParameter = inputParametersProvider.getInputParameter(vnf);
+ final InputParameter inputParameter = new InputParameter();
+
+ final InputParameter userParamsInputParameter = getUserParamsInputParameter(execution);
+ final InputParameter sdncInputParameter = getSdncInputParameter(execution);
+
+ inputParameter.putAdditionalParams(sdncInputParameter.getAdditionalParams());
+ inputParameter.addExtVirtualLinks(sdncInputParameter.getExtVirtualLinks());
+
+ inputParameter.putAdditionalParams(userParamsInputParameter.getAdditionalParams());
+ inputParameter.addExtVirtualLinks(userParamsInputParameter.getExtVirtualLinks());
LOGGER.debug("inputParameter: {}", inputParameter);
execution.setVariable(INPUT_PARAMETER, inputParameter);
LOGGER.debug("Finished executing getInputParameters ...");
} catch (final Exception exception) {
- LOGGER.error("Unable to invoke create and instantiation request", exception);
+ LOGGER.error("Unable to get input parameters", exception);
execution.setVariable(INPUT_PARAMETER, NullInputParameter.NULL_INSTANCE);
}
}
+ private InputParameter getSdncInputParameter(final BuildingBlockExecution execution)
+ throws BBObjectNotFoundException {
+ final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+ return sdncInputParametersProvider.getInputParameter(vnf);
+ }
+
+ private InputParameter getUserParamsInputParameter(final BuildingBlockExecution execution) {
+ final GeneralBuildingBlock generalBuildingBlock = execution.getGeneralBuildingBlock();
+
+ if (generalBuildingBlock != null && generalBuildingBlock.getRequestContext() != null
+ && generalBuildingBlock.getRequestContext().getRequestParameters() != null) {
+
+ final List<Map<String, Object>> userParams =
+ generalBuildingBlock.getRequestContext().getRequestParameters().getUserParams();
+ if (userParams != null) {
+ final Map<String, Object> params = new HashMap<>();
+
+ userParams.stream().forEach(obj -> {
+ params.putAll(obj);
+ });
+ LOGGER.info("User params found : {}", params);
+ if (userParams != null && !userParams.isEmpty()) {
+ return userParamInputParametersProvider.getInputParameter(params);
+ }
+ }
+
+ }
+ LOGGER.warn("No input parameters found in userparams ...");
+ return NullInputParameter.NULL_INSTANCE;
+ }
+
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
index 32516c1dcb..41649dc838 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
@@ -20,7 +20,9 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+import com.google.common.base.Optional;
import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
@@ -33,7 +35,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
-import com.google.common.base.Optional;
/**
* @author waqas.ikram@est.tech
@@ -82,7 +83,8 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide
}
return Optional.of(createVnfResponse);
- } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
+ } catch (final RestProcessingException | InvalidRestRequestException
+ | HttpResouceNotFoundException httpInvocationException) {
LOGGER.error("Unexpected error while processing create and instantiation request", httpInvocationException);
return Optional.absent();
}
@@ -144,7 +146,8 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide
return Optional.absent();
}
return Optional.of(response.getBody());
- } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
+ } catch (final RestProcessingException | InvalidRestRequestException
+ | HttpResouceNotFoundException httpInvocationException) {
LOGGER.error("Unexpected error while processing job request", httpInvocationException);
throw httpInvocationException;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java
new file mode 100644
index 0000000000..5cd84a2e11
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.ADDITIONAL_PARAMS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.EXT_VIRTUAL_LINKS;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@ericsson.com)
+ *
+ */
+public abstract class AbstractInputParametersProvider<T> implements InputParametersProvider<T> {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractInputParametersProvider.class);
+
+ protected Map<String, String> parseAdditionalParameters(final String additionalParamsString) {
+ try {
+ final ObjectMapper mapper = new ObjectMapper();
+ final TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {};
+ return mapper.readValue(additionalParamsString, typeRef);
+ } catch (final Exception exception) {
+ LOGGER.error("Unable to parse {} ", ADDITIONAL_PARAMS, exception);
+ }
+ return Collections.emptyMap();
+
+ }
+
+ protected List<ExternalVirtualLink> parseExternalVirtualLinks(final String extVirtualLinksString) {
+ try {
+ final ObjectMapper mapper = new ObjectMapper();
+ final TypeReference<List<ExternalVirtualLink>> extVirtualLinksStringTypeRef =
+ new TypeReference<List<ExternalVirtualLink>>() {};
+ return mapper.readValue(extVirtualLinksString, extVirtualLinksStringTypeRef);
+ } catch (final Exception exception) {
+ LOGGER.error("Unable to parse {} ", EXT_VIRTUAL_LINKS, exception);
+ }
+ return Collections.emptyList();
+ }
+
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java
index d01d494c58..fde69c7e91 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
/**
@@ -39,6 +41,8 @@ public class InputParameter implements Serializable {
private List<ExternalVirtualLink> extVirtualLinks = new ArrayList<>();
+ public InputParameter() {}
+
public InputParameter(final Map<String, String> additionalParams, final List<ExternalVirtualLink> extVirtualLinks) {
this.additionalParams = additionalParams;
this.extVirtualLinks = extVirtualLinks;
@@ -65,6 +69,12 @@ public class InputParameter implements Serializable {
this.additionalParams = additionalParams;
}
+ public void putAdditionalParams(final Map<String, String> additionalParams) {
+ if (additionalParams != null) {
+ this.additionalParams.putAll(additionalParams);
+ }
+ }
+
/**
* @param extVirtualLinks the extVirtualLinks to set
*/
@@ -72,9 +82,17 @@ public class InputParameter implements Serializable {
this.extVirtualLinks = extVirtualLinks;
}
+ public void addExtVirtualLinks(final List<ExternalVirtualLink> extVirtualLinks) {
+ if (extVirtualLinks != null) {
+ this.extVirtualLinks = Stream.concat(this.extVirtualLinks.stream(), extVirtualLinks.stream()).distinct()
+ .collect(Collectors.toList());
+ }
+ }
+
@Override
public String toString() {
- return "InputParameter [additionalParams=" + additionalParams + ", extVirtualLinks=" + extVirtualLinks + "]";
+ return this.getClass().getSimpleName() + " [additionalParams=" + additionalParams + ", extVirtualLinks="
+ + extVirtualLinks + "]";
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProvider.java
index 55203fb7cc..2d11143fff 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProvider.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProvider.java
@@ -19,13 +19,11 @@
*/
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
-
/**
* @author waqas.ikram@est.tech
*/
-public interface InputParametersProvider {
+public interface InputParametersProvider<T> {
- InputParameter getInputParameter(final GenericVnf genericVnf);
+ InputParameter getInputParameter(final T object);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java
index fb877ac55d..2eed224eb7 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java
@@ -20,12 +20,18 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
/**
* @author waqas.ikram@est.tech
*/
public class NullInputParameter extends InputParameter {
+ private static final String ERROR =
+ "method should not be called for null object " + NullInputParameter.class.getSimpleName();
+
private static final long serialVersionUID = -7261286746726871696L;
public static final NullInputParameter NULL_INSTANCE = new NullInputParameter();
@@ -34,4 +40,23 @@ public class NullInputParameter extends InputParameter {
super(Collections.emptyMap(), Collections.emptyList());
}
+ @Override
+ public void setAdditionalParams(final Map<String, String> additionalParams) {
+ throw new UnsupportedOperationException("setAdditionalParams() " + ERROR);
+ }
+
+ @Override
+ public void setExtVirtualLinks(final List<ExternalVirtualLink> extVirtualLinks) {
+ throw new UnsupportedOperationException("setExtVirtualLinks() " + ERROR);
+ }
+
+ @Override
+ public void addExtVirtualLinks(final List<ExternalVirtualLink> extVirtualLinks) {
+ throw new UnsupportedOperationException("addExtVirtualLinks() " + ERROR);
+ }
+
+ @Override
+ public void putAdditionalParams(final Map<String, String> additionalParams) {
+ throw new UnsupportedOperationException("putAdditionalParams() " + ERROR);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java
index bf4f16b355..7d81f4d5c2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java
@@ -19,6 +19,8 @@
*/
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.ADDITIONAL_PARAMS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.EXT_VIRTUAL_LINKS;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.FORWARD_SLASH;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.PRELOAD_VNFS_URL;
import java.io.IOException;
@@ -35,8 +37,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.jsonpath.JsonPath;
import net.minidev.json.JSONArray;
@@ -48,18 +48,16 @@ import net.minidev.json.JSONArray;
* @author waqas.ikram@est.tech
*/
@Service
-public class InputParametersProviderImpl implements InputParametersProvider {
+public class SdncInputParametersProvider extends AbstractInputParametersProvider<GenericVnf> {
- private static final Logger LOGGER = LoggerFactory.getLogger(InputParametersProviderImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(SdncInputParametersProvider.class);
- private static final String EXT_VIRTUAL_LINKS = "extVirtualLinks";
- private static final String ADDITIONAL_PARAMS = "additionalParams";
private static final String VNF_PARAMETERS_PATH = "$..vnf-parameters";
private final SDNCClient sdncClient;
@Autowired
- public InputParametersProviderImpl(final SDNCClient sdncClient) {
+ public SdncInputParametersProvider(final SDNCClient sdncClient) {
this.sdncClient = sdncClient;
}
@@ -80,8 +78,11 @@ public class InputParametersProviderImpl implements InputParametersProvider {
if (vnfParametersObject instanceof JSONArray) {
final JSONArray vnfParameters = (JSONArray) vnfParametersObject;
final Map<String, String> vnfParametersMap = getVnfParameterMap(vnfParameters);
- return new InputParameter(getAdditionalParameters(vnfParametersMap),
- getExtVirtualLinks(vnfParametersMap));
+ final Map<String, String> additionalParameters = getAdditionalParameters(vnfParametersMap);
+ final List<ExternalVirtualLink> extVirtualLinks = getExtVirtualLinks(vnfParametersMap);
+ final InputParameter inputParameter = new InputParameter(additionalParameters, extVirtualLinks);
+ LOGGER.info("InputParameter found in sdnc response : {}", inputParameter);
+ return inputParameter;
}
}
}
@@ -93,39 +94,24 @@ public class InputParametersProviderImpl implements InputParametersProvider {
}
- private List<ExternalVirtualLink> getExtVirtualLinks(final Map<String, String> vnfParametersMap)
- throws JsonParseException, IOException {
- try {
- final String extVirtualLinksString = vnfParametersMap.get(EXT_VIRTUAL_LINKS);
-
- if (extVirtualLinksString != null && !extVirtualLinksString.isEmpty()) {
- final ObjectMapper mapper = new ObjectMapper();
- final TypeReference<List<ExternalVirtualLink>> extVirtualLinksStringTypeRef =
- new TypeReference<List<ExternalVirtualLink>>() {};
+ private List<ExternalVirtualLink> getExtVirtualLinks(final Map<String, String> vnfParametersMap) {
+ final String extVirtualLinksString = vnfParametersMap.get(EXT_VIRTUAL_LINKS);
- return mapper.readValue(extVirtualLinksString, extVirtualLinksStringTypeRef);
- }
- } catch (final Exception exception) {
- LOGGER.error("Unable to parse {} ", EXT_VIRTUAL_LINKS, exception);
+ if (extVirtualLinksString != null && !extVirtualLinksString.isEmpty()) {
+ return parseExternalVirtualLinks(extVirtualLinksString);
}
return Collections.emptyList();
}
- private Map<String, String> getAdditionalParameters(final Map<String, String> vnfParametersMap)
- throws JsonParseException, IOException {
- try {
- final String additionalParamsString = vnfParametersMap.get(ADDITIONAL_PARAMS);
- if (additionalParamsString != null && !additionalParamsString.isEmpty()) {
- final ObjectMapper mapper = new ObjectMapper();
- final TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {};
- return mapper.readValue(additionalParamsString, typeRef);
- }
- } catch (final Exception exception) {
- LOGGER.error("Unable to parse {} ", ADDITIONAL_PARAMS, exception);
+ private Map<String, String> getAdditionalParameters(final Map<String, String> vnfParametersMap) {
+ final String additionalParamsString = vnfParametersMap.get(ADDITIONAL_PARAMS);
+ if (additionalParamsString != null && !additionalParamsString.isEmpty()) {
+ return parseAdditionalParameters(additionalParamsString);
}
return Collections.emptyMap();
}
+
private Map<String, String> getVnfParameterMap(final JSONArray array) {
try {
if (array != null) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProvider.java
new file mode 100644
index 0000000000..ac939d04ec
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProvider.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.ADDITIONAL_PARAMS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.EXT_VIRTUAL_LINKS;
+import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@ericsson.com)
+ *
+ */
+@Service
+public class UserParamInputParametersProvider extends AbstractInputParametersProvider<Map<String, Object>> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(UserParamInputParametersProvider.class);
+
+ @Override
+ public InputParameter getInputParameter(final Map<String, Object> userParams) {
+ if (userParams != null) {
+ final InputParameter inputParameter = new InputParameter();
+ final Object additionalParams = userParams.get(ADDITIONAL_PARAMS);
+
+ if (additionalParams != null && additionalParams instanceof String) {
+ inputParameter.setAdditionalParams(parseAdditionalParameters(additionalParams.toString()));
+ }
+
+ final Object extVirtualLinks = userParams.get(EXT_VIRTUAL_LINKS);
+ if (extVirtualLinks != null && extVirtualLinks instanceof String) {
+ inputParameter.setExtVirtualLinks(parseExternalVirtualLinks(extVirtualLinks.toString()));
+ }
+ LOGGER.info("InputParameter found in userParams : {}", inputParameter);
+ return inputParameter;
+ }
+ LOGGER.warn("No input parameters found ...");
+ return NullInputParameter.NULL_INSTANCE;
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java
new file mode 100644
index 0000000000..4b967c7bc4
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessor.java
@@ -0,0 +1,189 @@
+package org.onap.so.bpmn.infrastructure.appc.tasks;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVm;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.core.json.JsonUtils;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.Relationships;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+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;
+
+@Component
+public class AppcOrchestratorPreProcessor {
+ private static final Logger logger = LoggerFactory.getLogger(AppcOrchestratorPreProcessor.class);
+ public static final String CONTROLLER_TYPE_DEFAULT = "APPC";
+
+ @Autowired
+ private ExceptionBuilder exceptionUtil;
+ @Autowired
+ private ExtractPojosForBB extractPojosForBB;
+ @Autowired
+ private CatalogDbClient catalogDbClient;
+ @Autowired
+ private AAIVnfResources aaiVnfResources;
+
+ public void buildAppcTaskRequest(BuildingBlockExecution execution, String actionName) {
+ try {
+ Action action = Action.valueOf(actionName);
+ ApplicationControllerTaskRequest appcTaskRequest = new ApplicationControllerTaskRequest();
+ appcTaskRequest.setAction(action);
+ GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
+ GenericVnf vnf = null;
+ try {
+ vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ } catch (BBObjectNotFoundException e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "No valid VNF exists");
+ }
+ String vnfId = null;
+ String vnfName = null;
+ String vnfType = null;
+ String vnfHostIpAddress = null;
+
+ if (vnf != null) {
+ vnfId = vnf.getVnfId();
+ vnfName = vnf.getVnfName();
+ vnfType = vnf.getVnfType();
+ vnfHostIpAddress = vnf.getIpv4OamAddress();
+ }
+ String msoRequestId = gBBInput.getRequestContext().getMsoRequestId();
+
+ String aicIdentity = execution.getVariable("aicIdentity");
+ String identityUrl = execution.getVariable("identityUrl");
+ appcTaskRequest.setIdentityUrl(identityUrl);
+
+ if (gBBInput.getRequestContext().getRequestParameters() != null) {
+ String payload = gBBInput.getRequestContext().getRequestParameters().getPayload();
+ if (payload == null) {
+ payload = "";
+ }
+ String existingSoftwareVersion = JsonUtils.getJsonValue(payload, "existing-software-version");
+ appcTaskRequest.setExistingSoftwareVersion(existingSoftwareVersion);
+ String newSoftwareVersion = JsonUtils.getJsonValue(payload, "new-software-version");
+ appcTaskRequest.setNewSoftwareVersion(newSoftwareVersion);
+ String operationsTimeout = JsonUtils.getJsonValue(payload, "operations-timeout");
+ appcTaskRequest.setOperationsTimeout(operationsTimeout);
+ }
+
+ ControllerSelectionReference controllerSelectionReference = catalogDbClient
+ .getControllerSelectionReferenceByVnfTypeAndActionCategory(vnfType, action.toString());
+ String controllerType = null;
+ if (controllerSelectionReference != null) {
+ controllerType = controllerSelectionReference.getControllerName();
+ } else {
+ controllerType = CONTROLLER_TYPE_DEFAULT;
+ }
+ appcTaskRequest.setControllerType(controllerType);
+
+ execution.setVariable("vmIdList", null);
+ execution.setVariable("vserverIdList", null);
+ execution.setVariable("vmIndex", 0);
+ execution.setVariable("vmIdListSize", 0);
+
+ String vfModuleId = null;
+ VfModule vfModule = null;
+ try {
+ vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
+ } catch (BBObjectNotFoundException e) {
+ }
+ if (vfModule != null) {
+ vfModuleId = vfModule.getVfModuleId();
+ }
+ if (action.equals(Action.Snapshot)) {
+ try {
+ getVserversForAppc(execution, vnf);
+ } catch (Exception e) {
+ logger.warn("Unable to retrieve vservers for vnf: " + vnfId);
+ }
+ }
+
+ ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
+ applicationControllerVnf.setVnfHostIpAddress(vnfHostIpAddress);
+ applicationControllerVnf.setVnfId(vnfId);
+ applicationControllerVnf.setVnfName(vnfName);
+ appcTaskRequest.setApplicationControllerVnf(applicationControllerVnf);
+
+ execution.setVariable("appcOrchestratorRequest", appcTaskRequest);
+ } catch (Exception e) {
+ logger.error("Error building ApplicationControllerTaskRequest Object", e);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
+ }
+ }
+
+ public void addVmInfoToAppcTaskRequest(BuildingBlockExecution execution) {
+ try {
+ ApplicationControllerTaskRequest appcTaskRequest =
+ (ApplicationControllerTaskRequest) execution.getVariable("appcOrchestratorRequest");
+ ArrayList<String> vmIdList = execution.getVariable("vmIdList");
+ ArrayList<String> vserverIdList = execution.getVariable("vserverIdList");
+ Integer vmIndex = (Integer) execution.getVariable("vmIndex");
+
+ if (vmIdList != null && !vmIdList.isEmpty() && vserverIdList != null && !vserverIdList.isEmpty()) {
+ execution.setVariable("vmIdListSize", vmIdList.size());
+ if (vmIndex < vmIdList.size()) {
+ ApplicationControllerVm applicationControllerVm = new ApplicationControllerVm();
+ applicationControllerVm.setVmId(vmIdList.get(vmIndex));
+ applicationControllerVm.setVserverId(vserverIdList.get(vmIndex));
+ if (appcTaskRequest.getApplicationControllerVnf() == null) {
+ ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
+ appcTaskRequest.setApplicationControllerVnf(applicationControllerVnf);
+ }
+ appcTaskRequest.getApplicationControllerVnf().setApplicationControllerVm(applicationControllerVm);
+ execution.setVariable("appcOrchestratorRequest", appcTaskRequest);
+ vmIndex++;
+ execution.setVariable("vmIndex", vmIndex);
+ }
+ }
+ } catch (Exception e) {
+ logger.error("Error adding VM info to ApplicationControllerTaskRequest Object", e);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
+ }
+ }
+
+ protected void getVserversForAppc(BuildingBlockExecution execution, GenericVnf vnf) throws Exception {
+ AAIResultWrapper aaiRW = aaiVnfResources.queryVnfWrapperById(vnf);
+
+ if (aaiRW != null && aaiRW.getRelationships().isPresent()) {
+ Relationships relationships = aaiRW.getRelationships().get();
+ if (relationships != null) {
+ List<AAIResourceUri> vserverUris = relationships.getRelatedAAIUris(AAIObjectType.VSERVER);
+ ArrayList<String> vserverIds = new ArrayList<String>();
+ ArrayList<String> vserverSelfLinks = new ArrayList<String>();
+ for (AAIResourceUri j : vserverUris) {
+ String vserverId = j.getURIKeys().get("vserver-id");
+ vserverIds.add(vserverId);
+ Optional<Vserver> oVserver = aaiVnfResources.getVserver(j);
+ if (oVserver.isPresent()) {
+ Vserver vserver = oVserver.get();
+ String vserverSelfLink = vserver.getVserverSelflink();
+ vserverSelfLinks.add(vserverSelfLink);
+ }
+ }
+ logger.debug("vmIdsArray is: {}", vserverSelfLinks);
+ logger.debug("vserverIdsArray is: {}", vserverIds);
+ execution.setVariable("vmIdList", vserverSelfLinks);
+ execution.setVariable("vserverIdList", vserverIds);
+ }
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
index eddcc94e71..79ccd9216f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
@@ -23,19 +23,30 @@
package org.onap.so.bpmn.infrastructure.appc.tasks;
import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Optional;
import org.onap.so.logger.LoggingAnchor;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.appc.client.lcm.model.Action;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.Relationships;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.appc.ApplicationControllerAction;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.logger.ErrorCode;
@@ -51,6 +62,8 @@ public class AppcRunTasks {
public static final String ROLLBACK_VNF_STOP = "rollbackVnfStop";
public static final String ROLLBACK_VNF_LOCK = "rollbackVnfLock";
public static final String ROLLBACK_QUIESCE_TRAFFIC = "rollbackQuiesceTraffic";
+ public static final String CONTROLLER_TYPE_DEFAULT = "APPC";
+ public static final String GENERIC_APPC_ERROR_CODE = "1002";
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -59,6 +72,8 @@ public class AppcRunTasks {
private CatalogDbClient catalogDbClient;
@Autowired
private ApplicationControllerAction appCClient;
+ @Autowired
+ private AAIVnfResources aaiVnfResources;
public void preProcessActivity(BuildingBlockExecution execution) {
execution.setVariable("actionSnapshot", Action.Snapshot);
@@ -78,6 +93,22 @@ public class AppcRunTasks {
execution.setVariable(ROLLBACK_VNF_STOP, false);
execution.setVariable(ROLLBACK_VNF_LOCK, false);
execution.setVariable(ROLLBACK_QUIESCE_TRAFFIC, false);
+ execution.setVariable("vmIdList", null);
+ execution.setVariable("vserverIdList", null);
+
+ GenericVnf vnf = null;
+ try {
+ vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ } catch (BBObjectNotFoundException e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "No valid VNF exists");
+ }
+
+ try {
+ getVserversForAppc(execution, vnf);
+ } catch (Exception e) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Unable to retrieve vservers");
+ }
+
}
public void runAppcCommand(BuildingBlockExecution execution, Action action) {
@@ -112,7 +143,12 @@ public class AppcRunTasks {
ControllerSelectionReference controllerSelectionReference = catalogDbClient
.getControllerSelectionReferenceByVnfTypeAndActionCategory(vnfType, action.toString());
- String controllerType = controllerSelectionReference.getControllerName();
+ String controllerType = null;
+ if (controllerSelectionReference != null) {
+ controllerType = controllerSelectionReference.getControllerName();
+ } else {
+ controllerType = CONTROLLER_TYPE_DEFAULT;
+ }
String vfModuleId = null;
VfModule vfModule = null;
@@ -126,12 +162,16 @@ public class AppcRunTasks {
HashMap<String, String> payloadInfo = buildPayloadInfo(vnfName, aicIdentity, vnfHostIpAddress, vmIdList,
vserverIdList, identityUrl, vfModuleId);
- Optional<String> payload = null;
+ Optional<String> payload = Optional.empty();
RequestParameters requestParameters = gBBInput.getRequestContext().getRequestParameters();
if (requestParameters != null) {
String pay = requestParameters.getPayload();
if (pay != null) {
payload = Optional.of(pay);
+ } else {
+ String payloadFromUserParams =
+ buildPayloadFromUserParams(gBBInput.getRequestContext().getUserParams());
+ payload = Optional.of(payloadFromUserParams);
}
}
logger.debug("Running APP-C action: {}", action.toString());
@@ -142,7 +182,9 @@ public class AppcRunTasks {
mapRollbackVariables(execution, action, appcCode);
} catch (Exception e) {
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
- "Caught exception in runAppcCommand", "BPMN", ErrorCode.UnknownError.getValue(), "APPC Error", e);
+ "Caught exception in runAppcCommand", "BPMN", ErrorCode.UnknownError.getValue(),
+ "Error on request to APPC", e);
+ appcCode = GENERIC_APPC_ERROR_CODE;
appcMessage = e.getMessage();
}
@@ -155,7 +197,7 @@ public class AppcRunTasks {
}
protected void mapRollbackVariables(BuildingBlockExecution execution, Action action, String appcCode) {
- if (appcCode.equals("0") && action != null) {
+ if (appcCode != null && appcCode.equals("0") && action != null) {
if (action.equals(Action.Lock)) {
execution.setVariable(ROLLBACK_VNF_LOCK, true);
} else if (action.equals(Action.Unlock)) {
@@ -184,4 +226,60 @@ public class AppcRunTasks {
payloadInfo.put("vfModuleId", vfModuleId);
return payloadInfo;
}
+
+ protected String buildPayloadFromUserParams(Map<String, Object> userParams) {
+ if (userParams == null || userParams.size() == 0) {
+ return null;
+ }
+
+ String payload = "{}";
+ for (Map.Entry<String, Object> entry : userParams.entrySet()) {
+ payload = JsonUtils.addJsonValue(payload, entry.getKey(), (String) entry.getValue());
+ }
+
+ payload = payload.replaceAll("\"", "\\\\\"");
+ payload = payload.replaceAll("\n", "");
+ return payload;
+ }
+
+ protected void getVserversForAppc(BuildingBlockExecution execution, GenericVnf vnf) throws Exception {
+ AAIResultWrapper aaiRW = aaiVnfResources.queryVnfWrapperById(vnf);
+
+ if (aaiRW != null && aaiRW.getRelationships() != null && aaiRW.getRelationships().isPresent()) {
+ Relationships relationships = aaiRW.getRelationships().get();
+ if (relationships != null) {
+ List<AAIResourceUri> vserverUris = relationships.getRelatedAAIUris(AAIObjectType.VSERVER);
+ JSONArray vserverIds = new JSONArray();
+ JSONArray vserverSelfLinks = new JSONArray();
+ if (vserverUris != null) {
+ for (AAIResourceUri j : vserverUris) {
+ if (j != null) {
+ if (j.getURIKeys() != null) {
+ String vserverId = j.getURIKeys().get("vserver-id");
+ vserverIds.put(vserverId);
+ }
+ Optional<Vserver> oVserver = aaiVnfResources.getVserver(j);
+ if (oVserver.isPresent()) {
+ Vserver vserver = oVserver.get();
+ if (vserver != null) {
+ String vserverSelfLink = vserver.getVserverSelflink();
+ vserverSelfLinks.put(vserverSelfLink);
+ }
+ }
+ }
+ }
+ }
+
+ JSONObject vmidsArray = new JSONObject();
+ JSONObject vserveridsArray = new JSONObject();
+ vmidsArray.put("vmIds", vserverSelfLinks.toString());
+ vserveridsArray.put("vserverIds", vserverIds.toString());
+ logger.debug("vmidsArray is: {}", vmidsArray.toString());
+ logger.debug("vserveridsArray is: {}", vserveridsArray.toString());
+
+ execution.setVariable("vmIdList", vmidsArray.toString());
+ execution.setVariable("vserverIdList", vserveridsArray.toString());
+ }
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
index 922b721098..30e2c94ac6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.audit;
-import java.util.List;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -32,10 +31,6 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.db.request.beans.RequestProcessingData;
-import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.objects.audit.AAIObjectAuditList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/UnassignNetworkException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/UnassignNetworkException.java
new file mode 100644
index 0000000000..566cdccd50
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/UnassignNetworkException.java
@@ -0,0 +1,14 @@
+package org.onap.so.bpmn.infrastructure.flowspecific.exceptions;
+
+public class UnassignNetworkException extends Exception {
+
+ private static final long serialVersionUID = 2864418350216433736L;
+
+ public UnassignNetworkException() {
+ super();
+ }
+
+ public UnassignNetworkException(String message) {
+ super(message);
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/VnfNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/VnfNotFoundException.java
new file mode 100644
index 0000000000..e1c2e01832
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/exceptions/VnfNotFoundException.java
@@ -0,0 +1,7 @@
+package org.onap.so.bpmn.infrastructure.flowspecific.exceptions;
+
+public class VnfNotFoundException extends Exception {
+ public VnfNotFoundException(String modelCustomizationUuidOfSearchedVnf) {
+ super("Can not find vnf for model customization uuid: " + modelCustomizationUuidOfSearchedVnf);
+ };
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
index bc71fc6f67..3a69d27f32 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
@@ -3,13 +3,14 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2019 TechMahindra.
+ * Copyright (C) 2019 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.
@@ -20,10 +21,14 @@
package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.UUID;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.flowspecific.exceptions.VnfNotFoundException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
@@ -33,15 +38,15 @@ import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
import org.onap.so.client.cds.beans.ConfigAssignPropertiesForVnf;
import org.onap.so.client.cds.beans.ConfigAssignRequestVnf;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.serviceinstancebeans.Service;
+import org.onap.so.serviceinstancebeans.Vnfs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
- *
* Get vnf related data and config assign
- *
*/
@Component
public class ConfigAssignVnf {
@@ -51,48 +56,42 @@ public class ConfigAssignVnf {
private static final String ACTION_NAME = "config-assign";
private static final String MODE = "sync";
+ private final ExtractPojosForBB extractPojosForBB;
+ private final ExceptionBuilder exceptionBuilder;
+
@Autowired
- private ExceptionBuilder exceptionUtil;
- @Autowired
- private ExtractPojosForBB extractPojosForBB;
+ public ConfigAssignVnf(ExtractPojosForBB extractPojosForBB, ExceptionBuilder exceptionBuilder) {
+ this.extractPojosForBB = extractPojosForBB;
+ this.exceptionBuilder = exceptionBuilder;
+ }
/**
* Getting the vnf data, blueprint name, blueprint version etc and setting them in execution object and calling the
* subprocess.
- *
- * @param execution
*/
public void preProcessAbstractCDSProcessing(BuildingBlockExecution execution) {
logger.info("Start preProcessAbstractCDSProcessing ");
try {
- GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
-
- List<Map<String, Object>> userParams =
- execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters().getUserParams();
-
ConfigAssignPropertiesForVnf configAssignPropertiesForVnf = new ConfigAssignPropertiesForVnf();
configAssignPropertiesForVnf.setServiceInstanceId(serviceInstance.getServiceInstanceId());
configAssignPropertiesForVnf
.setServiceModelUuid(serviceInstance.getModelInfoServiceInstance().getModelUuid());
configAssignPropertiesForVnf
- .setVnfCustomizationUuid(vnf.getModelInfoGenericVnf().getModelCustomizationUuid());
- configAssignPropertiesForVnf.setVnfId(vnf.getVnfId());
- configAssignPropertiesForVnf.setVnfName(vnf.getVnfName());
-
- for (Map<String, Object> params : userParams) {
- for (Map.Entry<String, Object> entry : params.entrySet()) {
- configAssignPropertiesForVnf.setUserParam(entry.getKey(), entry.getValue());
- }
- }
-
+ .setVnfCustomizationUuid(genericVnf.getModelInfoGenericVnf().getModelCustomizationUuid());
+ configAssignPropertiesForVnf.setVnfId(genericVnf.getVnfId());
+ configAssignPropertiesForVnf.setVnfName(genericVnf.getVnfName());
+ setUserParamsInConfigAssignPropertiesForVnf(configAssignPropertiesForVnf,
+ execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters().getUserParams(),
+ genericVnf);
ConfigAssignRequestVnf configAssignRequestVnf = new ConfigAssignRequestVnf();
- configAssignRequestVnf.setResolutionKey(vnf.getVnfName());
+ configAssignRequestVnf.setResolutionKey(genericVnf.getVnfName());
configAssignRequestVnf.setConfigAssignPropertiesForVnf(configAssignPropertiesForVnf);
- String blueprintName = vnf.getModelInfoGenericVnf().getBlueprintName();
- String blueprintVersion = vnf.getModelInfoGenericVnf().getBlueprintVersion();
+ String blueprintName = genericVnf.getModelInfoGenericVnf().getBlueprintName();
+ String blueprintVersion = genericVnf.getModelInfoGenericVnf().getBlueprintVersion();
logger.debug(" BlueprintName : " + blueprintName + " BlueprintVersion : " + blueprintVersion);
AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean();
@@ -109,10 +108,49 @@ public class ConfigAssignVnf {
abstractCDSPropertiesBean.setActionName(ACTION_NAME);
abstractCDSPropertiesBean.setMode(MODE);
execution.setVariable("executionObject", abstractCDSPropertiesBean);
-
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ logger.error("An exception occurred when creating ConfigAssignPropertiesForVnf for CDS request", ex);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ private void setUserParamsInConfigAssignPropertiesForVnf(ConfigAssignPropertiesForVnf configAssignProperties,
+ List<Map<String, Object>> userParamsFromRequest, GenericVnf vnf) throws Exception {
+ Service service = getServiceFromRequestUserParams(userParamsFromRequest);
+ List<Map<String, String>> instanceParamsList =
+ getInstanceParamForVnf(service, vnf.getModelInfoGenericVnf().getModelCustomizationUuid());
+ instanceParamsList
+ .forEach(instanceParamsMap -> instanceParamsMap.forEach(configAssignProperties::setUserParam));
+ }
+
+ private Service getServiceFromRequestUserParams(List<Map<String, Object>> userParams) throws Exception {
+ Map<String, Object> serviceMap = userParams.stream().filter(key -> key.containsKey("service")).findFirst()
+ .orElseThrow(() -> new Exception("Can not find service in userParams section in generalBuildingBlock"));
+ return getServiceObjectFromServiceMap(serviceMap);
+ }
+
+ private Service getServiceObjectFromServiceMap(Map<String, Object> serviceMap) throws IOException {
+ ObjectMapper objectMapper = new ObjectMapper();
+ String serviceFromJson = objectMapper.writeValueAsString(serviceMap.get("service"));
+ try {
+ return objectMapper.readValue(serviceFromJson, Service.class);
+ } catch (IOException e) {
+ logger.error(String.format(
+ "An exception occurred while converting json object to Service object. The json is: %s",
+ serviceFromJson), e);
+ throw e;
+ }
+ }
+
+ private List<Map<String, String>> getInstanceParamForVnf(Service service, String genericVnfModelCustomizationUuid)
+ throws VnfNotFoundException {
+ Optional<Vnfs> foundedVnf = service.getResources().getVnfs().stream()
+ .filter(vnfs -> vnfs.getModelInfo().getModelCustomizationId().equals(genericVnfModelCustomizationUuid))
+ .findFirst();
+ if (foundedVnf.isPresent()) {
+ return foundedVnf.get().getInstanceParams();
+ } else {
+ throw new VnfNotFoundException(genericVnfModelCustomizationUuid);
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
index cdbe0db57c..6a8058938f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
@@ -62,7 +62,7 @@ public class ConfigDeployVnf {
* @param execution
*/
public void updateAAIConfigure(BuildingBlockExecution execution) {
- aaiUpdateTask.updateOrchestrationStausConfigDeployConfigureVnf(execution);
+ aaiUpdateTask.updateOrchestrationStatusConfigDeployConfigureVnf(execution);
}
@@ -129,7 +129,7 @@ public class ConfigDeployVnf {
* @param execution
*/
public void updateAAIConfigured(BuildingBlockExecution execution) {
- aaiUpdateTask.updateOrchestrationStausConfigDeployConfiguredVnf(execution);
+ aaiUpdateTask.updateOrchestrationStatusConfigDeployConfiguredVnf(execution);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
index c9a937b824..f95e7afed9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
@@ -24,19 +24,22 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
import java.util.Optional;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.flowspecific.exceptions.UnassignNetworkException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class UnassignNetworkBB {
-
+ private static final Logger logger = LoggerFactory.getLogger(UnassignNetworkBB.class);
private static String messageCannotPerformUnassign =
"Cannot perform Unassign Network. Network is still related to ";
private static String messageErrorRollback = " Rollback is not possible. Please restore data manually.";
@@ -71,7 +74,8 @@ public class UnassignNetworkBB {
if (networkBBUtils.isRelationshipRelatedToExists(network, relatedToValue)) {
String msg = messageCannotPerformUnassign + relatedToValue;
execution.setVariable("ErrorUnassignNetworkBB", msg);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ logger.error("ErrorUnassignNetworkBB: {}", msg);
+ throw new UnassignNetworkException(msg);
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java
index e51774c12c..0afca71b99 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java
@@ -30,12 +30,15 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAIInstanceGroupResources;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component()
public class UnassignVnf {
+ private static final Logger logger = LoggerFactory.getLogger(UnassignVnf.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -45,6 +48,17 @@ public class UnassignVnf {
@Autowired
private AAIObjectInstanceNameGenerator aaiObjectInstanceNameGenerator;
+ /**
+ * BPMN access method to deleting instanceGroup in AAI.
+ *
+ * It will extract the vnf from BBobject ,It will get the instance group from the vnf and add it into a list.
+ *
+ * Then iterate that list and check the ModelInfoInstanceGroup type.
+ *
+ * Then it will delete that.
+ *
+ * @param execution
+ */
public void deleteInstanceGroups(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
@@ -56,6 +70,7 @@ public class UnassignVnf {
}
}
} catch (Exception ex) {
+ logger.error("Exception occurred in UnassignVnf deleteInstanceGroups", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
index b85e33144f..f61b40ad23 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
@@ -52,6 +52,7 @@ import org.springframework.stereotype.Component;
@Component
public class SDNCActivateTasks extends AbstractSDNCTask {
+ private static final Logger logger = LoggerFactory.getLogger(SDNCActivateTasks.class);
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
private SDNCVnfResources sdncVnfResources;
@@ -66,6 +67,13 @@ public class SDNCActivateTasks extends AbstractSDNCTask {
@Autowired
private Environment env;
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for activate the vnf.
+ *
+ * @param execution
+ */
public void activateVnf(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -82,13 +90,14 @@ public class SDNCActivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCActivateTasks activateVnf process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
/**
* BPMN access method to perform Assign action on SDNC for L3Network
- *
+ *
* @param execution
* @throws BBObjectNotFoundException
*/
@@ -112,6 +121,13 @@ public class SDNCActivateTasks extends AbstractSDNCTask {
}
}
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for activate the activateVfModule.
+ *
+ * @param execution
+ */
public void activateVfModule(BuildingBlockExecution execution) {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
RequestContext requestContext = gBBInput.getRequestContext();
@@ -131,6 +147,7 @@ public class SDNCActivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCActivateTasks activateVfModule process", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index 1dcdfa912c..b8f5c8629d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -96,6 +96,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.SERVICE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -117,7 +118,6 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
-
GenericResourceApiVnfOperationInformation req =
sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext,
Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest));
@@ -125,10 +125,12 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+
/**
* BPMN access method to assigning the vfModule in SDNC.
*
@@ -160,6 +162,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
index 3c42f76d73..96b656ff95 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
@@ -53,6 +53,7 @@ import org.springframework.stereotype.Component;
@Component
public class SDNCDeactivateTasks extends AbstractSDNCTask {
+ private static final Logger logger = LoggerFactory.getLogger(SDNCDeactivateTasks.class);
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
private SDNCNetworkResources sdncNetworkResources;
@@ -69,6 +70,12 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask {
@Autowired
private Environment env;
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object. Which is used for deactivate
+ * VfModule.
+ *
+ * @param execution
+ */
public void deactivateVfModule(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -86,13 +93,14 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCDeactivateTasks deactivateVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
/**
* BPMN access method to perform Service Topology Deactivate action on SDNC for Vnf
- *
+ *
* @param execution
* @throws Exception
*/
@@ -113,15 +121,16 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCDeactivateTasks deactivateVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
/*
* BPMN access method to perform Service Topology Deactivate action on SDNC for Service Instance
- *
+ *
* @param execution
- *
+ *
* @throws Exception
*/
public void deactivateServiceInstance(BuildingBlockExecution execution) throws Exception {
@@ -138,13 +147,14 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.SERVICE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCDeactivateTasks deactivateServiceInstance", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
/**
* BPMN access method to invoke deactivate on a L3Network object
- *
+ *
* @param execution
*/
public void deactivateNetwork(BuildingBlockExecution execution) {
@@ -163,6 +173,7 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.NETWORK);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCDeactivateTasks deactivateNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
index 7478479a86..192cb3fc90 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
@@ -32,7 +32,7 @@ import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.SDNCVnfResources;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
- * This class is used for quering the SDNC
+ * This class is used for querying the SDNC.
*/
@Component
public class SDNCQueryTasks {
@@ -78,16 +78,19 @@ public class SDNCQueryTasks {
String response = sdncVnfResources.queryVnf(genericVnf);
execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response);
} catch (BadResponseException ex) {
+ logger.error("Exception occurred", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SDNC);
} else {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ logger.error("Exception occurred", ex);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
}
+
/**
* BPMN access method to query the SDNC for fetching the VfModule details.
*
@@ -116,12 +119,14 @@ public class SDNCQueryTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BadResponseException ex) {
+ logger.error("Exception occurred for BadResponse ", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SDNC);
} else {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
} catch (Exception ex) {
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
@@ -144,21 +149,27 @@ public class SDNCQueryTasks {
+ " exists in gBuildingBlock but does not have a selflink value");
}
} catch (BBObjectNotFoundException bbException) {
- // If there is not a vf module in the general building block, we will not call SDNC and proceed as normal
+ logger.error("Error occurred if bb object not found in SDNCQueryTasks queryVfModuleForVolumeGroup ",
+ bbException);
+ // If there is not a vf module in the general building block, we will not call
+ // SDNC and proceed as normal
// without throwing an error
- // If we see a bb object not found exception for something that is not a vf module id, then we should throw
+ // If we see a bb object not found exception for something that is not a vf
+ // module id, then we should throw
// the error as normal
if (!ResourceKey.VF_MODULE_ID.equals(bbException.getResourceKey())) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, TargetEntity.SO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, ONAPComponents.SO);
}
} catch (BadResponseException ex) {
+ logger.error("Error occurred for BadResponseException in SDNCQueryTasks queryVfModuleForVolumeGroup ", ex);
if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SDNC);
} else {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ logger.error("Exception occurred", ex);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO);
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
index 03714db943..e55fa9e24b 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
@@ -37,7 +37,7 @@ import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCRequest;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -80,19 +80,19 @@ public class SDNCRequestTasks {
} catch (PathNotFoundException e) {
logger.error("Error Parsing SDNC Response. Could not find read final ack indicator from JSON.", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Recieved invalid response from SDNC, unable to read message content.", TargetEntity.SO);
+ "Recieved invalid response from SDNC, unable to read message content.", ONAPComponents.SO);
} catch (MapperException e) {
logger.error("Failed to map SDNC object to JSON prior to POST.", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Failed to map SDNC object to JSON prior to POST.", TargetEntity.SO);
+ "Failed to map SDNC object to JSON prior to POST.", ONAPComponents.SO);
} catch (BadResponseException e) {
logger.error("Did not receive a successful response from SDNC.", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getLocalizedMessage(),
- TargetEntity.SDNC);
+ ONAPComponents.SDNC);
} catch (HttpClientErrorException e) {
logger.error("HttpClientErrorException: 404 Not Found, Failed to contact SDNC", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "SDNC cannot be contacted.",
- TargetEntity.SO);
+ ONAPComponents.SO);
}
}
@@ -102,6 +102,9 @@ public class SDNCRequestTasks {
String asyncRequest = (String) execution.getVariable(request.getCorrelationName() + MESSAGE);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(new StringReader(asyncRequest)));
@@ -123,17 +126,17 @@ public class SDNCRequestTasks {
}
} catch (SDNCErrorResponseException e) {
logger.error("SDNC error response - " + e.getMessage());
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.SDNC);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), ONAPComponents.SDNC);
} catch (Exception e) {
logger.error("Error processing SDNC callback", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error processing SDNC callback",
- TargetEntity.SO);
+ ONAPComponents.SO);
}
}
public void handleTimeOutException(DelegateExecution execution) {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Error timed out waiting on SDNC Async-Response", TargetEntity.SO);
+ "Error timed out waiting on SDNC Async-Response", ONAPComponents.SO);
}
protected boolean convertIndicatorToBoolean(String finalMessageIndicator) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
index e3c9785ab2..4817ba8b61 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
@@ -53,6 +53,7 @@ import org.springframework.stereotype.Component;
@Component
public class SDNCUnassignTasks extends AbstractSDNCTask {
+ private static final Logger logger = LoggerFactory.getLogger(SDNCUnassignTasks.class);
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
private SDNCServiceInstanceResources sdncSIResources;
@@ -69,6 +70,13 @@ public class SDNCUnassignTasks extends AbstractSDNCTask {
@Autowired
private Environment env;
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for unassign the ServiceInstance.
+ *
+ * @param execution
+ */
public void unassignServiceInstance(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -83,10 +91,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.SERVICE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCUnassignTasks unassignServiceInstance", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for unassign the VfModule.
+ *
+ * @param execution
+ */
public void unassignVfModule(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -102,10 +118,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCUnassignTasks unassignVfModule", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for unassign the Vnf.
+ *
+ * @param execution
+ */
public void unassignVnf(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -122,10 +146,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCUnassignTasks unassignVnf", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ /**
+ * This method is used to prepare a SDNC request and set it to the execution Object.
+ *
+ * Which is used for unassign the Network.
+ *
+ * @param execution
+ */
public void unassignNetwork(BuildingBlockExecution execution) throws Exception {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -144,6 +176,7 @@ public class SDNCUnassignTasks extends AbstractSDNCTask {
sdncRequest.setTopology(SDNCTopology.NETWORK);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
+ logger.error("Exception occurred in SDNCUnassignTasks unassignNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
index fc3f2aec7a..11cac08f57 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
@@ -22,11 +22,12 @@ package org.onap.so.bpmn.infrastructure.validations;
import java.util.Optional;
import java.util.regex.Pattern;
+import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.listener.Skip;
import org.onap.so.bpmn.common.listener.validation.PreBuildingBlockValidator;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.listener.Skip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -62,7 +63,7 @@ public class CloudRegionOrchestrationValidator implements PreBuildingBlockValida
}
} catch (Exception e) {
logger.error("failed to validate", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, ONAPComponents.SO);
}
return Optional.empty();
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
index e809ecd0ae..206942fcb1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
@@ -20,27 +20,14 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.delegate.BpmnError;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse;
-import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
-import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
-import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.serviceinstancebeans.RequestReferences;
-import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class FlowCompletionTasks {
@@ -50,7 +37,9 @@ public class FlowCompletionTasks {
@Autowired
private RequestsDbClient requestDbclient;
+
public void updateRequestDbStatus(BuildingBlockExecution execution) {
+
try {
String requestId = execution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId();
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
index 7eaf011c75..64f0072991 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
@@ -55,7 +55,6 @@ public class OrchestrationStatusValidator {
private static final String MULTI_STAGE_DESIGN_OFF = "false";
private static final String MULTI_STAGE_DESIGN_ON = "true";
-
@Autowired
private ExtractPojosForBB extractPojosForBB;
@Autowired
@@ -63,6 +62,7 @@ public class OrchestrationStatusValidator {
@Autowired
private CatalogDbClient catalogDbClient;
+
/**
* This method validate's the status of the OrchestrationStatus against the buildingBlockDetail ResourceType
*
@@ -137,7 +137,8 @@ public class OrchestrationStatusValidator {
OrchestrationStatusValidationDirective.VALIDATION_SKIPPED);
return;
default:
- // can't currently get here, so not tested. Added in case enum is expanded without a change to this
+ // can't currently get here, so not tested. Added in case enum is expanded
+ // without a change to this
// code
throw new OrchestrationStatusValidationException(
String.format(UNKNOWN_RESOURCE_TYPE, buildingBlockFlowName,
@@ -152,16 +153,6 @@ public class OrchestrationStatusValidator {
.getOrchestrationStatusStateTransitionDirective(buildingBlockDetail.getResourceType(),
orchestrationStatus, buildingBlockDetail.getTargetAction());
- if (aLaCarte && ResourceType.VF_MODULE.equals(buildingBlockDetail.getResourceType())
- && OrchestrationAction.CREATE.equals(buildingBlockDetail.getTargetAction())
- && OrchestrationStatus.PENDING_ACTIVATION.equals(orchestrationStatus)) {
- org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf =
- extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- orchestrationStatusStateTransitionDirective = processPossibleSecondStageofVfModuleCreate(execution,
- previousOrchestrationStatusValidationResult, genericVnf,
- orchestrationStatusStateTransitionDirective);
- }
-
if (orchestrationStatusStateTransitionDirective
.getFlowDirective() == OrchestrationStatusValidationDirective.FAIL) {
throw new OrchestrationStatusValidationException(
@@ -172,6 +163,9 @@ public class OrchestrationStatusValidator {
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT,
orchestrationStatusStateTransitionDirective.getFlowDirective());
} catch (BBObjectNotFoundException ex) {
+ logger.error(
+ "Error occurred for bb object notfound in OrchestrationStatusValidator validateOrchestrationStatus ",
+ ex);
if (execution.getFlowToBeCalled().contains("Unassign")) {
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT,
OrchestrationStatusValidationDirective.SILENT_SUCCESS);
@@ -179,26 +173,8 @@ public class OrchestrationStatusValidator {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex);
}
} catch (Exception e) {
+ logger.error("Exception occurred", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e);
}
}
-
- private OrchestrationStatusStateTransitionDirective processPossibleSecondStageofVfModuleCreate(
- BuildingBlockExecution execution,
- OrchestrationStatusValidationDirective previousOrchestrationStatusValidationResult,
- org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf,
- OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective) {
- if (previousOrchestrationStatusValidationResult != null && previousOrchestrationStatusValidationResult
- .equals(OrchestrationStatusValidationDirective.SILENT_SUCCESS)) {
- String multiStageDesign = MULTI_STAGE_DESIGN_OFF;
- if (genericVnf.getModelInfoGenericVnf() != null) {
- multiStageDesign = genericVnf.getModelInfoGenericVnf().getMultiStageDesign();
- }
- if (multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
- orchestrationStatusStateTransitionDirective
- .setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE);
- }
- }
- return orchestrationStatusStateTransitionDirective;
- }
}
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 e6dd38ee1e..356fe8d9a2 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
@@ -6,6 +6,8 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
+ * Copyright (C) 2019 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
@@ -54,6 +56,7 @@ 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.bpmn.servicedecomposition.tasks.exceptions.DuplicateNameException;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException;
import org.onap.so.client.aai.AAICommonObjectMapperProvider;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
@@ -62,6 +65,7 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
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;
@@ -71,15 +75,7 @@ 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;
import org.onap.so.db.catalog.client.CatalogDbClient;
-import org.onap.so.serviceinstancebeans.ModelInfo;
-import org.onap.so.serviceinstancebeans.ModelType;
-import org.onap.so.serviceinstancebeans.Networks;
-import org.onap.so.serviceinstancebeans.RelatedInstance;
-import org.onap.so.serviceinstancebeans.RequestDetails;
-import org.onap.so.serviceinstancebeans.Service;
-import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
-import org.onap.so.serviceinstancebeans.VfModules;
-import org.onap.so.serviceinstancebeans.Vnfs;
+import org.onap.so.serviceinstancebeans.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -93,12 +89,14 @@ public class WorkflowAction {
private static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage";
private static final String SERVICE_INSTANCES = "serviceInstances";
+ private static final String SERVICE_INSTANCE = "serviceInstance";
private static final String VF_MODULES = "vfModules";
private static final String WORKFLOW_ACTION_WAS_UNABLE_TO_VERIFY_IF_THE_INSTANCE_NAME_ALREADY_EXIST_IN_AAI =
"WorkflowAction was unable to verify if the instance name already exist in AAI.";
private static final String VNF_TYPE = "vnfType";
private static final String SERVICE = "Service";
private static final String VNF = "Vnf";
+ private static final String PNF = "Pnf";
private static final String VFMODULE = "VfModule";
private static final String VOLUMEGROUP = "VolumeGroup";
private static final String NETWORK = "Network";
@@ -106,8 +104,10 @@ public class WorkflowAction {
private static final String CONFIGURATION = "Configuration";
private static final String ASSIGNINSTANCE = "assignInstance";
private static final String CREATEINSTANCE = "createInstance";
+ private static final String REPLACEINSTANCE = "replaceInstance";
+ private static final String REPLACEINSTANCERETAINASSIGNMENTS = "replaceInstanceRetainAssignments";
private static final String USERPARAMSERVICE = "service";
- private static final String supportedTypes =
+ private static final String SUPPORTEDTYPES =
"vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups";
private static final String HOMINGSOLUTION = "Homing_Solution";
private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
@@ -123,6 +123,10 @@ public class WorkflowAction {
private static final String NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID =
"(%s), same parent and different customization id (%s)";
private static final String NAME_EXISTS_WITH_DIFF_PARENT = "(%s) id (%s) and different parent relationship";
+ private static final String CREATENETWORKBB = "CreateNetworkBB";
+ private static final String ACTIVATENETWORKBB = "ActivateNetworkBB";
+ private static final String VOLUMEGROUP_DELETE_PATTERN = "(Un|De)(.*)Volume(.*)";
+ private static final String VOLUMEGROUP_CREATE_PATTERN = "(A|C)(.*)Volume(.*)";
@Autowired
protected BBInputSetup bbInputSetup;
@@ -179,23 +183,22 @@ public class WorkflowAction {
execution.setVariable(BBConstants.G_ISTOPLEVELFLOW, true);
ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
RequestDetails requestDetails = sIRequest.getRequestDetails();
- String cloudOwner = "";
- try {
- cloudOwner = requestDetails.getCloudConfiguration().getCloudOwner();
- } catch (Exception ex) {
- cloudOwner = environment.getProperty(defaultCloudOwner);
- }
boolean suppressRollback = false;
try {
suppressRollback = requestDetails.getRequestInfo().getSuppressRollback();
} catch (Exception ex) {
+ logger.error("Exception in getSuppressRollback", ex);
suppressRollback = false;
}
execution.setVariable("suppressRollback", suppressRollback);
+ boolean isResume = false;
if (isUriResume(uri)) {
- logger.debug("replacing URI {}", uri);
- uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl();
- logger.debug("for RESUME with original value {}", uri);
+ isResume = true;
+ if (!aLaCarte) {
+ logger.debug("replacing URI {}", uri);
+ uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl();
+ logger.debug("for RESUME with original value {}", uri);
+ }
}
Resource resource = extractResourceIdAndTypeFromUri(uri);
WorkflowType resourceType = resource.getResourceType();
@@ -209,7 +212,7 @@ public class WorkflowAction {
} else {
resourceId = resource.getResourceId();
}
- if ((serviceInstanceId == null || serviceInstanceId.equals("")) && resourceType == WorkflowType.SERVICE) {
+ if ((serviceInstanceId == null || serviceInstanceId.isEmpty()) && resourceType == WorkflowType.SERVICE) {
serviceInstanceId = resourceId;
}
execution.setVariable("resourceId", resourceId);
@@ -220,7 +223,14 @@ public class WorkflowAction {
if (flowsToExecute == null) {
buildAndThrowException(execution, "Could not resume Macro flow. Error loading execution path.");
}
+ } else if (aLaCarte && isResume) {
+ flowsToExecute = bbInputSetupUtils.loadOriginalFlowExecutionPath(requestId);
+ if (flowsToExecute == null) {
+ buildAndThrowException(execution,
+ "Could not resume request with request Id: " + requestId + ". No flowsToExecute was found");
+ }
} else {
+ String cloudOwner = getCloudOwner(requestDetails.getCloudConfiguration());
if (aLaCarte) {
if (orchFlows == null || orchFlows.isEmpty()) {
orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte,
@@ -249,6 +259,18 @@ public class WorkflowAction {
}
orchFlows = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION))
.collect(Collectors.toList());
+
+ if ((requestAction.equalsIgnoreCase(REPLACEINSTANCE)
+ || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS))
+ && resourceType.equals(WorkflowType.VFMODULE)) {
+ logger.debug("Build a BB list for replacing BB modules");
+ orchFlows = getVfModuleReplaceBuildingBlocks(
+ new ConfigBuildingBlocksDataObject().setsIRequest(sIRequest).setOrchFlows(orchFlows)
+ .setRequestId(requestId).setResourceKey(resourceKey).setApiVersion(apiVersion)
+ .setResourceId(resourceId).setRequestAction(requestAction).setaLaCarte(aLaCarte)
+ .setVnfType(vnfType).setWorkflowResourceIds(workflowResourceIds)
+ .setRequestDetails(requestDetails).setExecution(execution));
+ }
for (OrchestrationFlow orchFlow : orchFlows) {
ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey,
apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
@@ -259,7 +281,8 @@ public class WorkflowAction {
boolean foundRelated = false;
boolean containsService = false;
if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) {
- // SERVICE-MACRO-ASSIGN will always get user params with a
+ // SERVICE-MACRO-ASSIGN will always get user params with
+ // a
// service.
if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) {
List<Map<String, Object>> userParams =
@@ -277,7 +300,8 @@ public class WorkflowAction {
"Service-Macro-Assign request details must contain user params with a service");
}
} else if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(CREATEINSTANCE)) {
- // SERVICE-MACRO-CREATE will get user params with a service,
+ // SERVICE-MACRO-CREATE will get user params with a
+ // service,
// a service with a network, a service with a
// networkcollection, OR an empty service.
// If user params is just a service or null and macro
@@ -300,20 +324,21 @@ public class WorkflowAction {
traverseCatalogDbService(execution, sIRequest, resourceCounter, aaiResourceIds);
}
} else if (resourceType == WorkflowType.SERVICE
- && (requestAction.equalsIgnoreCase("activateInstance")
- || requestAction.equalsIgnoreCase("unassignInstance")
- || requestAction.equalsIgnoreCase("deleteInstance")
+ && ("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
+ // Will never get user params with service, macro will
+ // have
// to query the SI in AAI to find related instances.
traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds);
} else if (resourceType == WorkflowType.SERVICE
- && requestAction.equalsIgnoreCase("deactivateInstance")) {
+ && "deactivateInstance".equalsIgnoreCase(requestAction)) {
resourceCounter.add(new Resource(WorkflowType.SERVICE, "", false));
- } else if (resourceType == WorkflowType.VNF && (requestAction.equalsIgnoreCase("replaceInstance")
- || (requestAction.equalsIgnoreCase("recreateInstance")))) {
+ } else if (resourceType == WorkflowType.VNF && ("replaceInstance".equalsIgnoreCase(requestAction)
+ || ("recreateInstance".equalsIgnoreCase(requestAction)))) {
traverseAAIVnf(execution, resourceCounter, workflowResourceIds.getServiceInstanceId(),
workflowResourceIds.getVnfId(), aaiResourceIds);
} else {
@@ -331,14 +356,20 @@ public class WorkflowAction {
orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte,
cloudOwner, serviceType);
}
+ boolean vnfReplace = false;
+ if (resourceType.equals(WorkflowType.VNF) && ("replaceInstance".equalsIgnoreCase(requestAction)
+ || "replaceInstanceRetainAssignments".equalsIgnoreCase(requestAction))) {
+ vnfReplace = true;
+ }
flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion,
- resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails);
+ resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, vnfReplace);
if (!resourceCounter.stream().filter(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType())
.collect(Collectors.toList()).isEmpty()) {
logger.info("Sorting for Vlan Tagging");
flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction);
}
- // By default, enable homing at VNF level for CREATEINSTANCE and ASSIGNINSTANCE
+ // By default, enable homing at VNF level for CREATEINSTANCE
+ // and ASSIGNINSTANCE
if (resourceType == WorkflowType.SERVICE
&& (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE))
&& !resourceCounter.stream().filter(x -> WorkflowType.VNF.equals(x.getResourceType()))
@@ -355,7 +386,8 @@ public class WorkflowAction {
}
}
}
- // If the user set "Homing_Solution" to "none", disable homing, else if "Homing_Solution" is specified,
+ // If the user set "Homing_Solution" to "none", disable homing, else
+ // if "Homing_Solution" is specified,
// enable it.
if (sIRequest.getRequestDetails().getRequestParameters() != null
&& sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) {
@@ -363,7 +395,7 @@ public class WorkflowAction {
sIRequest.getRequestDetails().getRequestParameters().getUserParams();
for (Map<String, Object> params : userParams) {
if (params.containsKey(HOMINGSOLUTION)) {
- if (params.get(HOMINGSOLUTION).equals("none")) {
+ if ("none".equals(params.get(HOMINGSOLUTION))) {
execution.setVariable("homing", false);
} else {
execution.setVariable("homing", true);
@@ -382,7 +414,7 @@ public class WorkflowAction {
flowNames.add(ebb.getBuildingBlock().getBpmnFlowName());
}
- if (!aLaCarte) {
+ if (!isResume) {
bbInputSetupUtils.persistFlowExecutionPath(requestId, flowsToExecute);
}
execution.setVariable("flowNames", flowNames);
@@ -393,10 +425,25 @@ public class WorkflowAction {
execution.setVariable("isRollbackComplete", false);
} catch (Exception ex) {
- buildAndThrowException(execution, "Exception in create execution list. " + ex.getMessage(), ex);
+ buildAndThrowException(execution, "Exception in execution list. ", ex);
}
}
+ private String getCloudOwner(CloudConfiguration cloudConfiguration) {
+ if (cloudConfiguration != null && cloudConfiguration.getCloudOwner() != null) {
+ return cloudConfiguration.getCloudOwner();
+ }
+ logger.warn("cloud owner value not found in request details, it will be set as default");
+ return environment.getProperty(defaultCloudOwner);
+ }
+
+ private boolean isSuppressRollback(RequestInfo requestInfo) {
+ if (requestInfo != null) {
+ return requestInfo.getSuppressRollback();
+ }
+ return false;
+ }
+
protected <T> List<T> getRelatedResourcesInVfModule(String vnfId, String vfModuleId, Class<T> resultClass,
AAIObjectType type) {
List<T> vnfcs = new ArrayList<>();
@@ -447,14 +494,15 @@ public class WorkflowAction {
protected boolean isConfiguration(List<OrchestrationFlow> orchFlows) {
for (OrchestrationFlow flow : orchFlows) {
- if (flow.getFlowName().contains("Configuration") && !flow.getFlowName().equals("ConfigurationScaleOutBB")) {
+ if (flow.getFlowName().contains(CONFIGURATION) && !"ConfigurationScaleOutBB".equals(flow.getFlowName())) {
return true;
}
}
return false;
}
- protected List<ExecuteBuildingBlock> getConfigBuildingBlocks(ConfigBuildingBlocksDataObject dataObj) {
+ protected List<ExecuteBuildingBlock> getConfigBuildingBlocks(ConfigBuildingBlocksDataObject dataObj)
+ throws Exception {
List<ExecuteBuildingBlock> flowsToExecuteConfigs = new ArrayList<>();
List<OrchestrationFlow> result = dataObj.getOrchFlows().stream()
@@ -463,8 +511,17 @@ public class WorkflowAction {
String vfModuleId = dataObj.getWorkflowResourceIds().getVfModuleId();
String vnfCustomizationUUID = bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId();
- String vfModuleCustomizationUUID =
- bbInputSetupUtils.getAAIVfModule(vnfId, vfModuleId).getModelCustomizationId();
+ String vfModuleCustomizationUUID = "";
+ org.onap.aai.domain.yang.VfModule aaiVfModule = bbInputSetupUtils.getAAIVfModule(vnfId, vfModuleId);
+
+ if (aaiVfModule == null) {
+ logger.error("No matching VfModule is found in Generic-Vnf in AAI for vnfId: {} and vfModuleId : {}", vnfId,
+ vfModuleId);
+ throw new AAIEntityNotFoundException("No matching VfModule is found in Generic-Vnf in AAI for vnfId: "
+ + vnfId + " and vfModuleId : " + vfModuleId);
+ } else {
+ vfModuleCustomizationUUID = aaiVfModule.getModelCustomizationId();
+ }
List<org.onap.aai.domain.yang.Vnfc> vnfcs = getRelatedResourcesInVfModule(vnfId, vfModuleId,
org.onap.aai.domain.yang.Vnfc.class, AAIObjectType.VNFC);
@@ -501,6 +558,68 @@ public class WorkflowAction {
return flowsToExecuteConfigs;
}
+ protected List<OrchestrationFlow> getVfModuleReplaceBuildingBlocks(ConfigBuildingBlocksDataObject dataObj)
+ throws Exception {
+
+ List<ExecuteBuildingBlock> flowsToExecuteConfigs = new ArrayList<>();
+
+ String vnfId = dataObj.getWorkflowResourceIds().getVnfId();
+ String vfModuleId = dataObj.getWorkflowResourceIds().getVfModuleId();
+
+ logger.debug("BUILDING REPLACE LIST");
+
+ boolean volumeGroupExisted = false;
+ boolean volumeGroupWillExist = false;
+ boolean keepVolumeGroup = false;
+
+ boolean rebuildVolumeGroups = false;
+ if (dataObj.getRequestDetails().getRequestParameters() != null
+ && dataObj.getRequestDetails().getRequestParameters().getRebuildVolumeGroups() != null) {
+ rebuildVolumeGroups =
+ dataObj.getRequestDetails().getRequestParameters().getRebuildVolumeGroups().booleanValue();
+ }
+
+ Optional<VolumeGroup> volumeGroupFromVfModule =
+ bbInputSetupUtils.getRelatedVolumeGroupFromVfModule(vnfId, vfModuleId);
+ if (volumeGroupFromVfModule.isPresent()) {
+ String volumeGroupId = volumeGroupFromVfModule.get().getVolumeGroupId();
+ logger.debug("Volume group id of the existing volume group is: " + volumeGroupId);
+ volumeGroupExisted = true;
+ dataObj.getWorkflowResourceIds().setVolumeGroupId(volumeGroupId);
+ }
+
+ List<OrchestrationFlow> orchFlows = dataObj.getOrchFlows();
+ VfModuleCustomization vfModuleCustomization = catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(
+ dataObj.getRequestDetails().getModelInfo().getModelCustomizationUuid());
+ if (vfModuleCustomization != null && vfModuleCustomization.getVfModule() != null
+ && vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null
+ && vfModuleCustomization.getVolumeHeatEnv() != null) {
+ volumeGroupWillExist = true;
+ if (!volumeGroupExisted) {
+ String newVolumeGroupId = UUID.randomUUID().toString();
+ dataObj.getWorkflowResourceIds().setVolumeGroupId(newVolumeGroupId);
+ logger.debug("newVolumeGroupId: " + newVolumeGroupId);
+ }
+ }
+
+ if (volumeGroupExisted && volumeGroupWillExist && !rebuildVolumeGroups) {
+ keepVolumeGroup = true;
+ }
+
+ if (!volumeGroupExisted || keepVolumeGroup) {
+ logger.debug("Filtering out deletion of volume groups");
+ orchFlows = orchFlows.stream().filter(item -> !item.getFlowName().matches(VOLUMEGROUP_DELETE_PATTERN))
+ .collect(Collectors.toList());
+ }
+ if (!volumeGroupWillExist || keepVolumeGroup) {
+ logger.debug("Filtering out creation of volume groups");
+ orchFlows = orchFlows.stream().filter(item -> !item.getFlowName().matches(VOLUMEGROUP_CREATE_PATTERN))
+ .collect(Collectors.toList());
+ }
+
+ return orchFlows;
+ }
+
protected String getVnfcNameForConfiguration(org.onap.aai.domain.yang.Configuration configuration) {
AAIResultWrapper wrapper = new AAIResultWrapper(configuration);
Optional<Relationships> relationshipsOp = wrapper.getRelationships();
@@ -601,6 +720,8 @@ public class WorkflowAction {
workflowResourceIds.setServiceInstanceId(serviceInstanceId);
if (resource == WorkflowType.VNF) {
workflowResourceIds.setVnfId(resourceId);
+ } else if (resource == WorkflowType.PNF) {
+ workflowResourceIds.setPnfId(resourceId);
} else if (resource == WorkflowType.VFMODULE) {
workflowResourceIds.setVfModuleId(resourceId);
} else if (resource == WorkflowType.VOLUMEGROUP) {
@@ -715,7 +836,7 @@ public class WorkflowAction {
protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration,
AAIResultWrapper configWrapper) throws VrfBondingServiceException {
- if (vrfConfiguration.getConfigurationType().equalsIgnoreCase("VRF-ENTRY")) {
+ if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) {
Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships();
if (relationshipsConfigOp.isPresent()) {
Optional<VpnBinding> relatedInfraVpnBindingOp =
@@ -752,7 +873,7 @@ public class WorkflowAction {
if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() != null) {
String toscaNodeType = collectionResourceCustomization.getCollectionResource()
.getInstanceGroup().getToscaNodeType();
- if (toscaNodeType != null && toscaNodeType.contains("NetworkCollection")) {
+ if (toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION)) {
int minNetworks = 0;
org.onap.so.db.catalog.beans.InstanceGroup instanceGroup =
collectionResourceCustomization.getCollectionResource().getInstanceGroup();
@@ -885,6 +1006,7 @@ public class WorkflowAction {
}
}
} 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.");
}
@@ -926,6 +1048,7 @@ public class WorkflowAction {
}
}
} catch (Exception ex) {
+ logger.error("Exception in traverseAAIVnf", ex);
buildAndThrowException(execution,
"Could not find existing Vnf or related Instances to execute the request on.");
}
@@ -953,6 +1076,7 @@ public class WorkflowAction {
}
}
} catch (Exception ex) {
+ logger.error("Exception in findConfigurationsInsideVfModule", ex);
buildAndThrowException(execution, "Failed to find Configuration object from the vfModule.");
}
}
@@ -1015,8 +1139,8 @@ public class WorkflowAction {
vfModuleCustomizationUUID =
vfModule.getModelInfo().getModelCustomizationUuid();
}
- if (!vnfCustomizationUUID.equals("")
- && !vfModuleCustomizationUUID.equals("")) {
+ if (!vnfCustomizationUUID.isEmpty()
+ && !vfModuleCustomizationUUID.isEmpty()) {
List<CvnfcConfigurationCustomization> configs =
traverseCatalogDbForConfiguration(
validate.getModelInfo().getModelVersionId(),
@@ -1041,6 +1165,13 @@ public class WorkflowAction {
}
}
}
+ if (validate.getResources().getPnfs() != null) {
+ for (Pnfs pnf : validate.getResources().getPnfs()) {
+ resourceCounter.add(new Resource(WorkflowType.PNF,
+ pnf.getModelInfo().getModelCustomizationId(), false));
+ foundRelated = true;
+ }
+ }
if (validate.getResources().getNetworks() != null) {
for (Networks network : validate.getResources().getNetworks()) {
resourceCounter.add(new Resource(WorkflowType.NETWORK,
@@ -1109,8 +1240,8 @@ public class WorkflowAction {
}
protected Resource extractResourceIdAndTypeFromUri(String uri) {
- Pattern patt = Pattern.compile(
- "[vV]\\d+.*?(?:(?:/(?<type>" + supportedTypes + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?)?$");
+ Pattern patt = Pattern.compile("[vV]\\d+.*?(?:(?:/(?<type>" + SUPPORTEDTYPES
+ + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?(?:/resume)?)?$");
Matcher m = patt.matcher(uri);
Boolean generated = false;
@@ -1123,15 +1254,15 @@ public class WorkflowAction {
throw new IllegalArgumentException("Uri could not be parsed. No type found. " + uri);
}
if (action == null) {
- if (type.equals(SERVICE_INSTANCES) && (id == null || id.equals("assign"))) {
+ if (type.equals(SERVICE_INSTANCES) && (id == null || "assign".equals(id))) {
id = UUID.randomUUID().toString();
generated = true;
- } else if (type.equals(VF_MODULES) && id.equals("scaleOut")) {
+ } else if (type.equals(VF_MODULES) && "scaleOut".equals(id)) {
id = UUID.randomUUID().toString();
generated = true;
}
} else {
- if (action.matches(supportedTypes)) {
+ if (action.matches(SUPPORTEDTYPES)) {
id = UUID.randomUUID().toString();
generated = true;
type = action;
@@ -1147,142 +1278,21 @@ public class WorkflowAction {
RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds) throws Exception {
try {
if ("SERVICE".equalsIgnoreCase(type.toString())) {
- // Service name verification based upon name + model-version-id
- // + service-type + global-customer-id per requirements
- String globalCustomerId = reqDetails.getSubscriberInfo().getGlobalSubscriberId();
- String serviceType = reqDetails.getRequestParameters().getSubscriptionServiceType();
- if (instanceName != null) {
- Optional<ServiceInstance> serviceInstanceAAI =
- bbInputSetupUtils.getAAIServiceInstanceByName(globalCustomerId, serviceType, instanceName);
- if (serviceInstanceAAI.isPresent()) {
- if (serviceInstanceAAI.get().getModelVersionId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelVersionId())) {
- return serviceInstanceAAI.get().getServiceInstanceId();
- } else {
- throw new DuplicateNameException("serviceInstance",
- String.format(NAME_EXISTS_WITH_DIFF_VERSION_ID, instanceName,
- reqDetails.getModelInfo().getModelVersionId()));
- }
- } else {
- ServiceInstances aaiServiceInstances =
- bbInputSetupUtils.getAAIServiceInstancesGloballyByName(instanceName);
- if (aaiServiceInstances != null) {
- if (aaiServiceInstances.getServiceInstance() != null
- && !aaiServiceInstances.getServiceInstance().isEmpty()) {
- if (aaiServiceInstances.getServiceInstance().size() > 1) {
- throw new DuplicateNameException("serviceInstance",
- String.format(NAME_EXISTS_MULTIPLE, instanceName));
- } else {
- ServiceInstance si =
- aaiServiceInstances.getServiceInstance().stream().findFirst().get();
- Map<String, String> keys =
- bbInputSetupUtils.getURIKeysFromServiceInstance(si.getServiceInstanceId());
-
- throw new DuplicateNameException("serviceInstance",
- String.format(NAME_EXISTS_WITH_DIFF_COMBINATION, instanceName,
- keys.get("global-customer-id"), keys.get("service-type"),
- si.getModelVersionId()));
- }
- }
- }
- }
- }
+ return validateServiceResourceIdInAAI(generatedResourceId, instanceName, reqDetails);
} else if ("NETWORK".equalsIgnoreCase(type.toString())) {
- Optional<L3Network> network = bbInputSetupUtils.getRelatedNetworkByNameFromServiceInstance(
- workflowResourceIds.getServiceInstanceId(), instanceName);
- if (network.isPresent()) {
- if (network.get().getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return network.get().getNetworkId();
- } else {
- throw new DuplicateNameException("l3Network",
- String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
- network.get().getModelCustomizationId()));
- }
- }
-
- if (bbInputSetupUtils.existsAAINetworksGloballyByName(instanceName)) {
- throw new DuplicateNameException("l3Network", String.format(NAME_EXISTS_WITH_DIFF_PARENT,
- instanceName, workflowResourceIds.getServiceInstanceId()));
- }
-
+ return validateNetworkResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
+ workflowResourceIds);
} else if ("VNF".equalsIgnoreCase(type.toString())) {
- Optional<GenericVnf> vnf = bbInputSetupUtils.getRelatedVnfByNameFromServiceInstance(
- workflowResourceIds.getServiceInstanceId(), instanceName);
- if (vnf.isPresent()) {
- if (vnf.get().getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return vnf.get().getVnfId();
- } else {
- throw new DuplicateNameException("generic-vnf",
- String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
- vnf.get().getModelCustomizationId()));
- }
- }
- GenericVnfs vnfs = bbInputSetupUtils.getAAIVnfsGloballyByName(instanceName);
- if (vnfs != null) {
- throw new DuplicateNameException("generic-vnf", String.format(NAME_EXISTS_WITH_DIFF_PARENT,
- instanceName, vnfs.getGenericVnf().get(0).getVnfId()));
- }
+ return validateVnfResourceIdInAAI(generatedResourceId, instanceName, reqDetails, workflowResourceIds);
} else if ("VFMODULE".equalsIgnoreCase(type.toString())) {
- GenericVnf vnf = bbInputSetupUtils.getAAIGenericVnf(workflowResourceIds.getVnfId());
- if (vnf != null && vnf.getVfModules() != null) {
- for (org.onap.aai.domain.yang.VfModule vfModule : vnf.getVfModules().getVfModule()) {
- if (vfModule.getVfModuleName().equalsIgnoreCase(instanceName)) {
- if (vfModule.getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return vfModule.getVfModuleId();
- } else {
- throw new DuplicateNameException("vfModule",
- String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
- reqDetails.getModelInfo().getModelCustomizationId()));
- }
- }
- }
- }
+ return validateVfModuleResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
+ workflowResourceIds);
} else if ("VOLUMEGROUP".equalsIgnoreCase(type.toString())) {
- GenericVnf vnf = bbInputSetupUtils.getAAIGenericVnf(workflowResourceIds.getVnfId());
- Optional<VolumeGroup> volumeGroup = bbInputSetupUtils
- .getRelatedVolumeGroupByNameFromVnf(workflowResourceIds.getVnfId(), instanceName);
- if (volumeGroup.isPresent()) {
- if (vnf.getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return volumeGroup.get().getVolumeGroupId();
- } else {
- throw new DuplicateNameException("volumeGroup", volumeGroup.get().getVolumeGroupName());
- }
- }
- if (vnf != null && vnf.getVfModules() != null) {
- for (org.onap.aai.domain.yang.VfModule vfModule : vnf.getVfModules().getVfModule()) {
- Optional<VolumeGroup> volumeGroupFromVfModule =
- bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnf.getVnfId(),
- vfModule.getVfModuleId(), instanceName);
- if (volumeGroupFromVfModule.isPresent()) {
- if (vnf.getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return volumeGroupFromVfModule.get().getVolumeGroupId();
- } else {
- throw new DuplicateNameException("volumeGroup",
- String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
- volumeGroupFromVfModule.get().getModelCustomizationId()));
- }
- }
- }
- }
+ return validateVolumeGroupResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
+ workflowResourceIds);
} else if ("CONFIGURATION".equalsIgnoreCase(type.toString())) {
- Optional<org.onap.aai.domain.yang.Configuration> configuration =
- bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance(
- workflowResourceIds.getServiceInstanceId(), instanceName);
- if (configuration.isPresent()) {
- if (configuration.get().getModelCustomizationId()
- .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
- return configuration.get().getConfigurationId();
- } else {
- throw new DuplicateNameException("configuration",
- String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
- configuration.get().getConfigurationId()));
- }
- }
+ return validateConfigurationResourceIdInAAI(generatedResourceId, instanceName, reqDetails,
+ workflowResourceIds);
}
return generatedResourceId;
} catch (DuplicateNameException dne) {
@@ -1295,7 +1305,7 @@ public class WorkflowAction {
}
protected String convertTypeFromPlural(String type) {
- if (!type.matches(supportedTypes)) {
+ if (!type.matches(SUPPORTEDTYPES)) {
return type;
} else {
if (type.equals(SERVICE_INSTANCES)) {
@@ -1317,31 +1327,31 @@ public class WorkflowAction {
String virtualLinkKey = ebb.getBuildingBlock().getVirtualLinkKey();
sortedOrchFlows.add(ebb);
for (ExecuteBuildingBlock ebb2 : orchFlows) {
- if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB")
+ if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB)
&& ebb2.getBuildingBlock().getKey().equalsIgnoreCase(key)) {
sortedOrchFlows.add(ebb2);
break;
}
- if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB")
+ if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB)
&& ebb2.getBuildingBlock().getVirtualLinkKey().equalsIgnoreCase(virtualLinkKey)) {
sortedOrchFlows.add(ebb2);
break;
}
}
for (ExecuteBuildingBlock ebb2 : orchFlows) {
- if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB")
+ if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB)
&& ebb2.getBuildingBlock().getKey().equalsIgnoreCase(key)) {
sortedOrchFlows.add(ebb2);
break;
}
- if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB")
+ if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB)
&& ebb2.getBuildingBlock().getVirtualLinkKey().equalsIgnoreCase(virtualLinkKey)) {
sortedOrchFlows.add(ebb2);
break;
}
}
- } else if (ebb.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB")
- || ebb.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB")) {
+ } else if (ebb.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB)
+ || ebb.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB)) {
continue;
} else if (!ebb.getBuildingBlock().getBpmnFlowName().equals("")) {
sortedOrchFlows.add(ebb);
@@ -1377,99 +1387,83 @@ public class WorkflowAction {
return sortedOrchFlows;
}
+ private void addBuildingBlockToExecuteBBList(List<ExecuteBuildingBlock> flowsToExecute, List<Resource> resourceList,
+ WorkflowType workflowType, OrchestrationFlow orchFlow, String requestId, String apiVersion,
+ String resourceId, String requestAction, String vnfType, WorkflowResourceIds workflowResourceIds,
+ RequestDetails requestDetails, boolean isVirtualLink, boolean isConfiguration) {
+
+ List<Resource> serviceResources = resourceList.stream()
+ .filter(resource -> resource.getResourceType().equals(workflowType)).collect(Collectors.toList());
+ serviceResources.forEach(resource -> flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, resource,
+ apiVersion, resourceId, requestAction, false, vnfType, workflowResourceIds, requestDetails,
+ isVirtualLink, resource.getVirtualLinkKey(), isConfiguration)));
+ }
+
protected List<ExecuteBuildingBlock> buildExecuteBuildingBlockList(List<OrchestrationFlow> orchFlows,
- List<Resource> resourceCounter, String requestId, String apiVersion, String resourceId,
- String requestAction, boolean aLaCarte, String vnfType, WorkflowResourceIds workflowResourceIds,
- RequestDetails requestDetails) {
+ List<Resource> resourceList, String requestId, String apiVersion, String resourceId, String requestAction,
+ String vnfType, WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails,
+ boolean replaceVnf) {
List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
for (OrchestrationFlow orchFlow : orchFlows) {
if (orchFlow.getFlowName().contains(SERVICE)) {
- for (int i = 0; i < resourceCounter.stream().filter(x -> WorkflowType.SERVICE == x.getResourceType())
- .collect(Collectors.toList()).size(); i++) {
+ if (!replaceVnf) {
workflowResourceIds.setServiceInstanceId(resourceId);
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.SERVICE == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
}
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.SERVICE, orchFlow, requestId,
+ apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false,
+ false);
} else if (orchFlow.getFlowName().contains(VNF)) {
- for (int i = 0; i < resourceCounter.stream().filter(x -> WorkflowType.VNF == x.getResourceType())
- .collect(Collectors.toList()).size(); i++) {
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.VNF == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
- }
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.VNF, orchFlow, requestId,
+ apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false,
+ false);
+ } else if (orchFlow.getFlowName().contains(PNF)) {
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.PNF, orchFlow, requestId,
+ apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false,
+ false);
} else if (orchFlow.getFlowName().contains(NETWORK)
&& !orchFlow.getFlowName().contains(NETWORKCOLLECTION)) {
- for (int i = 0; i < resourceCounter.stream().filter(x -> WorkflowType.NETWORK == x.getResourceType())
- .collect(Collectors.toList()).size(); i++) {
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.NETWORK == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
- }
- for (int i = 0; i < resourceCounter.stream()
- .filter(x -> WorkflowType.VIRTUAL_LINK == x.getResourceType()).collect(Collectors.toList())
- .size(); i++) {
- Resource resource =
- resourceCounter.stream().filter(x -> WorkflowType.VIRTUAL_LINK == x.getResourceType())
- .collect(Collectors.toList()).get(i);
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, resource, apiVersion, resourceId,
- requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, true,
- resource.getVirtualLinkKey(), false));
- }
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.NETWORK, orchFlow, requestId,
+ apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false,
+ false);
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.VIRTUAL_LINK, orchFlow,
+ requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails,
+ true, false);
+
} else if (orchFlow.getFlowName().contains(VFMODULE)) {
List<Resource> vfModuleResourcesSorted = null;
- if (requestAction.equals("createInstance") || requestAction.equals("assignInstance")
+ if (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE)
|| requestAction.equals("activateInstance")) {
- vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceCounter.stream()
+ vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceList.stream()
.filter(x -> WorkflowType.VFMODULE == x.getResourceType()).collect(Collectors.toList()));
} else {
- vfModuleResourcesSorted = sortVfModulesByBaseLast(resourceCounter.stream()
+ vfModuleResourcesSorted = sortVfModulesByBaseLast(resourceList.stream()
.filter(x -> WorkflowType.VFMODULE == x.getResourceType()).collect(Collectors.toList()));
}
for (int i = 0; i < vfModuleResourcesSorted.size(); i++) {
flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, vfModuleResourcesSorted.get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
+ apiVersion, resourceId, requestAction, false, vnfType, workflowResourceIds, requestDetails,
+ false, null, false));
}
} else if (orchFlow.getFlowName().contains(VOLUMEGROUP)) {
- for (int i = 0; i < resourceCounter.stream()
- .filter(x -> WorkflowType.VOLUMEGROUP == x.getResourceType()).collect(Collectors.toList())
- .size(); i++) {
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.VOLUMEGROUP == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
+ if (requestAction.equalsIgnoreCase(REPLACEINSTANCE)
+ || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS)) {
+ logger.debug("Replacing workflow resource id by volume group id");
+ resourceId = workflowResourceIds.getVolumeGroupId();
}
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.VOLUMEGROUP, orchFlow,
+ requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails,
+ false, false);
} else if (orchFlow.getFlowName().contains(NETWORKCOLLECTION)) {
- for (int i = 0; i < resourceCounter.stream()
- .filter(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType()).collect(Collectors.toList())
- .size(); i++) {
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, false));
- }
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.NETWORKCOLLECTION, orchFlow,
+ requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails,
+ false, false);
} else if (orchFlow.getFlowName().contains(CONFIGURATION)) {
- for (int i = 0; i < resourceCounter.stream()
- .filter(x -> WorkflowType.CONFIGURATION == x.getResourceType()).collect(Collectors.toList())
- .size(); i++) {
- flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId,
- resourceCounter.stream().filter(x -> WorkflowType.CONFIGURATION == x.getResourceType())
- .collect(Collectors.toList()).get(i),
- apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails, false, null, true));
- }
+ addBuildingBlockToExecuteBBList(flowsToExecute, resourceList, WorkflowType.CONFIGURATION, orchFlow,
+ requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails,
+ false, true);
} else {
flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, null, apiVersion, resourceId,
- requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null, false));
+ requestAction, false, vnfType, workflowResourceIds, requestDetails, false, null, false));
}
}
return flowsToExecute;
@@ -1481,6 +1475,11 @@ public class WorkflowAction {
boolean isVirtualLink, String virtualLinkKey, boolean isConfiguration) {
ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
BuildingBlock buildingBlock = new BuildingBlock();
+
+ Optional.ofNullable(orchFlow.getBpmnAction()).ifPresent(action -> buildingBlock.setBpmnAction(action));
+ Optional.ofNullable(orchFlow.getBpmnScope()).ifPresent(scope -> buildingBlock.setBpmnScope(scope));
+
+
buildingBlock.setBpmnFlowName(orchFlow.getFlowName());
buildingBlock.setMsoId(UUID.randomUUID().toString());
if (resource == null) {
@@ -1493,6 +1492,13 @@ public class WorkflowAction {
executeBuildingBlock.setApiVersion(apiVersion);
executeBuildingBlock.setaLaCarte(aLaCarte);
executeBuildingBlock.setRequestAction(requestAction);
+
+ if (resource != null
+ && (orchFlow.getFlowName().contains(VOLUMEGROUP) && (requestAction.equalsIgnoreCase(REPLACEINSTANCE)
+ || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS)))) {
+ logger.debug("Setting resourceId to volume group id for volume group flow on replace");
+ resourceId = workflowResourceIds.getVolumeGroupId();
+ }
executeBuildingBlock.setResourceId(resourceId);
executeBuildingBlock.setVnfType(vnfType);
executeBuildingBlock.setWorkflowResourceIds(workflowResourceIds);
@@ -1549,7 +1555,7 @@ public class WorkflowAction {
if (flows == null)
flows = new ArrayList<>();
for (OrchestrationFlow flow : flows) {
- if (!flow.getFlowName().contains("BB")) {
+ if (!flow.getFlowName().contains("BB") && !flow.getFlowName().contains("Activity")) {
List<OrchestrationFlow> macroQueryFlows =
catalogDbClient.getOrchestrationFlowByAction(flow.getFlowName());
for (OrchestrationFlow macroFlow : macroQueryFlows) {
@@ -1605,5 +1611,151 @@ public class WorkflowAction {
&& (serviceInstanceId != null && serviceInstanceId.trim().length() > 1)
&& (bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId) != null));
}
-}
+ protected String validateServiceResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails) throws DuplicateNameException, MultipleObjectsFoundException {
+ String globalCustomerId = reqDetails.getSubscriberInfo().getGlobalSubscriberId();
+ String serviceType = reqDetails.getRequestParameters().getSubscriptionServiceType();
+ if (instanceName != null) {
+ Optional<ServiceInstance> serviceInstanceAAI =
+ bbInputSetupUtils.getAAIServiceInstanceByName(globalCustomerId, serviceType, instanceName);
+ if (serviceInstanceAAI.isPresent()) {
+ if (serviceInstanceAAI.get().getModelVersionId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelVersionId())) {
+ return serviceInstanceAAI.get().getServiceInstanceId();
+ } else {
+ throw new DuplicateNameException(SERVICE_INSTANCE, String.format(NAME_EXISTS_WITH_DIFF_VERSION_ID,
+ instanceName, reqDetails.getModelInfo().getModelVersionId()));
+ }
+ } else {
+ ServiceInstances aaiServiceInstances =
+ bbInputSetupUtils.getAAIServiceInstancesGloballyByName(instanceName);
+ if (aaiServiceInstances != null) {
+ if (aaiServiceInstances.getServiceInstance() != null
+ && !aaiServiceInstances.getServiceInstance().isEmpty()) {
+ if (aaiServiceInstances.getServiceInstance().size() > 1) {
+ throw new DuplicateNameException(SERVICE_INSTANCE,
+ String.format(NAME_EXISTS_MULTIPLE, instanceName));
+ } else {
+ ServiceInstance si = aaiServiceInstances.getServiceInstance().stream().findFirst().get();
+ Map<String, String> keys =
+ bbInputSetupUtils.getURIKeysFromServiceInstance(si.getServiceInstanceId());
+
+ throw new DuplicateNameException(SERVICE_INSTANCE,
+ String.format(NAME_EXISTS_WITH_DIFF_COMBINATION, instanceName,
+ keys.get("global-customer-id"), keys.get("service-type"),
+ si.getModelVersionId()));
+ }
+ }
+ }
+ }
+ }
+ return generatedResourceId;
+ }
+
+ protected String validateNetworkResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds)
+ throws DuplicateNameException, MultipleObjectsFoundException {
+ Optional<L3Network> network = bbInputSetupUtils
+ .getRelatedNetworkByNameFromServiceInstance(workflowResourceIds.getServiceInstanceId(), instanceName);
+ if (network.isPresent()) {
+ if (network.get().getModelCustomizationId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
+ return network.get().getNetworkId();
+ } else {
+ throw new DuplicateNameException("l3Network", String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID,
+ instanceName, network.get().getModelCustomizationId()));
+ }
+ }
+ if (bbInputSetupUtils.existsAAINetworksGloballyByName(instanceName)) {
+ throw new DuplicateNameException("l3Network", String.format(NAME_EXISTS_WITH_DIFF_PARENT, instanceName,
+ workflowResourceIds.getServiceInstanceId()));
+ }
+ return generatedResourceId;
+ }
+
+ protected String validateVnfResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds)
+ throws DuplicateNameException, MultipleObjectsFoundException {
+ Optional<GenericVnf> vnf = bbInputSetupUtils
+ .getRelatedVnfByNameFromServiceInstance(workflowResourceIds.getServiceInstanceId(), instanceName);
+ if (vnf.isPresent()) {
+ if (vnf.get().getModelCustomizationId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
+ return vnf.get().getVnfId();
+ } else {
+ throw new DuplicateNameException("generic-vnf", String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID,
+ instanceName, vnf.get().getModelCustomizationId()));
+ }
+ }
+ GenericVnfs vnfs = bbInputSetupUtils.getAAIVnfsGloballyByName(instanceName);
+ if (vnfs != null) {
+ throw new DuplicateNameException("generic-vnf",
+ String.format(NAME_EXISTS_WITH_DIFF_PARENT, instanceName, vnfs.getGenericVnf().get(0).getVnfId()));
+ }
+ return generatedResourceId;
+ }
+
+ protected String validateVfModuleResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds) throws DuplicateNameException {
+ GenericVnf vnf = bbInputSetupUtils.getAAIGenericVnf(workflowResourceIds.getVnfId());
+ if (vnf != null && vnf.getVfModules() != null) {
+ for (org.onap.aai.domain.yang.VfModule vfModule : vnf.getVfModules().getVfModule()) {
+ if (vfModule.getVfModuleName().equalsIgnoreCase(instanceName)) {
+ if (vfModule.getModelCustomizationId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
+ return vfModule.getVfModuleId();
+ } else {
+ throw new DuplicateNameException("vfModule",
+ String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID, instanceName,
+ reqDetails.getModelInfo().getModelCustomizationId()));
+ }
+ }
+ }
+ }
+ if (bbInputSetupUtils.existsAAIVfModuleGloballyByName(instanceName)) {
+ throw new DuplicateNameException("vfModule", instanceName);
+ }
+ return generatedResourceId;
+ }
+
+ protected String validateVolumeGroupResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds)
+ throws DuplicateNameException, MultipleObjectsFoundException {
+ Optional<VolumeGroup> volumeGroup =
+ bbInputSetupUtils.getRelatedVolumeGroupByNameFromVnf(workflowResourceIds.getVnfId(), instanceName);
+ if (volumeGroup.isPresent()) {
+ if (volumeGroup.get().getVfModuleModelCustomizationId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
+ return volumeGroup.get().getVolumeGroupId();
+ } else {
+ throw new DuplicateNameException("volumeGroup", volumeGroup.get().getVolumeGroupName());
+ }
+ }
+ if (bbInputSetupUtils.existsAAIVolumeGroupGloballyByName(instanceName)) {
+ throw new DuplicateNameException("volumeGroup", instanceName);
+ }
+ return generatedResourceId;
+ }
+
+ protected String validateConfigurationResourceIdInAAI(String generatedResourceId, String instanceName,
+ RequestDetails reqDetails, WorkflowResourceIds workflowResourceIds)
+ throws DuplicateNameException, MultipleObjectsFoundException {
+ Optional<org.onap.aai.domain.yang.Configuration> configuration =
+ bbInputSetupUtils.getRelatedConfigurationByNameFromServiceInstance(
+ workflowResourceIds.getServiceInstanceId(), instanceName);
+ if (configuration.isPresent()) {
+ if (configuration.get().getModelCustomizationId()
+ .equalsIgnoreCase(reqDetails.getModelInfo().getModelCustomizationId())) {
+ return configuration.get().getConfigurationId();
+ } else {
+ throw new DuplicateNameException("configuration", String.format(NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID,
+ instanceName, configuration.get().getConfigurationId()));
+ }
+ }
+ if (bbInputSetupUtils.existsAAIConfigurationGloballyByName(instanceName)) {
+ throw new DuplicateNameException("configuration", instanceName);
+ }
+ return generatedResourceId;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
index be3e06c9ea..56cd9fd70f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
@@ -39,6 +39,8 @@ import org.springframework.stereotype.Component;
@Component
public class WorkflowActionBBFailure {
+ private static final String DEACTIVATE_FABRIC_CONFIGURATION_FLOW = "DeactivateFabricConfigurationBB";
+ private static final String UNASSIGN_FABRIC_CONFIGURATION_FLOW = "UnassignFabricConfigurationBB";
private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBFailure.class);
public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState";
@Autowired
@@ -96,6 +98,16 @@ public class WorkflowActionBBFailure {
String rollbackTargetState = (String) execution.getVariable(ROLLBACK_TARGET_STATE);
request.setRequestStatus(rollbackTargetState);
} else if (isRollbackFailure) {
+ if (ebb != null && ebb.getBuildingBlock() != null && ebb.getBuildingBlock().getBpmnFlowName() != null) {
+ String flowName = ebb.getBuildingBlock().getBpmnFlowName();
+ if (DEACTIVATE_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName)
+ || UNASSIGN_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName)) {
+ String statusMessage = String.format(
+ "%s Warning: The vf-module is active but configuration was not removed completely for one or more VMs.",
+ request.getStatusMessage());
+ request.setStatusMessage(statusMessage);
+ }
+ }
Optional<String> rollbackErrorMsgOp = retrieveErrorMessage(execution);
if (rollbackErrorMsgOp.isPresent()) {
rollbackErrorMsg = rollbackErrorMsgOp.get();
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 073dead8b3..9d45272a60 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
@@ -23,10 +23,17 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
+import java.util.Optional;
import java.util.UUID;
import javax.persistence.EntityNotFoundException;
import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.InstanceGroup;
+import org.onap.aai.domain.yang.L3Network;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.VfModule;
import org.onap.aai.domain.yang.Vnfc;
+import org.onap.aai.domain.yang.VolumeGroup;
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;
@@ -38,9 +45,9 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.Configuration;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -65,6 +72,9 @@ public class WorkflowActionBBTasks {
private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
private static final String ASSIGN_FABRIC_CONFIGURATION_BB = "AssignFabricConfigurationBB";
private static final String ACTIVATE_FABRIC_CONFIGURATION_BB = "ActivateFabricConfigurationBB";
+ private static final String COMPLETED = "completed";
+ private static final String HANDLINGCODE = "handlingCode";
+ private static final String ROLLBACKTOCREATED = "RollbackToCreated";
protected String maxRetries = "mso.rainyDay.maxRetries";
private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class);
@@ -98,9 +108,9 @@ public class WorkflowActionBBTasks {
execution.setVariable("buildingBlock", ebb);
currentSequence++;
if (currentSequence >= flowsToExecute.size()) {
- execution.setVariable("completed", true);
+ execution.setVariable(COMPLETED, true);
} else {
- execution.setVariable("completed", false);
+ execution.setVariable(COMPLETED, false);
}
execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
}
@@ -114,7 +124,8 @@ public class WorkflowActionBBTasks {
}
} catch (Exception ex) {
logger.warn(
- "Bpmn Flow Statistics was unable to update Request Db with the new completion percentage. Competion percentage may be invalid.");
+ "Bpmn Flow Statistics was unable to update Request Db with the new completion percentage. Competion percentage may be invalid.",
+ ex);
}
}
@@ -236,7 +247,7 @@ public class WorkflowActionBBTasks {
}
public void checkRetryStatus(DelegateExecution execution) {
- String handlingCode = (String) execution.getVariable("handlingCode");
+ String handlingCode = (String) execution.getVariable(HANDLINGCODE);
String requestId = (String) execution.getVariable(G_REQUEST_ID);
String retryDuration = (String) execution.getVariable("RetryDuration");
int retryCount = (int) execution.getVariable(RETRY_COUNT);
@@ -244,11 +255,11 @@ public class WorkflowActionBBTasks {
try {
envMaxRetries = Integer.parseInt(this.environment.getProperty(maxRetries));
} catch (Exception ex) {
- logger.error("Could not read maxRetries from config file. Setting max to 5 retries");
+ logger.error("Could not read maxRetries from config file. Setting max to 5 retries", ex);
envMaxRetries = 5;
}
int nextCount = retryCount + 1;
- if (handlingCode.equals("Retry")) {
+ if ("Retry".equals(handlingCode)) {
workflowActionBBFailure.updateRequestErrorStatusMessage(execution);
try {
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
@@ -259,8 +270,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("gCurrentSequence");
- execution.setVariable("gCurrentSequence", currSequence - 1);
+ int currSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ execution.setVariable(G_CURRENT_SEQUENCE, currSequence - 1);
execution.setVariable(RETRY_COUNT, nextCount);
} else {
workflowAction.buildAndThrowException(execution,
@@ -287,12 +298,12 @@ public class WorkflowActionBBTasks {
flowsToExecute.remove(i);
} else {
String flowName = flowsToExecute.get(i).getBuildingBlock().getBpmnFlowName();
- if (flowName.contains("Assign")) {
- flowName = "Unassign" + flowName.substring(6, flowName.length());
- } else if (flowName.contains("Create")) {
- flowName = "Delete" + flowName.substring(6, flowName.length());
- } else if (flowName.contains("Activate")) {
- flowName = "Deactivate" + flowName.substring(8, flowName.length());
+ if (flowName.startsWith("Assign")) {
+ flowName = flowName.replaceFirst("Assign", "Unassign");
+ } else if (flowName.startsWith("Create")) {
+ flowName = flowName.replaceFirst("Create", "Delete");
+ } else if (flowName.startsWith("Activate")) {
+ flowName = flowName.replaceFirst("Activate", "Deactivate");
} else {
continue;
}
@@ -301,15 +312,16 @@ public class WorkflowActionBBTasks {
}
}
- String handlingCode = (String) execution.getVariable("handlingCode");
+ String handlingCode = (String) execution.getVariable(HANDLINGCODE);
List<ExecuteBuildingBlock> rollbackFlowsFiltered = new ArrayList<>();
rollbackFlowsFiltered.addAll(rollbackFlows);
- if (handlingCode.equals("RollbackToAssigned") || handlingCode.equals("RollbackToCreated")) {
+ if ("RollbackToAssigned".equals(handlingCode) || ROLLBACKTOCREATED.equals(handlingCode)) {
for (int i = 0; i < rollbackFlows.size(); i++) {
- if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign")) {
+ if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign") && !rollbackFlows
+ .get(i).getBuildingBlock().getBpmnFlowName().contains("FabricConfiguration")) {
rollbackFlowsFiltered.remove(rollbackFlows.get(i));
} else if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Delete")
- && handlingCode.equals("RollbackToCreated")) {
+ && ROLLBACKTOCREATED.equals(handlingCode)) {
rollbackFlowsFiltered.remove(rollbackFlows.get(i));
}
}
@@ -321,9 +333,9 @@ public class WorkflowActionBBTasks {
else
execution.setVariable("isRollbackNeeded", true);
execution.setVariable("flowsToExecute", rollbackFlowsFiltered);
- execution.setVariable("handlingCode", "PreformingRollback");
+ execution.setVariable(HANDLINGCODE, "PreformingRollback");
execution.setVariable("isRollback", true);
- execution.setVariable("gCurrentSequence", 0);
+ execution.setVariable(G_CURRENT_SEQUENCE, 0);
execution.setVariable(RETRY_COUNT, 0);
} else {
workflowAction.buildAndThrowException(execution,
@@ -352,8 +364,11 @@ public class WorkflowActionBBTasks {
} else if (resourceType == WorkflowType.INSTANCE_GROUP) {
request.setInstanceGroupId(resourceId);
}
+ setInstanceName(resourceId, resourceType, request);
+ request.setLastModifiedBy("CamundaBPMN");
requestDbclient.updateInfraActiveRequests(request);
} catch (Exception ex) {
+ logger.error("Exception in updateInstanceId", ex);
workflowAction.buildAndThrowException(execution, "Failed to update Request db with instanceId");
}
}
@@ -361,12 +376,12 @@ public class WorkflowActionBBTasks {
public void postProcessingExecuteBB(DelegateExecution execution) {
List<ExecuteBuildingBlock> flowsToExecute =
(List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
- String handlingCode = (String) execution.getVariable("handlingCode");
+ String handlingCode = (String) execution.getVariable(HANDLINGCODE);
final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1);
String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName();
- if (bbFlowName.equalsIgnoreCase("ActivateVfModuleBB") && aLaCarte && handlingCode.equalsIgnoreCase("Success")) {
+ if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) {
postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute);
}
}
@@ -394,7 +409,7 @@ public class WorkflowActionBBTasks {
if (fabricConfig != null && fabricConfig.getConfigurationResource() != null
&& fabricConfig.getConfigurationResource().getToscaNodeType() != null
&& fabricConfig.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) {
- String configurationId = UUID.randomUUID().toString();
+ String configurationId = getConfigurationId(vnfc);
ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys();
configurationResourceKeys.setCvnfcCustomizationUUID(modelCustomizationId);
configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID);
@@ -410,21 +425,32 @@ public class WorkflowActionBBTasks {
.forEach(executeBB -> logger.info("Flows to Execute After Post Processing: {}",
executeBB.getBuildingBlock().getBpmnFlowName()));
execution.setVariable("flowsToExecute", flowsToExecute);
- execution.setVariable("completed", false);
+ execution.setVariable(COMPLETED, false);
} else {
- logger.debug("No cvnfcCustomization found for customizationId: " + modelCustomizationId);
+ logger.debug("No cvnfcCustomization found for customizationId: {}", modelCustomizationId);
}
}
} catch (EntityNotFoundException e) {
- logger.debug(e.getMessage() + " Will not be running Fabric Config Building Blocks");
+ logger.debug("Will not be running Fabric Config Building Blocks", e);
} catch (Exception e) {
String errorMessage = "Error occurred in post processing of Vf Module create";
- execution.setVariable("handlingCode", "RollbackToCreated");
+ execution.setVariable(HANDLINGCODE, ROLLBACKTOCREATED);
execution.setVariable("WorkflowActionErrorMessage", errorMessage);
logger.error(errorMessage, e);
}
}
+ protected String getConfigurationId(Vnfc vnfc) {
+ List<Configuration> configurations =
+ workflowAction.getRelatedResourcesInVnfc(vnfc, Configuration.class, AAIObjectType.CONFIGURATION);
+ if (!configurations.isEmpty()) {
+ Configuration configuration = configurations.get(0);
+ return configuration.getConfigurationId();
+ } else {
+ return UUID.randomUUID().toString();
+ }
+ }
+
protected ExecuteBuildingBlock getExecuteBBForConfig(String bbName, ExecuteBuildingBlock ebb,
String configurationId, ConfigurationResourceKeys configurationResourceKeys) {
ExecuteBuildingBlock configBB = new ExecuteBuildingBlock();
@@ -444,4 +470,50 @@ public class WorkflowActionBBTasks {
configBB.setConfigurationResourceKeys(configurationResourceKeys);
return configBB;
}
+
+ protected void setInstanceName(String resourceId, WorkflowType resourceType, InfraActiveRequests request) {
+ logger.debug("Setting instanceName in infraActiveRequest");
+ try {
+ if (resourceType == WorkflowType.SERVICE && request.getServiceInstanceName() == null) {
+ ServiceInstance service = bbInputSetupUtils.getAAIServiceInstanceById(resourceId);
+ if (service != null) {
+ request.setServiceInstanceName(service.getServiceInstanceName());
+ }
+ } else if (resourceType == WorkflowType.VNF && request.getVnfName() == null) {
+ GenericVnf vnf = bbInputSetupUtils.getAAIGenericVnf(resourceId);
+ if (vnf != null) {
+ request.setVnfName(vnf.getVnfName());
+ }
+ } else if (resourceType == WorkflowType.VFMODULE && request.getVfModuleName() == null) {
+ VfModule vfModule = bbInputSetupUtils.getAAIVfModule(request.getVnfId(), resourceId);
+ if (vfModule != null) {
+ request.setVfModuleName(vfModule.getVfModuleName());
+ }
+ } else if (resourceType == WorkflowType.VOLUMEGROUP && request.getVolumeGroupName() == null) {
+ Optional<VolumeGroup> volumeGroup =
+ bbInputSetupUtils.getRelatedVolumeGroupByIdFromVnf(request.getVnfId(), resourceId);
+ if (volumeGroup.isPresent()) {
+ request.setVolumeGroupName(volumeGroup.get().getVolumeGroupName());
+ }
+ } else if (resourceType == WorkflowType.NETWORK && request.getNetworkName() == null) {
+ L3Network network = bbInputSetupUtils.getAAIL3Network(resourceId);
+ if (network != null) {
+ request.setNetworkName(network.getNetworkName());
+ }
+ } else if (resourceType == WorkflowType.CONFIGURATION && request.getConfigurationName() == null) {
+ org.onap.aai.domain.yang.Configuration configuration =
+ bbInputSetupUtils.getAAIConfiguration(resourceId);
+ if (configuration != null) {
+ request.setConfigurationName(configuration.getConfigurationName());
+ }
+ } else if (resourceType == WorkflowType.INSTANCE_GROUP && request.getInstanceGroupName() == null) {
+ InstanceGroup instanceGroup = bbInputSetupUtils.getAAIInstanceGroup(resourceId);
+ if (instanceGroup != null) {
+ request.setInstanceGroupName(instanceGroup.getInstanceGroupName());
+ }
+ }
+ } catch (Exception ex) {
+ logger.error("Exception in setInstanceName", ex);
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
index 05a51797dd..1eb5cf7437 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
@@ -24,6 +24,7 @@ public enum WorkflowType {
SERVICE("Service"),
VNF("Vnf"),
+ PNF("Pnf"),
VFMODULE("VfModule"),
VOLUMEGROUP("VolumeGroup"),
NETWORK("Network"),
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
index 173e776af9..d78fa69680 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
@@ -269,6 +269,7 @@ public class NetworkAdapterObjectMapper {
org.onap.so.openstack.beans.Subnet.class) == null) {
PropertyMap<org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet, org.onap.so.openstack.beans.Subnet> personMap =
new PropertyMap<org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet, org.onap.so.openstack.beans.Subnet>() {
+ @Override
protected void configure() {
map().setSubnetName(source.getSubnetName());
map(source.getSubnetId(), destination.getSubnetId());
@@ -387,7 +388,7 @@ public class NetworkAdapterObjectMapper {
createNetworkRequest.setSkipAAI(true);
createNetworkRequest.setBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
// TODO confirm value - false by default
- createNetworkRequest.setFailIfExists(true);
+ createNetworkRequest.setFailIfExists(false);
// NetworkTechnology(NetworkTechnology.NEUTRON); NOOP - default
return createNetworkRequest;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java
index e24e86285c..9af2128f63 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -33,11 +33,16 @@ import org.onap.so.adapters.vnfrest.RollbackVfModuleResponse;
import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest;
import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse;
import org.onap.so.client.adapter.rest.AdapterRestClient;
+import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterClientImpl implements VnfAdapterClient {
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterClientImpl.class);
+
private static final String VF_MODULES = "/vf-modules/";
private VnfAdapterRestProperties props;
@@ -57,6 +62,7 @@ public class VnfAdapterClientImpl implements VnfAdapterClient {
return new AdapterRestClient(this.props, this.getUri("/" + aaiVnfId + "/vf-modules").build()).post(req,
CreateVfModuleResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in createVfModule", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -69,6 +75,7 @@ public class VnfAdapterClientImpl implements VnfAdapterClient {
this.getUri("/" + aaiVnfId + VF_MODULES + aaiVfModuleId + "/rollback").build()).delete(req,
RollbackVfModuleResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in rollbackVfModule", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -80,6 +87,7 @@ public class VnfAdapterClientImpl implements VnfAdapterClient {
return new AdapterRestClient(this.props, this.getUri("/" + aaiVnfId + VF_MODULES + aaiVfModuleId).build())
.delete(req, DeleteVfModuleResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in deleteVfModule", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -91,6 +99,7 @@ public class VnfAdapterClientImpl implements VnfAdapterClient {
return new AdapterRestClient(this.props, this.getUri("/" + aaiVnfId + VF_MODULES + aaiVfModuleId).build())
.put(req, UpdateVfModuleResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in updateVfModule", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -122,6 +131,7 @@ public class VnfAdapterClientImpl implements VnfAdapterClient {
return new AdapterRestClient(this.props, builder.build(), MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON).get(QueryVfModuleResponse.class).get();
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in queryVfModule", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java
index 2af4d5f1fa..c5e8bf7416 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -34,11 +34,15 @@ import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest;
import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse;
import org.onap.so.client.RestClient;
import org.onap.so.client.adapter.rest.AdapterRestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
+ private static final Logger logger = LoggerFactory.getLogger(VnfVolumeAdapterClientImpl.class);
+
private final VnfVolumeAdapterRestProperties props;
public VnfVolumeAdapterClientImpl() {
@@ -50,6 +54,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
try {
return this.getAdapterRestClient("").post(req, CreateVolumeGroupResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in createVNFVolumes", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -60,6 +65,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
try {
return this.getAdapterRestClient("/" + aaiVolumeGroupId).delete(req, DeleteVolumeGroupResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in deleteVNFVolumes", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -71,6 +77,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
return this.getAdapterRestClient("/" + aaiVolumeGroupId + "/rollback").delete(req,
RollbackVolumeGroupResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in rollbackVNFVolumes", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -81,6 +88,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
try {
return this.getAdapterRestClient("/" + aaiVolumeGroupId).put(req, UpdateVolumeGroupResponse.class);
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in updateVNFVolumes", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
@@ -94,6 +102,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient {
requestId, serviceInstanceId);
return this.getAdapterRestClient(path).get(QueryVolumeGroupResponse.class).get();
} catch (InternalServerErrorException e) {
+ logger.error("InternalServerErrorException in queryVNFVolumes", e);
throw new VnfAdapterClientException(e.getMessage());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
index 6daed56675..6278d48e03 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
@@ -23,10 +23,10 @@ package org.onap.so.client.adapter.vnf.mapper;
import java.io.Serializable;
public class AttributeNameValue implements Serializable {
- private final static long serialVersionUID = -5215028275587848311L;
+ private static final long serialVersionUID = -5215028275587848311L;
private String attributeName;
- private Object attributeValue;
+ private transient Object attributeValue;
public AttributeNameValue(String attributeName, Object attributeValue) {
this.attributeName = attributeName;
@@ -51,7 +51,7 @@ public class AttributeNameValue implements Serializable {
@Override
public String toString() {
- return new StringBuilder().append("{\"attribute_name\": \"").append(attributeName.toString())
+ return new StringBuilder().append("{\"attribute_name\": \"").append(attributeName)
.append("\", \"attribute_value\": \"").append(attributeValue.toString()).append("\"}").toString();
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
index a78870afc4..293bcf9f0e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
@@ -52,6 +52,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class VnfAdapterObjectMapper {
private ObjectMapper mapper = new ObjectMapper();
+ private static final String ENABLE_BRIDGE = "mso.bridgeEnabled";
@PostConstruct
public void init() {
@@ -78,7 +79,7 @@ public class VnfAdapterObjectMapper {
createVolumeGroupRequest.setSkipAAI(true);
createVolumeGroupRequest.setSuppressBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
- createVolumeGroupRequest.setFailIfExists(true);
+ createVolumeGroupRequest.setFailIfExists(false);
createVolumeGroupRequest.setMsoRequest(createMsoRequest(requestContext, serviceInstance));
@@ -86,6 +87,10 @@ public class VnfAdapterObjectMapper {
createVolumeGroupRequest.setMessageId(messageId);
createVolumeGroupRequest.setNotificationUrl(createCallbackUrl("VNFAResponse", messageId));
+ String enableBridge = getProperty(ENABLE_BRIDGE);
+ if (enableBridge == null || Boolean.valueOf(enableBridge)) {
+ createVolumeGroupRequest.setEnableBridge(true);
+ }
return createVolumeGroupRequest;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index f23e5cdb5a..bc618e17de 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -68,6 +68,7 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfresourceassign
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology;
import org.onap.so.adapters.vnfrest.CreateVfModuleRequest;
import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest;
+import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
@@ -75,10 +76,10 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.adapter.vnf.mapper.exceptions.MissingValueTagException;
import org.onap.so.entity.MsoRequest;
import org.onap.so.jsonpath.JsonPathUtil;
import org.onap.so.openstack.utils.MsoMulticloudUtils;
-import org.onap.so.client.adapter.vnf.mapper.exceptions.MissingValueTagException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -95,6 +96,7 @@ import com.google.common.base.Joiner;
public class VnfAdapterVfModuleObjectMapper {
@Autowired
protected VnfAdapterObjectMapperUtils vnfAdapterObjectMapperUtils;
+
private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVfModuleObjectMapper.class);
private static List<String> sdncResponseParamsToSkip =
asList("vnf_id", "vf_module_id", "vnf_name", "vf_module_name");
@@ -114,6 +116,7 @@ public class VnfAdapterVfModuleObjectMapper {
private static final String FLOATING_IP = "_floating_ip";
private static final String FLOATING_V6_IP = "_floating_v6_ip";
private static final String UNDERSCORE = "_";
+ private static final String ENABLE_BRIDGE = "mso.bridgeEnabled";
@PostConstruct
public void init() {
@@ -150,7 +153,7 @@ public class VnfAdapterVfModuleObjectMapper {
createVfModuleRequest.setSkipAAI(true);
createVfModuleRequest.setBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
- createVfModuleRequest.setFailIfExists(true);
+ createVfModuleRequest.setFailIfExists(false);
MsoRequest msoRequest = buildMsoRequest(requestContext, serviceInstance);
createVfModuleRequest.setMsoRequest(msoRequest);
@@ -160,6 +163,11 @@ public class VnfAdapterVfModuleObjectMapper {
createVfModuleRequest
.setNotificationUrl(vnfAdapterObjectMapperUtils.createCallbackUrl("VNFAResponse", messageId));
+ String enableBridge = getProperty(ENABLE_BRIDGE);
+ if (enableBridge == null || Boolean.valueOf(enableBridge)) {
+ createVfModuleRequest.setEnableBridge(true);
+ }
+
return createVfModuleRequest;
}
@@ -210,23 +218,25 @@ public class VnfAdapterVfModuleObjectMapper {
protected void buildDirectivesParamFromMap(Map<String, Object> paramsMap, String directive,
Map<String, Object> srcMap) throws MissingValueTagException {
StringBuilder directives = new StringBuilder();
- int no_directives_size = 0;
+ int noOfDirectivesSize = 0;
if (directive.equals(MsoMulticloudUtils.USER_DIRECTIVES)
&& srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) {
- no_directives_size = 1;
+ noOfDirectivesSize = 1;
}
- if (srcMap.size() > no_directives_size) {
+ if (srcMap.size() > noOfDirectivesSize) {
directives.append("{ \"attributes\": [ ");
int i = 0;
- for (String attributeName : srcMap.keySet()) {
+ for (Map.Entry<String, Object> attributeEntry : srcMap.entrySet()) {
+ String attributeName = attributeEntry.getKey();
+ Object attributeValue = attributeEntry.getValue();
if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directive)
&& attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) {
- if (srcMap.get(attributeName) == null) {
+ if (attributeValue == null) {
logger.error("No value tag found for attribute: {}", attributeName);
throw new MissingValueTagException("No value tag found for " + attributeName);
}
- directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
- if (i < (srcMap.size() - 1 + no_directives_size))
+ directives.append(new AttributeNameValue(attributeName, attributeValue.toString()));
+ if (i < (srcMap.size() - 1 + noOfDirectivesSize))
directives.append(", ");
i++;
}
@@ -478,7 +488,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
sbInterfaceRoutePrefixes.append("]");
- if (interfaceRoutePrefixesList.size() > 0) {
+ if (!interfaceRoutePrefixesList.isEmpty()) {
paramsMap.put(key + UNDERSCORE + networkKey + "_route_prefixes",
sbInterfaceRoutePrefixes.toString());
}
@@ -505,7 +515,7 @@ public class VnfAdapterVfModuleObjectMapper {
sriovFilterBuf.append(heatVlanFilterValue);
}
}
- if (heatVlanFiltersList.size() > 0) {
+ if (!heatVlanFiltersList.isEmpty()) {
paramsMap.put(networkKey + "_ATT_VF_VLAN_FILTER", sriovFilterBuf.toString());
}
}
@@ -537,7 +547,7 @@ public class VnfAdapterVfModuleObjectMapper {
String ipVersion = ipAddress.getIpVersion();
for (int b = 0; b < ipsList.size(); b++) {
String ipAddressValue = ipsList.get(b);
- if (ipVersion.equals("ipv4")) {
+ if ("ipv4".equals(ipVersion)) {
if (b != ipsList.size() - 1) {
sbIpv4Ips.append(ipAddressValue + ",");
} else {
@@ -545,7 +555,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
paramsMap.put(key + UNDERSCORE + networkKey + IP + UNDERSCORE + b,
ipAddressValue);
- } else if (ipVersion.equals("ipv6")) {
+ } else if ("ipv6".equals(ipVersion)) {
if (b != ipsList.size() - 1) {
sbIpv6Ips.append(ipAddressValue + ",");
} else {
@@ -869,6 +879,10 @@ public class VnfAdapterVfModuleObjectMapper {
deleteVfModuleRequest.setTenantId(cloudRegion.getTenantId());
deleteVfModuleRequest.setVnfId(genericVnf.getVnfId());
deleteVfModuleRequest.setVfModuleId(vfModule.getVfModuleId());
+ if (vfModule.getModelInfoVfModule() != null) {
+ deleteVfModuleRequest
+ .setModelCustomizationUuid(vfModule.getModelInfoVfModule().getModelCustomizationUUID());
+ }
if (!StringUtils.isEmpty(vfModule.getHeatStackId())) {
deleteVfModuleRequest.setVfModuleStackId(vfModule.getHeatStackId());// DoDVfMod_heatStackId
} else {
@@ -894,6 +908,7 @@ public class VnfAdapterVfModuleObjectMapper {
try {
json = mapper.writeValueAsString(obj);
} catch (JsonProcessingException e) {
+ logger.error("JsonProcessingException in convertToString", e);
json = "{}";
}
@@ -913,4 +928,8 @@ public class VnfAdapterVfModuleObjectMapper {
}
return baseVfModule;
}
+
+ protected String getProperty(String key) {
+ return UrnPropertiesReader.getVariable(key);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
index 867d80a4ea..8b939940fa 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
@@ -52,7 +52,7 @@ public class AAIConfigurationResources {
AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, configuration.getConfigurationId());
configuration.setOrchestrationStatus(OrchestrationStatus.INVENTORIED);
org.onap.aai.domain.yang.Configuration aaiConfiguration = aaiObjectMapper.mapConfiguration(configuration);
- injectionHelper.getAaiClient().create(configurationURI, aaiConfiguration);
+ injectionHelper.getAaiClient().createIfNotExists(configurationURI, Optional.of(aaiConfiguration));
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java
new file mode 100644
index 0000000000..5f65e5d76d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIEntityNotFoundException.java
@@ -0,0 +1,16 @@
+package org.onap.so.client.orchestration;
+
+public class AAIEntityNotFoundException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -107868951852460677L;
+
+ public AAIEntityNotFoundException(String error) {
+ super(error);
+ }
+
+
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
index c41f3fa56c..fc1528526c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
@@ -22,7 +22,9 @@
package org.onap.so.client.orchestration;
+import java.util.List;
import java.util.Optional;
+import org.onap.aai.domain.yang.OwningEntities;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
@@ -120,6 +122,25 @@ public class AAIServiceInstanceResources {
return aaiRC.exists(owningEntityUri);
}
+ public org.onap.aai.domain.yang.OwningEntity getOwningEntityByName(String owningEntityName)
+ throws AAIEntityNotFoundException {
+ AAIResourceUri owningEntityUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+ .queryParam("owning-entity-name", owningEntityName);
+ AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
+ Optional<OwningEntities> owningEntities = aaiRC.get(OwningEntities.class, owningEntityUri);
+ if (owningEntities.isPresent()) {
+ List<org.onap.aai.domain.yang.OwningEntity> owningEntityList = owningEntities.get().getOwningEntity();
+ if (owningEntityList.size() > 1) {
+ throw new AAIEntityNotFoundException(
+ "Non unique result returned for owning entity name: " + owningEntityName);
+ } else {
+ return owningEntityList.get(0);
+ }
+ } else {
+ throw new AAIEntityNotFoundException("No result returned for owning entity name: " + owningEntityName);
+ }
+ }
+
public void connectOwningEntityandServiceInstance(OwningEntity owningEntity, ServiceInstance serviceInstance) {
AAIResourceUri owningEntityURI =
AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntity.getOwningEntityId());
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
index a9635d1e34..7ad74a6d86 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
@@ -24,6 +24,7 @@ package org.onap.so.client.orchestration;
import java.io.IOException;
import java.util.Optional;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -32,14 +33,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIRestClientImpl;
import org.onap.so.client.aai.AAIValidatorImpl;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -151,6 +152,8 @@ public class AAIVnfResources {
.get(org.onap.aai.domain.yang.GenericVnf.class,
AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
.orElse(new org.onap.aai.domain.yang.GenericVnf());
+ AAIRestClientImpl client = new AAIRestClientImpl();
+ aaiValidatorImpl.setClient(client);
return aaiValidatorImpl.isPhysicalServerLocked(vnf.getVnfId());
}
@@ -160,4 +163,14 @@ public class AAIVnfResources {
AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName);
return injectionHelper.getAaiClient().exists(vnfUri);
}
+
+ public AAIResultWrapper queryVnfWrapperById(GenericVnf vnf) {
+ AAIResourceUri uri =
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnf.getVnfId()).depth(Depth.ALL);
+ return injectionHelper.getAaiClient().get(uri);
+ }
+
+ public Optional<Vserver> getVserver(AAIResourceUri uri) {
+ return injectionHelper.getAaiClient().get(uri).asBean(Vserver.class);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
index d4a4cfbd8a..0123eb67be 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
@@ -32,8 +32,6 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.NetworkTopologyOperationRequestMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
index b3ea18df58..01511eaccc 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
@@ -37,14 +37,11 @@ import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.VfModuleTopologyOperationRequestMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCVfModuleResources {
- private static final Logger logger = LoggerFactory.getLogger(SDNCVfModuleResources.class);
@Autowired
private VfModuleTopologyOperationRequestMapper sdncRM;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
index 6434bfb176..27edeed02a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
@@ -36,8 +36,6 @@ import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.VnfTopologyOperationRequestMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
index 62d6a110f6..6a15ca321a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
@@ -34,8 +34,6 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper;
import org.onap.so.client.adapter.vnf.mapper.exceptions.MissingValueTagException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
index 2e7877fe3b..7d2fc10d0b 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
@@ -29,8 +29,6 @@ import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCProperties;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
@@ -57,7 +55,7 @@ public class SDNCClient {
BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>();
STOClient.setTargetUrl(targetUrl);
- HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth());
+ HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true);
STOClient.setHttpHeader(httpHeader);
LinkedHashMap<String, Object> output =
STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
@@ -69,7 +67,7 @@ public class SDNCClient {
String jsonRequest = sdnCommonTasks.buildJsonRequest(request);
BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>();
STOClient.setTargetUrl(url);
- HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth());
+ HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true);
STOClient.setHttpHeader(httpHeader);
LinkedHashMap<String, Object> output =
STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
@@ -89,7 +87,7 @@ public class SDNCClient {
String targetUrl = UriBuilder.fromUri(properties.getHost()).path(queryLink).build().toString();
BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>();
STOClient.setTargetUrl(targetUrl);
- HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth());
+ HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), false);
STOClient.setHttpHeader(httpHeader);
LinkedHashMap<String, Object> output =
STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
index 1144648517..e7e4e25af2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
@@ -82,10 +82,12 @@ public class SdnCommonTasks {
* @param auth
* @return
*/
- public HttpHeaders getHttpHeaders(String auth) {
+ public HttpHeaders getHttpHeaders(String auth, boolean includeContentType) {
HttpHeaders httpHeader = new HttpHeaders();
httpHeader.set("Authorization", auth);
- httpHeader.setContentType(MediaType.APPLICATION_JSON);
+ if (includeContentType) {
+ httpHeader.setContentType(MediaType.APPLICATION_JSON);
+ }
List<MediaType> acceptMediaTypes = new ArrayList<>();
acceptMediaTypes.add(MediaType.APPLICATION_JSON);
httpHeader.setAccept(acceptMediaTypes);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
index 12d1b0be95..2c8bdd931c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/beans/SDNCRequest.java
@@ -36,7 +36,7 @@ public class SDNCRequest implements Serializable {
private SDNCTopology topology;
private String correlationValue = UUID.randomUUID().toString();
private String correlationName = "SDNCCallback";
- private Object SDNCPayload;
+ private transient Object sdncPayload;
public String getTimeOut() {
@@ -72,11 +72,11 @@ public class SDNCRequest implements Serializable {
}
public Object getSDNCPayload() {
- return SDNCPayload;
+ return sdncPayload;
}
public void setSDNCPayload(Object sDNCPayload) {
- SDNCPayload = sDNCPayload;
+ this.sdncPayload = sDNCPayload;
}
@Override
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
index 6ddb292a6c..a41c79b171 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
@@ -96,6 +96,10 @@ public class VfModuleTopologyOperationRequestMapper {
genericResourceApiSvcAction = GenericResourceApiSvcActionEnumeration.UNASSIGN;
requestAction = GenericResourceApiRequestActionEnumeration.DELETEVFMODULEINSTANCE;
includeModelInformation = false;
+ } else if (svcAction.equals(SDNCSvcAction.CHANGE_ASSIGN)) {
+ genericResourceApiSvcAction = GenericResourceApiSvcActionEnumeration.CHANGEASSIGN;
+ requestAction = GenericResourceApiRequestActionEnumeration.CREATEVFMODULEINSTANCE;
+ includeModelInformation = true;
}
String sdncReqId = UUID.randomUUID().toString();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
index d07574a1ad..c63cbc0b68 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
@@ -37,7 +37,6 @@ import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonProcessingException;
@Component
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java
new file mode 100644
index 0000000000..9dd0365e7a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java
@@ -0,0 +1,149 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.buildingblock;
+
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.buildingblock.HomingV2.HOMING_OOF;
+import static org.onap.so.bpmn.buildingblock.HomingV2.HOMING_SNIRO;
+import static org.onap.so.bpmn.buildingblock.HomingV2.HOMING_SOLUTION;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+
+public class HomingV2Test {
+
+ @Test
+ public void whenHomingSolutionSetToSniroShouldCallSniro() {
+ HashMap<String, Object> userParams = new HashMap<>();
+ userParams.put(HOMING_SOLUTION, HOMING_SNIRO);
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(userParams);
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.callHoming(givenExecution);
+
+ then(sniroHoming).should().callSniro(givenExecution);
+ then(oofHoming).shouldHaveZeroInteractions();
+ }
+
+ @Test
+ public void whenHomingSolutionSetToSniroShouldProcessSniro() {
+ HashMap<String, Object> userParams = new HashMap<>();
+ userParams.put(HOMING_SOLUTION, HOMING_SNIRO);
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(userParams);
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.processSolution(givenExecution, "dummy");
+
+ then(sniroHoming).should().processSolution(givenExecution, "dummy");
+ then(oofHoming).shouldHaveZeroInteractions();
+ }
+
+ @Test
+ public void whenHomingSolutionSetToOofShouldCallOof() {
+ HashMap<String, Object> userParams = new HashMap<>();
+ userParams.put(HOMING_SOLUTION, HOMING_OOF);
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(userParams);
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.callHoming(givenExecution);
+
+ then(oofHoming).should().callOof(givenExecution);
+ then(sniroHoming).shouldHaveZeroInteractions();
+ }
+
+ @Test
+ public void whenHomingSolutionSetToOofShouldProcessOof() {
+ HashMap<String, Object> userParams = new HashMap<>();
+ userParams.put(HOMING_SOLUTION, HOMING_OOF);
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(userParams);
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.processSolution(givenExecution, "dummy");
+
+ then(oofHoming).should().processSolution(givenExecution, "dummy");
+ then(sniroHoming).shouldHaveZeroInteractions();
+ }
+
+ @Test
+ public void whenHomingSolutionNotSetShouldCallOof() {
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(new HashMap<>());
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.callHoming(givenExecution);
+
+ then(oofHoming).should().callOof(givenExecution);
+ then(sniroHoming).shouldHaveZeroInteractions();
+ }
+
+ @Test
+ public void whenHomingSolutionNotSetShouldProcessOof() {
+ BuildingBlockExecution givenExecution = createBuildingBlockExecutionMock(new HashMap<>());
+
+ OofHomingV2 oofHoming = mock(OofHomingV2.class);
+ SniroHomingV2 sniroHoming = mock(SniroHomingV2.class);
+
+ HomingV2 homingV2 = new HomingV2(oofHoming, sniroHoming);
+ homingV2.processSolution(givenExecution, "dummy");
+
+ then(oofHoming).should().processSolution(givenExecution, "dummy");
+ then(sniroHoming).shouldHaveZeroInteractions();
+ }
+
+ private BuildingBlockExecution createBuildingBlockExecutionMock(Map<String, Object> userParams) {
+ BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
+ GeneralBuildingBlock generalBuildingBlock = mock(GeneralBuildingBlock.class);
+ RequestContext requestContext = mock(RequestContext.class);
+ RequestParameters requestParameters = mock(RequestParameters.class);
+ List<Map<String, Object>> userParamsList = new ArrayList<>();
+
+ userParamsList.add(userParams);
+
+ when(execution.getGeneralBuildingBlock()).thenReturn(generalBuildingBlock);
+ when(generalBuildingBlock.getRequestContext()).thenReturn(requestContext);
+ when(requestContext.getRequestParameters()).thenReturn(requestParameters);
+ when(requestParameters.getUserParams()).thenReturn(userParamsList);
+
+ return execution;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index ed3ec759c3..a8550d8df9 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -54,16 +54,16 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
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.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
public class AAICreateTasksTest extends BaseTaskTest {
@@ -272,24 +272,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createOwningEntityNullOwningEntityIdTest() throws Exception {
- expectedException.expect(BpmnError.class);
-
- serviceInstance.getOwningEntity().setOwningEntityId(null);
-
- aaiCreateTasks.createOwningEntity(execution);
- }
-
- @Test
- public void createOwningEntityEmptyOwningEntityIdTest() throws Exception {
- expectedException.expect(BpmnError.class);
-
- serviceInstance.getOwningEntity().setOwningEntityId("");
-
- aaiCreateTasks.createOwningEntity(execution);
- }
-
- @Test
public void createOwningEntityNullOwningEntityNameTest() throws Exception {
expectedException.expect(BpmnError.class);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
index 905f244278..c337f7f1b5 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
@@ -733,7 +733,7 @@ public class AAIUpdateTasksTest extends BaseTaskTest {
doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf,
OrchestrationStatus.CONFIGURE);
- aaiUpdateTasks.updateOrchestrationStausConfigDeployConfigureVnf(execution);
+ aaiUpdateTasks.updateOrchestrationStatusConfigDeployConfigureVnf(execution);
}
@Test
@@ -741,6 +741,6 @@ public class AAIUpdateTasksTest extends BaseTaskTest {
doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf,
OrchestrationStatus.CONFIGURED);
- aaiUpdateTasks.updateOrchestrationStausConfigDeployConfiguredVnf(execution);
+ aaiUpdateTasks.updateOrchestrationStatusConfigDeployConfiguredVnf(execution);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java
index 56ff813e73..1fde3f4fbc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivityTest.java
@@ -22,22 +22,41 @@ package org.onap.so.bpmn.infrastructure.activity;
import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
import java.nio.file.Files;
import java.nio.file.Paths;
+import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBFailure;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.onap.so.client.exception.ExceptionBuilder;
public class ExecuteActivityTest extends BaseTaskTest {
@InjectMocks
protected ExecuteActivity executeActivity = new ExecuteActivity();
+ @InjectMocks
+ @Spy
+ private ExceptionBuilder exceptionBuilder;
+
+ @Mock
+ private WorkflowActionBBFailure workflowActionBBFailure;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
private DelegateExecution execution;
@Before
@@ -72,4 +91,30 @@ public class ExecuteActivityTest extends BaseTaskTest {
assertEquals(ebb.getBuildingBlock(), bb);
}
+ @Test
+ public void executeException_Test() throws Exception {
+ execution.setVariable("workflowSyncAckSent", true);
+ execution.setVariable("testProcessKey", "testProcessKeyValue");
+ thrown.expect(BpmnError.class);
+ executeActivity.execute(execution);
+ String errorMessage = (String) execution.getVariable("ExecuteActivityErrorMessage");
+ assertEquals(errorMessage, "not implemented");
+ WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
+ assertEquals(workflowException.getErrorMessage(), "not implemented");
+ assertEquals(workflowException.getErrorCode(), 7000);
+ }
+
+ @Test
+ public void buildAndThrowException_Test() throws Exception {
+ doNothing().when(workflowActionBBFailure).updateRequestStatusToFailed(execution);
+ doReturn("Process key").when(exceptionBuilder).getProcessKey(execution);
+ thrown.expect(BpmnError.class);
+ executeActivity.buildAndThrowException(execution, "TEST EXCEPTION MSG");
+ String errorMessage = (String) execution.getVariable("ExecuteActivityErrorMessage");
+ assertEquals(errorMessage, "TEST EXCEPTION MSG");
+ WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
+ assertEquals(workflowException.getErrorMessage(), "TEST EXCEPTION MSG");
+ assertEquals(workflowException.getErrorCode(), 7000);
+ }
+
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
index 8aea2d2650..5bd4df74bb 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Copyright (C) 2018 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
@@ -20,7 +22,6 @@
package org.onap.so.bpmn.infrastructure.adapter.network.tasks;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.JAXBException;
@@ -31,22 +32,24 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+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.UpdateNetworkError;
import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.bpmn.BaseTaskTest;
-import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.client.exception.MapperException;
-import org.onap.so.utils.TargetEntity;
+import org.onap.so.utils.Components;
+import org.onap.logging.filter.base.ONAPComponents;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -59,13 +62,22 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
@Mock
ExceptionBuilder exceptionBuilder = new ExceptionBuilder();
+ private static final String CREATE_NETWORK_RESPONSE = "createNetworkResponse";
+ private static final String DELETE_NETWORK_RESPONSE = "deleteNetworkResponse";
+ private static final String CREATE_NETWORK_ERROR = "createNetworkError";
+ private static final String DELETE_NETWORK_ERROR = "deleteNetworkError";
+ private static final String NET_ID_FOR_CREATE_NETWORK_RESPONSE = "netIdForCreateNetworkResponse";
+ private static final String NET_ID_FOR_DELETE_NETWORK_RESPONSE = "netIdForDeleteNetworkResponse";
+ private static final String CREATE_NETWORK_ERROR_MESSAGE = "createNetErrorMessage";
+ private static final String DELETE_NETWORK_ERROR_MESSAGE = "deleteNetErrorMessage";
+
@Before
public void setup() {
delegateExecution = new DelegateExecutionFake();
}
@Test
- public void testUnmarshalXml() throws IOException, JAXBException {
+ public void testUnmarshalXml() throws JAXBException {
String xml =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><createNetworkResponse><messageId>ec37c121-e3ec-4697-8adf-2d7dca7044fc</messageId><networkCreated>true</networkCreated><networkFqdn>someNetworkFqdn</networkFqdn><networkId>991ec7bf-c9c4-4ac1-bb9c-4b61645bddb3</networkId><networkStackId>someStackId</networkStackId><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><rollback><cloudId>someCloudId</cloudId><modelCustomizationUuid>b7171cdd-8b05-459b-80ef-2093150e8983</modelCustomizationUuid><msoRequest><requestId>90b32315-176e-4dab-bcf1-80eb97a1c4f4</requestId><serviceInstanceId>71e7db22-7907-4d78-8fcc-8d89d28e90be</serviceInstanceId></msoRequest><networkCreated>true</networkCreated><networkStackId>someStackId</networkStackId><networkType>SomeNetworkType</networkType><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><tenantId>b60da4f71c1d4b35b8113d4eca6deaa1</tenantId></rollback><subnetMap><entry><key>6b381fa9-48ce-4e16-9978-d75309565bb6</key><value>bc1d5537-860b-4894-8eba-6faff41e648c</value></entry></subnetMap></createNetworkResponse>";
CreateNetworkResponse response =
@@ -75,11 +87,11 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
}
@Test
- public void testUnmarshalXmlUpdate() throws IOException, JAXBException {
+ public void testUnmarshalXmlUpdate() throws JAXBException {
UpdateNetworkResponse expectedResponse = new UpdateNetworkResponse();
expectedResponse.setMessageId("ec100bcc-2659-4aa4-b4d8-3255715c2a51");
expectedResponse.setNetworkId("80de31e3-cc78-4111-a9d3-5b92bf0a39eb");
- Map<String, String> subnetMap = new HashMap<String, String>();
+ Map<String, String> subnetMap = new HashMap<>();
subnetMap.put("95cd8437-25f1-4238-8720-cbfe7fa81476", "d8d16606-5d01-4822-b160-9a0d257303e0");
expectedResponse.setSubnetMap(subnetMap);
String xml =
@@ -90,7 +102,7 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
}
@Test
- public void processCallbackTest() throws MapperException, BadResponseException, IOException {
+ public void processCallbackTest() {
UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest();
UpdateNetworkResponse updateNetworkResponse = new UpdateNetworkResponse();
updateNetworkResponse.setMessageId("messageId");
@@ -104,7 +116,7 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
}
@Test
- public void processCallbackErrorTest() throws MapperException, BadResponseException, IOException {
+ public void processCallbackErrorTest() {
UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest();
UpdateNetworkError updateNetworkResponse = new UpdateNetworkError();
updateNetworkResponse.setMessageId("messageId");
@@ -113,7 +125,7 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
delegateExecution.setVariable("NetworkAResponse_MESSAGE", updateNetworkResponse.toXmlString());
doThrow(new BpmnError("MSOWorkflowException")).when(exceptionBuilder).buildAndThrowWorkflowException(
- any(DelegateExecution.class), anyInt(), any(String.class), any(TargetEntity.class));
+ any(DelegateExecution.class), anyInt(), any(String.class), any(ONAPComponents.class));
try {
networkAdapterRestV1Tasks.processCallback(delegateExecution);
@@ -122,6 +134,69 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
}
assertNull(delegateExecution.getVariable("updateNetworkResponse"));
verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(any(DelegateExecution.class), eq(7000),
- eq("test error message"), eq(TargetEntity.OPENSTACK));
+ eq("test error message"), eq(Components.OPENSTACK));
+ }
+
+ @Test
+ public void processCallback_createNetworkResponse() {
+ delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest());
+ delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+ createNetworkResponse(CREATE_NETWORK_RESPONSE, NET_ID_FOR_CREATE_NETWORK_RESPONSE));
+ networkAdapterRestV1Tasks.processCallback(delegateExecution);
+
+ Object result = delegateExecution.getVariable("createNetworkResponse");
+ assertTrue(result instanceof CreateNetworkResponse);
+ CreateNetworkResponse createNetworkResponse = (CreateNetworkResponse) result;
+ assertEquals(createNetworkResponse.getNetworkId(), NET_ID_FOR_CREATE_NETWORK_RESPONSE);
+ }
+
+ @Test
+ public void processCallback_deleteNetworkResponse() {
+ delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest());
+ delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+ createNetworkResponse(DELETE_NETWORK_RESPONSE, NET_ID_FOR_DELETE_NETWORK_RESPONSE));
+ networkAdapterRestV1Tasks.processCallback(delegateExecution);
+
+ Object result = delegateExecution.getVariable("deleteNetworkResponse");
+ assertTrue(result instanceof DeleteNetworkResponse);
+ DeleteNetworkResponse deleteNetworkResponse = (DeleteNetworkResponse) result;
+ assertEquals(deleteNetworkResponse.getNetworkId(), NET_ID_FOR_DELETE_NETWORK_RESPONSE);
}
+
+ @Test
+ public void processCallback_createNetworkError() {
+ try {
+ delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest());
+ delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+ createNetworkError(CREATE_NETWORK_ERROR, CREATE_NETWORK_ERROR_MESSAGE));
+ networkAdapterRestV1Tasks.processCallback(delegateExecution);
+ } catch (Exception e) {
+ assertEquals(e.getMessage(), CREATE_NETWORK_ERROR_MESSAGE);
+ }
+ }
+
+ @Test
+ public void processCallback_deleteNetworkError() {
+ try {
+ delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest());
+ delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+ createNetworkError(DELETE_NETWORK_ERROR, DELETE_NETWORK_ERROR_MESSAGE));
+ networkAdapterRestV1Tasks.processCallback(delegateExecution);
+ } catch (Exception e) {
+ assertEquals(e.getMessage(), DELETE_NETWORK_ERROR_MESSAGE);
+ }
+ }
+
+ private String createNetworkResponse(String networkResponseType, String networkId) {
+
+ return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkResponseType + "><networkId>"
+ + networkId + "</networkId></" + networkResponseType + ">";
+ }
+
+ private String createNetworkError(String networkErrorType, String message) {
+
+ return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkErrorType + "><message>"
+ + message + "</message></" + networkErrorType + ">";
+ }
+
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java
deleted file mode 100644
index caae90bfff..0000000000
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/InputParameterRetrieverTaskTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Ericsson. 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.onap.so.bpmn.BaseTaskTest;
-import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParametersProvider;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.NullInputParameter;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
-import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
-import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
-import org.onap.so.client.exception.BBObjectNotFoundException;
-
-/**
- * @author waqas.ikram@est.tech
- */
-public class InputParameterRetrieverTaskTest extends BaseTaskTest {
-
- private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
-
- @Mock
- private InputParametersProvider inputParametersProvider;
-
- @Test
- public void testGGetInputParameters_inputParameterStoredInExecutionContext() throws BBObjectNotFoundException {
- final InputParameterRetrieverTask objUnderTest =
- new InputParameterRetrieverTask(inputParametersProvider, extractPojosForBB);
-
- final InputParameter inputParameter = new InputParameter(Collections.emptyMap(), Collections.emptyList());
- when(inputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class))).thenReturn(inputParameter);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
- objUnderTest.getInputParameters(stubbedxecution);
-
- final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
- assertNotNull(actual);
- assertTrue(actual instanceof InputParameter);
- }
-
- @Test
- public void testGGetInputParameters_ThrowExecption_NullInputParameterStoredInExecutionContext()
- throws BBObjectNotFoundException {
- final InputParameterRetrieverTask objUnderTest =
- new InputParameterRetrieverTask(inputParametersProvider, extractPojosForBB);
-
- when(inputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class)))
- .thenThrow(RuntimeException.class);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
- objUnderTest.getInputParameters(stubbedxecution);
-
- final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
- assertNotNull(actual);
- assertTrue(actual instanceof NullInputParameter);
- }
-
-
- private class StubbedBuildingBlockExecution implements BuildingBlockExecution {
-
- private final Map<String, Serializable> execution = new HashMap<>();
-
- @Override
- public GeneralBuildingBlock getGeneralBuildingBlock() {
- return null;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> T getVariable(final String key) {
- return (T) execution.get(key);
- }
-
- @Override
- public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
- return null;
- }
-
- @Override
- public void setVariable(final String key, final Serializable value) {
- execution.put(key, value);
- }
-
- @Override
- public Map<ResourceKey, String> getLookupMap() {
- return Collections.emptyMap();
- }
-
- @Override
- public String getFlowToBeCalled() {
- return null;
- }
-
- @Override
- public int getCurrentSequence() {
- return 0;
- }
-
- }
-}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java
index 7b63e5f811..686b4f80cc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/TestConstants.java
@@ -20,9 +20,11 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.DUMMY_URL;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.ADDITIONAL_PARAMS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.EXT_VIRTUAL_LINKS;
+import java.util.HashMap;
+import java.util.Map;
import java.util.UUID;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmBasicHttpConfigProvider;
/**
* @author waqas.ikram@est.tech
@@ -30,6 +32,7 @@ import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmBasicHttpConfigPro
*/
public class TestConstants {
+ public static final String EXT_VIRTUAL_LINK_ID = "ac1ed33d-8dc1-4800-8ce8-309b99c38eec";
public static final String DUMMY_GENERIC_VND_ID = "5956a99d-9736-11e8-8caf-022ac9304eeb";
public static final String DUMMY_BASIC_AUTH = "Basic 123abc";
public static final String DUMMY_URL = "http://localhost:30406/so/vnfm-adapter/v1/";
@@ -38,6 +41,19 @@ public class TestConstants {
public static final String DUMMY_JOB_ID = UUID.randomUUID().toString();
public static final String JOB_STATUS_EXPECTED_URL = DUMMY_URL + "jobs/" + DUMMY_JOB_ID;
+ public static final String EXT_VIRTUAL_LINK_VALUE = "{\"id\":\"" + EXT_VIRTUAL_LINK_ID + "\","
+ + "\"tenant\":{\"cloudOwner\":\"CloudOwner\",\"regionName\":\"RegionOne\","
+ + "\"tenantId\":\"80c26954-2536-4bca-9e20-10f8a2c9c2ad\"},\"resourceId\":\"8ef8cd54-75fd-4372-a6dd-2e05ea8fbd9b\","
+ + "\"extCps\":[{\"cpdId\":\"f449292f-2f0f-4656-baa3-a18d86bac80f\","
+ + "\"cpConfig\":[{\"cpInstanceId\":\"07876709-b66f-465c-99a7-0f4d026197f2\","
+ + "\"linkPortId\":null,\"cpProtocolData\":null}]}],\"extLinkPorts\":null}";
+
+ public static final String ADDITIONAL_PARAMS_VALUE = "{\"image_id\": \"DUMMYVNF\",\"instance_type\": \"m1.small\","
+ + "\"ftp_address\": \"ftp://0.0.0.0:2100/\"}";
+
+ public static final String EXT_VIRTUAL_LINKS_VALUE = "[" + EXT_VIRTUAL_LINK_VALUE + "]";
+
+
public static VnfmBasicHttpConfigProvider getVnfmBasicHttpConfigProvider() {
return getVnfmBasicHttpConfigProvider(DUMMY_URL, DUMMY_BASIC_AUTH);
}
@@ -49,6 +65,14 @@ public class TestConstants {
return vnfmBasicHttpConfigProvider;
}
+ public static Map<String, Object> getUserParamsMap(final String additionalParams,
+ final String extVirtualLinksValue) {
+ final Map<String, Object> userParams = new HashMap<>();
+ userParams.put(ADDITIONAL_PARAMS, additionalParams);
+ userParams.put(EXT_VIRTUAL_LINKS, extVirtualLinksValue);
+ return userParams;
+ }
+
private TestConstants() {}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java
new file mode 100644
index 0000000000..9003510be7
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java
@@ -0,0 +1,248 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.ADDITIONAL_PARAMS_VALUE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.EXT_VIRTUAL_LINKS_VALUE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.EXT_VIRTUAL_LINK_ID;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getUserParamsMap;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.InputParameterRetrieverTask;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.sdnc.SDNCClient;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLinkCpConfig;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLinkExtCps;
+
+/**
+ * @author waqas.ikram@est.tech
+ */
+public class InputParameterRetrieverTaskTest extends BaseTaskTest {
+
+ private static final String INSTANCE_TYPE_VALUE_1 = "m1.small";
+
+ private static final String INSTANCE_TYPE_VALUE_2 = "m1.large";
+
+ private static final String INSTANCE_TYPE = "instance_type";
+
+ private static final String RANDOM_EXT_VIRTUAL_LINK_ID = UUID.randomUUID().toString();
+
+ private static final String CPU_INSTANCE_ID = EXT_VIRTUAL_LINK_ID;
+
+ private static final String FLAVOR_VALUE = "ubuntu";
+
+ private static final String FLAVOR = "flavor_type";
+
+ private final StubbedBuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+ @Mock
+ private InputParametersProvider<GenericVnf> sdncInputParametersProvider;
+
+ private final InputParametersProvider<Map<String, Object>> userParamsinputParametersProvider =
+ new UserParamInputParametersProvider();
+
+ @Mock
+ private SDNCClient mockedSdncClient;
+
+ @Test
+ public void testGetInputParameters_inputParameterStoredInExecutionContext() throws BBObjectNotFoundException {
+ final InputParameterRetrieverTask objUnderTest = new InputParameterRetrieverTask(sdncInputParametersProvider,
+ userParamsinputParametersProvider, extractPojosForBB);
+
+
+ final GeneralBuildingBlock buildingBlock =
+ getGeneralBuildingBlock(getUserParamsMap(ADDITIONAL_PARAMS_VALUE, null));
+ stubbedxecution.setGeneralBuildingBlock(buildingBlock);
+
+ final InputParameter inputParameter = new InputParameter(Collections.emptyMap(), Collections.emptyList());
+ when(sdncInputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class))).thenReturn(inputParameter);
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
+ objUnderTest.getInputParameters(stubbedxecution);
+
+ final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
+ assertNotNull(actual);
+ assertTrue(actual instanceof InputParameter);
+ final InputParameter actualInputParameter = (InputParameter) actual;
+ final Map<String, String> actualAdditionalParams = actualInputParameter.getAdditionalParams();
+ assertEquals(3, actualAdditionalParams.size());
+
+ final String actualInstanceType = actualAdditionalParams.get(INSTANCE_TYPE);
+ assertEquals(INSTANCE_TYPE_VALUE_1, actualInstanceType);
+
+ }
+
+ @Test
+ public void testGetInputParameters_ThrowExecption_NullInputParameterStoredInExecutionContext()
+ throws BBObjectNotFoundException {
+ final InputParameterRetrieverTask objUnderTest = new InputParameterRetrieverTask(sdncInputParametersProvider,
+ userParamsinputParametersProvider, extractPojosForBB);
+
+ when(sdncInputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class)))
+ .thenThrow(RuntimeException.class);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
+ objUnderTest.getInputParameters(stubbedxecution);
+
+ final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
+ assertNotNull(actual);
+ assertTrue(actual instanceof NullInputParameter);
+ }
+
+ @Test
+ public void testGetInputParameters_SdncAndUserParamInputParameterStoredInExecutionContext()
+ throws BBObjectNotFoundException {
+ final InputParameterRetrieverTask objUnderTest = new InputParameterRetrieverTask(sdncInputParametersProvider,
+ userParamsinputParametersProvider, extractPojosForBB);
+
+
+ final GeneralBuildingBlock buildingBlock =
+ getGeneralBuildingBlock(getUserParamsMap(ADDITIONAL_PARAMS_VALUE, EXT_VIRTUAL_LINKS_VALUE));
+ stubbedxecution.setGeneralBuildingBlock(buildingBlock);
+
+ final InputParameter inputParameter = new InputParameter(getAdditionalParams(), getExternalVirtualLink());
+ when(sdncInputParametersProvider.getInputParameter(Mockito.any(GenericVnf.class))).thenReturn(inputParameter);
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(new GenericVnf());
+ objUnderTest.getInputParameters(stubbedxecution);
+
+ final Object actual = stubbedxecution.getVariable(Constants.INPUT_PARAMETER);
+ assertNotNull(actual);
+ assertTrue(actual instanceof InputParameter);
+ final InputParameter actualInputParameter = (InputParameter) actual;
+ final Map<String, String> actualAdditionalParams = actualInputParameter.getAdditionalParams();
+ assertEquals(4, actualAdditionalParams.size());
+
+ final String actualInstanceType = actualAdditionalParams.get(INSTANCE_TYPE);
+ assertEquals(INSTANCE_TYPE_VALUE_1, actualInstanceType);
+
+ assertEquals(FLAVOR_VALUE, actualAdditionalParams.get(FLAVOR));
+ final List<ExternalVirtualLink> actualExtVirtualLinks = actualInputParameter.getExtVirtualLinks();
+ assertEquals(2, actualExtVirtualLinks.size());
+
+ final Optional<ExternalVirtualLink> externalVirtualLink0 = actualExtVirtualLinks.stream()
+ .filter(extVirtualLink -> EXT_VIRTUAL_LINK_ID.equals(extVirtualLink.getId())).findAny();
+ assertTrue(externalVirtualLink0.isPresent());
+ assertEquals(EXT_VIRTUAL_LINK_ID, externalVirtualLink0.get().getId());
+
+ final Optional<ExternalVirtualLink> externalVirtualLink1 = actualExtVirtualLinks.stream()
+ .filter(extVirtualLink -> RANDOM_EXT_VIRTUAL_LINK_ID.equals(extVirtualLink.getId())).findAny();
+ assertTrue(externalVirtualLink1.isPresent());
+ assertEquals(RANDOM_EXT_VIRTUAL_LINK_ID, externalVirtualLink1.get().getId());
+
+
+ }
+
+ private List<ExternalVirtualLink> getExternalVirtualLink() {
+ return Arrays.asList(
+ new ExternalVirtualLink().id(RANDOM_EXT_VIRTUAL_LINK_ID).addExtCpsItem(new ExternalVirtualLinkExtCps()
+ .addCpConfigItem(new ExternalVirtualLinkCpConfig().cpInstanceId(CPU_INSTANCE_ID))));
+ }
+
+ private Map<String, String> getAdditionalParams() {
+ final Map<String, String> additionalParams = new HashMap<>();
+ additionalParams.put(FLAVOR, FLAVOR_VALUE);
+ additionalParams.put(INSTANCE_TYPE, INSTANCE_TYPE_VALUE_2);
+ return additionalParams;
+ }
+
+
+ private GeneralBuildingBlock getGeneralBuildingBlock(final Map<String, Object> userParams) {
+ final GeneralBuildingBlock buildingBlock = new GeneralBuildingBlock();
+ final RequestContext requestContext = new RequestContext();
+ final RequestParameters requestParameters = new RequestParameters();
+ requestParameters.setUserParams(Arrays.asList(userParams));
+ requestContext.setRequestParameters(requestParameters);
+ buildingBlock.setRequestContext(requestContext);
+ return buildingBlock;
+
+ }
+
+ private class StubbedBuildingBlockExecution implements BuildingBlockExecution {
+
+ private final Map<String, Serializable> execution = new HashMap<>();
+ private GeneralBuildingBlock buildingBlock;
+
+ private void setGeneralBuildingBlock(final GeneralBuildingBlock buildingBlock) {
+ this.buildingBlock = buildingBlock;
+ }
+
+ @Override
+ public GeneralBuildingBlock getGeneralBuildingBlock() {
+ return buildingBlock;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getVariable(final String key) {
+ return (T) execution.get(key);
+ }
+
+ @Override
+ public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
+ return null;
+ }
+
+ @Override
+ public void setVariable(final String key, final Serializable value) {
+ execution.put(key, value);
+ }
+
+ @Override
+ public Map<ResourceKey, String> getLookupMap() {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public String getFlowToBeCalled() {
+ return null;
+ }
+
+ @Override
+ public int getCurrentSequence() {
+ return 0;
+ }
+
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java
new file mode 100644
index 0000000000..6dee904fde
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.junit.Test;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@ericsson.com)
+ *
+ */
+public class InputParameterTest {
+ @Test
+ public void test_putAdditionalParams_addsEntryToExistingMap() {
+ final InputParameter objUnderTest = new InputParameter();
+ objUnderTest.setAdditionalParams(getMap("name", "value"));
+ objUnderTest.putAdditionalParams(getMap("name1", "value1"));
+
+ final Map<String, String> additionalParams = objUnderTest.getAdditionalParams();
+ assertEquals(2, additionalParams.size());
+ assertTrue(additionalParams.containsKey("name"));
+ assertTrue(additionalParams.containsKey("name1"));
+
+ }
+
+ @Test
+ public void test_addExtVirtualLinks_adddistinctEntriesToExistingList() {
+ final InputParameter objUnderTest = new InputParameter();
+ String firstId = UUID.randomUUID().toString();
+ String secondId = UUID.randomUUID().toString();
+ objUnderTest.setExtVirtualLinks(getExternalVirtualLinkList(firstId));
+ objUnderTest.addExtVirtualLinks(getExternalVirtualLinkList(secondId));
+ objUnderTest.addExtVirtualLinks(getExternalVirtualLinkList(secondId));
+ objUnderTest.addExtVirtualLinks(getExternalVirtualLinkList(secondId));
+
+ final List<ExternalVirtualLink> externalVirtualLinks = objUnderTest.getExtVirtualLinks();
+ assertEquals(2, externalVirtualLinks.size());
+
+ }
+
+ private List<ExternalVirtualLink> getExternalVirtualLinkList(final String id) {
+ final ExternalVirtualLink externalVirtualLink = new ExternalVirtualLink();
+ externalVirtualLink.setId(id);
+ final List<ExternalVirtualLink> list = new ArrayList<>();
+ list.add(externalVirtualLink);
+ return list;
+ }
+
+ private Map<String, String> getMap(final String name, final String value) {
+ final Map<String, String> map = new HashMap<>();
+ map.put(name, value);
+ return map;
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameterTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameterTest.java
new file mode 100644
index 0000000000..e076df7a9b
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameterTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.junit.Assert.assertTrue;
+import java.util.Collections;
+import org.junit.Test;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@ericsson.com)
+ *
+ */
+public class NullInputParameterTest {
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_addExtVirtualLinks_throwException() {
+ NullInputParameter.NULL_INSTANCE.addExtVirtualLinks(Collections.emptyList());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_setAdditionalParams_throwException() {
+ NullInputParameter.NULL_INSTANCE.setAdditionalParams(Collections.emptyMap());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_setExtVirtualLinks_throwException() {
+ NullInputParameter.NULL_INSTANCE.setExtVirtualLinks(Collections.emptyList());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_putAdditionalParams_throwException() {
+ NullInputParameter.NULL_INSTANCE.putAdditionalParams(Collections.emptyMap());
+ }
+
+ @Test
+ public void test_getAdditionalParams_ReturnEmptyCollection() {
+ assertTrue(NullInputParameter.NULL_INSTANCE.getAdditionalParams().isEmpty());
+ }
+
+ @Test
+ public void test_getExtVirtualLinks_ReturnEmptyCollection() {
+ assertTrue(NullInputParameter.NULL_INSTANCE.getExtVirtualLinks().isEmpty());
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java
index 51e86c1fea..e2e37ac6e4 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParametersProviderImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java
@@ -48,7 +48,7 @@ import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
* @author waqas.ikram@est.tech
*/
@RunWith(MockitoJUnitRunner.class)
-public class InputParametersProviderImplTest {
+public class SdncInputParametersProviderImplTest {
private static final String BASE_DIR = "src/test/resources/__files/";
@@ -89,7 +89,7 @@ public class InputParametersProviderImplTest {
@Test
public void testGetInputParameter_ValidResponseFromSdncInvalidData_EmptyInputParameter() throws Exception {
when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_PRE_LOAD_SDNC_RESPONSE));
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
assertNotNull(actual);
assertTrue(actual.getAdditionalParams().isEmpty());
@@ -99,7 +99,7 @@ public class InputParametersProviderImplTest {
@Test
public void testGetInputParameter_ExceptionThrownFromSdnc_EmptyInputParameter() throws Exception {
when(mockedSdncClient.get(Mockito.eq(URL))).thenThrow(RuntimeException.class);
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
assertNotNull(actual);
assertTrue(actual instanceof NullInputParameter);
@@ -110,7 +110,7 @@ public class InputParametersProviderImplTest {
@Test
public void testGetInputParameter_InvalidResponseData_EmptyInputParameter() throws Exception {
when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_ADDITIONAL_AND_EXT_VM_DATA));
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
assertNotNull(actual);
assertTrue(actual.getAdditionalParams().isEmpty());
@@ -120,7 +120,7 @@ public class InputParametersProviderImplTest {
@Test
public void testGetInputParameter_EmptyResponseData_EmptyInputParameter() throws Exception {
when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn("");
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
assertNotNull(actual);
assertTrue(actual instanceof NullInputParameter);
@@ -131,7 +131,7 @@ public class InputParametersProviderImplTest {
@Test
public void testGetInputParameter_InvalidVnfParamsResponseData_EmptyInputParameter() throws Exception {
when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(INVALID_VNF_PARAMS));
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(getGenericVnf());
assertNotNull(actual);
assertTrue(actual.getAdditionalParams().isEmpty());
@@ -140,7 +140,7 @@ public class InputParametersProviderImplTest {
private void assertValues(final GenericVnf genericVnf) throws MapperException, BadResponseException, IOException {
when(mockedSdncClient.get(Mockito.eq(URL))).thenReturn(getReponseAsString(PRE_LOAD_SDNC_RESPONSE));
- final InputParametersProvider objUnderTest = new InputParametersProviderImpl(mockedSdncClient);
+ final InputParametersProvider<GenericVnf> objUnderTest = new SdncInputParametersProvider(mockedSdncClient);
final InputParameter actual = objUnderTest.getInputParameter(genericVnf);
assertNotNull(actual);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java
new file mode 100644
index 0000000000..e6d4ad056a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.ADDITIONAL_PARAMS_VALUE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.EXT_VIRTUAL_LINKS_VALUE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.EXT_VIRTUAL_LINK_VALUE;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getUserParamsMap;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.junit.Test;
+import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@ericsson.com)
+ *
+ */
+public class UserParamInputParametersProviderTest {
+
+ @Test
+ public void testGetInputParameter_ValidUserParams_NotEmptyInputParameter() throws Exception {
+ final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
+
+ final InputParameter actual =
+ objUnderTest.getInputParameter(getUserParamsMap(ADDITIONAL_PARAMS_VALUE, EXT_VIRTUAL_LINKS_VALUE));
+ assertNotNull(actual);
+
+ final Map<String, String> actualAdditionalParams = actual.getAdditionalParams();
+ assertEquals(3, actualAdditionalParams.size());
+
+ final String actualInstanceType = actualAdditionalParams.get("instance_type");
+ assertEquals("m1.small", actualInstanceType);
+
+ final List<ExternalVirtualLink> actualExtVirtualLinks = actual.getExtVirtualLinks();
+ assertEquals(1, actualExtVirtualLinks.size());
+
+ final ExternalVirtualLink actualExternalVirtualLink = actualExtVirtualLinks.get(0);
+ assertEquals("ac1ed33d-8dc1-4800-8ce8-309b99c38eec", actualExternalVirtualLink.getId());
+
+ }
+
+ @Test
+ public void testGetInputParameter_EmptyOrNullUserParams_EmptyInputParameter() throws Exception {
+ final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
+
+ InputParameter actual = objUnderTest.getInputParameter(Collections.emptyMap());
+ assertNotNull(actual);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+
+ actual = objUnderTest.getInputParameter(null);
+ assertNotNull(actual);
+ assertTrue(actual instanceof NullInputParameter);
+ assertTrue(actual.getAdditionalParams().isEmpty());
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+
+ }
+
+ @Test
+ public void testGetInputParameter_InValidExtVirtualLinks_NotEmptyInputParameter() throws Exception {
+ final InputParametersProvider<Map<String, Object>> objUnderTest = new UserParamInputParametersProvider();
+
+ final InputParameter actual =
+ objUnderTest.getInputParameter(getUserParamsMap(ADDITIONAL_PARAMS_VALUE, EXT_VIRTUAL_LINK_VALUE));
+ assertNotNull(actual);
+
+ final Map<String, String> actualAdditionalParams = actual.getAdditionalParams();
+ assertEquals(3, actualAdditionalParams.size());
+
+ final String actualInstanceType = actualAdditionalParams.get("instance_type");
+ assertEquals("m1.small", actualInstanceType);
+
+ assertTrue(actual.getExtVirtualLinks().isEmpty());
+
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessorTest.java
new file mode 100644
index 0000000000..c78b652bd0
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcOrchestratorPreProcessorTest.java
@@ -0,0 +1,166 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.bpmn.infrastructure.appc.tasks;
+
+import static com.shazam.shazamcrest.MatcherAssert.assertThat;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Optional;
+import org.junit.Test;
+import org.mockito.ArgumentMatchers;
+import org.mockito.InjectMocks;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerTaskRequest;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.policy.JettisonStyleMapperProvider;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class AppcOrchestratorPreProcessorTest extends BaseTaskTest {
+
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
+ @InjectMocks
+ private AppcOrchestratorPreProcessor appcOrchestratorPreProcessor = new AppcOrchestratorPreProcessor();
+
+ private ObjectMapper mapper = new JettisonStyleMapperProvider().getMapper();
+
+ @Test
+ public void buildAppcTaskRequestTest() throws Exception {
+ final String expectedRequestJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "appcTaskRequest.json")));
+ ApplicationControllerTaskRequest expectedTaskRequest =
+ mapper.readValue(expectedRequestJson, ApplicationControllerTaskRequest.class);
+ execution.getLookupMap().put(ResourceKey.GENERIC_VNF_ID, "-TEST");
+ fillRequiredAppcExecutionFields();
+ GenericVnf genericVnf = getTestGenericVnf();
+ when(extractPojosForBB.extractByKey(eq(execution), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(genericVnf);
+ mockReferenceResponse();
+ execution.getLookupMap().put(ResourceKey.VF_MODULE_ID, "VF-MODULE-ID-TEST");
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("VF-MODULE-ID");
+ when(extractPojosForBB.extractByKey(eq(execution), eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+ appcOrchestratorPreProcessor.buildAppcTaskRequest(execution, "Lock");
+ ApplicationControllerTaskRequest actualTaskRequest = execution.getVariable("appcOrchestratorRequest");
+ assertThat(actualTaskRequest, sameBeanAs(expectedTaskRequest));
+ }
+
+ @Test
+ public void getVserversForAppcTest() throws Exception {
+
+ GenericVnf genericVnf = getTestGenericVnf();
+
+ final String aaiVnfJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
+ final String aaiVserverJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json")));
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiVnfJson);
+ ObjectMapper mapper = new ObjectMapper();
+ Vserver vserver = mapper.readValue(aaiVserverJson, Vserver.class);
+ doReturn(aaiResultWrapper).when(aaiVnfResources).queryVnfWrapperById(genericVnf);
+ doReturn(Optional.of(vserver)).when(aaiVnfResources).getVserver(ArgumentMatchers.any(AAIResourceUri.class));
+ appcOrchestratorPreProcessor.getVserversForAppc(execution, genericVnf);
+ ArrayList<String> vserverIdList = execution.getVariable("vserverIdList");
+ ArrayList<String> expectedVserverIdList = new ArrayList<String>();
+ expectedVserverIdList.add("1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5");
+ expectedVserverIdList.add("14551849-1e70-45cd-bc5d-a256d49548a2");
+ expectedVserverIdList.add("48bd7f11-408f-417c-b834-b41c1b98f7d7");
+ ArrayList<String> vmIdList = execution.getVariable("vmIdList");
+ ArrayList<String> expectedVmIdList = new ArrayList<String>();
+ expectedVmIdList.add("http://VSERVER-link.com");
+ expectedVmIdList.add("http://VSERVER-link.com");
+ expectedVmIdList.add("http://VSERVER-link.com");
+ assertEquals(vserverIdList, expectedVserverIdList);
+ assertEquals(vmIdList, expectedVmIdList);
+ }
+
+ @Test
+ public void addVmInfoToAppcTaskRequestTest() throws Exception {
+ ApplicationControllerTaskRequest appcTaskRequest = new ApplicationControllerTaskRequest();
+ ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
+ appcTaskRequest.setApplicationControllerVnf(applicationControllerVnf);
+ execution.setVariable("appcOrchestratorRequest", appcTaskRequest);
+ ArrayList<String> vmIdList = new ArrayList<String>();
+ vmIdList.add("http://VSERVER-link.com");
+ vmIdList.add("http://VSERVER-link.com");
+ vmIdList.add("http://VSERVER-link.com");
+ execution.setVariable("vmIdList", vmIdList);
+ ArrayList<String> vserverIdList = new ArrayList<String>();
+ vserverIdList.add("1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5");
+ vserverIdList.add("14551849-1e70-45cd-bc5d-a256d49548a2");
+ vserverIdList.add("48bd7f11-408f-417c-b834-b41c1b98f7d7");
+ execution.setVariable("vserverIdList", vserverIdList);
+ execution.setVariable("vmIndex", 1);
+ appcOrchestratorPreProcessor.addVmInfoToAppcTaskRequest(execution);
+ Integer nextVmIndex = execution.getVariable("vmIndex");
+ assertThat(nextVmIndex == 2);
+ Integer vmIdListSize = execution.getVariable("vmIdListSize");
+ assertThat(vmIdListSize == 3);
+ appcTaskRequest = execution.getVariable("appcOrchestratorRequest");
+ assertEquals(appcTaskRequest.getApplicationControllerVnf().getApplicationControllerVm().getVserverId(),
+ "14551849-1e70-45cd-bc5d-a256d49548a2");
+ assertEquals(appcTaskRequest.getApplicationControllerVnf().getApplicationControllerVm().getVmId(),
+ "http://VSERVER-link.com");
+ }
+
+ private void mockReferenceResponse() {
+ ControllerSelectionReference reference = new ControllerSelectionReference();
+ reference.setControllerName("TEST-CONTROLLER-NAME");
+ when(catalogDbClient.getControllerSelectionReferenceByVnfTypeAndActionCategory(eq("TEST-VNF-TYPE"),
+ eq(Action.Lock.toString()))).thenReturn(reference);
+ }
+
+ private void fillRequiredAppcExecutionFields() {
+ RequestContext context = new RequestContext();
+ context.setMsoRequestId("TEST-MSO-ID");
+ execution.setVariable("aicIdentity", "AIC-TEST");
+ execution.setVariable("vmIdList", "VM-ID-LIST-TEST");
+ execution.setVariable("vserverIdList", "VSERVER-ID-LIST");
+ execution.setVariable("identityUrl", "IDENTITY-URL-TEST");
+ execution.getGeneralBuildingBlock().setRequestContext(context);
+ }
+
+ private GenericVnf getTestGenericVnf() {
+ GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId("TEST-VNF-ID");
+ genericVnf.setVnfType("TEST-VNF-TYPE");
+ genericVnf.setVnfName("TEST-VNF-NAME");
+ genericVnf.setIpv4OamAddress("127.0.0.1");
+ return genericVnf;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
index e7a8b35db8..21b472b0f3 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
@@ -19,11 +19,17 @@
*/
package org.onap.so.bpmn.infrastructure.appc.tasks;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Optional;
import java.util.UUID;
@@ -34,11 +40,14 @@ import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.client.aai.AAIVersion;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.springframework.beans.factory.annotation.Autowired;
public class AppcRunTasksIT extends BaseIntegrationTest {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
@Autowired
private AppcRunTasks appcRunTasks;
@@ -56,8 +65,52 @@ public class AppcRunTasksIT extends BaseIntegrationTest {
}
@Test
- public void preProcessActivityTest() throws Exception {
+ public void preProcessActivityWithVserversTest() throws Exception {
+ final String aaiVnfJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/" + AAIVersion.LATEST + "/network/generic-vnfs/generic-vnf/testVnfId1?depth=all"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVnfJson)
+ .withStatus(200)));
+
+ final String aaiVserverJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverFullQueryResponse.json")));
+ wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+ + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+ wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+ + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+ wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+ + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
+ .withStatus(200)));
+
+ appcRunTasks.preProcessActivity(execution);
+ String vserverIdList = execution.getVariable("vserverIdList");
+ String expectedVserverIdList =
+ "{\"vserverIds\":\"[\\\"1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5\\\",\\\"14551849-1e70-45cd-bc5d-a256d49548a2\\\",\\\"48bd7f11-408f-417c-b834-b41c1b98f7d7\\\"]\"}";
+ String vmIdList = execution.getVariable("vmIdList");
+ String expectedVmIdList =
+ "{\"vmIds\":\"[\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\"]\"}";
+
+ assertEquals(vserverIdList, expectedVserverIdList);
+ assertEquals(vmIdList, expectedVmIdList);
+ assertEquals(execution.getVariable("actionQuiesceTraffic"), Action.QuiesceTraffic);
+ assertEquals(execution.getVariable("rollbackQuiesceTraffic"), false);
+ }
+
+ @Test
+ public void preProcessActivityNoVserversTest() throws Exception {
+ final String aaiVnfJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnf.json")));
+ wireMockServer.stubFor(
+ get(urlEqualTo("/aai/v15/network/generic-vnfs/generic-vnf/testVnfId1?depth=all")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody(aaiVnfJson).withStatus(200)));
appcRunTasks.preProcessActivity(execution);
+ assertNull(execution.getVariable("vmIdList"));
+ assertNull(execution.getVariable("vServerIdList"));
assertEquals(execution.getVariable("actionQuiesceTraffic"), Action.QuiesceTraffic);
assertEquals(execution.getVariable("rollbackQuiesceTraffic"), false);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
index cf673c5eb5..f0c333007e 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
@@ -26,12 +26,19 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
import org.junit.Test;
import org.mockito.InjectMocks;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.appc.client.lcm.model.Action;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -39,11 +46,16 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
public class AppcRunTasksTest extends BaseTaskTest {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
@InjectMocks
private AppcRunTasks appcRunTasks = new AppcRunTasks();
@@ -132,6 +144,47 @@ public class AppcRunTasksTest extends BaseTaskTest {
assertEquals(true, execution.getVariable("rollbackVnfLock"));
}
+ @Test
+ public void getVserversForAppcTest() throws Exception {
+
+ GenericVnf genericVnf = getTestGenericVnf();
+
+ final String aaiVnfJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
+ final String aaiVserverJson =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json")));
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiVnfJson);
+ ObjectMapper mapper = new ObjectMapper();
+ Vserver vserver = mapper.readValue(aaiVserverJson, Vserver.class);
+ doReturn(aaiResultWrapper).when(aaiVnfResources).queryVnfWrapperById(genericVnf);
+ doReturn(Optional.of(vserver)).when(aaiVnfResources).getVserver(any(AAIResourceUri.class));
+ appcRunTasks.getVserversForAppc(execution, genericVnf);
+ String vserverIdList = execution.getVariable("vserverIdList");
+ String expectedVserverIdList =
+ "{\"vserverIds\":\"[\\\"1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5\\\",\\\"14551849-1e70-45cd-bc5d-a256d49548a2\\\",\\\"48bd7f11-408f-417c-b834-b41c1b98f7d7\\\"]\"}";
+ String vmIdList = execution.getVariable("vmIdList");
+ String expectedVmIdList =
+ "{\"vmIds\":\"[\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\",\\\"http://VSERVER-link.com\\\"]\"}";
+
+ assertEquals(vserverIdList, expectedVserverIdList);
+ assertEquals(vmIdList, expectedVmIdList);
+ }
+
+ @Test
+ public void testUserParams() throws Exception {
+ Map<String, Object> userParams = new HashMap<String, Object>();
+ userParams.put("existing_software_version", "3.1");
+ userParams.put("new_software_version", "3.2");
+ userParams.put("operations_timeout", "150000");
+
+ String actualPayload = appcRunTasks.buildPayloadFromUserParams(userParams);
+ System.out.println(actualPayload);
+ String expectedPayload =
+ "{\\\"operations_timeout\\\":\\\"150000\\\",\\\"existing_software_version\\\":\\\"3.1\\\",\\\"new_software_version\\\":\\\"3.2\\\"}";
+ assertEquals(expectedPayload, actualPayload.replaceAll(" ", ""));
+
+ }
+
private void mockReferenceResponse() {
ControllerSelectionReference reference = new ControllerSelectionReference();
reference.setControllerName("TEST-CONTROLLER-NAME");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
index 7d96a18305..2d7649438e 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnfTest.java
@@ -3,13 +3,14 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2019 TechMahindra.
+ * Copyright (C) 2019 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.
@@ -20,57 +21,225 @@
package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
-import static org.junit.Assert.assertTrue;
+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.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import java.util.UUID;
-import org.camunda.bpm.engine.delegate.BpmnError;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.ArgumentMatchers;
-import org.mockito.InjectMocks;
-import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.DelegateExecutionImpl;
+import org.onap.so.bpmn.infrastructure.flowspecific.exceptions.VnfNotFoundException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.serviceinstancebeans.ModelInfo;
+import org.onap.so.serviceinstancebeans.Resources;
+import org.onap.so.serviceinstancebeans.Service;
+import org.onap.so.serviceinstancebeans.Vnfs;
-public class ConfigAssignVnfTest extends BaseTaskTest {
- @InjectMocks
- private ConfigAssignVnf configAssignVnf = new ConfigAssignVnf();
+public class ConfigAssignVnfTest {
- private GenericVnf genericVnf;
- private ServiceInstance serviceInstance;
- private RequestContext requestContext;
- private String msoRequestId;
+ private static final String GENERIC_VNF_ID = "vnfId_configVnfTest";
+ private static final String GENERIC_VNF_NAME = "vnfName_configVnfTest";
+ private static final String VNF_MODEL_CUSTOMIZATION_ID = "0c1ac643-377e-475b-be50-6be65f91a7ad";
+ private static final String SERVICE_INSTANCE_ID = "serviceInst_configTest";
+ private static final String SERVICE_MODEL_UUID = "5af91c26-8418-4d3f-944c-965842deda94";
+ private static final String TARGET_VNF_MODEL_CUSTOMIZATION_UUID = "0c1ac643-377e-475b-be50-6be65f91a7ad";
+ private static final String GENERAL_BLOCK_EXECUTION_MAP_KEY = "gBBInput";
+ private static final int THE_NUMBER_OF_EXPECTED_CONFIG_PROPERTIES = 8;
+
+ private static final String INSTANCE_PARAM1_NAME = "paramName1";
+ private static final String INSTANCE_PARAM1_VALUE = "paramValue1";
+ private static final String INSTANCE_PARAM2_NAME = "paramName2";
+ private static final String INSTANCE_PARAM2_VALUE = "paramValue2";
+ private static final String INSTANCE_PARAM3_NAME = "paramName3";
+ private static final String INSTANCE_PARAM3_VALUE = "paramValue3";
+ private static final String INSTANCE_PARAM4_NAME = "paramName4";
+ private static final String INSTANCE_PARAM4_VALUE = "paramValue4";
+ private static final String INSTANCE_PARAM5_NAME = "paramName5";
+ private static final String INSTANCE_PARAM5_VALUE = "paramValue5";
+
+ private ConfigAssignVnf testedObject;
+
+ private ExtractPojosForBB extractPojosForBB;
+ private ExceptionBuilder exceptionBuilderMock;
@Before
- public void before() throws BBObjectNotFoundException {
- genericVnf = setGenericVnf();
- serviceInstance = setServiceInstance();
- msoRequestId = UUID.randomUUID().toString();
- requestContext = setRequestContext();
- requestContext.setMsoRequestId(msoRequestId);
- gBBInput.setRequestContext(requestContext);
-
- doThrow(new BpmnError("BPMN Error")).when(exceptionUtil)
- .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
- when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID)))
- .thenReturn(genericVnf);
- when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
- .thenReturn(serviceInstance);
+ public void setup() {
+ extractPojosForBB = mock(ExtractPojosForBB.class);
+ exceptionBuilderMock = mock(ExceptionBuilder.class);
+ testedObject = new ConfigAssignVnf(extractPojosForBB, exceptionBuilderMock);
+ }
+
+ @Test
+ public void prepareAbstractCDSPropertiesBean_success() throws Exception {
+ // given
+ BuildingBlockExecution buildingBlockExecution = createBuildingBlockExecution(createService(createVnfList()));
+ prepareExtractPojosForBB(buildingBlockExecution);
+ // when
+ testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
+ // then
+ verifyConfigAssignPropertiesJsonContent(buildingBlockExecution);
+ }
+
+ @Test
+ public void invalidServiceJsonContentWhenPrepareCDSBean_flowExIsThrown() throws Exception {
+ // given
+ BuildingBlockExecution buildingBlockExecution = createBuildingBlockExecution("{invalidJsonContent}");
+ prepareExtractPojosForBB(buildingBlockExecution);
+ // when
+ testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
+ // then
+ verify(exceptionBuilderMock).buildAndThrowWorkflowException(eq(buildingBlockExecution), eq(7000),
+ any(IOException.class));
}
@Test
- public void preProcessAbstractCDSProcessingTest() throws Exception {
+ public void vnfIsNotFoundWhenPrepareCDSBean_flowExIsThrown() throws Exception {
+ // given
+ BuildingBlockExecution buildingBlockExecution =
+ createBuildingBlockExecution(createService(Collections.emptyList()));
+ prepareExtractPojosForBB(buildingBlockExecution);
+ // when
+ testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
+ // then
+ verify(exceptionBuilderMock).buildAndThrowWorkflowException(eq(buildingBlockExecution), eq(7000),
+ any(VnfNotFoundException.class));
+ }
+
+ private void prepareExtractPojosForBB(BuildingBlockExecution buildingBlockExecution) throws Exception {
+ when(extractPojosForBB.extractByKey(buildingBlockExecution, ResourceKey.GENERIC_VNF_ID))
+ .thenReturn(createGenericVnf());
+ when(extractPojosForBB.extractByKey(buildingBlockExecution, ResourceKey.SERVICE_INSTANCE_ID))
+ .thenReturn(createServiceInstance());
+ }
+
+ private void verifyConfigAssignPropertiesJsonContent(BuildingBlockExecution buildingBlockExecution)
+ throws Exception {
+ AbstractCDSPropertiesBean abstractCDSPropertiesBean = buildingBlockExecution.getVariable("executionObject");
+ String payload = abstractCDSPropertiesBean.getRequestObject();
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode payloadJson = mapper.readTree(payload);
+ JsonNode configAssignPropertiesNode = payloadJson.findValue("config-assign-properties");
+ assertThat(configAssignPropertiesNode.size()).isEqualTo(THE_NUMBER_OF_EXPECTED_CONFIG_PROPERTIES);
+ assertThat(configAssignPropertiesNode.get("service-instance-id").asText()).isEqualTo(SERVICE_INSTANCE_ID);
+ assertThat(configAssignPropertiesNode.get("vnf-id").asText()).isEqualTo(GENERIC_VNF_ID);
+ assertThat(configAssignPropertiesNode.get("vnf-name").asText()).isEqualTo(GENERIC_VNF_NAME);
+ assertThat(configAssignPropertiesNode.get("service-model-uuid").asText()).isEqualTo(SERVICE_MODEL_UUID);
+ assertThat(configAssignPropertiesNode.get("vnf-customization-uuid").asText())
+ .isEqualTo(VNF_MODEL_CUSTOMIZATION_ID);
+ assertThat(configAssignPropertiesNode.has(INSTANCE_PARAM1_NAME)).isTrue();
+ assertThat(configAssignPropertiesNode.get(INSTANCE_PARAM1_NAME).asText()).isEqualTo(INSTANCE_PARAM1_VALUE);
+ assertThat(configAssignPropertiesNode.has(INSTANCE_PARAM2_NAME)).isTrue();
+ assertThat(configAssignPropertiesNode.get(INSTANCE_PARAM2_NAME).asText()).isEqualTo(INSTANCE_PARAM2_VALUE);
+ assertThat(configAssignPropertiesNode.has(INSTANCE_PARAM3_NAME)).isTrue();
+ assertThat(configAssignPropertiesNode.get(INSTANCE_PARAM3_NAME).asText()).isEqualTo(INSTANCE_PARAM3_VALUE);
+ }
- configAssignVnf.preProcessAbstractCDSProcessing(execution);
+ private BuildingBlockExecution createBuildingBlockExecution(Object serviceJson) {
+ DelegateExecution execution = new DelegateExecutionFake();
+ execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock(serviceJson));
+ return new DelegateExecutionImpl(execution);
+ }
+
+ private ServiceInstance createServiceInstance() {
+ ServiceInstance serviceInstance = new ServiceInstance();
+ serviceInstance.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
+ modelInfoServiceInstance.setModelUuid(SERVICE_MODEL_UUID);
+ serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
+ return serviceInstance;
+ }
+
+ private GenericVnf createGenericVnf() {
+ GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(GENERIC_VNF_ID);
+ genericVnf.setVnfName(GENERIC_VNF_NAME);
+ ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setModelCustomizationUuid(TARGET_VNF_MODEL_CUSTOMIZATION_UUID);
+ modelInfoGenericVnf.setBlueprintName("blueprintTest");
+ modelInfoGenericVnf.setBlueprintVersion("blueprintVerTest");
+ genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
+ return genericVnf;
+ }
+
+ private GeneralBuildingBlock createGeneralBuildingBlock(Object serviceJson) {
+ GeneralBuildingBlock generalBuildingBlock = new GeneralBuildingBlock();
+ RequestContext requestContext = new RequestContext();
+ RequestParameters requestParameters = new RequestParameters();
+ requestParameters.setUserParams(createRequestUserParams(serviceJson));
+ requestContext.setRequestParameters(requestParameters);
+ generalBuildingBlock.setRequestContext(requestContext);
+ return generalBuildingBlock;
+ }
- assertTrue(true);
+ private List<Map<String, Object>> createRequestUserParams(Object serviceJson) {
+ List<Map<String, Object>> userParams = new ArrayList<>();
+ Map<String, Object> userParamMap = new HashMap<>();
+ userParamMap.put("service", serviceJson);
+ userParams.add(userParamMap);
+ return userParams;
}
+ private Service createService(List<Vnfs> vnfList) {
+ Service service = new Service();
+ Resources resources = new Resources();
+ resources.setVnfs(vnfList);
+ service.setResources(resources);
+ return service;
+ }
+
+ private List<Vnfs> createVnfList() {
+ List<Map<String, String>> instanceParamsListSearchedVnf = new ArrayList<>();
+ Map<String, String> instanceParam = new HashMap<>();
+ instanceParam.put(INSTANCE_PARAM1_NAME, INSTANCE_PARAM1_VALUE);
+ instanceParam.put(INSTANCE_PARAM2_NAME, INSTANCE_PARAM2_VALUE);
+ Map<String, String> instanceParam2 = new HashMap<>();
+ instanceParam2.put(INSTANCE_PARAM3_NAME, INSTANCE_PARAM3_VALUE);
+ instanceParamsListSearchedVnf.add(instanceParam);
+ instanceParamsListSearchedVnf.add(instanceParam2);
+ Vnfs searchedVnf = createVnf(VNF_MODEL_CUSTOMIZATION_ID, instanceParamsListSearchedVnf);
+
+ List<Map<String, String>> instanceParamsListForAnotherVnf = new ArrayList<>();
+ Map<String, String> instanceParam3 = new HashMap<>();
+ instanceParam3.put(INSTANCE_PARAM4_NAME, INSTANCE_PARAM4_VALUE);
+ instanceParam3.put(INSTANCE_PARAM5_NAME, INSTANCE_PARAM5_VALUE);
+ instanceParamsListForAnotherVnf.add(instanceParam3);
+ Vnfs anotherVnf = createVnf("2d1ac656-377e-467b-be50-6ce65f66a7ca", instanceParamsListForAnotherVnf);
+
+ List<Vnfs> vnfList = new ArrayList<>();
+ vnfList.add(searchedVnf);
+ vnfList.add(anotherVnf);
+ return vnfList;
+ }
+
+ private Vnfs createVnf(String vnfModelCustomizationId, List<Map<String, String>> instanceParamsList) {
+ Vnfs vnf = new Vnfs();
+ ModelInfo modelInfo = new ModelInfo();
+ modelInfo.setModelCustomizationId(vnfModelCustomizationId);
+ vnf.setModelInfo(modelInfo);
+ vnf.setInstanceParams(instanceParamsList);
+ return vnf;
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBBTest.java
index bacc57758b..ed55c56231 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBBTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBBTest.java
@@ -40,9 +40,7 @@ import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
-import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.entities.AAIResultWrapper;
-import org.springframework.beans.factory.annotation.Autowired;
public class UnassignNetworkBBTest extends BaseTaskTest {
@@ -84,6 +82,15 @@ public class UnassignNetworkBBTest extends BaseTaskTest {
}
@Test
+ public void checkRelationshipRelatedToUnassignNetworkExceptionTest() throws Exception {
+ String msg = "Cannot perform Unassign Network. Network is still related to vf-module";
+ expectedException.expect(BpmnError.class);
+ doReturn(true).when(networkBBUtils).isRelationshipRelatedToExists(any(Optional.class), eq("vf-module"));
+ unassignNetworkBB.checkRelationshipRelatedTo(execution, "vf-module");
+ assertEquals(execution.getVariable("ErrorUnassignNetworkBB"), msg);
+ }
+
+ @Test
public void getCloudSdncRegion25Test() throws Exception {
CloudRegion cloudRegion = setCloudRegion();
cloudRegion.setCloudRegionVersion("2.5");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
index 0ba9237aaf..e158925568 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
@@ -44,8 +44,8 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.utils.TargetEntities;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponentsList;
+import org.onap.logging.filter.base.ONAPComponents;
public class SDNCQueryTasksTest extends BaseTaskTest {
@InjectMocks
@@ -65,7 +65,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
vfModule = setVfModule();
doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(
- any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(TargetEntities.class));
+ any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(ONAPComponentsList.class));
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
.thenReturn(serviceInstance);
@@ -98,7 +98,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVfModule(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC);
}
@Test
@@ -109,7 +109,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVfModule(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO);
}
@Test
@@ -133,7 +133,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVnf(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC);
}
@Test
@@ -144,7 +144,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVnf(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO);
}
@Test
@@ -169,7 +169,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVfModuleForVolumeGroup(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC);
}
@Test
@@ -180,7 +180,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
sdncQueryTasks.queryVfModuleForVolumeGroup(execution);
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO);
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
index 0fc33fe5ce..e435909f59 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
@@ -49,7 +49,7 @@ import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import com.fasterxml.jackson.core.JsonParseException;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
index b371e3a48a..ffe48876c4 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
@@ -50,7 +51,6 @@ import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective;
import org.onap.so.db.catalog.beans.ResourceType;
import org.springframework.beans.factory.annotation.Autowired;
-@Ignore
public class OrchestrationStatusValidatorTest extends BaseTaskTest {
@InjectMocks
protected OrchestrationStatusValidator orchestrationStatusValidator = new OrchestrationStatusValidator();
@@ -72,6 +72,13 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstance =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance();
+ serviceInstance.setServiceInstanceId("serviceInstanceId");
+ serviceInstance.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
+ .thenReturn(serviceInstance);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE);
@@ -115,6 +122,13 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration configuration =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration();
+ configuration.setConfigurationId("configurationId");
+ configuration.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.CONFIGURATION_ID)))
+ .thenReturn(configuration);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective
@@ -134,6 +148,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
execution.getVariable("orchestrationStatusValidationResult"));
}
+ @Ignore
@Test
public void test_validateOrchestrationStatus_buildingBlockDetailNotFound() throws Exception {
expectedException.expect(BpmnError.class);
@@ -147,6 +162,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
orchestrationStatusValidator.validateOrchestrationStatus(execution);
}
+ @Ignore
@Test
public void test_validateOrchestrationStatus_orchestrationValidationFail() throws Exception {
expectedException.expect(BpmnError.class);
@@ -178,6 +194,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
orchestrationStatusValidator.validateOrchestrationStatus(execution);
}
+ @Ignore
@Test
public void test_validateOrchestrationStatus_orchestrationValidationNotFound() throws Exception {
expectedException.expect(BpmnError.class);
@@ -228,8 +245,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
orchestrationStatusValidator.validateOrchestrationStatus(execution);
- assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS,
- execution.getVariable("orchestrationStatusValidationResult"));
+ assertNull(execution.getVariable("orchestrationStatusValidationResult"));
}
@Test
@@ -247,6 +263,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf);
setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("CreateVfModuleBB");
buildingBlockDetail.setId(1);
@@ -257,7 +279,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
- orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.FAIL);
+ orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE);
orchestrationStatusStateTransitionDirective.setId(1);
orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE);
@@ -288,6 +310,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf);
setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("CreateVfModuleBB");
buildingBlockDetail.setId(1);
@@ -338,6 +366,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective
@@ -380,6 +414,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective
@@ -422,6 +462,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective
@@ -464,6 +510,12 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
new OrchestrationStatusStateTransitionDirective();
orchestrationStatusStateTransitionDirective
@@ -482,4 +534,39 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS,
execution.getVariable("orchestrationStatusValidationResult"));
}
+
+ @Test
+ public void continueValidationActivatedTest() throws Exception {
+ String flowToBeCalled = "DeactivateVnfBB";
+ BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
+ buildingBlockDetail.setBuildingBlockName(flowToBeCalled);
+ buildingBlockDetail.setId(1);
+ buildingBlockDetail.setResourceType(ResourceType.VF_MODULE);
+ buildingBlockDetail.setTargetAction(OrchestrationAction.DEACTIVATE);
+ when(catalogDbClient.getBuildingBlockDetail(flowToBeCalled)).thenReturn(buildingBlockDetail);
+
+ org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ vfModule.setOrchestrationStatus(OrchestrationStatus.ACTIVATED);
+ when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
+
+ OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective =
+ new OrchestrationStatusStateTransitionDirective();
+ orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE);
+ orchestrationStatusStateTransitionDirective.setId(1);
+ orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.ACTIVATED);
+ orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE);
+ orchestrationStatusStateTransitionDirective.setTargetAction(OrchestrationAction.DEACTIVATE);
+ doReturn(orchestrationStatusStateTransitionDirective).when(catalogDbClient)
+ .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.ACTIVATED,
+ OrchestrationAction.DEACTIVATE);
+
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("flowToBeCalled", flowToBeCalled);
+ orchestrationStatusValidator.validateOrchestrationStatus(execution);
+
+ assertEquals(OrchestrationStatusValidationDirective.CONTINUE,
+ execution.getVariable("orchestrationStatusValidationResult"));
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
index 2d48d02774..573601b20f 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
@@ -41,6 +41,8 @@ import org.mockito.Spy;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -140,6 +142,31 @@ public class WorkflowActionBBFailureTest extends BaseTaskTest {
}
@Test
+ public void updateRequestStatusToFailedRollbackFabric() {
+ ExecuteBuildingBlock ebb = new ExecuteBuildingBlock();
+ BuildingBlock bb = new BuildingBlock();
+ bb.setBpmnFlowName("UnassignFabricConfigurationBB");
+ ebb.setBuildingBlock(bb);
+ execution.setVariable("buildingBlock", ebb);
+ execution.setVariable("mso-request-id", "123");
+ execution.setVariable("isRollbackComplete", false);
+ execution.setVariable("isRollback", true);
+ InfraActiveRequests req = new InfraActiveRequests();
+ req.setStatusMessage("PINC failure.");
+ WorkflowException wfe = new WorkflowException("processKey123", 1, "error in rollback");
+ execution.setVariable("WorkflowException", wfe);
+ doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123");
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
+ String errorMsg = (String) execution.getVariable("RollbackErrorMessage");
+ assertEquals("error in rollback", errorMsg);
+ assertEquals(
+ "PINC failure. Warning: The vf-module is active but configuration was not removed completely for one or more VMs.",
+ req.getStatusMessage());
+ assertEquals(Status.FAILED.toString(), req.getRequestStatus());
+ }
+
+ @Test
public void updateRequestStatusToRolledback() {
execution.setVariable("mso-request-id", "123");
execution.setVariable("isRollbackComplete", true);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index aac09b4475..4991fa59ee 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -21,14 +21,18 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Optional;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
@@ -40,17 +44,25 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
+import org.onap.aai.domain.yang.Configuration;
import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.InstanceGroup;
+import org.onap.aai.domain.yang.L3Network;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.VfModule;
+import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
-import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
+import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.RequestDetails;
+import org.onap.so.serviceinstancebeans.RequestInfo;
import org.springframework.core.env.Environment;
public class WorkflowActionBBTasksTest extends BaseTaskTest {
@@ -328,6 +340,51 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
}
@Test
+ public void rollbackExecutionRollbackToAssignedWithFabricTest() {
+ execution.setVariable("isRollback", false);
+ execution.setVariable("handlingCode", "RollbackToAssigned");
+ List<ExecuteBuildingBlock> flowsToExecute = new ArrayList();
+ ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock();
+ BuildingBlock bb1 = new BuildingBlock();
+ bb1.setBpmnFlowName("AssignVfModuleBB");
+ ebb1.setBuildingBlock(bb1);
+ flowsToExecute.add(ebb1);
+ ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock();
+ BuildingBlock bb2 = new BuildingBlock();
+ bb2.setBpmnFlowName("CreateVfModuleBB");
+ ebb2.setBuildingBlock(bb2);
+ flowsToExecute.add(ebb2);
+ ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock();
+ BuildingBlock bb3 = new BuildingBlock();
+ bb3.setBpmnFlowName("ActivateVfModuleBB");
+ ebb3.setBuildingBlock(bb3);
+ flowsToExecute.add(ebb3);
+ ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock();
+ BuildingBlock bb4 = new BuildingBlock();
+ bb4.setBpmnFlowName("AssignFabricConfigurationBB");
+ ebb4.setBuildingBlock(bb4);
+ flowsToExecute.add(ebb4);
+ ExecuteBuildingBlock ebb5 = new ExecuteBuildingBlock();
+ BuildingBlock bb5 = new BuildingBlock();
+ bb5.setBpmnFlowName("ActivateFabricConfigurationBB");
+ ebb5.setBuildingBlock(bb5);
+ flowsToExecute.add(ebb5);
+
+ execution.setVariable("flowsToExecute", flowsToExecute);
+ execution.setVariable("gCurrentSequence", 5);
+
+ workflowActionBBTasks.rollbackExecutionPath(execution);
+ List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
+ assertEquals(0, execution.getVariable("gCurrentSequence"));
+ assertEquals(4, ebbs.size());
+ assertEquals("DeactivateFabricConfigurationBB", ebbs.get(0).getBuildingBlock().getBpmnFlowName());
+ assertEquals("UnassignFabricConfigurationBB", ebbs.get(1).getBuildingBlock().getBpmnFlowName());
+ assertEquals("DeactivateVfModuleBB", ebbs.get(2).getBuildingBlock().getBpmnFlowName());
+ assertEquals("DeleteVfModuleBB", ebbs.get(3).getBuildingBlock().getBpmnFlowName());
+
+ }
+
+ @Test
public void rollbackExecutionRollbackToCreatedTest() {
execution.setVariable("isRollback", false);
execution.setVariable("handlingCode", "RollbackToCreated");
@@ -417,4 +474,115 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
workflowActionBBTasks.updateInstanceId(execution);
Mockito.verify(reqMock, Mockito.times(1)).setServiceInstanceId(instanceId);
}
+
+ @Test
+ public void getConfigurationId() {
+ org.onap.aai.domain.yang.Vnfc vnfc = new org.onap.aai.domain.yang.Vnfc();
+ vnfc.setModelInvariantId("modelInvariantId");
+ vnfc.setVnfcName("testVnfcName");
+ List<org.onap.aai.domain.yang.Configuration> configurations =
+ new ArrayList<org.onap.aai.domain.yang.Configuration>();
+ org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration();
+ configuration.setConfigurationId("configurationId");
+ configuration.setModelCustomizationId("modelCustimizationId");
+ configuration.setConfigurationName("testConfigurationName");
+ configurations.add(configuration);
+ doReturn(configurations.get(0).getConfigurationId()).when(workflowActionBBTasks).getConfigurationId(vnfc);
+ assertEquals(workflowActionBBTasks.getConfigurationId(vnfc), "configurationId");
+ }
+
+ @Test
+ public void setServiceInstanceNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.SERVICE;
+ InfraActiveRequests request = new InfraActiveRequests();
+ ServiceInstance service = new ServiceInstance();
+ service.setServiceInstanceName("serviceInstanceName");
+ doReturn(service).when(bbSetupUtils).getAAIServiceInstanceById(resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("serviceInstanceName", request.getServiceInstanceName());
+ }
+
+ @Test
+ public void setVnfNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.VNF;
+ InfraActiveRequests request = new InfraActiveRequests();
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfName("vnfName");
+ doReturn(vnf).when(bbSetupUtils).getAAIGenericVnf(resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("vnfName", request.getVnfName());
+ }
+
+ @Test
+ public void setVfModuleNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.VFMODULE;
+ InfraActiveRequests request = new InfraActiveRequests();
+ request.setVnfId("ae5cc3e8-c13c-4d88-aaf6-694ab4977b0e");
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleName("vfModuleName");
+ doReturn(vfModule).when(bbSetupUtils).getAAIVfModule("ae5cc3e8-c13c-4d88-aaf6-694ab4977b0e", resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("vfModuleName", request.getVfModuleName());
+ }
+
+ @Test
+ public void setNetworkNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.NETWORK;
+ InfraActiveRequests request = new InfraActiveRequests();
+ L3Network network = new L3Network();
+ network.setNetworkName("networkName");
+ doReturn(network).when(bbSetupUtils).getAAIL3Network(resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("networkName", request.getNetworkName());
+ }
+
+ @Test
+ public void setConfigurationNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.CONFIGURATION;
+ InfraActiveRequests request = new InfraActiveRequests();
+ Configuration configuration = new Configuration();
+ configuration.setConfigurationName("configurationName");
+ doReturn(configuration).when(bbSetupUtils).getAAIConfiguration(resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("configurationName", request.getConfigurationName());
+ }
+
+ @Test
+ public void setInstanceGroupNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.INSTANCE_GROUP;
+ InfraActiveRequests request = new InfraActiveRequests();
+ InstanceGroup instanceGroup = new InstanceGroup();
+ instanceGroup.setInstanceGroupName("instanceGroupName");
+ doReturn(instanceGroup).when(bbSetupUtils).getAAIInstanceGroup(resourceId);
+
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+ assertEquals("instanceGroupName", request.getInstanceGroupName());
+ }
+
+ @Test
+ public void setVolumeGroupNameTest() {
+ String resourceId = "40bc4ebd-11df-4610-8055-059f7441ec1c";
+ WorkflowType resourceType = WorkflowType.VOLUMEGROUP;
+ InfraActiveRequests request = new InfraActiveRequests();
+ request.setVnfId("4aa72c90-21eb-4465-8847-997e27af6c3e");
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupName("volumeGroupName");
+ Optional<VolumeGroup> returnVolumeGroup = Optional.of(volumeGroup);
+
+ doReturn(returnVolumeGroup).when(bbSetupUtils).getRelatedVolumeGroupByIdFromVnf(request.getVnfId(), resourceId);
+ workflowActionBBTasks.setInstanceName(resourceId, resourceType, request);
+
+ assertEquals("volumeGroupName", request.getVolumeGroupName());
+ }
}
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 eea885288e..ed3ee0a3a1 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
@@ -45,11 +45,9 @@ import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import java.util.Set;
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -66,7 +64,6 @@ import org.mockito.Spy;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.GenericVnfs;
import org.onap.aai.domain.yang.L3Network;
-import org.onap.aai.domain.yang.L3Networks;
import org.onap.aai.domain.yang.Relationship;
import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.ServiceInstance;
@@ -80,13 +77,13 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
-import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.DuplicateNameException;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.Relationships;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.client.orchestration.AAIEntityNotFoundException;
import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResource;
import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
@@ -103,8 +100,6 @@ import org.onap.so.db.catalog.beans.Service;
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;
-import org.onap.so.db.request.beans.InfraActiveRequests;
-import org.onap.so.db.request.beans.RequestProcessingData;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.RequestParameters;
@@ -130,6 +125,16 @@ public class WorkflowActionTest extends BaseTaskTest {
private String RESOURCE_PATH = "src/test/resources/__files/";
+ private List<OrchestrationFlow> replaceVfModuleOrchFlows =
+ createFlowList("DeactivateVfModuleBB", "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB",
+ "DeleteVolumeGroupBB", "UnassignVFModuleBB", "UnassignVolumeGroupBB", "AssignVolumeGroupBB",
+ "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "CreateVolumeGroupBB",
+ "ActivateVolumeGroupBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ private List<OrchestrationFlow> replaceRetainAssignmentsVfModuleOrchFlows = createFlowList("DeactivateVfModuleBB",
+ "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB", "DeleteVolumeGroupBB", "UnassignVolumeGroupBB",
+ "AssignVolumeGroupBB", "ChangeModelVfModuleBB", "CreateVolumeGroupBB", "ActivateVolumeGroupBB",
+ "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+
@Before
public void before() throws Exception {
execution = new DelegateExecutionFake();
@@ -933,6 +938,9 @@ public class WorkflowActionTest extends BaseTaskTest {
"CreateVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "ActivateVfModuleBB",
"AssignFabricConfigurationBB", "ActivateFabricConfigurationBB", "ChangeModelVnfBB", "ActivateVnfBB",
"ChangeModelServiceInstanceBB", "SDNOVnfHealthCheckBB", "AAIUnsetVnfInMaintBB");
+ for (ExecuteBuildingBlock executeBuildingBlock : ebbs) {
+ assertEquals("123", executeBuildingBlock.getWorkflowResourceIds().getServiceInstanceId());
+ }
}
@Ignore
@@ -1095,6 +1103,362 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
+ public void selectExecutionListALaCarteVfModuleNoVolumeGroupReplaceTest() throws Exception {
+ String gAction = "replaceInstance";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "UnassignVFModuleBB",
+ "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB",
+ "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleNoVolumeGroupReplaceRetainAssignmentsTest() throws Exception {
+ String gAction = "replaceInstanceRetainAssignments";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceRetainAssignmentsVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "ChangeModelVfModuleBB",
+ "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleVolumeGroupToNoVolumeGroupReplaceTest() throws Exception {
+ String gAction = "replaceInstance";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB",
+ "DeleteVolumeGroupBB", "UnassignVFModuleBB", "UnassignVolumeGroupBB", "AssignVfModuleBB",
+ "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleVolumeGroupToNoVolumeGroupReplaceRetainAssignmentsTest()
+ throws Exception {
+ String gAction = "replaceInstanceRetainAssignments";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceRetainAssignmentsVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB",
+ "DeleteVolumeGroupBB", "UnassignVolumeGroupBB", "ChangeModelVfModuleBB", "CreateVfModuleBB",
+ "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleKeepVolumeGroupReplaceTest() throws Exception {
+ String gAction = "replaceInstance";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "UnassignVFModuleBB",
+ "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB",
+ "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleKeepVolumeGroupReplaceRetainAssignmentsTest() throws Exception {
+ String gAction = "replaceInstanceRetainAssignments";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceRetainAssignmentsVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "ChangeModelVfModuleBB",
+ "CreateVfModuleBB", "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleNoVolumeGroupToVolumeGroupReplaceTest() throws Exception {
+ String gAction = "replaceInstance";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "UnassignVFModuleBB",
+ "AssignVolumeGroupBB", "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB",
+ "CreateVolumeGroupBB", "ActivateVolumeGroupBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleNoVolumeGroupToVolumeGroupReplaceRetainAssignmentsTest()
+ throws Exception {
+ String gAction = "replaceInstanceRetainAssignments";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceRetainAssignmentsVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "AssignVolumeGroupBB",
+ "ChangeModelVfModuleBB", "CreateVolumeGroupBB", "ActivateVolumeGroupBB", "CreateVfModuleBB",
+ "ActivateVfModuleBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleRebuildVolumeGroupReplaceTest() throws Exception {
+ String gAction = "replaceInstance";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest = new String(
+ Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB",
+ "DeleteVolumeGroupBB", "UnassignVFModuleBB", "UnassignVolumeGroupBB", "AssignVolumeGroupBB",
+ "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "CreateVolumeGroupBB",
+ "ActivateVolumeGroupBB", "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+ @Test
+ public void selectExecutionListALaCarteVfModuleRebuildVolumeGroupReplaceRetainAssignmentsTest() throws Exception {
+ String gAction = "replaceInstanceRetainAssignments";
+ String resource = "VfModule";
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest = new String(
+ Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("aLaCarte", true);
+ execution.setVariable("apiVersion", "7");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules/1234");
+ execution.setVariable("vnfId", "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d");
+ execution.setVariable("vfModuleId", "1234");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("volumeGroupId");
+ doReturn(Optional.of(volumeGroup)).when(bbSetupUtils)
+ .getRelatedVolumeGroupFromVfModule("b80b16a5-f80d-4ffa-91c8-bd47c7438a3d", "1234");
+
+ VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
+ vfModuleCustomization.setVolumeHeatEnv(new HeatEnvironment());
+ org.onap.so.db.catalog.beans.VfModule vfModule = new org.onap.so.db.catalog.beans.VfModule();
+ vfModule.setVolumeHeatTemplate(new HeatTemplate());
+ vfModuleCustomization.setVfModule(vfModule);
+ when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("9a6d01fd-19a7-490a-9800-460830a12e0b"))
+ .thenReturn(vfModuleCustomization);
+
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setOrchestrationFlowList(replaceRetainAssignmentsVfModuleOrchFlows);
+ 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, "DeactivateVfModuleBB", "DeleteVfModuleATTBB", "DeactivateVolumeGroupBB",
+ "DeleteVolumeGroupBB", "UnassignVolumeGroupBB", "AssignVolumeGroupBB", "ChangeModelVfModuleBB",
+ "CreateVolumeGroupBB", "ActivateVolumeGroupBB", "CreateVfModuleBB", "ActivateVfModuleBB",
+ "ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
+ }
+
+
+ @Test
public void selectExecutionListALaCarteVfModuleFabricDeleteTest() throws Exception {
String gAction = "deleteInstance";
String resource = "VfModule";
@@ -1152,6 +1516,56 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
+ public void getConfigBuildingBlocksNoVfModuleFabricDeleteTest() throws Exception {
+ String gAction = "deleteInstance";
+ ObjectMapper mapper = new ObjectMapper();
+ WorkflowType resourceType = WorkflowType.VFMODULE;
+ execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688");
+ execution.setVariable("requestAction", gAction);
+ String bpmnRequest =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json")));
+ execution.setVariable("bpmnRequest", bpmnRequest);
+ execution.setVariable("vnfId", "1234");
+ execution.setVariable("vfModuleId", "vfModuleId1234");
+ execution.setVariable("requestUri",
+ "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules");
+ ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
+ RequestDetails requestDetails = sIRequest.getRequestDetails();
+ String requestAction = "deleteInstance";
+ String requestId = "9c944122-d161-4280-8594-48c06a9d96d5";
+ boolean aLaCarte = true;
+ String apiVersion = "7";
+ String vnfType = "vnfType";
+ String key = "00d15ebb-c80e-43c1-80f0-90c40dde70b0";
+ String resourceId = "d1d35800-783d-42d3-82f6-d654c5054a6e";
+ Resource resourceKey = new Resource(resourceType, key, aLaCarte);
+ WorkflowResourceIds workflowResourceIds = SPY_workflowAction.populateResourceIdsFromApiHandler(execution);
+
+ thrown.expect(AAIEntityNotFoundException.class);
+ thrown.expectMessage(containsString(
+ "No matching VfModule is found in Generic-Vnf in AAI for vnfId: 1234 and vfModuleId : vfModuleId1234"));
+
+ List<OrchestrationFlow> orchFlows = createFlowList("DeactivateVfModuleBB", "DeleteVfModuleBB",
+ "UnassignVfModuleBB", "DeactivateFabricConfigurationBB", "UnassignFabricConfigurationBB");
+
+ ConfigBuildingBlocksDataObject dataObj = new ConfigBuildingBlocksDataObject().setsIRequest(sIRequest)
+ .setOrchFlows(orchFlows).setRequestId(requestId).setResourceKey(resourceKey).setApiVersion(apiVersion)
+ .setResourceId(resourceId).setRequestAction(requestAction).setaLaCarte(aLaCarte).setVnfType(vnfType)
+ .setWorkflowResourceIds(workflowResourceIds).setRequestDetails(requestDetails).setExecution(execution);
+
+ org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf();
+ vnf.setVnfId("vnf0");
+ vnf.setModelCustomizationId("modelCustomizationId");
+ when(bbSetupUtils.getAAIGenericVnf(anyObject())).thenReturn(vnf);
+
+ org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule();
+ vfModule.setModelCustomizationId("modelCustomizationId");
+ when(bbSetupUtils.getAAIVfModule(anyObject(), anyObject())).thenReturn(null);
+
+ SPY_workflowAction.getConfigBuildingBlocks(dataObj);
+ }
+
+ @Test
public void selectExecutionListALaCarteVfModuleNoFabricDeleteTest() throws Exception {
String gAction = "deleteInstance";
String resource = "VfModule";
@@ -1476,9 +1890,40 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
+ public void extractResourceIdAndTypeFromUriResumeTest() {
+ Resource resource = workflowAction.extractResourceIdAndTypeFromUri(
+ "http://localhost:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/4ff87c63-461b-4d83-8121-d351e6db216c/vnfs/eea9b93b-b5b9-4fad-9c35-12d52e4b683f/vfModules/33cb74cd-9cb3-4090-a3c0-1b8c8e235847/resume");
+ assertEquals(resource.getResourceId(), "33cb74cd-9cb3-4090-a3c0-1b8c8e235847");
+ }
+
+ @Test
+ public void extractResourceIdAndTypeFromUriReplaceResumeTest() {
+ Resource resource = workflowAction.extractResourceIdAndTypeFromUri(
+ "http://localhost:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/4ff87c63-461b-4d83-8121-d351e6db216c/vnfs/eea9b93b-b5b9-4fad-9c35-12d52e4b683f/vfModules/33cb74cd-9cb3-4090-a3c0-1b8c8e235847/deactivateAndCloudDelete/resume");
+ assertEquals(resource.getResourceId(), "33cb74cd-9cb3-4090-a3c0-1b8c8e235847");
+ }
+
+ @Test
+ public void extractResourceIdAndTypeFromUriDeActiveResumeTest() {
+ Resource resource = workflowAction.extractResourceIdAndTypeFromUri(
+ "http://localhost:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/4ff87c63-461b-4d83-8121-d351e6db216c/vnfs/eea9b93b-b5b9-4fad-9c35-12d52e4b683f/vfModules/33cb74cd-9cb3-4090-a3c0-1b8c8e235847/replace/resume");
+ assertEquals(resource.getResourceId(), "33cb74cd-9cb3-4090-a3c0-1b8c8e235847");
+ }
+
+ @Test
+ public void extractResourceIdAndTypeFromUriResumeIdOnly() {
+ Resource resource = workflowAction.extractResourceIdAndTypeFromUri(
+ "http://localhost:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/4ff87c63-461b-4d83-8121-d351e6db216c/vnfs/eea9b93b-b5b9-4fad-9c35-12d52e4b683f/vfModules/33cb74cd-9cb3-4090-a3c0-1b8c8e235847/resume");
+ assertEquals(resource.getResourceId(), "33cb74cd-9cb3-4090-a3c0-1b8c8e235847");
+ }
+
+ @Test
public void isUriResumeTest() {
assertTrue(workflowAction.isUriResume(
"http://localhost:9100/onap/so/infra/orchestrationRequests/v7/requests/2f8ab587-ef6a-4456-b7b2-d73f9363dabd/resume"));
+ assertTrue(workflowAction.isUriResume(
+ " http://localhost:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/4ff87c63-461b-4d83-8121-d351e6db216c/vnfs/eea9b93b-b5b9-4fad-9c35-12d52e4b683f/vfModules/33cb74cd-9cb3-4090-a3c0-1b8c8e235847/resume"));
+
assertFalse(workflowAction.isUriResume("/v6/serviceInstances/123/vnfs/1234/vfmodules/5678/replace"));
}
@@ -1516,7 +1961,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateVnfResourceIdInAAITest() throws Exception {
+ public void validateResourceIdInAAIVnfTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1549,7 +1994,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateVnfResourceNameInAAITest() throws Exception {
+ public void validateResourceIdInAAIVnfNotGloballyUniqueTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1571,7 +2016,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateNetworkResourceIdInAAITest() throws Exception {
+ public void validateResourceIdInAAINetworkTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1631,7 +2076,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateVfModuleResourceIdInAAITest() throws Exception {
+ public void validateResourceIdInAAIVfModuleTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1674,11 +2119,28 @@ public class WorkflowActionTest extends BaseTaskTest {
"vfModule with name (vFModName222), same parent and different customization id (1234567) already exists. The name must be unique."));
workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VFMODULE, "vFModName222", reqDetails,
workflowResourceIds);
+ }
+
+ @Test
+ public void validateResourceIdInAAIVfModuleNotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("id111");
+ GenericVnf vnf1 = new GenericVnf();
+ workflowResourceIds.setVnfId("id111");
+ when(bbSetupUtils.getAAIGenericVnf("id111")).thenReturn(vnf1);
+
+ when(bbSetupUtils.existsAAIVfModuleGloballyByName("vFModName333")).thenReturn(true);
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("vfModule with name vFModName333 already exists. The name must be unique."));
+ workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VFMODULE, "vFModName333", reqDetails,
+ workflowResourceIds);
}
@Test
- public void validateVolumeGroupResourceIdInAAITest() throws Exception {
+ public void validateResourceIdInAAIVolumeGroupTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1697,6 +2159,7 @@ public class WorkflowActionTest extends BaseTaskTest {
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("id123");
volumeGroup.setVolumeGroupName("name123");
+ volumeGroup.setVfModuleModelCustomizationId("1234567");
workflowResourceIds.setVnfId("id123");
Optional<VolumeGroup> opVolumeGroup = Optional.of(volumeGroup);
@@ -1719,7 +2182,25 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateConfigurationResourceIdInAAITest() throws Exception {
+ public void validatesourceIdInAAIVolumeGroupNotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("id123");
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ when(bbSetupUtils.getAAIGenericVnf("id123")).thenReturn(vnf);
+ when(bbSetupUtils.getRelatedVolumeGroupByNameFromVnf("id123", "testVolumeGroup")).thenReturn(Optional.empty());
+
+ when(bbSetupUtils.existsAAIVolumeGroupGloballyByName("testVolumeGroup")).thenReturn(true);
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("volumeGroup with name testVolumeGroup already exists. The name must be unique."));
+ workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "testVolumeGroup",
+ reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateResourceIdInAAIConfigurationTest() throws Exception {
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
@@ -1761,7 +2242,23 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateServiceInstanceResourceIdInAAITest() throws Exception {
+ public void validateResourceIdInAAIConfigurationNotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ when(bbSetupUtils.getRelatedConfigurationByNameFromServiceInstance("siId123", "testConfig"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAIConfigurationGloballyByName("testConfig")).thenReturn(true);
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("configuration with name testConfig already exists. The name must be unique."));
+ workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.CONFIGURATION, "testConfig", reqDetails,
+ workflowResourceIds);
+ }
+
+ @Test
+ public void validateResourceIdInAAISITest() throws Exception {
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
@@ -1803,7 +2300,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateServiceInstanceResourceIdInAAIMultipleTest() throws Exception {
+ public void validateResourceIdInAAIMultipleSITest() throws Exception {
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
@@ -1834,7 +2331,7 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
- public void validateServiceInstanceResourceIdInAAIExistsTest() throws Exception {
+ public void validateResourceIdInAAISIExistsTest() throws Exception {
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId("siId123");
RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
@@ -1865,6 +2362,490 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
+ public void validateServiceResourceIdInAAINoDupTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ reqDetails.getModelInfo().setModelVersionId("1234567");
+ when(bbSetupUtils.getAAIServiceInstanceByName("id123", "subServiceType123", "siName123"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.getAAIServiceInstancesGloballyByName("siName123")).thenReturn(null);
+ String id = workflowAction.validateServiceResourceIdInAAI("generatedId123", "siName123", reqDetails);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateServiceResourceIdInAAISameModelVersionId() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ reqDetails.getModelInfo().setModelVersionId("1234567");
+
+ ServiceInstance si = new ServiceInstance();
+ si.setServiceInstanceId("siId123");
+ si.setModelVersionId("1234567");
+ Optional<ServiceInstance> siOp = Optional.of(si);
+
+ when(bbSetupUtils.getAAIServiceInstanceByName("id123", "subServiceType123", "siName123")).thenReturn(siOp);
+ String id = workflowAction.validateServiceResourceIdInAAI("generatedId123", "siName123", reqDetails);
+ assertEquals("siId123", id);
+ }
+
+ @Test
+ public void validateServiceResourceIdInAAIDifferentModelVersionId() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ reqDetails.getModelInfo().setModelVersionId("1234567");
+
+ ServiceInstance si = new ServiceInstance();
+ si.setServiceInstanceId("siId123");
+ si.setModelVersionId("9999999");
+ ServiceInstances serviceInstances = new ServiceInstances();
+ serviceInstances.getServiceInstance().add(si);
+ Optional<ServiceInstance> siOp = Optional.of(si);
+
+ when(bbSetupUtils.getAAIServiceInstanceByName("id123", "subServiceType123", "siName123")).thenReturn(siOp);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "serviceInstance with name (siName123) and different version id (1234567) already exists. The name must be unique."));
+
+ String id = workflowAction.validateServiceResourceIdInAAI("generatedId123", "siName123", reqDetails);
+ assertEquals("siId123", id);
+ }
+
+ @Test
+ public void validateServiceResourceIdInAAIDuplicateNameTest() throws Exception {
+
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ reqDetails.getModelInfo().setModelVersionId("1234567");
+
+ ServiceInstance si = new ServiceInstance();
+ si.setServiceInstanceId("siId123");
+ si.setModelVersionId("1234567");
+
+ ServiceInstances serviceInstances = new ServiceInstances();
+ serviceInstances.getServiceInstance().add(si);
+
+ when(bbSetupUtils.getAAIServiceInstanceByName("id123", "subServiceType123", "siName"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.getAAIServiceInstancesGloballyByName("siName")).thenReturn(serviceInstances);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "serviceInstance with name (siName) and global-customer-id (null), service-type (null), model-version-id (1234567) already exists. The name must be unique."));
+
+ workflowAction.validateServiceResourceIdInAAI("generatedId123", "siName", reqDetails);
+ }
+
+ @Test
+ public void validateServiceResourceIdInAAIDuplicateNameMultipleTest() throws Exception {
+
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ reqDetails.getModelInfo().setModelVersionId("1234567");
+
+ ServiceInstance si = new ServiceInstance();
+ si.setServiceInstanceId("siId123");
+ si.setModelVersionId("1234567");
+
+ ServiceInstance si2 = new ServiceInstance();
+ si2.setServiceInstanceId("siId222");
+ si2.setModelVersionId("22222");
+ si2.setServiceInstanceName("siName222");
+
+ ServiceInstances serviceInstances = new ServiceInstances();
+ serviceInstances.getServiceInstance().add(si);
+ serviceInstances.getServiceInstance().add(si2);
+
+ when(bbSetupUtils.getAAIServiceInstanceByName("id123", "subServiceType123", "siName"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.getAAIServiceInstancesGloballyByName("siName")).thenReturn(serviceInstances);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "serviceInstance with name (siName) and multiple combination of model-version-id + service-type + global-customer-id already exists. The name must be unique."));
+
+ workflowAction.validateServiceResourceIdInAAI("generatedId123", "siName", reqDetails);
+ }
+
+ @Test
+ public void validateNetworkResourceIdInAAITest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ when(bbSetupUtils.getRelatedNetworkByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAINetworksGloballyByName("name123")).thenReturn(false);
+
+ String id = workflowAction.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateNetworkResourceIdInAAISameModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ L3Network network = new L3Network();
+ network.setNetworkId("id123");
+ network.setNetworkName("name123");
+ network.setModelCustomizationId("1234567");
+ Optional<L3Network> opNetwork = Optional.of(network);
+
+ when(bbSetupUtils.getRelatedNetworkByNameFromServiceInstance("siId123", "name123")).thenReturn(opNetwork);
+
+ String id = workflowAction.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("id123", id);
+ }
+
+ @Test
+ public void validateNetworkResourceIdInAAIDuplicateNameTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ L3Network network = new L3Network();
+ network.setNetworkId("id123");
+ network.setNetworkName("name123");
+ network.setModelCustomizationId("9999999");
+ Optional<L3Network> opNetwork = Optional.of(network);
+
+ when(bbSetupUtils.getRelatedNetworkByNameFromServiceInstance("siId123", "name123")).thenReturn(opNetwork);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "l3Network with name (name123), same parent and different customization id (9999999) already exists. The name must be unique."));
+
+ workflowAction.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateNetworkResourceIdInAAINotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ when(bbSetupUtils.getRelatedNetworkByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAINetworksGloballyByName("name123")).thenReturn(true);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "l3Network with name (name123) id (siId123) and different parent relationship already exists. The name must be unique."));
+
+ workflowAction.validateNetworkResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateVnfResourceIdInAAITest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+ when(bbSetupUtils.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(Optional.empty());
+ String id = workflowAction.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails,
+ workflowResourceIds);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateVnfResourceIdInAAISameModelCustomizationIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ vnf.setVnfName("vnfName123");
+ vnf.setModelCustomizationId("1234567");
+ Optional<GenericVnf> opVnf = Optional.of(vnf);
+
+ when(bbSetupUtils.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(opVnf);
+ String id = workflowAction.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails,
+ workflowResourceIds);
+ assertEquals("id123", id);
+ }
+
+ @Test
+ public void validateVnfResourceIdInAAIDiffModelCustomizationIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ vnf.setVnfName("vnfName123");
+ vnf.setModelCustomizationId("9999999");
+ Optional<GenericVnf> opVnf = Optional.of(vnf);
+
+ when(bbSetupUtils.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(opVnf);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "generic-vnf with name (vnfName123), same parent and different customization id (9999999) already exists. The name must be unique."));
+
+ workflowAction.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateVnfResourceIdInAAINotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ vnf.setVnfName("vnfName123");
+ GenericVnfs genericVnfs = new GenericVnfs();
+ genericVnfs.getGenericVnf().add(vnf);
+
+ when(bbSetupUtils.getRelatedVnfByNameFromServiceInstance("siId123", "vnfName123")).thenReturn(Optional.empty());
+ when(bbSetupUtils.getAAIVnfsGloballyByName("vnfName123")).thenReturn(genericVnfs);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "generic-vnf with name (vnfName123) id (id123) and different parent relationship already exists. The name must be unique."));
+
+ workflowAction.validateVnfResourceIdInAAI("generatedId123", "vnfName123", reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateVfModuleResourceIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ when(bbSetupUtils.getAAIGenericVnf("id123")).thenReturn(null);
+ when(bbSetupUtils.existsAAIVfModuleGloballyByName("name123")).thenReturn(false);
+
+ String id = workflowAction.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateVfModuleResourceIdSameModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ VfModules vfModules = new VfModules();
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("id123");
+ vfModule.setVfModuleName("name123");
+ vfModule.setModelCustomizationId("1234567");
+ vfModules.getVfModule().add(vfModule);
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ vnf.setVnfName("vnfName123");
+ vnf.setVfModules(vfModules);
+
+ when(bbSetupUtils.getAAIGenericVnf("vnfId123")).thenReturn(vnf);
+
+ String id = workflowAction.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("id123", id);
+ }
+
+ @Test
+ public void validateVfModuleResourceIdDifferentModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ VfModules vfModules = new VfModules();
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("id123");
+ vfModule.setVfModuleName("name123");
+ vfModule.setModelCustomizationId("9999999");
+ vfModules.getVfModule().add(vfModule);
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("id123");
+ vnf.setVnfName("vnfName123");
+ vnf.setVfModules(vfModules);
+
+ when(bbSetupUtils.getAAIGenericVnf("vnfId123")).thenReturn(vnf);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "vfModule with name (name123), same parent and different customization id (1234567) already exists. The name must be unique."));
+
+ workflowAction.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
+
+ }
+
+ @Test
+ public void validateVfModuleResourceIdNotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ when(bbSetupUtils.getAAIGenericVnf("id123")).thenReturn(null);
+ when(bbSetupUtils.existsAAIVfModuleGloballyByName("name123")).thenReturn(true);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException
+ .expectMessage(containsString("vfModule with name name123 already exists. The name must be unique."));
+
+ workflowAction.validateVfModuleResourceIdInAAI("generatedId123", "name123", reqDetails, workflowResourceIds);
+ }
+
+ @Test
+ public void validateVolumeGroupResourceIdInAAITest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ when(bbSetupUtils.getRelatedVolumeGroupByNameFromVnf("id123", "name123")).thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAIVolumeGroupGloballyByName("name123")).thenReturn(false);
+
+ String id = workflowAction.validateVolumeGroupResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateVolumeGroupResourceIdInAAISameModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+ workflowResourceIds.setVnfId("vnfId123");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("id123");
+ volumeGroup.setVolumeGroupName("name123");
+ volumeGroup.setVfModuleModelCustomizationId("1234567");
+
+ Optional<VolumeGroup> opVolumeGroup = Optional.of(volumeGroup);
+
+ when(bbSetupUtils.getRelatedVolumeGroupByNameFromVnf("vnfId123", "name123")).thenReturn(opVolumeGroup);
+ String id = workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "name123",
+ reqDetails, workflowResourceIds);
+
+ assertEquals("id123", id);
+ }
+
+ @Test
+ public void validateVolumeGroupResourceIdInAAIDifferentModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+ workflowResourceIds.setVnfId("vnfId123");
+
+ VolumeGroup volumeGroup = new VolumeGroup();
+ volumeGroup.setVolumeGroupId("id123");
+ volumeGroup.setVolumeGroupName("name123");
+ volumeGroup.setVfModuleModelCustomizationId("9999999");
+
+ Optional<VolumeGroup> opVolumeGroup = Optional.of(volumeGroup);
+
+ when(bbSetupUtils.getRelatedVolumeGroupByNameFromVnf("vnfId123", "name123")).thenReturn(opVolumeGroup);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("volumeGroup with name name123 already exists. The name must be unique."));
+
+ workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "name123", reqDetails,
+ workflowResourceIds);
+ }
+
+ @Test
+ public void validateVolumeGroupResourceIdInAAINotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setVnfId("vnfId123");
+
+ when(bbSetupUtils.getRelatedVolumeGroupByNameFromVnf("vnfId123", "name123")).thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAIVolumeGroupGloballyByName("name123")).thenReturn(true);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("volumeGroup with name name123 already exists. The name must be unique."));
+
+ workflowAction.validateResourceIdInAAI("generatedId123", WorkflowType.VOLUMEGROUP, "name123", reqDetails,
+ workflowResourceIds);
+ }
+
+ @Test
+ public void validateConfigurationResourceIdInAAITest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ when(bbSetupUtils.getRelatedConfigurationByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAIConfigurationGloballyByName("name123")).thenReturn(false);
+
+ String id = workflowAction.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("generatedId123", id);
+ }
+
+ @Test
+ public void validateConfigurationResourceIdInAAISameModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration();
+ configuration.setConfigurationId("id123");
+ configuration.setConfigurationName("name123");
+ configuration.setModelCustomizationId("1234567");
+ Optional<org.onap.aai.domain.yang.Configuration> opConfiguration = Optional.of(configuration);
+
+ when(bbSetupUtils.getRelatedConfigurationByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(opConfiguration);
+ when(bbSetupUtils.existsAAIConfigurationGloballyByName("name123")).thenReturn(false);
+
+ String id = workflowAction.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ assertEquals("id123", id);
+ }
+
+ @Test
+ public void validateConfigurationResourceIdInAAIDifferentModelCustIdTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration();
+ configuration.setConfigurationId("id123");
+ configuration.setConfigurationName("name123");
+ configuration.setModelCustomizationId("9999999");
+ Optional<org.onap.aai.domain.yang.Configuration> opConfiguration = Optional.of(configuration);
+
+ when(bbSetupUtils.getRelatedConfigurationByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(opConfiguration);
+ when(bbSetupUtils.existsAAIConfigurationGloballyByName("name123")).thenReturn(false);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(containsString(
+ "configuration with name (name123), same parent and different customization id (id123) already exists. The name must be unique."));
+
+ workflowAction.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ }
+
+ @Test
+ public void validateConfigurationResourceIdInAAINotGloballyUniqueTest() throws Exception {
+ RequestDetails reqDetails = setupRequestDetails("id123", "subServiceType123", "1234567");
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId("siId123");
+
+ when(bbSetupUtils.getRelatedConfigurationByNameFromServiceInstance("siId123", "name123"))
+ .thenReturn(Optional.empty());
+ when(bbSetupUtils.existsAAIConfigurationGloballyByName("name123")).thenReturn(true);
+
+ this.expectedException.expect(DuplicateNameException.class);
+ this.expectedException.expectMessage(
+ containsString("configuration with name name123 already exists. The name must be unique."));
+
+ workflowAction.validateConfigurationResourceIdInAAI("generatedId123", "name123", reqDetails,
+ workflowResourceIds);
+ }
+
+ @Test
public void handleRuntimeExceptionTest() {
execution.setVariable("BPMN_javaExpMsg", "test runtime error message");
execution.setVariable("testProcessKey", "testProcessKeyValue");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
index d6485bd57f..109dc55294 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
@@ -106,7 +106,7 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup {
expectedCreateNetworkRequest.setNetworkName(l3Network.getNetworkName());
expectedCreateNetworkRequest.setNetworkType(l3Network.getNetworkType());
expectedCreateNetworkRequest.setBackout(false);
- expectedCreateNetworkRequest.setFailIfExists(true);
+ expectedCreateNetworkRequest.setFailIfExists(false);
expectedCreateNetworkRequest.setNetworkTechnology("CONTRAIL");
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId(requestContext.getMsoRequestId());
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
index 4450e4a9f4..a482da5158 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
@@ -34,7 +34,6 @@ import java.util.List;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
@@ -135,7 +134,7 @@ public class VnfAdapterObjectMapperTest {
expectedCreateVolumeGroupRequest.setSkipAAI(true);
expectedCreateVolumeGroupRequest
.setSuppressBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
- expectedCreateVolumeGroupRequest.setFailIfExists(true);
+ expectedCreateVolumeGroupRequest.setFailIfExists(false);
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId(requestContext.getMsoRequestId());
@@ -151,7 +150,23 @@ public class VnfAdapterObjectMapperTest {
CreateVolumeGroupRequest actualCreateVolumeGroupRequest =
vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext,
serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
+ assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
+
+ doReturn("false").when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
+ actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext,
+ cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
+ assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
+
+ doReturn(null).when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
+ expectedCreateVolumeGroupRequest.setEnableBridge(true);
+ actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext,
+ cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
+ assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
+ doReturn("true").when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
+ expectedCreateVolumeGroupRequest.setEnableBridge(true);
+ actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext,
+ cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
}
@@ -215,7 +230,7 @@ public class VnfAdapterObjectMapperTest {
expectedCreateVolumeGroupRequest.setSkipAAI(true);
expectedCreateVolumeGroupRequest
.setSuppressBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
- expectedCreateVolumeGroupRequest.setFailIfExists(true);
+ expectedCreateVolumeGroupRequest.setFailIfExists(false);
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId(requestContext.getMsoRequestId());
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
index 44a08139d6..836f8c1842 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
@@ -23,6 +23,7 @@ package org.onap.so.client.adapter.vnf.mapper;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -32,6 +33,7 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import org.mockito.Mockito;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVmNetworkData;
import org.onap.so.adapters.vnfrest.CreateVfModuleRequest;
import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest;
@@ -46,6 +48,7 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.openstack.utils.MsoMulticloudUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.onap.so.client.adapter.vnf.mapper.exceptions.MissingValueTagException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -56,6 +59,9 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
private VnfAdapterVfModuleObjectMapper vfModuleObjectMapper = new VnfAdapterVfModuleObjectMapper();
private ObjectMapper omapper = new ObjectMapper();
+ @Autowired
+ protected VnfAdapterObjectMapperUtils vnfAdapterObjectMapperUtils;
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
@@ -128,16 +134,35 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
String sdncVfModuleQueryResponse = new String(Files
.readAllBytes(Paths.get(JSON_FILE_LOCATION + "genericResourceApiVfModuleSdncVfModuleTopology.json")));
+ VnfAdapterVfModuleObjectMapper spyMapper = Mockito.spy(vfModuleObjectMapper);
+
+ doReturn("false").when(spyMapper).getProperty("mso.bridgeEnabled");
CreateVfModuleRequest vfModuleVNFAdapterRequest =
- vfModuleObjectMapper.createVfModuleRequestMapper(requestContext, cloudRegion, orchestrationContext,
+ spyMapper.createVfModuleRequestMapper(requestContext, cloudRegion, orchestrationContext,
serviceInstance, vnf, vfModule, null, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
-
-
String jsonToCompare =
new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "vnfAdapterCreateVfModuleRequest.json")));
-
CreateVfModuleRequest reqMapper1 = omapper.readValue(jsonToCompare, CreateVfModuleRequest.class);
+ assertThat(vfModuleVNFAdapterRequest, sameBeanAs(reqMapper1).ignoring("messageId").ignoring("notificationUrl"));
+
+ doReturn("true").when(spyMapper).getProperty("mso.bridgeEnabled");
+ vfModuleVNFAdapterRequest =
+ spyMapper.createVfModuleRequestMapper(requestContext, cloudRegion, orchestrationContext,
+ serviceInstance, vnf, vfModule, null, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
+ jsonToCompare = new String(Files
+ .readAllBytes(Paths.get(JSON_FILE_LOCATION + "vnfAdapterCreateVfModuleRequestBridgeEnabled.json")));
+ reqMapper1 = omapper.readValue(jsonToCompare, CreateVfModuleRequest.class);
+ assertThat(vfModuleVNFAdapterRequest, sameBeanAs(reqMapper1).ignoring("messageId").ignoring("notificationUrl"));
+
+
+ doReturn(null).when(spyMapper).getProperty("mso.bridgeEnabled");
+ vfModuleVNFAdapterRequest =
+ spyMapper.createVfModuleRequestMapper(requestContext, cloudRegion, orchestrationContext,
+ serviceInstance, vnf, vfModule, null, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
+ jsonToCompare = new String(Files
+ .readAllBytes(Paths.get(JSON_FILE_LOCATION + "vnfAdapterCreateVfModuleRequestBridgeEnabled.json")));
+ reqMapper1 = omapper.readValue(jsonToCompare, CreateVfModuleRequest.class);
assertThat(vfModuleVNFAdapterRequest, sameBeanAs(reqMapper1).ignoring("messageId").ignoring("notificationUrl"));
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
index 68f3d20c82..9855c8587a 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
@@ -96,14 +96,12 @@ public class AAIConfigurationResourcesTest extends TestDataSetup {
public void createConfigurationTest() {
doReturn(new org.onap.aai.domain.yang.Configuration()).when(MOCK_aaiObjectMapper)
.mapConfiguration(configuration);
- doNothing().when(MOCK_aaiResourcesClient).create(isA(AAIResourceUri.class),
- isA(org.onap.aai.domain.yang.Configuration.class));
-
+ doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ any(Optional.class));
aaiConfigurationResources.createConfiguration(configuration);
assertEquals(OrchestrationStatus.INVENTORIED, configuration.getOrchestrationStatus());
- verify(MOCK_aaiResourcesClient, times(1)).create(any(AAIResourceUri.class),
- isA(org.onap.aai.domain.yang.Configuration.class));
+ verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
index 0d48a29ca9..425b595686 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
@@ -20,8 +20,10 @@
package org.onap.so.client.orchestration;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -31,6 +33,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
@@ -49,16 +53,20 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIRestClientImpl;
import org.onap.so.client.aai.AAIValidatorImpl;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
@RunWith(MockitoJUnitRunner.Silent.class)
public class AAIVnfResourcesTest extends TestDataSetup {
+ private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
+
private GenericVnf genericVnf;
private ServiceInstance serviceInstance;
@@ -227,6 +235,7 @@ public class AAIVnfResourcesTest extends TestDataSetup {
boolean isVnfPserversLockedFlag = aaiVnfResources.checkVnfPserversLockedFlag("vnfId");
verify(MOCK_aaiResourcesClient, times(1)).get(eq(org.onap.aai.domain.yang.GenericVnf.class),
isA(AAIResourceUri.class));
+ verify(MOCK_aaiValidatorImpl, times(1)).setClient(isA(AAIRestClientImpl.class));
verify(MOCK_aaiValidatorImpl, times(1)).isPhysicalServerLocked(isA(String.class));
assertTrue(isVnfPserversLockedFlag);
}
@@ -249,4 +258,37 @@ public class AAIVnfResourcesTest extends TestDataSetup {
boolean nameInUse = aaiVnfResources.checkNameInUse("vnfName");
assertFalse(nameInUse);
}
+
+ @Test
+ public void queryVnfWrapperByIdTest() throws Exception {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "vnfId").depth(Depth.ALL);
+ final String aaiResponse = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnf.json")));
+ GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId("vnfId");
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiResponse);
+ doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(eq(uri));
+ AAIResultWrapper actualResult = aaiVnfResources.queryVnfWrapperById(genericVnf);
+ assertEquals(actualResult, aaiResultWrapper);
+
+ }
+
+ @Test
+ public void getVserverTest() throws Exception {
+ final String content =
+ new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json")));
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(content);
+ Optional<org.onap.aai.domain.yang.Vserver> oVserver = Optional.empty();
+ AAIResourceUri vserverUri = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, "ModelInvariantUUID",
+ "serviceModelVersionId", "abc", "abc");
+
+ doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(isA(AAIResourceUri.class));
+ oVserver = aaiVnfResources.getVserver(vserverUri);
+
+ verify(MOCK_aaiResourcesClient, times(1)).get(any(AAIResourceUri.class));
+
+ if (oVserver.isPresent()) {
+ org.onap.aai.domain.yang.Vserver vserver = oVserver.get();
+ assertThat(aaiResultWrapper.asBean(org.onap.aai.domain.yang.Vserver.class).get(), sameBeanAs(vserver));
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java
index 9c736b7634..a8816e1b04 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java
@@ -21,6 +21,7 @@
package org.onap.so.client.sdn.common;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import java.util.LinkedHashMap;
import org.junit.Assert;
import org.junit.Rule;
@@ -29,6 +30,8 @@ import org.junit.rules.ExpectedException;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SdnCommonTasks;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
public class SdnCommonTasksTest {
@@ -53,7 +56,20 @@ public class SdnCommonTasksTest {
@Test
public void getHttpHeadersTest() {
- Assert.assertNotNull(sdnCommonTasks.getHttpHeaders(""));
+ HttpHeaders result = sdnCommonTasks.getHttpHeaders("auth", true);
+
+ assertEquals("auth", result.getFirst("Authorization"));
+ assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Content-Type"));
+ assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Accept"));
+ }
+
+ @Test
+ public void getHttpHeadersGetRequestTest() {
+ HttpHeaders result = sdnCommonTasks.getHttpHeaders("auth", false);
+
+ assertEquals("auth", result.getFirst("Authorization"));
+ assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Accept"));
+ assertFalse(result.containsKey("Content-Type"));
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
index b71ddba63b..2fd684e0f0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
@@ -334,4 +334,69 @@ public class VfModuleTopologyOperationRequestMapperTest {
serviceInstance, customer, cloudRegion, requestContext, null, new URI("http://localhost:8080"));
}
+ @Test
+ public void reqMapperChangeAssignTest() throws Exception {
+
+ // prepare and set service instance
+ ServiceInstance serviceInstance = new ServiceInstance();
+ serviceInstance.setServiceInstanceId("serviceInstanceId");
+ ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
+ modelInfoServiceInstance.setModelInvariantUuid("serviceModelInvariantUuid");
+ modelInfoServiceInstance.setModelName("serviceModelName");
+ modelInfoServiceInstance.setModelUuid("serviceModelUuid");
+ modelInfoServiceInstance.setModelVersion("serviceModelVersion");
+
+ serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
+ // prepare Customer object
+ Customer customer = new Customer();
+ customer.setGlobalCustomerId("globalCustomerId");
+ customer.setServiceSubscription(new ServiceSubscription());
+ // set Customer on service instance
+ customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
+ //
+ RequestContext requestContext = new RequestContext();
+ RequestParameters requestParameters = new RequestParameters();
+ HashMap<String, Object> userParams1 = new HashMap<>();
+ userParams1.put("key1", "value1");
+ List<Map<String, Object>> userParams = new ArrayList<>();
+ userParams.add(userParams1);
+
+ requestParameters.setUserParams(userParams);
+ requestContext.setRequestParameters(requestParameters);
+ requestContext.setProductFamilyId("productFamilyId");
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("testVnfId");
+ vnf.setVnfType("testVnfType");
+ ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setModelInvariantUuid("vnfModelInvariantUuid");
+ modelInfoGenericVnf.setModelName("vnfModelName");
+ modelInfoGenericVnf.setModelVersion("vnfModelVersion");
+ modelInfoGenericVnf.setModelUuid("vnfModelUuid");
+ modelInfoGenericVnf.setModelCustomizationUuid("vnfModelCustomizationUuid");
+ vnf.setModelInfoGenericVnf(modelInfoGenericVnf);
+
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("testVfModuleId");
+ vfModule.setVfModuleName("testVfModuleName");
+ ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
+ modelInfoVfModule.setModelInvariantUUID("vfModuleModelInvariantUuid");
+ modelInfoVfModule.setModelName("vfModuleModelName");
+ modelInfoVfModule.setModelVersion("vfModuleModelVersion");
+ modelInfoVfModule.setModelUUID("vfModuleModelUuid");
+ modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
+ vfModule.setModelInfoVfModule(modelInfoVfModule);
+
+ CloudRegion cloudRegion = new CloudRegion();
+
+ GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
+ SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN, vfModule, null, vnf,
+ serviceInstance, customer, cloudRegion, requestContext, null, new URI("http://localhost:8080"));
+
+ assertEquals("vnfModelCustomizationUuid",
+ vfModuleSDNCrequest.getVnfInformation().getOnapModelInformation().getModelCustomizationUuid());
+ assertEquals("vfModuleModelCustomizationUuid",
+ vfModuleSDNCrequest.getVfModuleInformation().getOnapModelInformation().getModelCustomizationUuid());
+ }
+
}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json
index d7e282dda7..19d42dddb9 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json
@@ -33,7 +33,7 @@
"policyFqdns": [],
"routeTableFqdns": []
},
- "failIfExists": true,
+ "failIfExists": false,
"backout": false,
"msoRequest": {
"requestId": "6cfde724-76c7-4747-bcb3-67a59a46ca95",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleAddonRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleAddonRequest.json
index f655e9aa13..b57c8341f1 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleAddonRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleAddonRequest.json
@@ -12,7 +12,8 @@
"baseVfModuleStackId": "baseVfModuleStackId",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
index 3387b6d87e..19acec0373 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json
@@ -10,7 +10,7 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestBridgeEnabled.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestBridgeEnabled.json
new file mode 100644
index 0000000000..a02b1c901d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestBridgeEnabled.json
@@ -0,0 +1,71 @@
+{
+ "cloudSiteId": "cloudRegionId",
+ "tenantId": "tenantId",
+ "vnfId": "vnfId",
+ "vnfType": "vnfType",
+ "vfModuleId": "vfModuleId",
+ "vfModuleName": "vfModuleName",
+ "vfModuleType": "vfModuleModelName",
+ "vnfVersion": "serviceModelVersion",
+ "modelCustomizationUuid": "vfModuleModelCustomizationUuid",
+ "skipAAI": true,
+ "backout": false,
+ "failIfExists": false,
+ "enableBridge": true,
+ "msoRequest":
+ {
+ "requestId": "requestId",
+ "serviceInstanceId": "serviceInstanceId"
+ },
+
+ "vfModuleParams":
+ {
+ "vnf_id": "vnfId",
+ "vnf_name": "vnfName",
+ "vf_module_id": "vfModuleId",
+ "vf_module_index": "1",
+ "vf_module_name": "vfModuleName",
+ "environment_context": "environmentContext",
+ "fw_0_subint_ctrl_port_0_ip": "ip0,ip1",
+ "fw_0_subint_ctrl_port_0_ip_0": "ip0",
+ "fw_0_subint_ctrl_port_0_ip_1": "ip1",
+ "fw_0_subint_ctrl_port_0_net_ids": "networkId0",
+ "fw_0_subint_ctrl_port_0_net_names": "1",
+ "fw_subint_ctrl_port_0_subintcount": "1",
+ "fw_0_subint_ctrl_port_0_v6_ip": "ip0,ip1",
+ "fw_0_subint_ctrl_port_0_v6_ip_0": "ip0",
+ "fw_0_subint_ctrl_port_0_v6_ip_1": "ip1",
+ "fw_0_subint_ctrl_port_0_vlan_ids": "1",
+ "fw_subint_ctrl_port_0_floating_ip": "floatingIpV40",
+ "fw_subint_ctrl_port_0_floating_v6_ip": "floatingIpV60",
+ "workload_context": "workloadContext",
+ "key1": "value2",
+ "key3": "value3",
+ "availability_zone_0": "zone0",
+ "availability_zone_1": "zone1",
+ "availability_zone_2": "zone2",
+ "vnfNetworkRole0_net_fqdn": "netFqdnValue0",
+ "vnfNetworkRole0_net_id": "neutronId0",
+ "vnfNetworkRole0_net_name": "netName0",
+ "vnfNetworkRole0_subnet_id": "subnetId0",
+ "vnfNetworkRole0_v6_subnet_id": "subnetId1",
+ "vmType0_name_0": "vmName0",
+ "vmType0_name_1": "vmName1",
+ "vmType0_names": "vmName0,vmName1",
+ "vmType0_vmNetworkRole0_floating_ip": "floatingIpV40",
+ "vmType0_vmNetworkRole0_floating_v6_ip": "floatingIpV60",
+ "vmType0_vmNetworkRole0_route_prefixes": "[{\"interface_route_table_routes_route_prefix\": \"interfaceRoutePrefix0\"},{\"interface_route_table_routes_route_prefix\": \"interfaceRoutePrefix1\"}]",
+ "vmNetworkRole0_ATT_VF_VLAN_FILTER": "heatVlanFilter0,heatVlanFilter1",
+ "vmType0_vmNetworkRole0_ip_0": "ip0",
+ "vmType0_vmNetworkRole0_ip_1": "ip1",
+ "vmType0_vmNetworkRole0_ips": "ip0,ip1",
+ "vmType0_vmNetworkRole0_v6_ip_0": "ip2",
+ "vmType0_vmNetworkRole0_v6_ip_1": "ip3",
+ "vmType0_vmNetworkRole0_v6_ips": "ip2,ip3",
+ "paramOne": "paramOneValue",
+ "paramTwo": "paramTwoValue",
+ "paramThree": "paramThreeValue",
+ "sdnc_directives": "{ \"attributes\": [ {\"attribute_name\": \"key1\", \"attribute_value\": \"value1\"}, {\"attribute_name\": \"fw_subint_ctrl_port_0_subintcount\", \"attribute_value\": \"1\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_floating_ip\", \"attribute_value\": \"floatingIpV40\"}, {\"attribute_name\": \"paramOne\", \"attribute_value\": \"paramOneValue\"}, {\"attribute_name\": \"vmType0_name_0\", \"attribute_value\": \"vmName0\"}, {\"attribute_name\": \"vnfNetworkRole0_v6_subnet_id\", \"attribute_value\": \"subnetId1\"}, {\"attribute_name\": \"vmType0_name_1\", \"attribute_value\": \"vmName1\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_ip_1\", \"attribute_value\": \"ip1\"}, {\"attribute_name\": \"vnfNetworkRole0_net_name\", \"attribute_value\": \"netName0\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_ip_0\", \"attribute_value\": \"ip0\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_vlan_ids\", \"attribute_value\": \"1\"}, {\"attribute_name\": \"vnfNetworkRole0_net_id\", \"attribute_value\": \"neutronId0\"}, {\"attribute_name\": \"availability_zone_0\", \"attribute_value\": \"zone0\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_v6_ip_1\", \"attribute_value\": \"ip3\"}, {\"attribute_name\": \"availability_zone_1\", \"attribute_value\": \"zone1\"}, {\"attribute_name\": \"fw_subint_ctrl_port_0_floating_v6_ip\", \"attribute_value\": \"floatingIpV60\"}, {\"attribute_name\": \"availability_zone_2\", \"attribute_value\": \"zone2\"}, {\"attribute_name\": \"vmType0_names\", \"attribute_value\": \"vmName0,vmName1\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_route_prefixes\", \"attribute_value\": \"[{\"interface_route_table_routes_route_prefix\": \"interfaceRoutePrefix0\"},{\"interface_route_table_routes_route_prefix\": \"interfaceRoutePrefix1\"}]\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_v6_ip_0\", \"attribute_value\": \"ip2\"}, {\"attribute_name\": \"vnfNetworkRole0_subnet_id\", \"attribute_value\": \"subnetId0\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_v6_ip_1\", \"attribute_value\": \"ip1\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_ip_1\", \"attribute_value\": \"ip1\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_ip_0\", \"attribute_value\": \"ip0\"}, {\"attribute_name\": \"vnfNetworkRole0_net_fqdn\", \"attribute_value\": \"netFqdnValue0\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_v6_ip_0\", \"attribute_value\": \"ip0\"}, {\"attribute_name\": \"vmNetworkRole0_ATT_VF_VLAN_FILTER\", \"attribute_value\": \"heatVlanFilter0,heatVlanFilter1\"}, {\"attribute_name\": \"paramTwo\", \"attribute_value\": \"paramTwoValue\"}, {\"attribute_name\": \"paramThree\", \"attribute_value\": \"paramThreeValue\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_v6_ips\", \"attribute_value\": \"ip2,ip3\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_floating_v6_ip\", \"attribute_value\": \"floatingIpV60\"}, {\"attribute_name\": \"vmType0_vmNetworkRole0_ips\", \"attribute_value\": \"ip0,ip1\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_ip\", \"attribute_value\": \"ip0,ip1\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_net_names\", \"attribute_value\": \"1\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_net_ids\", \"attribute_value\": \"networkId0\"}, {\"attribute_name\": \"fw_0_subint_ctrl_port_0_v6_ip\", \"attribute_value\": \"ip0,ip1\"}, {\"attribute_name\": \"fw_subint_ctrl_port_0_floating_ip\", \"attribute_value\": \"floatingIpV40\"}] }",
+ "user_directives": "{ \"attributes\": [ {\"attribute_name\": \"key1\", \"attribute_value\": \"value2\"}] }"
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestDhcpDisabled.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestDhcpDisabled.json
index 8721bdc865..ea51d2c6b2 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestDhcpDisabled.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestDhcpDisabled.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestMultipleDhcp.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestMultipleDhcp.json
index 04f64790c4..aa633bf5a8 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestMultipleDhcp.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestMultipleDhcp.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestNoUserParams.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestNoUserParams.json
index 1b57fcd33c..9bddf29433 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestNoUserParams.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestNoUserParams.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestTrueBackout.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestTrueBackout.json
index a13740cf80..4ccfdbe890 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestTrueBackout.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestTrueBackout.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": true,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithCloudResources.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithCloudResources.json
index 5468e21ee3..da826b8a89 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithCloudResources.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithCloudResources.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithSingleAvailabilityZone.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithSingleAvailabilityZone.json
index dd8e62c0a0..3170b8ba54 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithSingleAvailabilityZone.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequestWithSingleAvailabilityZone.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithNoEnvironmentAndWorkloadContextRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithNoEnvironmentAndWorkloadContextRequest.json
index d44b1924cc..be860ace96 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithNoEnvironmentAndWorkloadContextRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithNoEnvironmentAndWorkloadContextRequest.json
@@ -10,7 +10,8 @@
"modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithVolumeGroupRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithVolumeGroupRequest.json
index 0d103926b9..54f6e403ed 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithVolumeGroupRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleWithVolumeGroupRequest.json
@@ -12,7 +12,8 @@
"volumeGroupStackId": "volumeGroupStackId",
"skipAAI": true,
"backout": false,
- "failIfExists": true,
+ "failIfExists": false,
+ "enableBridge": true,
"msoRequest":
{
"requestId": "requestId",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterDeleteVfModuleRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterDeleteVfModuleRequest.json
index 1d2e7d090f..9a3922650f 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterDeleteVfModuleRequest.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterDeleteVfModuleRequest.json
@@ -1,12 +1,13 @@
-{
+{
"cloudSiteId" : "cloudRegionId",
- "tenantId" : "tenantId",
+ "tenantId" : "tenantId",
"vnfId" : "vnfId",
"vfModuleId" : "vfModuleId",
"vfModuleStackId" : "vfModuleName",
"skipAAI" : true,
+ "modelCustomizationUuid": "vfModuleModelCustomizationUuid",
"msoRequest" : {
"requestId" : "requestId",
- "serviceInstanceId" : "serviceInstanceId"
+ "serviceInstanceId" : "serviceInstanceId"
}
} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json
new file mode 100644
index 0000000000..e997db3f69
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnf.json
@@ -0,0 +1,57 @@
+{
+ "closedLoopDisabled":false,
+ "vnf-id":"vnfId1",
+ "vnf-name":"vnfName",
+ "vnf-type":"vnfType",
+ "orchestration-status":"PRECREATED",
+ "vf-modules": {
+ "vf-module": [{
+ "vf-module-id": "lukewarm",
+ "vf-module-name": "testVfModuleNameGWPrim",
+ "heat-stack-id": "fastburn",
+ "is-base-vf-module": true,
+ "orchestration-status": "Created"
+ },
+ {
+ "vf-module-id": "testVfModuleIdGWSec",
+ "vf-module-name": "testVfModuleNameGWSec",
+ "heat-stack-id": "testHeatStackIdGWSec",
+ "orchestration-status": "Created"
+ }]
+ },
+ "volume-groups":[],
+ "line-of-business":null,
+ "platform":null,
+ "cascaded":false,
+ "cloud-params":{},
+ "cloud-context":null,
+ "solution":null,
+ "vnf-name-2":null,
+ "service-id":null,
+ "regional-resource-zone":null,
+ "prov-status":null,
+ "operational-status":null,
+ "equipment-role":null,
+ "management-option":null,
+ "ipv4-oam-address":null,
+ "ipv4-loopback0-address":null,
+ "nm-lan-v6-address":null,
+ "management-v6-address":null,
+ "vcpu":null,
+ "vcpu-units":null,
+ "vmemory":null,
+ "vmemory-units":null,
+ "vdisk":null,
+ "vdisk-units":null,
+ "in-maint":false,
+ "is-closed-loop-disabled":false,
+ "summary-status":null,
+ "encrypted-access-flag":null,
+ "as-number":null,
+ "regional-resource-subzone":null,
+ "self-link":null,
+ "ipv4-oam-gateway-address":null,
+ "ipv4-oam-gateway-address-prefix-length":null,
+ "vlan-id-outer":null,"nm-profile-name":null,
+ "model-info-generic-vnf":null
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json
new file mode 100644
index 0000000000..0ad0f054b0
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiGenericVnfWithVservers.json
@@ -0,0 +1,434 @@
+{
+ "vnf-id": "example-vnf-id-val-90603",
+ "vnf-name": "example-vnf-name-val-56838",
+ "vnf-name2": "example-vnf-name2-val-56319",
+ "vnf-type": "example-vnf-type-val-30533",
+ "service-id": "example-service-id-val-28290",
+ "regional-resource-zone": "example-regional-resource-zone-val-11059",
+ "prov-status": "example-prov-status-val-59777",
+ "operational-status": "example-operational-status-val-22513",
+ "in-maint": true,
+
+ "equipment-role": "example-equipment-role-val-23396",
+ "orchestration-status": "example-orchestration-status-val-59435",
+ "heat-stack-id": "example-heat-stack-id-val-96869",
+ "mso-catalog-key": "example-mso-catalog-key-val-30721",
+ "management-option": "example-management-option-val-61927",
+ "ipv4-oam-address": "192.168.10.14",
+ "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-87072",
+ "nm-lan-v6-address": "example-nm-lan-v6-address-val-91063",
+ "management-v6-address": "example-management-v6-address-val-80466",
+ "vcpu": 45837298,
+ "vcpu-units": "example-vcpu-units-val-86249",
+ "vmemory": 57288956,
+ "vmemory-units": "example-vmemory-units-val-13291",
+ "vdisk": 16937143,
+ "vdisk-units": "example-vdisk-units-val-73197",
+
+ "is-closed-loop-disabled": true,
+ "summary-status": "example-summary-status-val-86438",
+ "encrypted-access-flag": true,
+
+
+
+
+ "model-invariant-id": "example-model-invariant-id-val-14704",
+ "model-version-id": "example-model-version-id-val-47847",
+ "model-customization-id": "example-model-customization-id-val-52688",
+ "widget-model-id": "example-widget-model-id-val-20939",
+ "widget-model-version": "example-widget-model-version-val-72210",
+ "as-number": "example-as-number-val-68358",
+ "regional-resource-subzone": "example-regional-resource-subzone-val-34391",
+ "nf-type": "example-nf-type-val-54866",
+ "nf-function": "example-nf-function-val-24790",
+ "nf-role": "example-nf-role-val-4780",
+ "nf-naming-code": "example-nf-naming-code-val-25118",
+ "selflink": "example-selflink-val-68404",
+
+ "relationship-list": {"relationship": [
+ {
+ "related-to": "service-instance",
+ "relationship-label": "org.onap.relationships.inventory.ComposedOf",
+ "related-link": "/aai/v12/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/2c323333-af4f-4849-af03-c862c0e93e3b",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "e433710f-9217-458d-a79d-1c7aff376d89"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "VIRTUAL USP"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "2c323333-af4f-4849-af03-c862c0e93e3b"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "kjhgfd1"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm003"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "14551849-1e70-45cd-bc5d-a256d49548a2"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm002"
+ }]
+ },
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "mtn23a"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "e6beab145f6b49098277ac163ac1b4f3"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "48bd7f11-408f-417c-b834-b41c1b98f7d7"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "comx5000vm001"
+ }]
+ }
+ ]},
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-50593",
+ "interface-role": "example-interface-role-val-23375",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-5921",
+ "selflink": "example-selflink-val-75663",
+ "interface-id": "example-interface-id-val-37465",
+ "macaddr": "example-macaddr-val-62657",
+ "network-name": "example-network-name-val-7252",
+ "management-option": "example-management-option-val-32963",
+ "interface-description": "example-interface-description-val-89453",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-16684",
+ "vlan-id-inner": 8602916,
+ "vlan-id-outer": 97348542,
+ "speed-value": "example-speed-value-val-90330",
+ "speed-units": "example-speed-units-val-15849",
+ "vlan-description": "example-vlan-description-val-46942",
+ "backdoor-connection": "example-backdoor-connection-val-78445",
+
+ "orchestration-status": "example-orchestration-status-val-44994",
+
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-90277",
+ "l3-interface-ipv4-prefix-length": 3364150,
+ "vlan-id-inner": 44021171,
+ "vlan-id-outer": 55708677,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-43267",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-62870"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-45323",
+ "l3-interface-ipv6-prefix-length": 56688923,
+ "vlan-id-inner": 5703071,
+ "vlan-id-outer": 86682265,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-28366",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-53034"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-4720",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-42594",
+ "vf-mac-filter": "example-vf-mac-filter-val-13375",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-6057",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-81448",
+ "neutron-network-id": "example-neutron-network-id-val-9504"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-16738",
+ "interface-role": "example-interface-role-val-13943",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-63173",
+ "selflink": "example-selflink-val-43085",
+ "interface-id": "example-interface-id-val-51379",
+ "macaddr": "example-macaddr-val-16195",
+ "network-name": "example-network-name-val-45683",
+ "management-option": "example-management-option-val-78983",
+ "interface-description": "example-interface-description-val-34414",
+ "is-port-mirrored": true
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-99078",
+ "l3-interface-ipv4-prefix-length": 55755841,
+ "vlan-id-inner": 81525473,
+ "vlan-id-outer": 90908072,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-47919",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-84236"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-21939",
+ "l3-interface-ipv6-prefix-length": 50057584,
+ "vlan-id-inner": 75774660,
+ "vlan-id-outer": 4421090,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-46377",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-16585"
+ }
+ ]
+ }
+ ]
+ },
+ "lag-interfaces": {
+ "lag-interface": [
+ {
+ "interface-name": "example-interface-name-val-39234",
+ "interface-description": "example-interface-description-val-1037",
+ "speed-value": "example-speed-value-val-1929",
+ "speed-units": "example-speed-units-val-74937",
+ "interface-id": "example-interface-id-val-91265",
+ "interface-role": "example-interface-role-val-19613",
+
+
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-10722",
+ "interface-role": "example-interface-role-val-95194",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-24328",
+ "selflink": "example-selflink-val-24987",
+ "interface-id": "example-interface-id-val-75726",
+ "macaddr": "example-macaddr-val-36940",
+ "network-name": "example-network-name-val-65359",
+ "management-option": "example-management-option-val-49521",
+ "interface-description": "example-interface-description-val-70528",
+ "is-port-mirrored": true,
+ "vlans": {
+ "vlan": [
+ {
+ "vlan-interface": "example-vlan-interface-val-70827",
+ "vlan-id-inner": 55659612,
+ "vlan-id-outer": 90335612,
+ "speed-value": "example-speed-value-val-54761",
+ "speed-units": "example-speed-units-val-91398",
+ "vlan-description": "example-vlan-description-val-17018",
+ "backdoor-connection": "example-backdoor-connection-val-4021",
+
+ "orchestration-status": "example-orchestration-status-val-18315",
+
+
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-59336",
+ "l3-interface-ipv4-prefix-length": 57636053,
+ "vlan-id-inner": 34068397,
+ "vlan-id-outer": 48570286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-69862",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-75795"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-15038",
+ "l3-interface-ipv6-prefix-length": 42694503,
+ "vlan-id-inner": 15929806,
+ "vlan-id-outer": 87413856,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-52519",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-24471"
+ }
+ ]
+ }
+ ]
+ },
+ "sriov-vfs": {
+ "sriov-vf": [
+ {
+ "pci-id": "example-pci-id-val-44669",
+ "vf-vlan-filter": "example-vf-vlan-filter-val-53436",
+ "vf-mac-filter": "example-vf-mac-filter-val-71902",
+ "vf-vlan-strip": true,
+ "vf-vlan-anti-spoof-check": true,
+ "vf-mac-anti-spoof-check": true,
+ "vf-mirrors": "example-vf-mirrors-val-54963",
+ "vf-broadcast-allow": true,
+ "vf-unknown-multicast-allow": true,
+ "vf-unknown-unicast-allow": true,
+ "vf-insert-stag": true,
+ "vf-link-status": "example-vf-link-status-val-1546",
+ "neutron-network-id": "example-neutron-network-id-val-92159"
+ }
+ ]
+ },
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "example-interface-name-val-9327",
+ "interface-role": "example-interface-role-val-21859",
+ "v6-wan-link-ip": "example-v6-wan-link-ip-val-21445",
+ "selflink": "example-selflink-val-6085",
+ "interface-id": "example-interface-id-val-39854",
+ "macaddr": "example-macaddr-val-14433",
+ "network-name": "example-network-name-val-3722",
+ "management-option": "example-management-option-val-64739",
+ "interface-description": "example-interface-description-val-5814",
+ "is-port-mirrored": true
+
+
+
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-64531",
+ "l3-interface-ipv4-prefix-length": 66545882,
+ "vlan-id-inner": 12194134,
+ "vlan-id-outer": 29589286,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-91108",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-56984"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-37408",
+ "l3-interface-ipv6-prefix-length": 5116459,
+ "vlan-id-inner": 39229896,
+ "vlan-id-outer": 15091934,
+ "is-floating": true,
+ "neutron-network-id": "example-neutron-network-id-val-87700",
+ "neutron-subnet-id": "example-neutron-subnet-id-val-37352"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "example-vf-module-id-val-56249",
+ "vf-module-name": "example-vf-module-name-val-18987",
+ "heat-stack-id": "example-heat-stack-id-val-80110",
+ "orchestration-status": "example-orchestration-status-val-8226",
+ "is-base-vf-module": true,
+ "model-invariant-id": "example-model-invariant-id-val-5071",
+ "model-version-id": "example-model-version-id-val-80793",
+ "model-customization-id": "example-model-customization-id-val-83277",
+ "widget-model-id": "example-widget-model-id-val-99814",
+ "widget-model-version": "example-widget-model-version-val-22799",
+ "contrail-service-instance-fqdn": "example-contrail-service-instance-fqdn-val-52133",
+ "module-index": 1933,
+ "selflink": "example-selflink-val-69992"
+ }
+ ]
+ },
+ "licenses": {
+ "license": [
+ {
+ "group-uuid": "example-group-uuid-val-73012",
+ "resource-uuid": "example-resource-uuid-val-80045"
+ }
+ ]
+ },
+ "entitlements": {
+ "entitlement": [
+ {
+ "group-uuid": "example-group-uuid-val-14874",
+ "resource-uuid": "example-resource-uuid-val-49146"
+ }
+ ]
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json
new file mode 100644
index 0000000000..1c7e1fb970
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverFullQueryResponse.json
@@ -0,0 +1,13 @@
+{
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "linterfaces": null,
+ "prov-status": null,
+ "relationship-list": null,
+ "resource-version": null,
+ "volumes": null,
+ "vserver-id": "VServerId",
+ "vserver-name": "VServerName",
+ "vserver-name2": "VServerName2",
+ "vserver-selflink": "http://VSERVER-link.com"
+ } \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json
new file mode 100644
index 0000000000..eca735b810
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiVserverQueryResponse.json
@@ -0,0 +1,6 @@
+{
+ "vserverId": "VServerId",
+ "vserverName": "VServerName",
+ "vserverName2": "VServerName2",
+ "vserverSelflink": "http://VSERVER-link.com"
+ } \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/appcTaskRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/appcTaskRequest.json
new file mode 100644
index 0000000000..957c603dc9
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/appcTaskRequest.json
@@ -0,0 +1,12 @@
+{
+ "ApplicationControllerTaskRequest": {
+ "controllerType": "TEST-CONTROLLER-NAME",
+ "action": "Lock",
+ "identityUrl": "IDENTITY-URL-TEST",
+ "applicationControllerVnf": {
+ "vnfId": "TEST-VNF-ID",
+ "vnfName": "TEST-VNF-NAME",
+ "vnfHostIpAddress": "127.0.0.1"
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json
new file mode 100644
index 0000000000..aa2462f371
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModuleReplaceRebuildVolumeGroups.json
@@ -0,0 +1,66 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelCustomizationName": "model-cust-name",
+ "modelInvariantId": "db86e4a6-c027-452e-a559-3a23b3128367",
+ "modelType": "vfModule",
+ "modelName": "test-model-name",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "9a6d01fd-19a7-490a-9800-460830a12e0b",
+ "modelVersionId": "14c8f313-fb0f-4cf6-8caf-c7cce8137b60",
+ "modelCustomizationId": "9a6d01fd-19a7-490a-9800-460830a12e0b",
+ "modelUuid": "14c8f313-fb0f-4cf6-8caf-c7cce8137b60",
+ "modelInvariantUuid": "db86e4a6-c027-452e-a559-3a23b3128367",
+ "modelInstanceName": "test-model-instance-name"
+ },
+ "requestInfo": {
+ "source": "VID",
+ "instanceName": "instanceName",
+ "suppressRollback": false,
+ "requestorId": "user"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f647e3ef-6d2e-4cd3-bff4-8df4634208de",
+ "modelInfo": {
+ "modelInvariantId": "86adb376-5303-441a-b50e-96c0cd643b0f",
+ "modelType": "service",
+ "modelName": "model-name",
+ "modelVersion": "1.0",
+ "modelVersionId": "599e21ed-803d-4d1f-83df-20005339b83f",
+ "modelUuid": "599e21ed-803d-4d1f-83df-20005339b83f",
+ "modelInvariantUuid": "86adb376-5303-441a-b50e-96c0cd643b0f"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "b80b16a5-f80d-4ffa-91c8-bd47c7438a3d",
+ "modelInfo": {
+ "modelCustomizationName": "modle-cust-name",
+ "modelInvariantId": "5cca9285-4ed4-4e11-a609-921ed3344811",
+ "modelType": "vnf",
+ "modelName": "modle-name",
+ "modelVersion": "1.0",
+ "modelCustomizationUuid": "fc25201d-36d6-43a3-8d39-fdae88e526ae",
+ "modelVersionId": "7cae703a-b20d-481a-863a-b862236c00f7",
+ "modelCustomizationId": "fc25201d-36d6-43a3-8d39-fdae88e526ae",
+ "modelUuid": "7cae703a-b20d-481a-863a-b862236c00f7",
+ "modelInvariantUuid": "5cca9285-4ed4-4e11-a609-921ed3344811",
+ "modelInstanceName": "model-inst-name"
+ }
+ }
+ }
+ ],
+ "cloudConfiguration": {
+ "tenantId": "872f331350c54e59991a8de2cbffb40c",
+ "cloudOwner": "my-custom-cloud-owner",
+ "lcpCloudRegionId": "cloud-region"
+ },
+ "requestParameters": {
+ "usePreload": true,
+ "rebuildVolumeGroups": true
+ }
+ }
+} \ No newline at end of file
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
index 3bd646fada..d15fbf9322 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
@@ -135,7 +135,7 @@ public class CloudifyClient {
* @return An object of Class <R>
*/
public <R> CloudifyRequest<R> get(String path, Class<R> returnType) {
- return new CloudifyRequest<R>(this, HttpMethod.GET, path, null, returnType);
+ return new CloudifyRequest<>(this, HttpMethod.GET, path, null, returnType);
}
}
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java
index f031f10bb5..652df6ff0d 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientConnector.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -20,7 +20,7 @@
package org.onap.so.cloudify.base.client;
-
+@FunctionalInterface
public interface CloudifyClientConnector {
public <T> CloudifyResponse request(CloudifyRequest<T> request);
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
index df63bd18d3..006768f2f1 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
@@ -37,7 +37,7 @@ public class CloudifyRequest<R> {
private StringBuilder path = new StringBuilder();
- private Map<String, List<Object>> headers = new HashMap<String, List<Object>>();
+ private Map<String, List<Object>> headers = new HashMap<>();
private Entity<?> entity;
@@ -100,7 +100,7 @@ public class CloudifyRequest<R> {
}
public <T> Entity<T> entity(T entity, String contentType) {
- return new Entity<T>(entity, contentType);
+ return new Entity<>(entity, contentType);
}
public Entity<?> entity() {
@@ -160,7 +160,7 @@ public class CloudifyRequest<R> {
+ headers + ", entity=" + entity + ", returnType=" + returnType + "]";
}
- private Map<String, List<Object>> queryParams = new LinkedHashMap<String, List<Object>>();
+ private Map<String, List<Object>> queryParams = new LinkedHashMap<>();
public Map<String, List<Object>> queryParams() {
return queryParams;
@@ -171,7 +171,7 @@ public class CloudifyRequest<R> {
List<Object> values = queryParams.get(key);
values.add(value);
} else {
- List<Object> values = new ArrayList<Object>();
+ List<Object> values = new ArrayList<>();
values.add(value);
queryParams.put(key, values);
}
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java
index 966cc8f144..0ca3212238 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyResponseException.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -26,11 +26,11 @@ public class CloudifyResponseException extends CloudifyBaseException {
private static final long serialVersionUID = 7294957362769575271L;
- protected String message;
- protected int status;
+ private final String message;
+ private final int status;
// Make the response available for exception handling (includes body)
- protected CloudifyResponse response;
+ private final CloudifyResponse response;
public CloudifyResponseException(String message, int status) {
this.message = message;
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
index e1992d98ca..54519bac72 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
@@ -9,9 +9,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -94,7 +94,7 @@ public class HttpClientConnector implements CloudifyClientConnector {
public <T> CloudifyResponse request(CloudifyRequest<T> request) {
- CloseableHttpClient httpClient = null; // HttpClients.createDefault();
+ CloseableHttpClient httpClient = null;
if (request.isBasicAuth()) {
// Use Basic Auth for this request.
@@ -211,11 +211,14 @@ public class HttpClientConnector implements CloudifyClientConnector {
} catch (HttpResponseException e) {
// What exactly does this mean? It does not appear to get thrown for
// non-2XX responses as documented.
+ logger.error("Client HttpResponseException", e);
throw new CloudifyResponseException(e.getMessage(), e.getStatusCode());
} catch (UnknownHostException e) {
+ logger.error("Client UnknownHostException", e);
throw new CloudifyConnectException("Unknown Host: " + e.getMessage());
} catch (IOException e) {
// Catch all other IOExceptions and throw as OpenStackConnectException
+ logger.error("Client IOException", e);
throw new CloudifyConnectException(e.getMessage());
} catch (Exception e) {
// Catchall for anything else, must throw as a RuntimeException
@@ -227,13 +230,17 @@ public class HttpClientConnector implements CloudifyClientConnector {
try {
httpResponse.close();
} catch (IOException e) {
- logger.debug("Unable to close HTTP Response: " + e);
+ logger.debug("Unable to close HTTP Response: ", e);
}
}
// Get here on an error response (4XX-5XX)
- throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(),
- httpResponse.getStatusLine().getStatusCode(), httpClientResponse);
+ if (httpResponse != null) {
+ throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(),
+ httpResponse.getStatusLine().getStatusCode(), httpClientResponse);
+ } else {
+ throw new CloudifyResponseException("Null httpResponse", 0, httpClientResponse);
+ }
}
}
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java
index a96fdb6b50..f1aa06cb39 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientResponse.java
@@ -9,9 +9,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -39,7 +39,7 @@ public class HttpClientResponse implements CloudifyResponse {
private static Logger logger = LoggerFactory.getLogger(HttpClientResponse.class);
- private HttpResponse response = null;
+ private transient HttpResponse response = null;
private String entityBody = null;
public HttpClientResponse(HttpResponse response) {
diff --git a/common/pom.xml b/common/pom.xml
index a52897170a..cdd5df950a 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -16,6 +16,7 @@
<protobuf.version>3.6.1</protobuf.version>
<grpc.netty.version>4.1.30.Final</grpc.netty.version>
<ccsdk.version>0.4.2</ccsdk.version>
+ <appc.client.version>1.6.0-SNAPSHOT</appc.client.version>
</properties>
<dependencies>
@@ -58,7 +59,7 @@
<dependency>
<groupId>org.onap.aai.schema-service</groupId>
<artifactId>aai-schema</artifactId>
- <version>1.0.0</version>
+ <version>1.6.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
@@ -118,11 +119,6 @@
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.logging-analytics</groupId>
- <artifactId>logging-slf4j</artifactId>
- <version>1.2.2</version>
- </dependency>
- <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
@@ -136,6 +132,17 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.onap.aaf.authz</groupId>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <version>2.1.9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
@@ -186,7 +193,76 @@
<version>${grpc.version}</version>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.javatuples</groupId>
+ <artifactId>javatuples</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-external-task-client</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>${appc.client.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<dependencyManagement>
<dependencies>
@@ -241,6 +317,23 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <executions>
+ <execution>
+ <id>tests-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java
new file mode 100644
index 0000000000..3811b52551
--- /dev/null
+++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java
@@ -0,0 +1,104 @@
+package org.onap.so.appc.orchestrator.service.beans;
+
+import java.io.Serializable;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVnf;
+
+public class ApplicationControllerTaskRequest implements Serializable {
+
+ private static final long serialVersionUID = -3150320542857627682L;
+
+ private Action action;
+ private String controllerType;
+ private String identityUrl;
+ private String operationsTimeout;
+ private String bookName;
+ private String nodeList;
+ private String fileParameters;
+ private String existingSoftwareVersion;
+ private String newSoftwareVersion;
+ private ApplicationControllerVnf applicationControllerVnf;
+
+ public Action getAction() {
+ return action;
+ }
+
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ public String getControllerType() {
+ return controllerType;
+ }
+
+ public void setControllerType(String controllerType) {
+ this.controllerType = controllerType;
+ }
+
+ public ApplicationControllerVnf getApplicationControllerVnf() {
+ return applicationControllerVnf;
+ }
+
+ public void setApplicationControllerVnf(ApplicationControllerVnf applicationControllerVnf) {
+ this.applicationControllerVnf = applicationControllerVnf;
+ }
+
+ public String getIdentityUrl() {
+ return identityUrl;
+ }
+
+ public void setIdentityUrl(String identityUrl) {
+ this.identityUrl = identityUrl;
+ }
+
+ public String getOperationsTimeout() {
+ return operationsTimeout;
+ }
+
+ public void setOperationsTimeout(String operationsTimeout) {
+ this.operationsTimeout = operationsTimeout;
+ }
+
+ public String getBookName() {
+ return bookName;
+ }
+
+ public void setBookName(String bookName) {
+ this.bookName = bookName;
+ }
+
+ public String getNodeList() {
+ return nodeList;
+ }
+
+ public void setNodeList(String nodeList) {
+ this.nodeList = nodeList;
+ }
+
+ public String getFileParameters() {
+ return fileParameters;
+ }
+
+ public void setFileParameters(String fileParameters) {
+ this.fileParameters = fileParameters;
+ }
+
+ public String getExistingSoftwareVersion() {
+ return existingSoftwareVersion;
+ }
+
+ public void setExistingSoftwareVersion(String existingSoftwareVersion) {
+ this.existingSoftwareVersion = existingSoftwareVersion;
+ }
+
+ public String getNewSoftwareVersion() {
+ return newSoftwareVersion;
+ }
+
+ public void setNewSoftwareVersion(String newSoftwareVersion) {
+ this.newSoftwareVersion = newSoftwareVersion;
+ }
+
+
+
+}
diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java
new file mode 100644
index 0000000000..75e2053077
--- /dev/null
+++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java
@@ -0,0 +1,30 @@
+package org.onap.so.appc.orchestrator.service.beans;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ApplicationControllerVm implements Serializable {
+
+ private static final long serialVersionUID = 2786675508024214638L;
+
+ private String vserverId;
+ private String vmId;
+
+ public String getVserverId() {
+ return vserverId;
+ }
+
+ public void setVserverId(String vserverId) {
+ this.vserverId = vserverId;
+ }
+
+ public String getVmId() {
+ return vmId;
+ }
+
+ public void setVmId(String vmId) {
+ this.vmId = vmId;
+ }
+
+
+}
diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java
new file mode 100644
index 0000000000..526941dc39
--- /dev/null
+++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java
@@ -0,0 +1,49 @@
+package org.onap.so.appc.orchestrator.service.beans;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ApplicationControllerVnf implements Serializable {
+
+ private static final long serialVersionUID = 2786675508024214637L;
+
+ private String vnfId;
+ private String vnfName;
+ private String vnfHostIpAddress;
+ private ApplicationControllerVm applicationControllerVm;
+
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getVnfHostIpAddress() {
+ return vnfHostIpAddress;
+ }
+
+ public void setVnfHostIpAddress(String vnfHostIpAddress) {
+ this.vnfHostIpAddress = vnfHostIpAddress;
+ }
+
+ public ApplicationControllerVm getApplicationControllerVm() {
+ return applicationControllerVm;
+ }
+
+ public void setApplicationControllerVm(ApplicationControllerVm applicationControllerVm) {
+ this.applicationControllerVm = applicationControllerVm;
+ }
+
+
+
+}
diff --git a/common/src/main/java/org/onap/so/client/BaseClient.java b/common/src/main/java/org/onap/so/client/BaseClient.java
index d939a33358..24c83cbcab 100644
--- a/common/src/main/java/org/onap/so/client/BaseClient.java
+++ b/common/src/main/java/org/onap/so/client/BaseClient.java
@@ -22,7 +22,8 @@ package org.onap.so.client;
import java.util.ArrayList;
import java.util.List;
-import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -80,7 +81,8 @@ public class BaseClient<I, O> {
RestTemplate restTemplate = new RestTemplate();
restTemplate
.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
- restTemplate.getInterceptors().add(new SpringClientFilter());
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
ResponseEntity<O> responseEntity =
restTemplate.exchange(getTargetUrl(), method, requestEntity, typeRef, uriVariables);
return responseEntity.getBody();
diff --git a/common/src/main/java/org/onap/so/client/HttpClient.java b/common/src/main/java/org/onap/so/client/HttpClient.java
index 715ba32831..63a4b1cd65 100644
--- a/common/src/main/java/org/onap/so/client/HttpClient.java
+++ b/common/src/main/java/org/onap/so/client/HttpClient.java
@@ -24,22 +24,22 @@ import java.net.URL;
import java.util.Map;
import java.util.Optional;
import static org.apache.commons.lang3.StringUtils.*;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HttpClient extends RestClient {
protected final Logger log = LoggerFactory.getLogger(HttpClient.class);
- private TargetEntity targetEntity;
+ private ONAPComponents targetEntity;
- HttpClient(URL host, String contentType, TargetEntity targetEntity) {
+ HttpClient(URL host, String contentType, ONAPComponents targetEntity) {
super(host, contentType);
this.targetEntity = targetEntity;
}
@Override
- public TargetEntity getTargetEntity() {
+ public ONAPComponents getTargetEntity() {
return targetEntity;
}
diff --git a/common/src/main/java/org/onap/so/client/HttpClientFactory.java b/common/src/main/java/org/onap/so/client/HttpClientFactory.java
index d02c18ff56..3a8a9ee1bd 100644
--- a/common/src/main/java/org/onap/so/client/HttpClientFactory.java
+++ b/common/src/main/java/org/onap/so/client/HttpClientFactory.java
@@ -21,19 +21,19 @@ package org.onap.so.client;
import java.net.URL;
import javax.ws.rs.core.MediaType;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class HttpClientFactory {
- public HttpClient newJsonClient(URL host, TargetEntity targetEntity) {
+ public HttpClient newJsonClient(URL host, ONAPComponents targetEntity) {
return new HttpClient(host, MediaType.APPLICATION_JSON, targetEntity);
}
- public HttpClient newXmlClient(URL host, TargetEntity targetEntity) {
+ public HttpClient newXmlClient(URL host, ONAPComponents targetEntity) {
return new HttpClient(host, MediaType.APPLICATION_XML, targetEntity);
}
- public HttpClient newTextXmlClient(URL host, TargetEntity targetEntity) {
+ public HttpClient newTextXmlClient(URL host, ONAPComponents targetEntity) {
return new HttpClient(host, MediaType.TEXT_XML, targetEntity);
}
}
diff --git a/common/src/main/java/org/onap/so/client/RestClient.java b/common/src/main/java/org/onap/so/client/RestClient.java
index d3a4d444f7..077ba24c2b 100644
--- a/common/src/main/java/org/onap/so/client/RestClient.java
+++ b/common/src/main/java/org/onap/so/client/RestClient.java
@@ -44,11 +44,12 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriBuilder;
+import org.onap.logging.filter.base.MDCSetup;
+import org.onap.logging.filter.base.ONAPComponentsList;
+import org.onap.logging.filter.base.PayloadLoggingClientFilter;
import org.onap.so.client.policy.CommonObjectMapperProvider;
-import org.onap.so.logging.jaxrs.filter.JaxRsClientLogging;
-import org.onap.so.logging.jaxrs.filter.PayloadLoggingFilter;
+import org.onap.so.logging.jaxrs.filter.SOMetricLogClientFilter;
import org.onap.so.utils.CryptoUtils;
-import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@@ -71,7 +72,8 @@ public abstract class RestClient {
protected String accept;
protected String contentType;
protected String requestId = "";
- protected JaxRsClientLogging jaxRsClientLogging;
+ protected SOMetricLogClientFilter metricLogClientFilter;
+ protected MDCSetup mdcSetup = new MDCSetup();
protected RestProperties props;
protected RestClient(RestProperties props, Optional<URI> path) {
@@ -179,18 +181,18 @@ public abstract class RestClient {
return ClientBuilder.newBuilder().build();
}
- protected abstract TargetEntity getTargetEntity();
+ protected abstract ONAPComponentsList getTargetEntity();
protected void initializeClient(Client client) {
if (this.enableLogging()) {
- client.register(new PayloadLoggingFilter(this.getMaxPayloadSize()));
+ client.register(new PayloadLoggingClientFilter(this.getMaxPayloadSize()));
}
CommonObjectMapperProvider provider = this.getCommonObjectMapperProvider();
client.register(new JacksonJsonProvider(provider.getMapper()));
- jaxRsClientLogging = new JaxRsClientLogging();
- jaxRsClientLogging.setTargetService(getTargetEntity());
- client.register(jaxRsClientLogging);
+ metricLogClientFilter = new SOMetricLogClientFilter();
+ mdcSetup.setTargetEntity(getTargetEntity());
+ client.register(metricLogClientFilter);
if (!path.isPresent()) {
webTarget = client.target(host.toString());
diff --git a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
index 0633ae74c9..f8587ff776 100644
--- a/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
+++ b/common/src/main/java/org/onap/so/client/RestTemplateConfig.java
@@ -20,8 +20,9 @@
package org.onap.so.client;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
import org.onap.so.configuration.rest.HttpComponentsClientConfiguration;
-import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
@@ -45,7 +46,8 @@ public class RestTemplateConfig {
final RestTemplate restTemplate = new RestTemplate();
restTemplate
.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
- restTemplate.getInterceptors().add(new SpringClientFilter());
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
return restTemplate;
}
@@ -56,7 +58,8 @@ public class RestTemplateConfig {
httpComponentsClientConfiguration.httpComponentsClientHttpRequestFactory();
final RestTemplate restTemplate =
new RestTemplate(new BufferingClientHttpRequestFactory(clientHttpRequestFactory));
- restTemplate.getInterceptors().add(new SpringClientFilter());
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
return restTemplate;
}
}
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java b/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
index 2fe3910486..e255b297ed 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
@@ -50,6 +50,8 @@ public class AAIErrorFormatter {
}
protected String format(String s, List<String> variables) {
- return String.format(s.replaceAll("%(\\d+)", "%$1\\$s"), variables.toArray());
+ s = s.replaceAll("%(\\d(?!\\d))", "%$1\\$s");
+ s = s.replaceAll("%(\\d{2})", "%%$1");
+ return String.format(s, variables.toArray());
}
}
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java
index b546aaa23e..610ff728e9 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java
@@ -26,7 +26,7 @@ import java.util.Optional;
import org.onap.so.client.ResponseExceptionMapper;
import org.onap.so.client.graphinventory.GraphInventoryPatchConverter;
import org.onap.so.client.graphinventory.GraphInventoryRestClient;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class AAIRestClient extends GraphInventoryRestClient {
@@ -38,8 +38,8 @@ public class AAIRestClient extends GraphInventoryRestClient {
}
@Override
- public TargetEntity getTargetEntity() {
- return TargetEntity.AAI;
+ public ONAPComponents getTargetEntity() {
+ return ONAPComponents.AAI;
}
@Override
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
index 91030d831a..4f06b787f7 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
@@ -23,7 +23,7 @@ package org.onap.so.client.aai;
import org.onap.so.client.graphinventory.GraphInventoryVersion;
public enum AAIVersion implements GraphInventoryVersion {
- V13("v13"), V14("v14"), V15("v15");
+ V13("v13"), V14("v14"), V15("v15"), V16("v16"), V17("v17"), V18("v18"), V19("v19");
public static final AAIVersion LATEST = AAIVersion.values()[AAIVersion.values().length - 1];
private final String value;
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
index f2f99050db..1fe9da984f 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java
@@ -21,6 +21,7 @@
package org.onap.so.client.aai.entities.uri;
import java.net.URI;
+import java.util.regex.Pattern;
import javax.ws.rs.core.UriBuilder;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
@@ -138,4 +139,9 @@ public class AAISimpleUri extends SimpleUri implements AAIResourceUri {
public AAISimpleUri format(Format format) {
return (AAISimpleUri) super.format(format);
}
+
+ @Override
+ protected Pattern getPrefixPattern() {
+ return Pattern.compile("/aai/v\\d+");
+ }
}
diff --git a/common/src/main/java/org/onap/so/client/adapter/rest/AdapterRestClient.java b/common/src/main/java/org/onap/so/client/adapter/rest/AdapterRestClient.java
index d6c7072c14..88899a7097 100644
--- a/common/src/main/java/org/onap/so/client/adapter/rest/AdapterRestClient.java
+++ b/common/src/main/java/org/onap/so/client/adapter/rest/AdapterRestClient.java
@@ -29,7 +29,7 @@ import org.onap.so.client.RestClient;
import org.onap.so.client.policy.CommonObjectMapperProvider;
import org.onap.so.client.policy.JettisonStyleMapperProvider;
import org.onap.so.utils.CryptoUtils;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class AdapterRestClient extends RestClient {
@@ -46,8 +46,8 @@ public class AdapterRestClient extends RestClient {
}
@Override
- public TargetEntity getTargetEntity() {
- return TargetEntity.OPENSTACK_ADAPTER;
+ public ONAPComponents getTargetEntity() {
+ return ONAPComponents.OPENSTACK_ADAPTER;
}
@Override
diff --git a/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java b/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java
index 4ca5690188..8ef08057e6 100644
--- a/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java
+++ b/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java
@@ -35,11 +35,12 @@ public class DefaultDmaapPropertiesImpl implements DmaapProperties {
public DefaultDmaapPropertiesImpl() throws IOException {
File initialFile = new File("src/test/resources/dmaap.properties");
- InputStream targetStream = new FileInputStream(initialFile);
Properties properties = new Properties();
- properties.load(targetStream);
- this.properties = new HashMap<>();
- properties.forEach((key, value) -> this.properties.put((String) key, (String) value));
+ try (InputStream targetStream = new FileInputStream(initialFile)) {
+ properties.load(targetStream);
+ this.properties = new HashMap<>();
+ properties.forEach((key, value) -> this.properties.put((String) key, (String) value));
+ }
}
@Override
diff --git a/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java b/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java
index 68b4e84448..e0c8d4ba80 100644
--- a/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java
+++ b/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java
@@ -22,11 +22,15 @@ package org.onap.so.client.dmaap.rest;
import java.net.URL;
import java.util.Map;
+import java.util.UUID;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.client.RestClient;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.slf4j.MDC;
public class DMaaPRestClient extends RestClient {
+ private static final String SO = "SO";
private final String auth;
private final String key;
@@ -37,8 +41,8 @@ public class DMaaPRestClient extends RestClient {
}
@Override
- public TargetEntity getTargetEntity() {
- return TargetEntity.DMAAP;
+ public ONAPComponents getTargetEntity() {
+ return ONAPComponents.DMAAP;
}
@Override
@@ -46,6 +50,10 @@ public class DMaaPRestClient extends RestClient {
if (auth != null && !auth.isEmpty() && key != null && !key.isEmpty()) {
addBasicAuthHeader(auth, key);
}
+ String onapRequestId = UUID.randomUUID().toString();
+ headerMap.put(ONAPLogConstants.Headers.REQUEST_ID, onapRequestId);
+ if (MDC.get(ONAPLogConstants.MDCs.REQUEST_ID) != null) {
+ headerMap.put(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ }
}
-
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryRestClient.java b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryRestClient.java
index 434c65da46..babfa14d71 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryRestClient.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryRestClient.java
@@ -28,7 +28,8 @@ import org.onap.so.client.ResponseExceptionMapper;
import org.onap.so.client.RestClientSSL;
import org.onap.so.client.RestProperties;
import org.onap.so.client.policy.CommonObjectMapperProvider;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.filter.base.ONAPComponentsList;
public abstract class GraphInventoryRestClient extends RestClientSSL {
@@ -42,7 +43,7 @@ public abstract class GraphInventoryRestClient extends RestClientSSL {
}
@Override
- public abstract TargetEntity getTargetEntity();
+ public abstract ONAPComponentsList getTargetEntity();
@Override
protected abstract void initializeHeaderMap(Map<String, String> headerMap);
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
index f7f5d78604..e301edb0fd 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
@@ -32,9 +32,9 @@ public class DSLNodeKey implements QueryStep {
private boolean not = false;
private final StringBuilder query = new StringBuilder();
private final String keyName;
- private final List<String> values;
+ private final List<Object> values;
- public DSLNodeKey(String keyName, String... value) {
+ public DSLNodeKey(String keyName, Object... value) {
this.keyName = keyName;
this.values = Arrays.asList(value);
@@ -54,14 +54,18 @@ public class DSLNodeKey implements QueryStep {
result.append(" !");
}
result.append("('").append(keyName).append("', ");
- List<String> temp = new ArrayList<>();
- for (String item : values) {
+ List<Object> temp = new ArrayList<>();
+ for (Object item : values) {
if ("null".equals(item)) {
temp.add(String.format("' %s '", item));
} else if ("".equals(item)) {
temp.add("' '");
} else {
- temp.add(String.format("'%s'", item));
+ if (item instanceof String) {
+ temp.add(String.format("'%s'", item));
+ } else {
+ temp.add(item);
+ }
}
}
result.append(Joiner.on(", ").join(temp)).append(")");
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
index ffbb86f023..540472a88d 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
@@ -20,12 +20,15 @@
package org.onap.so.client.graphinventory.entities;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.onap.so.client.aai.entities.QueryStep;
import org.onap.so.client.graphinventory.GraphInventoryObjectName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.base.Joiner;
@@ -33,6 +36,7 @@ public class DSLQueryBuilder<S, E> implements QueryStep {
private List<QueryStep> steps = new ArrayList<>();
private String suffix = "";
+ private static final Logger logger = LoggerFactory.getLogger(DSLQueryBuilder.class);
public DSLQueryBuilder() {
@@ -49,8 +53,25 @@ public class DSLQueryBuilder<S, E> implements QueryStep {
}
public DSLQueryBuilder<S, E> output() {
- if (steps.get(steps.size() - 1) instanceof DSLNode) {
+ Object obj = steps.get(steps.size() - 1);
+ if (obj instanceof DSLNode) {
((DSLNode) steps.get(steps.size() - 1)).output();
+ } else if (obj.getClass().getName().contains("$$Lambda$")) {
+ // process lambda expressions
+ for (Field f : obj.getClass().getDeclaredFields()) {
+ f.setAccessible(true);
+ Object o;
+ try {
+ o = f.get(obj);
+ if (o instanceof DSLQueryBuilder && ((DSLQueryBuilder) o).steps.get(0) instanceof DSLNode) {
+ ((DSLNode) ((DSLQueryBuilder) o).steps.get(0)).output();
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ logger.error("Exception occured", e);
+ }
+ f.setAccessible(false);
+ break;
+ }
}
return this;
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/__.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/__.java
index 2fdd6574e5..87d4d84cac 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/__.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/__.java
@@ -45,7 +45,7 @@ public class __ {
return __.<DSLNode>start(new DSLNode(name, key));
}
- public static DSLNodeKey key(String keyName, String... value) {
+ public static DSLNodeKey key(String keyName, Object... value) {
return new DSLNodeKey(keyName, value);
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
index 41ba07ad6c..ffe47c5c51 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java
@@ -29,6 +29,7 @@ import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.onap.so.client.graphinventory.Format;
@@ -61,7 +62,7 @@ public class SimpleUri implements GraphInventoryResourceUri, Serializable {
protected SimpleUri(GraphInventoryObjectType type, URI uri) {
this.type = type;
this.pluralType = null;
- this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll("/aai/v\\d+", ""));
+ this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll(getPrefixPattern().toString(), ""));
this.values = new Object[0];
}
@@ -174,6 +175,10 @@ public class SimpleUri implements GraphInventoryResourceUri, Serializable {
return build(this.values);
}
+ protected Pattern getPrefixPattern() {
+ return Pattern.compile("/.*?/v\\d+");
+ }
+
protected URI build(Object... values) {
// This is a workaround because resteasy does not encode URIs correctly
final String[] encoded = new String[values.length];
diff --git a/common/src/main/java/org/onap/so/client/grm/GRMRestClient.java b/common/src/main/java/org/onap/so/client/grm/GRMRestClient.java
index 507f1130b5..147f688ea8 100644
--- a/common/src/main/java/org/onap/so/client/grm/GRMRestClient.java
+++ b/common/src/main/java/org/onap/so/client/grm/GRMRestClient.java
@@ -25,7 +25,7 @@ import java.net.URI;
import java.util.Map;
import java.util.Optional;
import org.onap.so.client.RestClient;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class GRMRestClient extends RestClient {
@@ -37,8 +37,8 @@ public class GRMRestClient extends RestClient {
}
@Override
- public TargetEntity getTargetEntity() {
- return TargetEntity.GRM;
+ public ONAPComponents getTargetEntity() {
+ return ONAPComponents.GRM;
}
@Override
diff --git a/common/src/main/java/org/onap/so/client/policy/PolicyRestClient.java b/common/src/main/java/org/onap/so/client/policy/PolicyRestClient.java
index 95bc4282ae..33ece07e3d 100644
--- a/common/src/main/java/org/onap/so/client/policy/PolicyRestClient.java
+++ b/common/src/main/java/org/onap/so/client/policy/PolicyRestClient.java
@@ -26,7 +26,7 @@ import java.util.Optional;
import javax.ws.rs.core.UriBuilder;
import org.onap.so.client.RestClient;
import org.onap.so.client.policy.entities.PolicyServiceType;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class PolicyRestClient extends RestClient {
@@ -38,8 +38,8 @@ public class PolicyRestClient extends RestClient {
}
@Override
- public TargetEntity getTargetEntity() {
- return TargetEntity.POLICY;
+ public ONAPComponents getTargetEntity() {
+ return ONAPComponents.POLICY;
}
@Override
diff --git a/common/src/main/java/org/onap/so/constants/OrchestrationRequestFormat.java b/common/src/main/java/org/onap/so/constants/OrchestrationRequestFormat.java
index ccfd2f4de6..641bbb28c7 100644
--- a/common/src/main/java/org/onap/so/constants/OrchestrationRequestFormat.java
+++ b/common/src/main/java/org/onap/so/constants/OrchestrationRequestFormat.java
@@ -21,5 +21,5 @@
package org.onap.so.constants;
public enum OrchestrationRequestFormat {
- DETAIL, STATUSDETAIL
+ DETAIL, STATUSDETAIL, SIMPLE
}
diff --git a/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java b/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java
index 14f2f5e9b7..40acac57aa 100644
--- a/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java
+++ b/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java
@@ -8,6 +8,11 @@ import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectInstance;
import javax.management.ObjectName;
+import org.jboss.logging.MDC;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ScheduledTasksMDCSetup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,16 +32,22 @@ public class ScheduledDnsLookup {
@Autowired
private DbDnsIpAddress dnsIpAddress;
+ @Autowired
+ private ScheduledTasksMDCSetup scheduledMDCSetup;
+
private static Logger logger = LoggerFactory.getLogger(ScheduledDnsLookup.class);
@Scheduled(fixedRate = 15000)
public void performDnsLookup() {
-
+ scheduledMDCSetup.mdcSetup(ONAPComponents.SO, "performDnsLookup");
String dnsUrl = System.getenv(DB_HOST);
try {
if (dnsUrl == null) {
+ scheduledMDCSetup.errorMDCSetup(ErrorCode.DataError, "Database DNS is not provided.");
logger.error("Database DNS is not provided. Please verify the configuration");
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString());
+ scheduledMDCSetup.exitAndClearMDC();
return;
}
@@ -46,6 +57,7 @@ public class ScheduledDnsLookup {
/* This is in initial state */
if (currentIpAddress == null) {
dnsIpAddress.setIpAddress(ipAddress);
+ scheduledMDCSetup.exitAndClearMDC();
return;
}
@@ -57,7 +69,7 @@ public class ScheduledDnsLookup {
} catch (UnknownHostException e) {
logger.warn("Database DNS %s is not resolvable to an IP Address", dnsUrl);
}
-
+ scheduledMDCSetup.exitAndClearMDC();
}
private void softEvictConnectionPool() {
diff --git a/common/src/main/java/org/onap/so/externaltasks/logging/AuditMDCSetup.java b/common/src/main/java/org/onap/so/externaltasks/logging/AuditMDCSetup.java
new file mode 100644
index 0000000000..9f71e61e1f
--- /dev/null
+++ b/common/src/main/java/org/onap/so/externaltasks/logging/AuditMDCSetup.java
@@ -0,0 +1,56 @@
+package org.onap.so.externaltasks.logging;
+
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.onap.logging.filter.base.MDCSetup;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.MdcConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditMDCSetup {
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditMDCSetup.class);
+
+ private MDCSetup mdcSetup = new MDCSetup();
+
+ public void setupMDC(ExternalTask externalTask) {
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP,
+ ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
+ String msoRequestId = externalTask.getVariable("mso-request-id");
+ if (msoRequestId != null && !msoRequestId.isEmpty()) {
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
+ }
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName());
+ MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, ONAPComponents.OPENSTACK_ADAPTER.toString());
+ setResponseCode(ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ setElapsedTime();
+ mdcSetup.setServerFQDN();
+ logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+ }
+
+ public void setElapsedTime() {
+ DateTimeFormatter timeFormatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
+ MDC.put(ONAPLogConstants.MDCs.ELAPSED_TIME, Long.toString(System.currentTimeMillis() - ZonedDateTime
+ .parse(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP), timeFormatter).toInstant().toEpochMilli()));
+ }
+
+ public void setResponseCode(String code) {
+ MDC.put(MdcConstants.OPENSTACK_STATUS_CODE, code);
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, code);
+ }
+
+ public void clearClientMDCs() {
+ MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
+ MDC.remove(MdcConstants.OPENSTACK_STATUS_CODE);
+ MDC.remove(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP);
+ MDC.remove(ONAPLogConstants.MDCs.ELAPSED_TIME);
+ MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/ListenerRunner.java b/common/src/main/java/org/onap/so/listener/ListenerRunner.java
index 3c36052dca..a489be6070 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/ListenerRunner.java
+++ b/common/src/main/java/org/onap/so/listener/ListenerRunner.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.common.listener;
+package org.onap.so.listener;
import java.lang.annotation.Annotation;
import java.util.Comparator;
@@ -27,7 +27,6 @@ import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.annotation.Priority;
-import org.onap.so.client.exception.ExceptionBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
@@ -36,10 +35,7 @@ public abstract class ListenerRunner {
@Autowired
protected ApplicationContext context;
- @Autowired
- protected ExceptionBuilder exceptionBuilder;
-
- protected <T> List<T> filterListeners(List<T> validators, Predicate<T> predicate) {
+ public <T> List<T> filterListeners(List<T> validators, Predicate<T> predicate) {
return validators.stream().filter(item -> {
return !item.getClass().isAnnotationPresent(Skip.class) && predicate.test(item);
}).sorted(Comparator.comparing(item -> {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/Skip.java b/common/src/main/java/org/onap/so/listener/Skip.java
index a0543fd3cc..aa3ec2a204 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/Skip.java
+++ b/common/src/main/java/org/onap/so/listener/Skip.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.common.listener;
+package org.onap.so.listener;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git a/common/src/main/java/org/onap/so/logger/ErrorCode.java b/common/src/main/java/org/onap/so/logger/ErrorCode.java
index 7fb9522b7c..a57ed99f2b 100644
--- a/common/src/main/java/org/onap/so/logger/ErrorCode.java
+++ b/common/src/main/java/org/onap/so/logger/ErrorCode.java
@@ -25,7 +25,7 @@ public enum ErrorCode {
AvailabilityError(200),
DataError(300),
SchemaError(400),
- BusinessProcesssError(500),
+ BusinessProcessError(500),
UnknownError(900);
private int value;
diff --git a/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java b/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
index 83b860ff01..2010bc1988 100644
--- a/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
+++ b/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
@@ -21,13 +21,5 @@
package org.onap.so.logger;
public class HttpHeadersConstants {
- public static final String HEADER_FROM_APP_ID = "X-FromAppId";
- public static final String ONAP_PARTNER_NAME = "X-ONAP-PartnerName";
- public static final String HEADER_REQUEST_ID = "X-RequestId";
- public static final String TRANSACTION_ID = "X-TransactionID";
- public static final String ECOMP_REQUEST_ID = "X-ECOMP-RequestID";
- public static final String ONAP_REQUEST_ID = "X-ONAP-RequestID";
- public static final String CLIENT_ID = "X-ClientID";
- public static final String INVOCATION_ID_HEADER = "X-InvocationID";
public static final String REQUESTOR_ID = "X-RequestorID";
}
diff --git a/common/src/main/java/org/onap/so/logger/LogConstants.java b/common/src/main/java/org/onap/so/logger/LogConstants.java
index 30915c6171..3dc0c062c6 100644
--- a/common/src/main/java/org/onap/so/logger/LogConstants.java
+++ b/common/src/main/java/org/onap/so/logger/LogConstants.java
@@ -21,8 +21,6 @@
package org.onap.so.logger;
public class LogConstants {
- public static final String TARGET_ENTITY_HEADER = "X-Target-Entity";
- public static final String UNKNOWN_TARGET_ENTITY = "Unknown-Target-Entity";
public static final String HTTP_URL = "Http-Url";
public static final String URI_BASE = "Uri-Base";
}
diff --git a/common/src/main/java/org/onap/so/logger/MdcConstants.java b/common/src/main/java/org/onap/so/logger/MdcConstants.java
index 33fceb2f0f..4c6672e59f 100644
--- a/common/src/main/java/org/onap/so/logger/MdcConstants.java
+++ b/common/src/main/java/org/onap/so/logger/MdcConstants.java
@@ -21,14 +21,6 @@
package org.onap.so.logger;
public class MdcConstants {
- public static final String INVOCATION_ID = "InvocationID";
- public static final String RESPONSECODE = "ResponseCode";
- public static final String RESPONSEDESC = "ResponseDesc";
- public static final String ECOMP_REQUEST_ID = "X-ECOMP-RequestID";
- public static final String CLIENT_ID = "X-ClientID";
- public static final String PARTNERNAME = "PartnerName";
- public static final String SERVICE_NAME = "ServiceName";
- public static final String STATUSCODE = "StatusCode";
- public static final String ENDTIME = "EndTimestamp";
public static final String ORIGINAL_PARTNER_NAME = "OriginalPartnerName";
+ public static final String OPENSTACK_STATUS_CODE = "OpenstackStatusCode";
}
diff --git a/common/src/main/java/org/onap/so/logger/ScheduledTasksMDCSetup.java b/common/src/main/java/org/onap/so/logger/ScheduledTasksMDCSetup.java
new file mode 100644
index 0000000000..41c4b4bfae
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logger/ScheduledTasksMDCSetup.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.logger;
+
+import java.util.UUID;
+import org.onap.logging.filter.base.Constants;
+import org.onap.logging.filter.base.MDCSetup;
+import org.onap.logging.filter.base.ONAPComponentsList;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ScheduledTasksMDCSetup extends MDCSetup {
+
+ public void mdcSetup(ONAPComponentsList targetEntity, String serviceName) {
+ try {
+ setEntryTimeStamp();
+ setServerFQDN();
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, UUID.randomUUID().toString());
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, targetEntity.toString());
+ MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, Constants.DefaultValues.UNKNOWN);
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, serviceName);
+ setLogTimestamp();
+ setElapsedTime();
+ MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, getProperty(Constants.Property.PARTNER_NAME));
+ logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+ } catch (Exception e) {
+ logger.warn("Error in ScheduledTasksMDCSetup mdcSetup: {}", e.getMessage());
+ }
+ }
+
+ public void errorMDCSetup(ErrorCode errorCode, String errorDescription) {
+ MDC.put(ONAPLogConstants.MDCs.ERROR_CODE, String.valueOf(errorCode.getValue()));
+ MDC.put(ONAPLogConstants.MDCs.ERROR_DESC, errorDescription);
+ }
+
+ public void exitAndClearMDC() {
+ try {
+ setStatusCode();
+ setLogTimestamp();
+ setElapsedTime();
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting.");
+ } catch (Exception e) {
+ logger.warn("Error in ScheduledTasksMDCSetup clear MDC: {}", e.getMessage());
+ }
+ MDC.clear();
+ }
+
+ public void setStatusCode() {
+ String currentStatusCode = MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
+ if (currentStatusCode == null || !currentStatusCode.equals(ONAPLogConstants.ResponseStatus.ERROR.toString())) {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.COMPLETE.toString());
+ }
+ }
+}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java
deleted file mode 100644
index 5dbf88d346..0000000000
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java
+++ /dev/null
@@ -1,136 +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.logging.jaxrs.filter;
-
-
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.utils.TargetEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.stereotype.Component;
-import javax.annotation.Priority;
-import javax.ws.rs.client.ClientRequestContext;
-import javax.ws.rs.client.ClientRequestFilter;
-import javax.ws.rs.client.ClientResponseContext;
-import javax.ws.rs.client.ClientResponseFilter;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Providers;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.UUID;
-
-@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
-@Component
-@Priority(0)
-public class JaxRsClientLogging implements ClientRequestFilter, ClientResponseFilter {
-
- @Context
- private Providers providers;
-
- private static final String TRACE = "trace-#";
- private static final String SO = "SO";
- private static Logger logger = LoggerFactory.getLogger(JaxRsClientLogging.class);
-
- public void setTargetService(TargetEntity targetEntity) {
- MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, targetEntity.toString());
- }
-
- @Override
- public void filter(ClientRequestContext clientRequest) {
- try {
- setupMDC(clientRequest);
- setupHeaders(clientRequest);
- logger.info(ONAPLogConstants.Markers.INVOKE, "Invoke");
- } catch (Exception e) {
- logger.warn("Error in incoming JAX-RS Inteceptor", e);
- }
- }
-
- private void setupHeaders(ClientRequestContext clientRequest) {
- MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
- headers.add(ONAPLogConstants.Headers.REQUEST_ID, extractRequestID(clientRequest));
- headers.add(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- headers.add(ONAPLogConstants.Headers.PARTNER_NAME, SO);
- }
-
- private void setupMDC(ClientRequestContext clientRequest) {
- MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP,
- ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
- MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, clientRequest.getUri().toString());
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
- setInvocationId();
- MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, MDC.get(ONAPLogConstants.MDCs.TARGET_ENTITY));
- }
-
- private String extractRequestID(ClientRequestContext clientRequest) {
- String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
- if (requestId == null || requestId.isEmpty() || requestId.equals(TRACE)) {
- requestId = UUID.randomUUID().toString();
- logger.warn("Could not Find Request ID Generating New One: {}", clientRequest.getUri().getPath());
- }
- return requestId;
- }
-
- private void setInvocationId() {
- String invocationId = MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID);
- if (invocationId == null || invocationId.isEmpty())
- invocationId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
- }
-
-
- @Override
- public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) {
-
- try {
- String statusCode;
- if (Response.Status.Family.familyOf(responseContext.getStatus())
- .equals(Response.Status.Family.SUCCESSFUL)) {
- statusCode = ONAPLogConstants.ResponseStatus.COMPLETED.toString();
- } else {
- statusCode = ONAPLogConstants.ResponseStatus.ERROR.toString();
- }
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseContext.getStatus()));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- logger.info(ONAPLogConstants.Markers.INVOKE_RETURN, "InvokeReturn");
- clearClientMDCs();
- } catch (Exception e) {
- logger.warn("Error in outgoing JAX-RS Inteceptor", e);
- }
- }
-
- private void clearClientMDCs() {
- MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
- MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
- MDC.remove(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP);
- }
-
-}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
deleted file mode 100644
index 7e2b603ba6..0000000000
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
+++ /dev/null
@@ -1,173 +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.logging.jaxrs.filter;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.UUID;
-import javax.annotation.Priority;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.Providers;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.logger.HttpHeadersConstants;
-import org.onap.so.logger.LogConstants;
-import org.onap.so.logger.MdcConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Priority(1)
-@Provider
-@Component
-public class JaxRsFilterLogging implements ContainerRequestFilter, ContainerResponseFilter {
-
- protected static Logger logger = LoggerFactory.getLogger(JaxRsFilterLogging.class);
-
- @Context
- private HttpServletRequest httpServletRequest;
-
- @Context
- private Providers providers;
-
- @Autowired
- private MDCSetup mdcSetup;
-
- @Override
- public void filter(ContainerRequestContext containerRequest) {
- try {
- MultivaluedMap<String, String> headers = containerRequest.getHeaders();
- setRequestId(headers);
- containerRequest.setProperty("requestId", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
- setInvocationId(headers);
- setServiceName(containerRequest);
- setMDCPartnerName(headers);
- mdcSetup.setServerFQDN();
- mdcSetup.setClientIPAddress(httpServletRequest);
- mdcSetup.setInstanceUUID();
- mdcSetup.setEntryTimeStamp();
- MDC.put(HttpHeadersConstants.REQUESTOR_ID, headers.getFirst("X-RequestorID"));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
- MDC.put(LogConstants.URI_BASE, containerRequest.getUriInfo().getBaseUri().toString());
- MDC.put(MdcConstants.ORIGINAL_PARTNER_NAME, MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
- } catch (Exception e) {
- logger.warn("Error in incoming JAX-RS Inteceptor", e);
- }
- }
-
- @Override
- public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
- throws IOException {
- try {
- setResponseStatusCode(responseContext);
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION, payloadMessage(responseContext));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseContext.getStatus()));
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting.");
- MDC.clear();
- } catch (Exception e) {
- MDC.clear();
- logger.warn("Error in outgoing JAX-RS Inteceptor", e);
- }
- }
-
- private void setResponseStatusCode(ContainerResponseContext responseContext) {
- String statusCode;
- if (Response.Status.Family.familyOf(responseContext.getStatus()).equals(Response.Status.Family.SUCCESSFUL)) {
- statusCode = ONAPLogConstants.ResponseStatus.COMPLETED.toString();
- } else {
- statusCode = ONAPLogConstants.ResponseStatus.ERROR.toString();
- }
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- }
-
- private String payloadMessage(ContainerResponseContext responseContext) throws IOException {
- String message = "";
- if (responseContext.hasEntity()) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- Class<?> entityClass = responseContext.getEntityClass();
- Type entityType = responseContext.getEntityType();
- Annotation[] entityAnnotations = responseContext.getEntityAnnotations();
- MediaType mediaType = responseContext.getMediaType();
- @SuppressWarnings("unchecked")
- MessageBodyWriter<Object> bodyWriter = (MessageBodyWriter<Object>) providers
- .getMessageBodyWriter(entityClass, entityType, entityAnnotations, mediaType);
- bodyWriter.writeTo(responseContext.getEntity(), entityClass, entityType, entityAnnotations, mediaType,
- responseContext.getHeaders(), baos);
- message = message.concat(new String(baos.toByteArray()));
- }
- return message;
- }
-
- private void setRequestId(MultivaluedMap<String, String> headers) {
- String requestId = headers.getFirst(ONAPLogConstants.Headers.REQUEST_ID);
- if (requestId == null || requestId.isEmpty())
- requestId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- }
-
- private void setInvocationId(MultivaluedMap<String, String> headers) {
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, findInvocationId(headers));
- }
-
- private void setMDCPartnerName(MultivaluedMap<String, String> headers) {
- String partnerName = headers.getFirst(ONAPLogConstants.Headers.PARTNER_NAME);
- if (partnerName == null || partnerName.isEmpty())
- partnerName = "";
- MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, partnerName);
- }
-
- private String findInvocationId(MultivaluedMap<String, String> headers) {
- String invocationId = headers.getFirst(ONAPLogConstants.Headers.INVOCATION_ID);
- if (invocationId == null || invocationId.isEmpty())
- invocationId = UUID.randomUUID().toString();
- return invocationId;
- }
-
- private void setServiceName(ContainerRequestContext containerRequest) {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, containerRequest.getUriInfo().getPath());
- }
-
- private void clearClientMDCs() {
- MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
- MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
- }
-
-}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java
deleted file mode 100644
index 607f067ec4..0000000000
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.logging.jaxrs.filter;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Map;
-import java.util.UUID;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Response;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.stereotype.Component;
-
-@Component
-public class MDCSetup {
-
- protected static Logger logger = LoggerFactory.getLogger(MDCSetup.class);
-
- private static final String INSTANCE_UUID = UUID.randomUUID().toString();
-
- public void setInstanceUUID() {
- MDC.put(ONAPLogConstants.MDCs.INSTANCE_UUID, INSTANCE_UUID);
- }
-
- public void setServerFQDN() {
- String serverFQDN = "";
- InetAddress addr = null;
- try {
- addr = InetAddress.getLocalHost();
- serverFQDN = addr.toString();
- } catch (UnknownHostException e) {
- logger.warn("Cannot Resolve Host Name");
- serverFQDN = "";
- }
- MDC.put(ONAPLogConstants.MDCs.SERVER_FQDN, serverFQDN);
- }
-
- public void setClientIPAddress(HttpServletRequest httpServletRequest) {
- String remoteIpAddress = "";
- if (httpServletRequest != null) {
- remoteIpAddress = httpServletRequest.getRemoteAddr();
- }
- MDC.put(ONAPLogConstants.MDCs.CLIENT_IP_ADDRESS, remoteIpAddress);
- }
-
- public void setEntryTimeStamp() {
- MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP,
- ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
- }
-
- public void setServiceName(HttpServletRequest request) {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
- }
-
- public void setRequestId(Map<String, String> headers) {
- String requestId = headers.get(ONAPLogConstants.Headers.REQUEST_ID);
- if (requestId == null || requestId.isEmpty())
- requestId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- }
-
- public void setInvocationId(Map<String, String> headers) {
- String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID);
- if (invocationId == null || invocationId.isEmpty())
- invocationId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
- }
-
- public void setMDCPartnerName(Map<String, String> headers) {
- String partnerName = headers.get(ONAPLogConstants.Headers.PARTNER_NAME);
- if (partnerName == null || partnerName.isEmpty())
- partnerName = "";
- MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, partnerName);
- }
-
-
- public void setResponseStatusCode(HttpServletResponse response) {
- String statusCode;
- if (Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)) {
- statusCode = ONAPLogConstants.ResponseStatus.COMPLETED.toString();
- } else {
- statusCode = ONAPLogConstants.ResponseStatus.ERROR.toString();
- }
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- }
-}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/PayloadLoggingFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/PayloadLoggingFilter.java
deleted file mode 100644
index 21c0b52a91..0000000000
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/PayloadLoggingFilter.java
+++ /dev/null
@@ -1,158 +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.logging.jaxrs.filter;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import javax.annotation.Priority;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.ClientRequestContext;
-import javax.ws.rs.client.ClientRequestFilter;
-import javax.ws.rs.client.ClientResponseContext;
-import javax.ws.rs.client.ClientResponseFilter;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.WriterInterceptor;
-import javax.ws.rs.ext.WriterInterceptorContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-@Provider
-@Priority(1)
-public class PayloadLoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor {
-
- private static final Logger logger = LoggerFactory.getLogger(PayloadLoggingFilter.class);
- private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream";
- private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
- private final int maxEntitySize;
-
- public PayloadLoggingFilter() {
- maxEntitySize = 1024 * 1024;
- }
-
- public PayloadLoggingFilter(int maxPayloadSize) {
- this.maxEntitySize = Integer.min(maxPayloadSize, 1024 * 1024);
- }
-
- private void log(StringBuilder sb) {
- logger.debug(sb.toString());
- }
-
- protected InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
- throws IOException {
- if (!stream.markSupported()) {
- stream = new BufferedInputStream(stream);
- }
- stream.mark(maxEntitySize + 1);
- final byte[] entity = new byte[maxEntitySize + 1];
- final int entitySize = stream.read(entity);
- if (entitySize != -1) {
- b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
- }
- if (entitySize > maxEntitySize) {
- b.append("...more...");
- }
- b.append('\n');
- stream.reset();
- return stream;
- }
-
- @Override
- public void filter(ClientRequestContext requestContext) throws IOException {
- if (requestContext.hasEntity()) {
- final OutputStream stream = new LoggingStream(requestContext.getEntityStream());
- requestContext.setEntityStream(stream);
- requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream);
- }
- String method = formatMethod(requestContext);
- log(new StringBuilder("Making " + method + " request to: " + requestContext.getUri() + "\nRequest Headers: "
- + requestContext.getHeaders().toString()));
-
- }
-
- @Override
- public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
- final StringBuilder sb = new StringBuilder();
- if (responseContext.hasEntity()) {
- responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET));
- String method = formatMethod(requestContext);
- log(sb.insert(0, "Response from " + method + ": " + requestContext.getUri() + "\nResponse Headers: "
- + responseContext.getHeaders().toString()));
- }
- }
-
- @Override
- public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
- final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY);
- context.proceed();
- if (stream != null) {
- log(stream.getStringBuilder(DEFAULT_CHARSET));
- }
- }
-
- private class LoggingStream extends FilterOutputStream {
-
- private final StringBuilder sb = new StringBuilder();
- private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- LoggingStream(OutputStream out) {
- super(out);
- }
-
- StringBuilder getStringBuilder(Charset charset) {
- // write entity to the builder
- final byte[] entity = baos.toByteArray();
-
- sb.append(new String(entity, 0, entity.length, charset));
- if (entity.length > maxEntitySize) {
- sb.append("...more...");
- }
- sb.append('\n');
-
- return sb;
- }
-
- @Override
- public void write(final int i) throws IOException {
- if (baos.size() <= maxEntitySize) {
- baos.write(i);
- }
- out.write(i);
- }
- }
-
- private String formatMethod(ClientRequestContext requestContext) {
- String method = requestContext.getHeaderString("X-HTTP-Method-Override");
- if (method == null) {
- method = requestContext.getMethod();
- } else {
- method = requestContext.getMethod() + " (overridden to " + method + ")";
- }
-
- return method;
- }
-}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java
new file mode 100644
index 0000000000..5ae1082464
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java
@@ -0,0 +1,34 @@
+package org.onap.so.logging.jaxrs.filter;
+
+import javax.annotation.Priority;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.HttpHeadersConstants;
+import org.onap.so.logger.LogConstants;
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+import org.onap.logging.filter.base.AuditLogContainerFilter;
+
+@Priority(1)
+@Component
+public class SOAuditLogContainerFilter extends AuditLogContainerFilter {
+
+ private static final String ORIGINAL_PARTNER_NAME = "OriginalPartnerName";
+
+ @Override
+ protected void additionalPreHandling(ContainerRequestContext request) {
+ request.setProperty("requestId", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ MDC.put(ORIGINAL_PARTNER_NAME, MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+ String requestorId = request.getHeaders().getFirst("X-RequestorID");
+ if (requestorId != null) {
+ MDC.put(HttpHeadersConstants.REQUESTOR_ID, requestorId);
+ }
+ MDC.put(LogConstants.URI_BASE, request.getUriInfo().getBaseUri().toString());
+ }
+
+ @Override
+ protected void additionalPostHandling(ContainerResponseContext response) {
+ // override to add additional post handling
+ }
+}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOMetricLogClientFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOMetricLogClientFilter.java
new file mode 100644
index 0000000000..3b6b5216e0
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOMetricLogClientFilter.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.logging.jaxrs.filter;
+
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientResponseContext;
+import org.onap.logging.filter.base.MetricLogClientFilter;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.MdcConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.slf4j.Marker;
+import org.slf4j.MarkerFactory;
+
+
+public class SOMetricLogClientFilter extends MetricLogClientFilter {
+
+ protected static Logger logger = LoggerFactory.getLogger(SOMetricLogClientFilter.class);
+ private static final Marker INVOKE_RETURN = MarkerFactory.getMarker("INVOKE-RETURN");
+
+ @Override
+ public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) {
+ try {
+ setLogTimestamp();
+ setElapsedTimeInvokeTimestamp();
+ setResponseStatusCode(responseContext.getStatus());
+ setResponseDescription(responseContext.getStatus());
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseContext.getStatus()));
+ logger.info(INVOKE_RETURN, "InvokeReturn");
+ clearClientMDCs();
+ setOpenStackResponseCode();
+ } catch (Exception e) {
+ logger.warn("Error in JAX-RS request,response client filter", e);
+ }
+ }
+
+ protected void setOpenStackResponseCode() {
+ if (MDC.get(MdcConstants.OPENSTACK_STATUS_CODE) != null) {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, MDC.get(MdcConstants.OPENSTACK_STATUS_CODE));
+ }
+ }
+}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOSpringClientFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOSpringClientFilter.java
new file mode 100644
index 0000000000..cf826d6350
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOSpringClientFilter.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.logging.jaxrs.filter;
+
+import java.io.IOException;
+import org.onap.logging.filter.spring.SpringClientFilter;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.MdcConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.slf4j.Marker;
+import org.slf4j.MarkerFactory;
+import org.springframework.http.HttpRequest;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SOSpringClientFilter extends SpringClientFilter implements ClientHttpRequestInterceptor {
+
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
+ private static final Marker INVOKE_RETURN = MarkerFactory.getMarker("INVOKE-RETURN");
+
+ @Override
+ protected void post(HttpRequest request, ClientHttpResponse response) {
+ setLogTimestamp();
+ setElapsedTimeInvokeTimestamp();
+ try {
+ setResponseStatusCode(response.getRawStatusCode());
+ int statusCode = response.getRawStatusCode();
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(statusCode));
+ setResponseDescription(statusCode);
+ } catch (IOException e) {
+ logger.error("Unable to get statusCode from response", e);
+ }
+
+
+ logger.info(INVOKE_RETURN, "InvokeReturn");
+ clearClientMDCs();
+ setOpenStackResponseCode();
+ }
+
+ protected void setOpenStackResponseCode() {
+ if (MDC.get(MdcConstants.OPENSTACK_STATUS_CODE) != null) {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, MDC.get(MdcConstants.OPENSTACK_STATUS_CODE));
+ }
+ }
+}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
deleted file mode 100644
index c763dd4374..0000000000
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.logging.jaxrs.filter;
-
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.logger.LogConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpRequest;
-import org.springframework.http.client.ClientHttpRequestExecution;
-import org.springframework.http.client.ClientHttpRequestInterceptor;
-import org.springframework.http.client.ClientHttpResponse;
-import org.springframework.util.StreamUtils;
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-import java.util.UUID;
-import javax.ws.rs.core.Response;
-
-public class SpringClientFilter implements ClientHttpRequestInterceptor {
-
- private final Logger log = LoggerFactory.getLogger(this.getClass());
-
- private static final String TRACE = "trace-#";
- private static final String SO = "SO";
-
- @Override
- public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
- throws IOException {
- processRequest(request, body);
- ClientHttpResponse response = execution.execute(request, body);
- processResponse(response);
- return response;
- }
-
- private void processRequest(HttpRequest request, byte[] body) throws IOException {
- setInvocationId();
- setupHeaders(request);
- setupMDC(request);
- if (log.isDebugEnabled()) {
- log.debug("===========================request begin================================================");
- log.debug("URI : {}", request.getURI());
- log.debug("Method : {}", request.getMethod());
- log.debug("Headers : {}", request.getHeaders());
- log.debug("Request body: {}", new String(body, "UTF-8"));
- log.debug("==========================request end================================================");
- }
- }
-
- private void setupHeaders(HttpRequest clientRequest) {
- HttpHeaders headers = clientRequest.getHeaders();
- headers.add(ONAPLogConstants.Headers.REQUEST_ID, extractRequestID(clientRequest));
- headers.add(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- headers.add(ONAPLogConstants.Headers.PARTNER_NAME, SO);
- }
-
- private String extractRequestID(HttpRequest clientRequest) {
- String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
- if (requestId == null || requestId.isEmpty() || requestId.equals(TRACE)) {
- requestId = UUID.randomUUID().toString();
- log.warn("Could not Find Request ID Generating New One: {}", clientRequest.getURI());
- }
- return requestId;
- }
-
- private void setupMDC(HttpRequest clientRequest) {
- MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP,
- ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
- MDC.put(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME, clientRequest.getURI().toString());
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
- MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, extractTargetEntity(clientRequest));
- }
-
- private String extractTargetEntity(HttpRequest clientRequest) {
- HttpHeaders headers = clientRequest.getHeaders();
- String headerTargetEntity = null;
- List<String> headerTargetEntityList = headers.get(LogConstants.TARGET_ENTITY_HEADER);
- if (headerTargetEntityList != null && !headerTargetEntityList.isEmpty())
- headerTargetEntity = headerTargetEntityList.get(0);
- String targetEntity = MDC.get(ONAPLogConstants.MDCs.TARGET_ENTITY);
- if (targetEntity != null && !targetEntity.isEmpty()) {
- return targetEntity;
- } else if (headerTargetEntity != null && !headerTargetEntity.isEmpty()) {
- targetEntity = headerTargetEntity;
- } else {
- targetEntity = LogConstants.UNKNOWN_TARGET_ENTITY;
- log.warn("Could not Target Entity: {}", clientRequest.getURI());
- }
- return targetEntity;
- }
-
- private void setInvocationId() {
- String invocationId = MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID);
- if (invocationId == null || invocationId.isEmpty())
- invocationId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
- }
-
-
- private void processResponse(ClientHttpResponse response) throws IOException {
- if (log.isDebugEnabled()) {
- log.debug("============================response begin==========================================");
- log.debug("Status code : {}", response.getStatusCode());
- log.debug("Status text : {}", response.getStatusText());
- log.debug("Headers : {}", response.getHeaders());
- log.debug("Response body: {}", StreamUtils.copyToString(response.getBody(), Charset.defaultCharset()));
- log.debug("=======================response end=================================================");
- }
- String statusCode;
- if (Response.Status.Family.familyOf(response.getRawStatusCode()).equals(Response.Status.Family.SUCCESSFUL)) {
- statusCode = ONAPLogConstants.ResponseStatus.COMPLETED.toString();
- } else {
- statusCode = ONAPLogConstants.ResponseStatus.ERROR.toString();
- }
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(response.getRawStatusCode()));
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION, "");
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- log.info(ONAPLogConstants.Markers.INVOKE_RETURN, "InvokeReturn");
- clearClientMDCs();
- }
-
- private void clearClientMDCs() {
- MDC.remove(ONAPLogConstants.MDCs.INVOCATION_ID);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION);
- MDC.remove(ONAPLogConstants.MDCs.RESPONSE_CODE);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_ENTITY);
- MDC.remove(ONAPLogConstants.MDCs.PARTNER_NAME);
- MDC.remove(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME);
- MDC.remove(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP);
- }
-}
diff --git a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
deleted file mode 100644
index fa5a5d5da4..0000000000
--- a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.logging.spring.interceptor;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.UUID;
-import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Providers;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.logging.jaxrs.filter.MDCSetup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-@Component
-public class LoggingInterceptor extends HandlerInterceptorAdapter {
-
- Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class);
-
- @Autowired
- private MDCSetup mdcSetup;
-
- @Context
- private Providers providers;
-
- @Override
- public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
- throws Exception {
-
- Map<String, String> headers = Collections.list((request).getHeaderNames()).stream()
- .collect(Collectors.toMap(h -> h, request::getHeader));
- setRequestId(headers);
- setInvocationId(headers);
- setServiceName(request);
- setMDCPartnerName(headers);
- mdcSetup.setClientIPAddress(request);
- mdcSetup.setEntryTimeStamp();
- mdcSetup.setInstanceUUID();
- mdcSetup.setServerFQDN();
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
- logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
- if (logger.isDebugEnabled())
- logRequestInformation(request);
- return true;
- }
-
- protected void logRequestInformation(HttpServletRequest request) {
- Map<String, String> headers = Collections.list((request).getHeaderNames()).stream()
- .collect(Collectors.toMap(h -> h, request::getHeader));
-
- logger.debug("===========================request begin================================================");
- logger.debug("URI : {}", request.getRequestURI());
- logger.debug("Method : {}", request.getMethod());
- logger.debug("Headers : {}", headers);
- logger.debug("==========================request end================================================");
-
- }
-
- @Override
- public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
- ModelAndView modelAndView) throws Exception {
- setResponseStatusCode(response);
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION, "");
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(response.getStatus()));
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting.");
- MDC.clear();
- }
-
- protected void setResponseStatusCode(HttpServletResponse response) {
- String statusCode;
- if (Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)) {
- statusCode = ONAPLogConstants.ResponseStatus.COMPLETED.toString();
- } else {
- statusCode = ONAPLogConstants.ResponseStatus.ERROR.toString();
- }
- MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
- }
-
- protected void setServiceName(HttpServletRequest request) {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
- }
-
- protected void setRequestId(Map<String, String> headers) {
- String requestId = headers.get(ONAPLogConstants.Headers.REQUEST_ID.toLowerCase());
- if (requestId == null || requestId.isEmpty())
- requestId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- }
-
- protected void setInvocationId(Map<String, String> headers) {
- String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID.toLowerCase());
- if (invocationId == null || invocationId.isEmpty())
- invocationId = UUID.randomUUID().toString();
- MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
- }
-
- protected void setMDCPartnerName(Map<String, String> headers) {
- String partnerName = headers.get(ONAPLogConstants.Headers.PARTNER_NAME.toLowerCase());
- if (partnerName == null || partnerName.isEmpty())
- partnerName = "";
- MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, partnerName);
- }
-
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfOperationRepository.java b/common/src/main/java/org/onap/so/rest/exceptions/HttpResouceNotFoundException.java
index 43c201734f..e7b7b72957 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfOperationRepository.java
+++ b/common/src/main/java/org/onap/so/rest/exceptions/HttpResouceNotFoundException.java
@@ -18,16 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.svnfm.simulator.repository;
+package org.onap.so.rest.exceptions;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.springframework.data.repository.CrudRepository;
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-public interface VnfOperationRepository extends CrudRepository<VnfOperation, String> {
+public class HttpResouceNotFoundException extends RuntimeException {
+
+ private static final long serialVersionUID = 9007892558312387355L;
+ public HttpResouceNotFoundException(final String message) {
+ super(message);
+ }
}
diff --git a/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
index e8ce00c7e5..5d62d8488a 100644
--- a/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
+++ b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
@@ -26,12 +26,28 @@ package org.onap.so.rest.exceptions;
public class RestProcessingException extends RuntimeException {
private static final long serialVersionUID = 16862313537198441L;
+ private final int statusCode;
public RestProcessingException(final String message) {
super(message);
+ statusCode = 0;
}
public RestProcessingException(final String message, final Throwable cause) {
+ this(message, cause, 0);
+ }
+
+ public RestProcessingException(final String message, final Throwable cause, final int statusCode) {
super(message, cause);
+ this.statusCode = statusCode;
+ }
+
+ /**
+ * Get the status code from the response to the rest request, if available
+ *
+ * @return the status code, or 0 if not available
+ */
+ public int getStatusCode() {
+ return statusCode;
}
}
diff --git a/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java
index a627e82802..b82d73bbbf 100644
--- a/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java
+++ b/common/src/main/java/org/onap/so/rest/service/HttpRestServiceProviderImpl.java
@@ -23,6 +23,7 @@ package org.onap.so.rest.service;
import com.google.common.base.Optional;
import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
import org.onap.so.configuration.rest.HttpHeadersProvider;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.so.rest.exceptions.InvalidRestRequestException;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.slf4j.Logger;
@@ -32,7 +33,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
@@ -116,15 +117,18 @@ public class HttpRestServiceProviderImpl implements HttpRestServiceProvider {
try {
return restTemplate.exchange(url, httpMethod, request, clazz);
- } catch (final HttpClientErrorException httpClientErrorException) {
+ } catch (final HttpStatusCodeException httpStatusCodeException) {
final String message = "Unable to invoke HTTP " + httpMethod + " using url: " + url + ", Response: "
- + httpClientErrorException.getRawStatusCode();
- LOGGER.error(message, httpClientErrorException);
- final int rawStatusCode = httpClientErrorException.getRawStatusCode();
- if (rawStatusCode == HttpStatus.BAD_REQUEST.value() || rawStatusCode == HttpStatus.NOT_FOUND.value()) {
+ + httpStatusCodeException.getRawStatusCode();
+ LOGGER.error(message, httpStatusCodeException);
+ final int rawStatusCode = httpStatusCodeException.getRawStatusCode();
+ if (rawStatusCode == HttpStatus.BAD_REQUEST.value()) {
throw new InvalidRestRequestException("No result found for given url: " + url);
+ } else if (rawStatusCode == HttpStatus.NOT_FOUND.value()) {
+ throw new HttpResouceNotFoundException("No result found for given url: " + url);
}
- throw new RestProcessingException("Unable to invoke HTTP " + httpMethod + " using URL: " + url);
+ throw new RestProcessingException("Unable to invoke HTTP " + httpMethod + " using URL: " + url,
+ httpStatusCodeException, rawStatusCode);
} catch (final RestClientException restClientException) {
LOGGER.error("Unable to invoke HTTP POST using url: {}", url, restClientException);
diff --git a/common/src/main/java/org/onap/so/security/SecurityFilters.java b/common/src/main/java/org/onap/so/security/SecurityFilters.java
new file mode 100644
index 0000000000..7ad0fd05df
--- /dev/null
+++ b/common/src/main/java/org/onap/so/security/SecurityFilters.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.security;
+
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.Ordered;
+
+@Configuration
+@Profile("!test & aaf")
+public class SecurityFilters {
+
+ @Bean
+ public FilterRegistrationBean<SoCadiFilter> loginRegistrationBean() {
+ FilterRegistrationBean<SoCadiFilter> filterRegistrationBean = new FilterRegistrationBean<>();
+ filterRegistrationBean.setFilter(new SoCadiFilter());
+ filterRegistrationBean.setName("cadiFilter");
+ filterRegistrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
+ return filterRegistrationBean;
+ }
+}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java b/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java
index f45d5a0219..c778dde9af 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java
+++ b/common/src/main/java/org/onap/so/security/SoBasicWebSecurityConfigurerAdapter.java
@@ -1,52 +1,55 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.security;
-package org.onap.so.adapters.vnfmadapter;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.annotation.Order;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.firewall.StrictHttpFirewall;
import org.springframework.util.StringUtils;
/**
- * Configure the web security for the application.
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
*/
@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
+@Configuration
+@Order(1)
+@Profile({"basic"})
+public class SoBasicWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
- @Value("${server.ssl.client-auth:none}")
- private String clientAuth;
+ @Autowired
+ private SoUserCredentialConfiguration soUserCredentialConfiguration;
@Override
protected void configure(final HttpSecurity http) throws Exception {
- if (clientAuth.equalsIgnoreCase("need")) {
- http.csrf().disable().authorizeRequests().anyRequest().permitAll();
- } else {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
- }
+ http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
+ .antMatchers("/**")
+ .hasAnyRole(StringUtils.collectionToDelimitedString(soUserCredentialConfiguration.getRoles(), ","))
+ .and().httpBasic();
}
@Override
@@ -56,4 +59,10 @@ public class WebSecurityConfigImpl extends WebSecurityConfig {
web.httpFirewall(firewall);
}
+ @Override
+ protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
+ auth.userDetailsService(soUserCredentialConfiguration.userDetailsService())
+ .passwordEncoder(soUserCredentialConfiguration.passwordEncoder());
+ }
+
}
diff --git a/common/src/main/java/org/onap/so/security/SoCadiFilter.java b/common/src/main/java/org/onap/so/security/SoCadiFilter.java
new file mode 100644
index 0000000000..2763d6ee15
--- /dev/null
+++ b/common/src/main/java/org/onap/so/security/SoCadiFilter.java
@@ -0,0 +1,118 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP SO
+ * ================================================================================
+ * Copyright (C) 2017-2018 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.security;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import org.onap.aaf.cadi.config.Config;
+import org.onap.aaf.cadi.filter.CadiFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+
+@Component
+@Profile("!test & aaf")
+public class SoCadiFilter extends CadiFilter {
+
+ protected final Logger logger = LoggerFactory.getLogger(SoCadiFilter.class);
+
+ @Value("${mso.config.cadi.cadiLoglevel:#{null}}")
+ private String cadiLoglevel;
+
+ @Value("${mso.config.cadi.cadiKeyFile:#{null}}")
+ private String cadiKeyFile;
+
+ @Value("${mso.config.cadi.cadiTruststorePassword:#{null}}")
+ private String cadiTrustStorePassword;
+
+ @Value("${mso.config.cadi.cadiTrustStore:#{null}}")
+ private String cadiTrustStore;
+
+ @Value("${mso.config.cadi.cadiLatitude:#{null}}")
+ private String cadiLatitude;
+
+ @Value("${mso.config.cadi.cadiLongitude:#{null}}")
+ private String cadiLongitude;
+
+ @Value("${mso.config.cadi.aafEnv:#{null}}")
+ private String aafEnv;
+
+ @Value("${mso.config.cadi.aafApiVersion:#{null}}")
+ private String aafApiVersion;
+
+ @Value("${mso.config.cadi.aafRootNs:#{null}}")
+ private String aafRootNs;
+
+ @Value("${mso.config.cadi.aafId:#{null}}")
+ private String aafMechId;
+
+ @Value("${mso.config.cadi.aafPassword:#{null}}")
+ private String aafMechIdPassword;
+
+ @Value("${mso.config.cadi.aafLocateUrl:#{null}}")
+ private String aafLocateUrl;
+
+ @Value("${mso.config.cadi.aafUrl:#{null}}")
+ private String aafUrl;
+
+ @Value("${mso.config.cadi.apiEnforcement:#{null}}")
+ private String apiEnforcement;
+
+ @Value("${mso.config.cadi.userExpires:#{null}}")
+ private String userExpires;
+
+ private void checkIfNullProperty(String key, String value) {
+ /*
+ * When value is null, it is not defined in application.yaml set nothing in System properties
+ */
+ if (value != null) {
+ System.setProperty(key, value);
+ }
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ checkIfNullProperty(Config.CADI_LOGLEVEL, cadiLoglevel);
+ checkIfNullProperty(Config.CADI_KEYFILE, cadiKeyFile);
+ checkIfNullProperty(Config.CADI_TRUSTSTORE, cadiTrustStore);
+ checkIfNullProperty(Config.CADI_TRUSTSTORE_PASSWORD, cadiTrustStorePassword);
+ checkIfNullProperty(Config.CADI_LATITUDE, cadiLatitude);
+ checkIfNullProperty(Config.CADI_LONGITUDE, cadiLongitude);
+ checkIfNullProperty(Config.AAF_ENV, aafEnv);
+ checkIfNullProperty(Config.AAF_API_VERSION, aafApiVersion);
+ checkIfNullProperty(Config.AAF_ROOT_NS, aafRootNs);
+ checkIfNullProperty(Config.AAF_APPID, aafMechId);
+ checkIfNullProperty(Config.AAF_APPPASS, aafMechIdPassword);
+ checkIfNullProperty(Config.AAF_LOCATE_URL, aafLocateUrl);
+ checkIfNullProperty(Config.AAF_URL, aafUrl);
+ checkIfNullProperty(Config.CADI_API_ENFORCEMENT, apiEnforcement);
+ checkIfNullProperty(Config.AAF_USER_EXPIRES, userExpires);
+ // checkIfNullProperty(AFT_ENVIRONMENT_VAR, aftEnv);
+ logger.debug(" *** init Filter Config *** ");
+ super.init(filterConfig);
+ }
+
+
+}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java b/common/src/main/java/org/onap/so/security/SoNoAuthWebSecurityConfigurerAdapter.java
index 18eadd2fc3..b3e4842bbd 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java
+++ b/common/src/main/java/org/onap/so/security/SoNoAuthWebSecurityConfigurerAdapter.java
@@ -1,48 +1,45 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.security;
-package org.onap.svnfm.simulator.config;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.firewall.StrictHttpFirewall;
/**
- * Configure the web security for the application.
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
*/
@EnableWebSecurity
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(final HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/**").permitAll();
- }
-
+@Configuration
+@Order(2)
+@Profile({"aaf", "test"})
+public class SoNoAuthWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
public void configure(final WebSecurity web) throws Exception {
- super.configure(web);
+ web.ignoring().antMatchers("/**");
final StrictHttpFirewall firewall = new MSOSpringFirewall();
web.httpFirewall(firewall);
}
-
}
diff --git a/common/src/main/java/org/onap/so/security/WebSecurityConfig.java b/common/src/main/java/org/onap/so/security/SoUserCredentialConfiguration.java
index 635784c642..ee680511b9 100644
--- a/common/src/main/java/org/onap/so/security/WebSecurityConfig.java
+++ b/common/src/main/java/org/onap/so/security/SoUserCredentialConfiguration.java
@@ -1,8 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,9 +13,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.onap.so.security;
import java.util.ArrayList;
@@ -25,17 +24,20 @@ import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.stereotype.Component;
-
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+@Component
@ConfigurationProperties(prefix = "spring.security")
-public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+public class SoUserCredentialConfiguration {
- private List<UserCredentials> credentials;
- private List<String> roles = new ArrayList<>();
+ private List<UserCredentials> credentials = new ArrayList<>();
+ private final List<String> roles = new ArrayList<>();
public List<String> getRoles() {
return roles;
@@ -52,8 +54,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
return credentials;
}
- public void setUsercredentials(List<UserCredentials> usercredentials) {
- this.credentials = usercredentials;
+ public void setUsercredentials(final List<UserCredentials> usercredentials) {
+ if (usercredentials != null) {
+ this.credentials = usercredentials;
+ }
}
@Bean
@@ -65,10 +69,4 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
-
- @Override
- protected void configure(AuthenticationManagerBuilder auth) throws Exception {
- auth.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder());
- }
-
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Pnfs.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Pnfs.java
new file mode 100644
index 0000000000..f601ebc3bd
--- /dev/null
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Pnfs.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.serviceinstancebeans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@JsonRootName(value = "pnfs")
+@JsonInclude(JsonInclude.Include.NON_DEFAULT)
+public class Pnfs implements Serializable {
+
+ private static final long serialVersionUID = 8081495240474276501L;
+ @JsonProperty("modelInfo")
+ protected ModelInfo modelInfo;
+ @JsonProperty("cloudConfiguration")
+ protected CloudConfiguration cloudConfiguration;
+ @JsonProperty("instanceName")
+ protected String instanceName;
+ @JsonProperty("platform")
+ protected Platform platform;
+ @JsonProperty("lineOfBusiness")
+ protected LineOfBusiness lineOfBusiness;
+ @JsonProperty("productFamilyId")
+ protected String productFamilyId;
+ @JsonProperty("instanceParams")
+ private List<Map<String, String>> instanceParams = new ArrayList<>();
+
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public void setModelInfo(ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+ public CloudConfiguration getCloudConfiguration() {
+ return cloudConfiguration;
+ }
+
+ public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
+ this.cloudConfiguration = cloudConfiguration;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public void setInstanceName(String instanceName) {
+ this.instanceName = instanceName;
+ }
+
+ public Platform getPlatform() {
+ return platform;
+ }
+
+ public void setPlatform(Platform platform) {
+ this.platform = platform;
+ }
+
+ public LineOfBusiness getLineOfBusiness() {
+ return lineOfBusiness;
+ }
+
+ public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
+ this.lineOfBusiness = lineOfBusiness;
+ }
+
+ public String getProductFamilyId() {
+ return productFamilyId;
+ }
+
+ public void setProductFamilyId(String productFamilyId) {
+ this.productFamilyId = productFamilyId;
+ }
+
+ public List<Map<String, String>> getInstanceParams() {
+ return instanceParams;
+ }
+
+ public void setInstanceParams(List<Map<String, String>> instanceParams) {
+ this.instanceParams = instanceParams;
+ }
+
+ @Override
+ public String toString() {
+ return "Pnfs [modelInfo=" + modelInfo + ", cloudConfiguration=" + cloudConfiguration + ", instanceName="
+ + instanceName + ", platform=" + platform + ", " + "lineOfBusiness=" + lineOfBusiness
+ + ", productFamilyId=" + productFamilyId + ", instanceParams=" + instanceParams + "]";
+ }
+
+}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java
index 121fd4a1a5..33678b336f 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java
@@ -33,7 +33,12 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.builder.ToStringBuilder;
-import com.fasterxml.jackson.annotation.JsonRootName;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
+import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
+import com.fasterxml.jackson.annotation.JsonTypeName;
/**
@@ -63,7 +68,9 @@ import com.fasterxml.jackson.annotation.JsonRootName;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {"policyException", "serviceException"})
@XmlRootElement(name = "requestError")
-@JsonRootName(value = "requestError")
+@JsonTypeName("requestError")
+@JsonTypeInfo(include = As.WRAPPER_OBJECT, use = Id.NAME)
+@JsonInclude(Include.NON_NULL)
public class RequestError {
protected PolicyException policyException;
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestInfo.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestInfo.java
index 61192c3147..250c5df5ce 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestInfo.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestInfo.java
@@ -55,6 +55,8 @@ public class RequestInfo implements Serializable {
protected boolean suppressRollback;
@JsonProperty("requestorId")
protected String requestorId;
+ @JsonProperty("applicationId")
+ protected String applicationId;
/**
* Gets the value of the callbackUrl property.
@@ -201,12 +203,21 @@ public class RequestInfo implements Serializable {
this.requestorId = requestorId;
}
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
+ }
+
@Override
public String toString() {
return "RequestInfo [billingAccountNumber=" + billingAccountNumber + ", callbackUrl=" + callbackUrl
+ ", correlator=" + correlator + ", orderNumber=" + orderNumber + ", productFamilyId=" + productFamilyId
+ ", orderVersion=" + orderVersion + ", source=" + source + ", instanceName=" + instanceName
- + ", suppressRollback=" + suppressRollback + ", requestorId=" + requestorId + "]";
+ + ", suppressRollback=" + suppressRollback + ", requestorId=" + requestorId + ", applicationId="
+ + applicationId + "]";
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
index 9fceed1641..a72229a25c 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
@@ -57,6 +57,9 @@ public class RequestParameters implements Serializable {
@JsonProperty("rebuildVolumeGroups")
private Boolean rebuildVolumeGroups;
+ @JsonProperty("enforceValidNfValues")
+ private Boolean enforceValidNfValues = false;
+
@Override
public String toString() {
return new ToStringBuilder(this).append("subscriptionServiceType", subscriptionServiceType)
@@ -64,7 +67,15 @@ public class RequestParameters implements Serializable {
.append("usePreload", usePreload).append("autoBuildVfModules", autoBuildVfModules)
.append("cascadeDelete", cascadeDelete).append("testApi", testApi)
.append("retainAssignments", retainAssignments).append("rebuildVolumeGroups", rebuildVolumeGroups)
- .toString();
+ .append("enforceValidNfValues", enforceValidNfValues).toString();
+ }
+
+ public Boolean getEnforceValidNfValues() {
+ return enforceValidNfValues;
+ }
+
+ public void setEnforceValidNfValues(Boolean enforceValidNfValues) {
+ this.enforceValidNfValues = enforceValidNfValues;
}
public String getSubscriptionServiceType() {
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java
index 2123b2f6fc..acac8c4033 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 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
@@ -36,6 +38,8 @@ public class Resources implements Serializable {
private static final long serialVersionUID = 2194797231782624520L;
@JsonProperty("vnfs")
private List<Vnfs> vnfs = new ArrayList<>();
+ @JsonProperty("pnfs")
+ private List<Pnfs> pnfs = new ArrayList<>();
@JsonProperty("networks")
private List<Networks> networks = new ArrayList<>();
@@ -47,6 +51,14 @@ public class Resources implements Serializable {
this.vnfs = vnfs;
}
+ public List<Pnfs> getPnfs() {
+ return pnfs;
+ }
+
+ public void setPnfs(List<Pnfs> pnfs) {
+ this.pnfs = pnfs;
+ }
+
public List<Networks> getNetworks() {
return networks;
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java
index f2976136e9..cbbc7f61c1 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java
@@ -31,6 +31,8 @@ package org.onap.so.serviceinstancebeans;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -55,6 +57,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "serviceException")
@JsonRootName(value = "serviceException")
+@JsonInclude(Include.NON_EMPTY)
public class ServiceException extends ExceptionType {
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
index 1a0e13587e..5bcdcb181b 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceInstancesRequest.java
@@ -32,6 +32,8 @@ public class ServiceInstancesRequest implements Serializable {
private String serviceInstanceId;
@JsonProperty("vnfInstanceId")
private String vnfInstanceId;
+ @JsonProperty("pnfId")
+ private String pnfId;
@JsonProperty("networkInstanceId")
private String networkInstanceId;
@JsonProperty("volumeGroupInstanceId")
@@ -67,6 +69,14 @@ public class ServiceInstancesRequest implements Serializable {
this.vnfInstanceId = vnfInstanceId;
}
+ public String getPnfId() {
+ return pnfId;
+ }
+
+ public void setPnfId(String pnfId) {
+ this.pnfId = pnfId;
+ }
+
public String getNetworkInstanceId() {
return networkInstanceId;
}
@@ -113,6 +123,7 @@ public class ServiceInstancesRequest implements Serializable {
sb.append("requestDetails=").append(requestDetails);
sb.append(", serviceInstanceId='").append(serviceInstanceId).append('\'');
sb.append(", vnfInstanceId='").append(vnfInstanceId).append('\'');
+ sb.append(", pnfId='").append(pnfId).append('\'');
sb.append(", networkInstanceId='").append(networkInstanceId).append('\'');
sb.append(", volumeGroupInstanceId='").append(volumeGroupInstanceId).append('\'');
sb.append(", vfModuleInstanceId='").append(vfModuleInstanceId).append('\'');
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Vnfs.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Vnfs.java
index a2eb35464b..ca67f566b1 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/Vnfs.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Vnfs.java
@@ -51,7 +51,8 @@ public class Vnfs implements Serializable {
private List<Map<String, String>> instanceParams = new ArrayList<>();
@JsonProperty("vfModules")
private List<VfModules> vfModules = new ArrayList<>();
-
+ @JsonProperty("applicationId")
+ protected String applicationId;
public ModelInfo getModelInfo() {
return modelInfo;
@@ -117,12 +118,20 @@ public class Vnfs implements Serializable {
this.vfModules = vfModules;
}
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
+ }
+
@Override
public String toString() {
return "Vnfs [modelInfo=" + modelInfo + ", cloudConfiguration=" + cloudConfiguration + ", instanceName="
+ instanceName + ", platform=" + platform + ", " + "lineOfBusiness=" + lineOfBusiness
+ ", productFamilyId=" + productFamilyId + ", instanceParams=" + instanceParams + ", vfModules="
- + vfModules + "]";
+ + vfModules + ", applicaionId=" + applicationId + " ]";
}
}
diff --git a/common/src/main/java/org/onap/so/utils/Components.java b/common/src/main/java/org/onap/so/utils/Components.java
new file mode 100644
index 0000000000..5af8c5aa56
--- /dev/null
+++ b/common/src/main/java/org/onap/so/utils/Components.java
@@ -0,0 +1,23 @@
+package org.onap.so.utils;
+
+import java.util.EnumSet;
+import java.util.Set;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.filter.base.ONAPComponentsList;
+
+public enum Components implements ONAPComponentsList {
+ OPENSTACK, UNKNOWN, ASDC_CONTROLLER, APIH, SDNC_ADAPTER;
+
+
+ public static Set<Components> getSOInternalComponents() {
+ return EnumSet.of(ASDC_CONTROLLER, APIH, SDNC_ADAPTER);
+ }
+
+ @Override
+ public String toString() {
+ if (getSOInternalComponents().contains(this))
+ return ONAPComponents.SO + "." + this.name();
+ else
+ return this.name();
+ }
+}
diff --git a/common/src/main/java/org/onap/so/utils/CryptoUtils.java b/common/src/main/java/org/onap/so/utils/CryptoUtils.java
index 640660e97c..1c38dfb774 100644
--- a/common/src/main/java/org/onap/so/utils/CryptoUtils.java
+++ b/common/src/main/java/org/onap/so/utils/CryptoUtils.java
@@ -76,6 +76,8 @@ public final class CryptoUtils {
* @throws GeneralSecurityException
*/
public static String decrypt(String message, String keyString) throws GeneralSecurityException {
+ if (message.equals(System.getenv("PLAINTEXTPASSWORD")))
+ return message;
SecretKeySpec sks = getSecretKeySpec(keyString);
byte[] cipherText = hexStringToByteArray(message);
Cipher cipher = Cipher.getInstance(AES_GCM_NO_PADDING);
@@ -91,7 +93,7 @@ public final class CryptoUtils {
return CryptoUtils.encrypt(message, CLOUD_KEY);
} catch (GeneralSecurityException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "Exception in encryptPassword ", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in encryptPassword ", e);
return null;
}
}
@@ -101,7 +103,7 @@ public final class CryptoUtils {
return CryptoUtils.decrypt(message, CLOUD_KEY);
} catch (GeneralSecurityException e) {
logger.error(LoggingAnchor.THREE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
- ErrorCode.BusinessProcesssError.getValue(), "Exception in encryptPassword ", e);
+ ErrorCode.BusinessProcessError.getValue(), "Exception in encryptPassword ", e);
return null;
}
}
diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
new file mode 100644
index 0000000000..e43b431821
--- /dev/null
+++ b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
@@ -0,0 +1,46 @@
+package org.onap.so.utils;
+
+import java.security.GeneralSecurityException;
+import org.camunda.bpm.client.ExternalTaskClient;
+import org.camunda.bpm.client.interceptor.ClientRequestInterceptor;
+import org.camunda.bpm.client.interceptor.auth.BasicAuthProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ExternalTaskServiceUtils {
+
+ @Autowired
+ public Environment env;
+
+ private static final Logger logger = LoggerFactory.getLogger(ExternalTaskServiceUtils.class);
+
+ public ExternalTaskClient createExternalTaskClient() throws Exception {
+ String auth = getAuth();
+ ClientRequestInterceptor interceptor = createClientInterceptor(auth);
+ return ExternalTaskClient.create().baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1)
+ .addInterceptor(interceptor).asyncResponseTimeout(120000).build();
+ }
+
+ protected ClientRequestInterceptor createClientInterceptor(String auth) {
+ return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth);
+ }
+
+ protected String getAuth() throws Exception {
+ try {
+ return CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
+ } catch (IllegalStateException | GeneralSecurityException e) {
+ logger.error("Error Decrypting Password", e);
+ throw new Exception("Cannot load password");
+ }
+ }
+
+ public int getMaxClients() {
+ return Integer.parseInt(env.getProperty("workflow.topics.maxClients", "3"));
+ }
+
+
+}
diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java
new file mode 100644
index 0000000000..a2aed638fe
--- /dev/null
+++ b/common/src/main/java/org/onap/so/utils/ExternalTaskUtils.java
@@ -0,0 +1,36 @@
+package org.onap.so.utils;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public abstract class ExternalTaskUtils {
+
+ @Autowired
+ Environment env;
+
+ private static final Logger logger = LoggerFactory.getLogger(ExternalTaskUtils.class);
+
+ public long calculateRetryDelay(int currentRetries) {
+ int retrySequence = getRetrySequence().length - currentRetries;
+ return Integer.parseInt(getRetrySequence()[retrySequence]) * getRetryMutiplier();
+ }
+
+ protected Long getRetryMutiplier() {
+ return Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier", "6000"));
+ }
+
+ protected String[] getRetrySequence() {
+ String[] seq = {"1", "1", "2", "3", "5", "8", "13", "20"};
+ if (env.getProperty("mso.workflow.topics.retrySequence") != null) {
+ seq = env.getProperty("mso.workflow.topics.retrySequence", String[].class);
+ }
+ return seq;
+ }
+}
diff --git a/common/src/test/java/org/onap/so/BeansTest.java b/common/src/test/java/org/onap/so/BeansTest.java
index 8bde3c4eb7..9e8a0184ab 100644
--- a/common/src/test/java/org/onap/so/BeansTest.java
+++ b/common/src/test/java/org/onap/so/BeansTest.java
@@ -60,6 +60,7 @@ public class BeansTest {
@Test
public void pojoStructure() {
+ test("org.onap.so.appc.orchestrator.service.beans");
test("org.onap.so.client.policy.entities");
test("org.onap.so.client.grm.beans");
test("org.onap.so.client.ruby.beans");
diff --git a/common/src/test/java/org/onap/so/client/HttpClientTest.java b/common/src/test/java/org/onap/so/client/HttpClientTest.java
index b12ed5956a..a01e2bb812 100644
--- a/common/src/test/java/org/onap/so/client/HttpClientTest.java
+++ b/common/src/test/java/org/onap/so/client/HttpClientTest.java
@@ -32,7 +32,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Rule;
import org.junit.Test;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
public class HttpClientTest {
@@ -49,7 +49,7 @@ public class HttpClientTest {
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody("")));
URL url = new URL("http://localhost:" + wireMockConfig().portNumber() + "/services/sdnc/post");
- HttpClient client = httpClientFactory.newJsonClient(url, TargetEntity.BPMN);
+ HttpClient client = httpClientFactory.newJsonClient(url, ONAPComponents.BPMN);
client.addBasicAuthHeader(
"97FF88AB352DA16E00DDD81E3876431DEF8744465DACA489EB3B3BE1F10F63EDA1715E626D0A4827A3E19CD88421BF",
@@ -68,7 +68,7 @@ public class HttpClientTest {
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody("")));
URL url = new URL("http://localhost:" + wireMockConfig().portNumber() + "/services/sdnc/post");
- HttpClient client = httpClientFactory.newJsonClient(url, TargetEntity.BPMN);
+ HttpClient client = httpClientFactory.newJsonClient(url, ONAPComponents.BPMN);
client.addAdditionalHeader("Accept", "application/json");
client.addAdditionalHeader("id", null);
@@ -86,7 +86,7 @@ public class HttpClientTest {
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody("")));
URL url = new URL("http://localhost:" + wireMockConfig().portNumber() + "/services/sdnc/post");
- HttpClient client = httpClientFactory.newJsonClient(url, TargetEntity.BPMN);
+ HttpClient client = httpClientFactory.newJsonClient(url, ONAPComponents.BPMN);
client.addBasicAuthHeader("", "12345");
client.addAdditionalHeader("Accept", "application/json");
diff --git a/common/src/test/java/org/onap/so/client/RestClientTest.java b/common/src/test/java/org/onap/so/client/RestClientTest.java
index 745dee23e8..cd00a9e4de 100644
--- a/common/src/test/java/org/onap/so/client/RestClientTest.java
+++ b/common/src/test/java/org/onap/so/client/RestClientTest.java
@@ -39,7 +39,7 @@ import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
@RunWith(MockitoJUnitRunner.class)
public class RestClientTest {
@@ -82,7 +82,7 @@ public class RestClientTest {
private RestClient buildSpy() throws MalformedURLException, IllegalArgumentException, UriBuilderException {
RestClient client = httpClientFactory.newJsonClient(UriBuilder.fromUri("http://localhost/test").build().toURL(),
- TargetEntity.BPMN);
+ ONAPComponents.BPMN);
return spy(client);
}
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java b/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java
index 2ef50dd77b..3587c71de0 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java
@@ -79,6 +79,22 @@ public class AAIErrorFormatterTest {
}
@Test
+ public void errorMessageOnPercentEncodedTest() {
+ ServiceException svcException = new ServiceException();
+ svcException.setText("test my%20Test %1 message - %2");
+ svcException.setVariables(Arrays.asList("error", "service exception %1 test"));
+
+ RequestError requestError = new RequestError();
+ requestError.setServiceException(svcException);
+
+ doReturn(requestError).when(errorObj).getRequestError();
+
+ AAIErrorFormatter formatter = new AAIErrorFormatter(errorObj);
+ String result = formatter.getMessage();
+ assertEquals("equal", "test my%20Test error message - service exception error test", result);
+ }
+
+ @Test
public void testGetMessageNoParsable() {
errorObj.setRequestError(null);
AAIErrorFormatter formatter = new AAIErrorFormatter(errorObj);
diff --git a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
index 6e55fe17fa..fb45652d53 100644
--- a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.so.client.graphinventory.entities.DSLNode;
+import org.onap.so.client.graphinventory.entities.DSLNodeKey;
import org.onap.so.client.graphinventory.entities.DSLQueryBuilder;
import org.onap.so.client.graphinventory.entities.__;
@@ -108,4 +109,40 @@ public class DSLQueryBuilderTest {
builder.equals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id')"));
assertTrue(builder.equals(builder));
}
+
+
+ @Test
+ public void mixedTypeTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.CLOUD_REGION,
+ __.key("cloud-owner", "owner"), __.key("cloud-region-id", "id")));
+ builder.to(__.node(AAIObjectType.VLAN_TAG, __.key("vlan-id-outer", 167), __.key("my-boolean", true)).output());
+ assertTrue(builder.equals(
+ "cloud-region('cloud-owner', 'owner')('cloud-region-id', 'id') > vlan-tag*('vlan-id-outer', 167)('my-boolean', true)"));
+ }
+
+ @Test
+ public void outputOnNodeLambdasTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder =
+ new DSLQueryBuilder<>(new DSLNode(AAIObjectType.L_INTERFACE, new DSLNodeKey("interface-id", "myId")));
+
+ builder.to(AAIObjectType.VSERVER, __.key("vserver-name", "myName")).output().to(AAIObjectType.P_INTERFACE)
+ .output();
+ assertEquals("l-interface('interface-id', 'myId') > vserver*('vserver-name', 'myName') > p-interface*",
+ builder.build());
+ }
+
+ @Test
+ public void skipOutputOnUnionTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder =
+ new DSLQueryBuilder<>(new DSLNode(AAIObjectType.GENERIC_VNF, __.key("vnf-id", "vnfId")).output());
+
+ builder.union(__.node(AAIObjectType.PSERVER).output().to(__.node(AAIObjectType.COMPLEX).output()),
+ __.node(AAIObjectType.VSERVER)
+ .to(__.node(AAIObjectType.PSERVER).output().to(__.node(AAIObjectType.COMPLEX).output())))
+ .output();
+
+ assertEquals(
+ "generic-vnf*('vnf-id', 'vnfId') > " + "[ pserver* > complex*, " + "vserver > pserver* > complex* ]",
+ builder.build());
+ }
}
diff --git a/common/src/test/java/org/onap/so/client/adapter/rest/AdapterRestClientTest.java b/common/src/test/java/org/onap/so/client/adapter/rest/AdapterRestClientTest.java
index bc600310b3..5075da3b7a 100644
--- a/common/src/test/java/org/onap/so/client/adapter/rest/AdapterRestClientTest.java
+++ b/common/src/test/java/org/onap/so/client/adapter/rest/AdapterRestClientTest.java
@@ -34,7 +34,7 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.so.client.policy.JettisonStyleMapperProvider;
import org.onap.so.utils.CryptoUtils;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
public class AdapterRestClientTest {
@@ -88,9 +88,9 @@ public class AdapterRestClientTest {
}
@Test
- public void getTargetEntity_success() throws URISyntaxException {
+ public void getONAPComponents_success() throws URISyntaxException {
AdapterRestClient testedObject = new AdapterRestClient(adapterRestPropertiesMock, new URI(""));
- assertThat(testedObject.getTargetEntity()).isEqualTo(TargetEntity.OPENSTACK_ADAPTER);
+ assertThat(testedObject.getTargetEntity()).isEqualTo(ONAPComponents.OPENSTACK_ADAPTER);
}
@Test
diff --git a/common/src/test/java/org/onap/so/client/dmaap/rest/DMaaPRestClientTest.java b/common/src/test/java/org/onap/so/client/dmaap/rest/DMaaPRestClientTest.java
new file mode 100644
index 0000000000..ca5b5da2da
--- /dev/null
+++ b/common/src/test/java/org/onap/so/client/dmaap/rest/DMaaPRestClientTest.java
@@ -0,0 +1,97 @@
+/*-
+ * ============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.client.dmaap.rest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.MDC;
+
+public class DMaaPRestClientTest {
+
+ URL url;
+ private final String contentType = "application/json";
+ private final String auth = "";
+ private final String key = "";
+
+
+ @Test
+ public void headerMapTest() {
+
+ try {
+ url = new URL("http://testhost.com");
+ } catch (MalformedURLException e) {
+
+ throw new RuntimeException(e);
+ }
+ DMaaPRestClient client = new DMaaPRestClient(url, contentType, auth, key);
+ Map<String, String> map = new HashMap<>();
+ client.initializeHeaderMap(map);
+ map.put(ONAPLogConstants.MDCs.REQUEST_ID, "1234");
+ assertNotNull(map);
+ assertEquals("Found expected RequesttId", "1234", map.get(ONAPLogConstants.MDCs.REQUEST_ID));
+
+ }
+
+ @Test
+ public void headerMapInvocationIdNotNullTest() {
+
+ try {
+ url = new URL("http://testhost.com");
+ } catch (MalformedURLException e) {
+
+ throw new RuntimeException(e);
+ }
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, "1234");
+ DMaaPRestClient client = new DMaaPRestClient(url, contentType, auth, key);
+ Map<String, String> map = new HashMap<>();
+ client.initializeHeaderMap(map);
+
+ assertNotNull(map);
+ assertEquals("Found expected RequestId", "1234", map.get(ONAPLogConstants.Headers.INVOCATION_ID));
+
+ }
+
+ @Test
+ public void headerMapInvocationIdNullTest() {
+
+ try {
+ url = new URL("http://testhost.com");
+ } catch (MalformedURLException e) {
+
+ throw new RuntimeException(e);
+ }
+
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, null);
+ DMaaPRestClient client = new DMaaPRestClient(url, contentType, auth, key);
+ Map<String, String> map = new HashMap<>();
+ client.initializeHeaderMap(map);
+
+ assertNotNull(map);
+ assertEquals("header not found as expected", null, map.get(ONAPLogConstants.Headers.INVOCATION_ID));
+
+ }
+}
diff --git a/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java b/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
index ad22c65248..3323fd8409 100644
--- a/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
+++ b/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Copyright (C) 2019 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
@@ -23,32 +25,50 @@ package org.onap.so.client.policy;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doReturn;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
+import org.onap.so.client.RestClient;
import org.onap.so.client.defaultproperties.PolicyRestPropertiesImpl;
+import org.onap.so.client.policy.entities.AllowedTreatments;
+import org.onap.so.client.policy.entities.Bbid;
import org.onap.so.client.policy.entities.Config;
import org.onap.so.client.policy.entities.ConfigRequestParameters;
+import org.onap.so.client.policy.entities.DecisionAttributes;
import org.onap.so.client.policy.entities.DictionaryData;
+import org.onap.so.client.policy.entities.DictionaryItemsRequest;
+import org.onap.so.client.policy.entities.DictionaryJson;
import org.onap.so.client.policy.entities.PolicyConfig;
import org.onap.so.client.policy.entities.PolicyDecision;
+import org.onap.so.client.policy.entities.PolicyDecisionRequest;
import org.onap.so.client.policy.entities.PolicyServiceType;
-import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.onap.so.client.policy.entities.Workstep;
public class PolicyClientImplTest {
+ private static final String SERVICE_TYPE = "serviceTest";
+ private static final String VNF_TYPE = "vTypeTest";
+ private static final String BB_ID = "bbTest";
+ private static final String WORK_STEP = "wStepTest";
+ private static final String ERROR_CODE = "errCodeTest";
+
@BeforeClass
public static void setUp() {
System.setProperty("mso.config.path", "src/test/resources");
@@ -67,53 +87,65 @@ public class PolicyClientImplTest {
}
@Test
- @Ignore
- public void getDecisionTest() {
- PolicyClient client = new PolicyClientImpl();
- PolicyDecision decision = client.getDecision("S", "V", "BB1", "1", "123");
- assertEquals("Decision is correct", decision.getDecision(), "PERMIT");
- assertEquals("Decision details is correct", decision.getDetails(), "Retry");
+ public void getDecision_success() {
+ // given
+ PolicyClientImpl testedObject = Mockito.spy(PolicyClientImpl.class);
+ PolicyRestClient policyRestClientMock = Mockito.mock(PolicyRestClient.class);
+ when(testedObject.getPolicyRestClient(PolicyServiceType.GET_DECISION)).thenReturn(policyRestClientMock);
+ // when
+ testedObject.getDecision(SERVICE_TYPE, VNF_TYPE, BB_ID, WORK_STEP, ERROR_CODE);
+ // then
+ ArgumentCaptor<PolicyDecisionRequest> captor1 = ArgumentCaptor.forClass(PolicyDecisionRequest.class);
+ verify(policyRestClientMock).post(captor1.capture(), eq(PolicyDecision.class));
+ verifyPolicyDecisionRequestArg(captor1.getValue());
}
- @Test
- @Ignore
- public void getAllowedTreatmentsTest() {
- PolicyClient client = new PolicyClientImpl();
- DictionaryData dictClient = client.getAllowedTreatments("BB1", "1");
- final String dictBbidString = dictClient.getBbid().getString();
- final String dictWorkStepString = dictClient.getWorkstep().getString();
- assertEquals("DictionaryData matches a response Bbid", dictBbidString, "BB1");
- assertEquals("DicitonaryData matches a response WorkStep", dictWorkStepString, "1");
+ private void verifyPolicyDecisionRequestArg(PolicyDecisionRequest actual) {
+ assertThat(actual.getEcompcomponentName()).isEqualTo(RestClient.ECOMP_COMPONENT_NAME);
+ DecisionAttributes decisionAttributes = actual.getDecisionAttributes();
+ assertThat(decisionAttributes.getServiceType()).isEqualTo(SERVICE_TYPE);
+ assertThat(decisionAttributes.getvNFType()).isEqualTo(VNF_TYPE);
+ assertThat(decisionAttributes.getBbID()).isEqualTo(BB_ID);
+ assertThat(decisionAttributes.getWorkStep()).isEqualTo(WORK_STEP);
+ assertThat(decisionAttributes.getErrorCode()).isEqualTo(ERROR_CODE);
}
@Test
- public void getDecisionMockTest() {
- String serviceType = "S";
- String vnfType = "V";
- String bbID = "BB1";
- String workStep = "1";
- String errorCode = "123";
-
- PolicyDecision expected = new PolicyDecision();
- expected.setDecision("PERMIT");
- expected.setDetails("Retry");
-
- DecisionAttributes decisionAttributes = new DecisionAttributes();
- decisionAttributes.setServiceType(serviceType);
- decisionAttributes.setVNFType(vnfType);
- decisionAttributes.setBBID(bbID);
- decisionAttributes.setWorkStep(workStep);
- decisionAttributes.setErrorCode(errorCode);
- PolicyClient client = Mockito.spy(PolicyClientImpl.class);
-
- doReturn(expected).when(client).getDecision(serviceType, vnfType, bbID, workStep, errorCode);
-
- PolicyDecision actual = client.getDecision(serviceType, vnfType, bbID, workStep, errorCode);
- assertThat(actual, sameBeanAs(expected));
+ public void getAllowedTreatments_success() {
+ // given
+ PolicyClientImpl testedObject = Mockito.spy(PolicyClientImpl.class);
+ PolicyRestClient policyRestClientMock = Mockito.mock(PolicyRestClient.class);
+ when(testedObject.getPolicyRestClient(PolicyServiceType.GET_DICTIONARY_ITEMS)).thenReturn(policyRestClientMock);
+ when(policyRestClientMock.post(any(DictionaryItemsRequest.class), eq(AllowedTreatments.class)))
+ .thenReturn(createAllowedTreatments());
+ // when
+ DictionaryData dictionaryDataResult = testedObject.getAllowedTreatments(BB_ID, WORK_STEP);
+ // then
+ assertThat(dictionaryDataResult.getBbid().getString()).isEqualTo(BB_ID);
+ assertThat(dictionaryDataResult.getWorkstep().getString()).isEqualTo(WORK_STEP);
+ }
+
+ private AllowedTreatments createAllowedTreatments() {
+ AllowedTreatments allowedTreatments = new AllowedTreatments();
+ DictionaryJson dictionaryJson = new DictionaryJson();
+ dictionaryJson.setDictionaryDatas(createDictionaryDataList());
+ allowedTreatments.setDictionaryJson(dictionaryJson);
+ return allowedTreatments;
+ }
+
+ private List<DictionaryData> createDictionaryDataList() {
+ DictionaryData dictionaryData = new DictionaryData();
+ Bbid bbid = new Bbid();
+ bbid.setString(BB_ID);
+ dictionaryData.setBbid(bbid);
+ Workstep workstep = new Workstep();
+ workstep.setString(WORK_STEP);
+ dictionaryData.setWorkstep(workstep);
+ return Arrays.asList(dictionaryData, new DictionaryData());
}
@Test
- public void getConfigFromStringJsonTest() throws JsonParseException, JsonMappingException, IOException {
+ public void getConfigFromStringJsonTest() throws IOException {
PolicyClientImpl client = new PolicyClientImpl();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
@@ -128,7 +160,7 @@ public class PolicyClientImplTest {
}
@Test
- public void getConfigWithPolicyNameTest() throws JsonParseException, JsonMappingException, IOException {
+ public void getConfigWithPolicyNameTest() throws IOException {
PolicyClientImpl client = Mockito.spy(PolicyClientImpl.class);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
diff --git a/common/src/test/java/org/onap/so/externaltasks/logging/AuditMDCSetupTest.java b/common/src/test/java/org/onap/so/externaltasks/logging/AuditMDCSetupTest.java
new file mode 100644
index 0000000000..c4609f0336
--- /dev/null
+++ b/common/src/test/java/org/onap/so/externaltasks/logging/AuditMDCSetupTest.java
@@ -0,0 +1,93 @@
+package org.onap.so.externaltasks.logging;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.doReturn;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.logging.filter.base.MDCSetup;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.MdcConstants;
+import org.slf4j.MDC;
+
+@RunWith(MockitoJUnitRunner.class)
+public class AuditMDCSetupTest {
+
+ @Mock
+ private ExternalTask externalTask;
+
+ @Mock
+ private MDCSetup mdcSet;
+
+ @Spy
+ @InjectMocks
+ private AuditMDCSetup mdcSetup;
+
+ private String requestId = "9bb86b8d-a02f-4a0b-81a9-2eb963850009";
+ private String serviceName = "testServiceName";
+
+ @After
+ public void tearDown() {
+ MDC.clear();
+ }
+
+ @Test
+ public void setupMDCTest() {
+ doReturn(requestId).when(externalTask).getVariable("mso-request-id");
+ doReturn(serviceName).when(externalTask).getTopicName();
+
+ mdcSetup.setupMDC(externalTask);
+
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
+ assertEquals(requestId, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ assertEquals(serviceName, MDC.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+ assertEquals("SO.OPENSTACK_ADAPTER", MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+ assertEquals(ONAPLogConstants.ResponseStatus.INPROGRESS.toString(),
+ MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ }
+
+ @Test
+ public void setElapsedTimeTest() {
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP, "2019-06-18T02:09:06.024Z");
+
+ mdcSetup.setElapsedTime();
+
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.ELAPSED_TIME));
+ }
+
+ @Test
+ public void setResponseCodeTest() {
+ mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+
+ assertEquals(ONAPLogConstants.ResponseStatus.INPROGRESS.toString(),
+ MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ assertEquals(ONAPLogConstants.ResponseStatus.INPROGRESS.toString(),
+ MDC.get(MdcConstants.OPENSTACK_STATUS_CODE));
+ }
+
+ @Test
+ public void clearClientMDCsTest() {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ MDC.put(MdcConstants.OPENSTACK_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP, "2019-06-18T02:09:06.024Z");
+ MDC.put(ONAPLogConstants.MDCs.ELAPSED_TIME, "318");
+ MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, "SO.OPENSTACK_ADAPTER");
+
+ mdcSetup.clearClientMDCs();
+
+ assertNull(MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ assertNull(MDC.get(MdcConstants.OPENSTACK_STATUS_CODE));
+ assertNull(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
+ assertNull(MDC.get(ONAPLogConstants.MDCs.ELAPSED_TIME));
+ assertNull(MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+
+ }
+
+}
diff --git a/common/src/test/java/org/onap/so/logger/ScheduledTasksMDCSetupTest.java b/common/src/test/java/org/onap/so/logger/ScheduledTasksMDCSetupTest.java
new file mode 100644
index 0000000000..f232781871
--- /dev/null
+++ b/common/src/test/java/org/onap/so/logger/ScheduledTasksMDCSetupTest.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.logger;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import org.junit.After;
+import org.junit.Test;
+import org.onap.logging.filter.base.Constants;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.utils.Components;
+import org.onap.so.utils.UUIDChecker;
+import org.slf4j.MDC;
+
+public class ScheduledTasksMDCSetupTest {
+ private ScheduledTasksMDCSetup tasksMDCSetup = new ScheduledTasksMDCSetup();
+
+ @After
+ public void tearDown() {
+ MDC.clear();
+ System.clearProperty("partnerName");
+ }
+
+ @Test
+ public void mdcSetupTest() {
+ System.setProperty("partnerName", Components.APIH.toString());
+ tasksMDCSetup.mdcSetup(Components.APIH, "mdcSetupTest");
+
+ assertTrue(UUIDChecker.isValidUUID(MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)));
+ assertEquals(Components.APIH.toString(), MDC.get(ONAPLogConstants.MDCs.TARGET_ENTITY));
+ assertEquals(Components.APIH.toString(), MDC.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+ assertEquals("mdcSetupTest", MDC.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+ assertEquals(Constants.DefaultValues.UNKNOWN, MDC.get(ONAPLogConstants.MDCs.TARGET_SERVICE_NAME));
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.ELAPSED_TIME));
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.LOG_TIMESTAMP));
+ assertNotNull(MDC.get(ONAPLogConstants.MDCs.SERVER_FQDN));
+ }
+
+ @Test
+ public void errorMDCSetupTest() {
+ tasksMDCSetup.errorMDCSetup(ErrorCode.UnknownError, "Error");
+
+ assertEquals("900", MDC.get(ONAPLogConstants.MDCs.ERROR_CODE));
+ assertEquals("Error", MDC.get(ONAPLogConstants.MDCs.ERROR_DESC));
+ }
+
+ @Test
+ public void setStatusCodeTest() {
+ tasksMDCSetup.setStatusCode();
+
+ assertEquals(ONAPLogConstants.ResponseStatus.COMPLETE.toString(),
+ MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ }
+
+ @Test
+ public void setStatusCodeErrorTest() {
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString());
+ tasksMDCSetup.setStatusCode();
+
+ assertEquals(ONAPLogConstants.ResponseStatus.ERROR.toString(),
+ MDC.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ }
+}
diff --git a/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java b/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java
index 978c016dec..72bacdf2db 100644
--- a/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java
+++ b/common/src/test/java/org/onap/so/rest/service/HttpRestServiceProviderImplTest.java
@@ -33,6 +33,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
@@ -116,7 +117,7 @@ public class HttpRestServiceProviderImplTest {
}
- @Test(expected = InvalidRestRequestException.class)
+ @Test(expected = HttpResouceNotFoundException.class)
public void test_get_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusNotFoundHttpStatus() {
assertGetErrorScenario(HttpStatus.NOT_FOUND);
}
@@ -239,7 +240,7 @@ public class HttpRestServiceProviderImplTest {
}
- @Test(expected = InvalidRestRequestException.class)
+ @Test(expected = HttpResouceNotFoundException.class)
public void test_post_ThrowsInvalidRestRequestExceptionifHttpClientErrorExceptionWithHttpStatusNotFoundHttpStatus() {
assertPostErrorScenario(HttpStatus.NOT_FOUND);
}
diff --git a/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java b/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java
new file mode 100644
index 0000000000..f918781b39
--- /dev/null
+++ b/common/src/test/java/org/onap/so/utils/ExternalTaskUtilsTest.java
@@ -0,0 +1,65 @@
+package org.onap.so.utils;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.springframework.core.env.Environment;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ExternalTaskUtilsTest {
+
+ @Mock
+ private Environment mockenv;
+
+ @InjectMocks
+ private ExternalTaskUtils externalTaskUtilsAnony = new ExternalTaskUtils() {
+
+ };
+
+ @Test
+ public void retry_sequence_calculation_Test() {
+ Mockito.when(mockenv.getProperty("mso.workflow.topics.retryMultiplier", "6000")).thenReturn("6000");
+ long firstRetry = externalTaskUtilsAnony.calculateRetryDelay(8);
+ assertEquals(6000L, firstRetry);
+ long secondRetry = externalTaskUtilsAnony.calculateRetryDelay(7);
+ assertEquals(6000L, secondRetry);
+ long thirdRetry = externalTaskUtilsAnony.calculateRetryDelay(6);
+ assertEquals(12000L, thirdRetry);
+ long fourthRetry = externalTaskUtilsAnony.calculateRetryDelay(5);
+ assertEquals(18000L, fourthRetry);
+ long fifthRetry = externalTaskUtilsAnony.calculateRetryDelay(4);
+ assertEquals(30000L, fifthRetry);
+ long sixRetry = externalTaskUtilsAnony.calculateRetryDelay(3);
+ assertEquals(48000L, sixRetry);
+ long seventhRetry = externalTaskUtilsAnony.calculateRetryDelay(2);
+ assertEquals(78000L, seventhRetry);
+ long eigthRetry = externalTaskUtilsAnony.calculateRetryDelay(1);
+ assertEquals(120000L, eigthRetry);
+ }
+
+ @Test
+ public void retry_sequence_Test() {
+ Mockito.when(mockenv.getProperty("mso.workflow.topics.retryMultiplier", "6000")).thenReturn("6000");
+ long firstRetry = externalTaskUtilsAnony.calculateRetryDelay(8);
+ assertEquals(6000L, firstRetry);
+ long secondRetry = externalTaskUtilsAnony.calculateRetryDelay(7);
+ assertEquals(6000L, secondRetry);
+ long thirdRetry = externalTaskUtilsAnony.calculateRetryDelay(6);
+ assertEquals(12000L, thirdRetry);
+ long fourthRetry = externalTaskUtilsAnony.calculateRetryDelay(5);
+ assertEquals(18000L, fourthRetry);
+ long fifthRetry = externalTaskUtilsAnony.calculateRetryDelay(4);
+ assertEquals(30000L, fifthRetry);
+ long sixRetry = externalTaskUtilsAnony.calculateRetryDelay(3);
+ assertEquals(48000L, sixRetry);
+ long seventhRetry = externalTaskUtilsAnony.calculateRetryDelay(2);
+ assertEquals(78000L, seventhRetry);
+ long eigthRetry = externalTaskUtilsAnony.calculateRetryDelay(1);
+ assertEquals(120000L, eigthRetry);
+ }
+
+}
diff --git a/cxf-logging/pom.xml b/cxf-logging/pom.xml
index 2c891f2c4a..f0c969aeb1 100644
--- a/cxf-logging/pom.xml
+++ b/cxf-logging/pom.xml
@@ -37,11 +37,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.onap.logging-analytics</groupId>
- <artifactId>logging-slf4j</artifactId>
- <version>1.2.2</version>
- </dependency>
</dependencies>
<build>
<resources>
diff --git a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
index a6cce27f91..d1f509f476 100644
--- a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
+++ b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
@@ -75,7 +75,7 @@ public class SOAPLoggingInInterceptor extends AbstractSoapInterceptor {
// CXF Appears to flatten headers to lower case
private void setMDCPartnerName(Map<String, List<String>> headers) {
- String partnerName = getValueOrDefault(headers, ONAPLogConstants.Headers.PARTNER_NAME.toLowerCase(), "");
+ String partnerName = getValueOrDefault(headers, ONAPLogConstants.Headers.PARTNER_NAME.toLowerCase(), "UNKNOWN");
MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, partnerName);
}
@@ -83,6 +83,7 @@ public class SOAPLoggingInInterceptor extends AbstractSoapInterceptor {
String invocationId = getValueOrDefault(headers, ONAPLogConstants.Headers.INVOCATION_ID.toLowerCase(),
UUID.randomUUID().toString());
MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+ MDC.put(ONAPLogConstants.MDCs.SERVER_INVOCATION_ID, invocationId);
}
private void setRequestId(Map<String, List<String>> headers) {
diff --git a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java
index 92b266870c..3785d3165f 100644
--- a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java
+++ b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java
@@ -51,7 +51,7 @@ public class SOAPLoggingOutInterceptor extends AbstractSoapInterceptor {
Exception ex = message.getContent(Exception.class);
if (ex == null) {
MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE,
- ONAPLogConstants.ResponseStatus.COMPLETED.toString());
+ ONAPLogConstants.ResponseStatus.COMPLETE.toString());
} else {
int responseCode = 0;
responseCode = (int) message.get(Message.RESPONSE_CODE);
diff --git a/deployment-configs/src/main/resources/logger/logback-spring.xml b/deployment-configs/src/main/resources/logger/logback-spring.xml
new file mode 100644
index 0000000000..831a33a490
--- /dev/null
+++ b/deployment-configs/src/main/resources/logger/logback-spring.xml
@@ -0,0 +1,231 @@
+<!-- ============LICENSE_START=======================================================
+ ECOMP MSO ================================================================================
+ 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========================================================= -->
+
+<configuration scan="false" debug="false">
+ <contextListener class="org.onap.so.logger.LoggerStartupListener" />
+
+ <property name="queueSize" value="256" />
+ <property name="maxFileSize" value="200MB" />
+ <property name="maxHistory" value="30" />
+ <property name="totalSizeCap" value="10GB" />
+
+ <!-- log file names -->
+ <property name="errorLogName" value="error" />
+ <property name="metricsLogName" value="metrics" />
+ <property name="auditLogName" value="audit" />
+ <property name="debugLogName" value="debug" />
+ <property name="cadiLogName" value="cadi" />
+
+ <property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}"/>
+
+ <property name="errorPattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName:-Unknown}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode:-900}|%X{ErrorDesc:-UnknownError}|%msg%n" />
+
+ <property name="debugPattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%logger{50} - %msg%n" />
+
+ <property name="auditPattern"
+ value="%X{EntryTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||%marker|%mdc|||%msg%n" />
+
+ <property name="metricPattern"
+ value="%X{InvokeTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|%marker|%mdc|||%msg%n" />
+
+ <property name="defaultPattern"
+ value="%nopexception%logger
+ \t%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}
+ \t%level
+ \t%replace(%replace(%message){'\t','\\\\t'}){'\n','\\\\n'}
+ \t%replace(%replace(%mdc){'\t','\\\\t'}){'\n','\\\\n'}
+ \t%replace(%replace(%rootException){'\t','\\\\t'}){'\n','\\\\n'}
+ \t%replace(%replace(%marker){'\t','\\\\t'}){'\n','\\\\n'}
+ \t%thread
+ \t%n" />
+
+ <appender name="Audit"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>EXIT</marker>
+ </evaluator>
+ <onMismatch>DENY</onMismatch>
+ <onMatch>ACCEPT</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${auditLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${auditLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${auditPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncAudit" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Audit" />
+ </appender>
+
+ <appender name="Metric"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>INVOKE-RETURN</marker>
+ </evaluator>
+ <onMismatch>DENY</onMismatch>
+ <onMatch>ACCEPT</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${metricsLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${metricPattern}</pattern>
+ </encoder>
+ </appender>
+
+
+ <appender name="asyncMetric" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Metric" />
+ </appender>
+
+ <appender name="Error"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <file>${logs_dir:-.}/${errorLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${errorLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${errorPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Error" />
+ </appender>
+
+ <appender name="Debug"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>INVOKE</marker>
+ <marker>INVOKE-RETURN</marker>
+ <marker>ENTRY</marker>
+ <marker>EXIT</marker>
+ </evaluator>
+ <onMismatch>ACCEPT</onMismatch>
+ <onMatch>DENY</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${debugLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Debug" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+ <appender name="Cadi"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logs_dir:-.}/${cadiLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${cadiLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncCadi" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Cadi" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+ <!-- Spring related loggers -->
+ <logger name="org.springframework" level="WARN" />
+ <logger
+ name="org.springframework.security.authentication.dao.DaoAuthenticationProvider"
+ level="DEBUG" />
+
+ <!-- Camunda related loggers -->
+ <logger name="org.camunda.bpm.engine.jobexecutor.level" level="DEBUG" />
+ <logger
+ name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level"
+ level="DEBUG" />
+
+ <logger name="org.flywaydb" level="DEBUG"/>
+ <logger name="org.apache.wire" level="DEBUG" />
+ <logger name="org.onap" level="DEBUG" />
+ <logger name="org.apache.cxf.interceptor" level="DEBUG" />
+ <logger name="com.woorea.openstack.connector" level="DEBUG" />
+
+ <!-- AAF Logs go here-->
+ <logger name="org.apache.catalina.core.ContainerBase" level="INFO" additivity="false">
+ <appender-ref ref="asyncCadi" />
+ </logger>
+
+ <logger name="org.reflections.Reflections" level="ERROR" additivity="false">
+ <appender-ref ref="asyncCadi" />
+ </logger>
+
+ <logger name="AUDIT" level="INFO" additivity="false">
+ <appender-ref ref="asyncAudit" />
+ </logger>
+
+ <logger name="METRIC" level="INFO" additivity="false">
+ <appender-ref ref="asyncMetric" />
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="asyncDebug" />
+ <appender-ref ref="asyncError" />
+ <appender-ref ref="asyncAudit" />
+ <appender-ref ref="asyncMetric" />
+ </root>
+
+</configuration>
diff --git a/docs/api/apis/SO_Interface.rst b/docs/api/apis/consumed-apis.rst
index d1586eb5d0..0ef69c4da1 100644
--- a/docs/api/apis/SO_Interface.rst
+++ b/docs/api/apis/consumed-apis.rst
@@ -2,1154 +2,11 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2018 Huawei Technologies Co., Ltd.
-SO Interfaces
-=============
+API consumed by SO
+==================
.. image:: ../../images/SO_1.png
-SO APIs
-----------------
-
-North Bound APIs
-----------------
-Create service instance
-+++++++++++++++++++++++
-
-+--------------------+------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+============================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6 |
-+--------------------+------------------------------------------------------------+
-|Operation Type |POST |
-+--------------------+------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+--------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+==========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|project |project Object |Content of project object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|owningEntity |owningEntity Object |Content of owningEntity object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|platform |platform Object |Content of platform object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
-+-------------------+--------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-|modelCustomizationUuid |String |The Model Customization UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelVersionId |String |The Model version id |
-+-------------------------+------------------+-------------------------------------------------+
-|modelUuid |String |The Model UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInvariantUuid |String |The Model Invariant UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInstanceName |String |The Model Instance name |
-+-------------------------+------------------+-------------------------------------------------+
-
-
-SubscriberInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|GlobalSubscriberId |String |Global customer Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|SubscriberName |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|billingAccountNumber |String |billingAccountNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|callbackUrl |String |callbackUrl of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|correlator |String |correlator of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderNumber |String |orderNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|productFamilyId |String |productFamilyId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderVersion |String |orderVersion of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |instanceName of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|suppressRollback |String |suppressRollback of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|requestorId |String |requestorId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestParameters Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|SubscriptionServiceType |String |The service type of the Subscription |
-+-------------------------+------------------+-------------------------------------------------+
-|UserParams |Array |The product family Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|aLaCarte |Boolean | aLaCarte |
-+-------------------------+------------------+-------------------------------------------------+
-|autoBuildVfModules |Boolean |autoBuildVfModules |
-+-------------------------+------------------+-------------------------------------------------+
-|cascadeDelete |Boolean |cascadeDelete |
-+-------------------------+------------------+-------------------------------------------------+
-|usePreload |Boolean |usePreload |
-+-------------------------+------------------+-------------------------------------------------+
-|rebuildVolumeGroups |Boolean |rebuildVolumeGroups |
-+-------------------------+------------------+-------------------------------------------------+
-|payload |String |payload |
-+-------------------------+------------------+-------------------------------------------------+
-|controllerType |String |controllerType |
-+-------------------------+------------------+-------------------------------------------------+
-
-UserParams Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|name |String |Tag name of attribute |
-+-------------------------+------------------+-------------------------------------------------+
-|value |String |Value of the tag |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-|aicNodeClli |String |aicNodeClli property |
-+-------------------------+------------------+-------------------------------------------------+
-
-Project Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|projectName |String |Name of the project |
-+-------------------------+------------------+-------------------------------------------------+
-
-OwningEntity Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|owningEntityId |String |owningEntityId of the owingEntity |
-+-------------------------+------------------+-------------------------------------------------+
-|owningEntityName |String |owningEntityName of the owingEntity |
-+-------------------------+------------------+-------------------------------------------------+
-
-Platform Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|platformName |String |Platform Name |
-+-------------------------+------------------+-------------------------------------------------+
-
-LineOfBusiness Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lineOfBusinessName |String |Line Of Business Name |
-+-------------------------+------------------+-------------------------------------------------+
-
-Delete service instance
-+++++++++++++++++++++++
-
-+--------------------+--------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId} |
-+--------------------+--------------------------------------------------------------------------------+
-|Operation Type |DELETE |
-+--------------------+--------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+--------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+-------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+=========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+-------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+-------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-Create Volume Group
-+++++++++++++++++++
-
-+--------------------+------------------------------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+==================================================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups |
-+--------------------+------------------------------------------------------------------------------------------------------------------+
-|Operation Type |POST |
-+--------------------+------------------------------------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+------------------------------------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+--------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+==========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|project |project Object |Content of project object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|owningEntity |owningEntity Object |Content of owningEntity object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|platform |platform Object |Content of platform object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
-+-------------------+--------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-|modelCustomizationUuid |String |The Model Customization UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelVersionId |String |The Model version id |
-+-------------------------+------------------+-------------------------------------------------+
-|modelUuid |String |The Model UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInvariantUuid |String |The Model Invariant UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInstanceName |String |The Model Instance name |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-|aicNodeClli |String |aicNodeClli property |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|billingAccountNumber |String |billingAccountNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|callbackUrl |String |callbackUrl of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|correlator |String |correlator of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderNumber |String |orderNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|productFamilyId |String |productFamilyId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderVersion |String |orderVersion of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |instanceName of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|suppressRollback |String |suppressRollback of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|requestorId |String |requestorId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|relatedInstance |Object |relatedInstance Object |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|instanceId |String |instanceId |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInfo |Object |Content of modelInfo object. |
-+-------------------------+------------------+-------------------------------------------------+
-
-Delete Volume Group
-+++++++++++++++++++
-
-+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+============================================================================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volume-groupinstance-id} |
-+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
-|Operation Type |DELETE |
-+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+---------------------+-------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=====================+=========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-Create VF Module
-++++++++++++++++
-
-+--------------------+---------------------------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+===============================================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules |
-+--------------------+---------------------------------------------------------------------------------------------------------------+
-|Operation Type |POST |
-+--------------------+---------------------------------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+---------------------------------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+---------------------+-------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=====================+=========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|relatedInstanceList |List |Content of relatedInstanceList. |
-+---------------------+-------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|InstanceName |String |The instance Name |
-+-------------------------+------------------+-------------------------------------------------+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|SuppressRollback |Boolean |SuppressRollback |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|relatedInstance |Object |relatedInstance Object |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|instanceId |String |instanceId |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInfo |Object |Content of modelInfo object. |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |Name of the instance |
-+-------------------------+------------------+-------------------------------------------------+
-
-Delete VF Module
-++++++++++++++++
-
-+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+=====================================================================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleinstance-id} |
-+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-|Operation Type |DELETE |
-+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+---------------------+-------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=====================+=========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-Create VNF
-++++++++++
-
-+--------------------+-------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+=====================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs |
-+--------------------+-------------------------------------------------------------------------------------+
-|Operation Type |POST |
-+--------------------+-------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+-------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+--------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+==========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|project |project Object |Content of project object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|owningEntity |owningEntity Object |Content of owningEntity object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|platform |platform Object |Content of platform object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
-+-------------------+--------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-|modelCustomizationUuid |String |The Model Customization UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelVersionId |String |The Model version id |
-+-------------------------+------------------+-------------------------------------------------+
-|modelUuid |String |The Model UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInvariantUuid |String |The Model Invariant UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInstanceName |String |The Model Instance name |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|billingAccountNumber |String |billingAccountNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|callbackUrl |String |callbackUrl of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|correlator |String |correlator of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderNumber |String |orderNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|productFamilyId |String |productFamilyId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderVersion |String |orderVersion of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |instanceName of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|suppressRollback |String |suppressRollback of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|requestorId |String |requestorId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|relatedInstance |Object |relatedInstance Object |
-+-------------------------+------------------+-------------------------------------------------+
-
-relatedInstance List
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|instanceId |String |instanceId |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInfo |Object |Content of modelInfo object. |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestParameters Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|UserParams |Array |The product family Id. |
-+-------------------------+------------------+-------------------------------------------------+
-
-UserParams Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|name |String |Tag name of attribute |
-+-------------------------+------------------+-------------------------------------------------+
-|value |String |Value of the tag |
-+-------------------------+------------------+-------------------------------------------------+
-
-Delete VNF
-++++++++++
-
-+--------------------+-----------------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+=====================================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId} |
-+--------------------+-----------------------------------------------------------------------------------------------------+
-|Operation Type |DELETE |
-+--------------------+-----------------------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+-----------------------------------------------------------------------------------------------------+
-
-Request Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+---------------------+-------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=====================+=========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+---------------------+-------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+---------------------+-------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-
-CloudConfiguration Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|tenantId |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestParameters Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|UserParams |Array |The product family Id. |
-+-------------------------+------------------+-------------------------------------------------+
-
-UserParams Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|name |String |Tag name of attribute |
-+-------------------------+------------------+-------------------------------------------------+
-|value |String |Value of the tag |
-+-------------------------+------------------+-------------------------------------------------+
-
-GET Orchestration Request
-+++++++++++++++++++++++++
-
-+--------------------+-------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+=====================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/orchestrationRequests/v6/{request-id} |
-+--------------------+-------------------------------------------------------------------------------------+
-|Operation Type |GET |
-+--------------------+-------------------------------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+-------------------------------------------------------------------------------------+
-
-Response Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|request |M |1 |request Object |Content of request object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-Request Object
-
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+===================+=========+===========+==========================+===========================================+
-|requestId |M |1 |String |Request Id |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|startTime |M |1 |request Object |Start time. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestScope |M |1 |request Object |Scope of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestType |M |1 |request Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestDetails |M |1 |requestDetails Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestStatus |M |1 |requestStatus Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+--------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+==========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|project |project Object |Content of project object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|owningEntity |owningEntity Object |Content of owningEntity object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|platform |platform Object |Content of platform object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
-+-------------------+--------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-|modelCustomizationUuid |String |The Model Customization UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelVersionId |String |The Model version id |
-+-------------------------+------------------+-------------------------------------------------+
-|modelUuid |String |The Model UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInvariantUuid |String |The Model Invariant UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInstanceName |String |The Model Instance name |
-+-------------------------+------------------+-------------------------------------------------+
-
-SubscriberInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|GlobalSubscriberId |String |Global customer Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|SubscriberName |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|billingAccountNumber |String |billingAccountNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|callbackUrl |String |callbackUrl of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|correlator |String |correlator of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderNumber |String |orderNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|productFamilyId |String |productFamilyId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderVersion |String |orderVersion of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |instanceName of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|suppressRollback |String |suppressRollback of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|requestorId |String |requestorId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestParameters Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|SubscriptionServiceType |String |The service type of the Subscription |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestStatus Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|finishTime |String |Time |
-+-------------------------+------------------+-------------------------------------------------+
-|requestState |String |state of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|statusMessage |String |statusMessage |
-+-------------------------+------------------+-------------------------------------------------+
-|percentProgress |String |percentage of progress |
-+-------------------------+------------------+-------------------------------------------------+
-
-GET Orchestration Requests
-++++++++++++++++++++++++++
-
-+--------------------+--------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+==============================================================+
-|URI |/onap/so/infra/serviceInstantiation/orchestrationRequests/v6 |
-+--------------------+--------------------------------------------------------------+
-|Operation Type |GET |
-+--------------------+--------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+--------------------------------------------------------------+
-
-Response Body:
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|requestList |M |1 |Array |Content of request List. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestList :
-
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+================+=========+===========+==========================+===========================================+
-|request |M |1 |request Object |Content of request object. |
-+----------------+---------+-----------+--------------------------+-------------------------------------------+
-
-Request Object
-
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content |Description |
-+===================+=========+===========+==========================+===========================================+
-|requestId |M |1 |String |Request Id. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|startTime |M |1 |request Object |Start time. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestScope |M |1 |request Object |Scope of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestType |M |1 |request Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestDetails |M |1 |requestDetails Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-|requestStatus |M |1 |requestStatus Object |Type of the request. |
-+-------------------+---------+-----------+--------------------------+-------------------------------------------+
-
-RequestDetails Object
-
-+-------------------+--------------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+===================+==========================+=================================================+
-|modelInfo |modelInfo Object |Content of modelInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestInfo |requestInfo Object |Content of requestInfo object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|requestParameters |requestParameters Object |Content of requestParameters object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|project |project Object |Content of project object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|owningEntity |owningEntity Object |Content of owningEntity object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|platform |platform Object |Content of platform object. |
-+-------------------+--------------------------+-------------------------------------------------+
-|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
-+-------------------+--------------------------+-------------------------------------------------+
-
-ModelInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|ModelType |String |Type of model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelInvariantId |String |The Model Invariant Id. |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelNameVersionId |String |The modelname Version Id |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelName |String |Name of the Model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelVersion |String |Version of the model |
-+-------------------------+------------------+-------------------------------------------------+
-|ModelCustomization Name |String |The Model Customization name |
-+-------------------------+------------------+-------------------------------------------------+
-|modelCustomizationUuid |String |The Model Customization UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelVersionId |String |The Model version id |
-+-------------------------+------------------+-------------------------------------------------+
-|modelUuid |String |The Model UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInvariantUuid |String |The Model Invariant UUid |
-+-------------------------+------------------+-------------------------------------------------+
-|modelInstanceName |String |The Model Instance name |
-+-------------------------+------------------+-------------------------------------------------+
-
-SubscriberInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|GlobalSubscriberId |String |Global customer Id (in A&AI) |
-+-------------------------+------------------+-------------------------------------------------+
-|SubscriberName |String |Name of the Subscriber |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestInfo Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|Source |String |source of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|billingAccountNumber |String |billingAccountNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|callbackUrl |String |callbackUrl of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|correlator |String |correlator of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderNumber |String |orderNumber of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|productFamilyId |String |productFamilyId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|orderVersion |String |orderVersion of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|instanceName |String |instanceName of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|suppressRollback |String |suppressRollback of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|requestorId |String |requestorId of the request |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestParameters Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|SubscriptionServiceType |String |The service type of the Subscription |
-+-------------------------+------------------+-------------------------------------------------+
-
-RequestStatus Object
-
-+-------------------------+------------------+-------------------------------------------------+
-|Attribute |Content |Description |
-+=========================+==================+=================================================+
-|finishTime |String |Time |
-+-------------------------+------------------+-------------------------------------------------+
-|requestState |String |state of the request |
-+-------------------------+------------------+-------------------------------------------------+
-|statusMessage |String |statusMessage |
-+-------------------------+------------------+-------------------------------------------------+
-|percentProgress |String |percentage of progress |
-+-------------------------+------------------+-------------------------------------------------+
SDC Client API
--------------
@@ -1371,181 +228,6 @@ Response:
|Content-Disposition |M |Specifies the name of file to store the downloaded artifact’s payload ( RFC 2183) . |
+--------------------+---------+--------------------------------------------------------------------------------------------------------------------------+
-E2E Service API
----------------
-
-Create E2E service instance
-+++++++++++++++++++++++++++
-
-+--------------------+------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+============================================================+
-|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3 |
-+--------------------+------------------------------------------------------------+
-|Operation Type |POST |
-+--------------------+------------------------------------------------------------+
-|Content-Type |application/json |
-+--------------------+------------------------------------------------------------+
-
-Request Body:
-
-+---------+---------+-----------+--------------------------+-----------------------------+
-|Attribute|Qualifier|Cardinality|Content |Description |
-+=========+=========+===========+==========================+=============================+
-|service |M |1 |Service Object |Content of service object. |
-+---------+---------+-----------+--------------------------+-----------------------------+
-
-Service Object
-
-+------------------------------+-----------------+------------------------------------+
-|Attribute |Content |Description |
-+==============================+=================+====================================+
-|name |String |Service instance name. |
-+------------------------------+-----------------+------------------------------------+
-|description |String |Service instance description |
-+------------------------------+-----------------+------------------------------------+
-|serviceUuid |String |Model UUID |
-+------------------------------+-----------------+------------------------------------+
-|serviceInvariantUuid |String |Model Invariant UUID |
-+------------------------------+-----------------+------------------------------------+
-|gloabalSubscriberId |String |Customer Id |
-+------------------------------+-----------------+------------------------------------+
-|serviceType |String |service Type |
-+------------------------------+-----------------+------------------------------------+
-|parameters |Object |Parameter Object |
-+------------------------------+-----------------+------------------------------------+
-
-Parameter Object
-
-+------------------------------+-----------------+------------------------------------+
-|Attribute |Content |Description |
-+==============================+=================+====================================+
-|locationConstraints |List of object |location infor for each vnf |
-+------------------------------+-----------------+------------------------------------+
-|resource |List of Resource |resource of service/resource |
-+------------------------------+-----------------+------------------------------------+
-|requestInputs |key-value map |input of service/resource |
-+------------------------------+-----------------+------------------------------------+
-
-LocationConstraint Object
-
-+------------------------------+-----------------+------------------------------------+
-|Attribute |Content |Description |
-+==============================+=================+====================================+
-|vnfProfileId |String |Customization id for VNF |
-+------------------------------+-----------------+------------------------------------+
-|locationConstraints |Object |DC location info of VNF |
-+------------------------------+-----------------+------------------------------------+
-
-VnfLocationConstraint Object
-
-+------------------------------+-----------------+------------------------------------+
-|Attribute |Content |Description |
-+==============================+=================+====================================+
-|vimId |String |VIM id from ESR definition |
-+------------------------------+-----------------+------------------------------------+
-
-Resource Object
-
-+------------------------------+-----------------+------------------------------------+
-|Attribute |Content |Description |
-+==============================+=================+====================================+
-|resourceName |String |The resource name |
-+------------------------------+-----------------+------------------------------------+
-|resourceInvariantUuid |String |The resource invariant UUID. |
-+------------------------------+-----------------+------------------------------------+
-|resourceUuid |String |The resource UUID. |
-+------------------------------+-----------------+------------------------------------+
-|resourceCustomizationUuid |String |The resource customization UUID. |
-+------------------------------+-----------------+------------------------------------+
-|parameters |Object |Parameter of resource |
-+------------------------------+-----------------+------------------------------------+
-
-Response:
-
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content|Description |
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-|serviceId |M |1 |String |Service instance ID. |
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operationId |M |1 |String |Service Operation ID. |
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-
-Delete E2E service instance
-+++++++++++++++++++++++++++
-
-+--------------------+----------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+======================================================================+
-|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3/{serviceId}|
-+--------------------+----------------------------------------------------------------------+
-|Operation Type |DELETE |
-+--------------------+----------------------------------------------------------------------+
-
-Request Parameters:
-
-+-------------------+---------+-----------+-------+----------------------------------------+
-|Attribute |Qualifier|Cardinality|Content|Description |
-+===================+=========+===========+=======+========================================+
-|globalSubscriberId |M |1 |String |The subscriber id. It is defined in AAI |
-+-------------------+---------+-----------+-------+----------------------------------------+
-|serviceType |M |1 |String |The service type. It is defined in AAI |
-+-------------------+---------+-----------+-------+----------------------------------------+
-
-Response:
-
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content|Description |
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operationId |M |1 |String |The operation id. |
-+-------------+---------+-----------+-------+------------------------------------------------------------------------+
-
-Query E2E service operation result
-++++++++++++++++++++++++++++++++++
-
-+--------------------+-----------------------------------------------------------------------------------------------+
-|Interface Definition|Description |
-+====================+===============================================================================================+
-|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3/{serviceId}/operations/{operationId}|
-+--------------------+-----------------------------------------------------------------------------------------------+
-|Operation Type |GET |
-+--------------------+-----------------------------------------------------------------------------------------------+
-
-Request Parameters:
-
-+--------------+---------+-----------+-------+--------------+
-|Attribute |Qualifier|Cardinality|Content|Description |
-+==============+=========+===========+=======+==============+
-|serviceId |M |1 |Service instance ID. |
-+--------------+---------+-----------+-------+--------------+
-|operationId |M |1 |Service Operation ID. |
-+--------------+---------+-----------+-------+--------------+
-
-Response:
-
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|Attribute |Qualifier|Cardinality|Content|Description |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operation |M |1 |String |Operation object identify. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operationId |M |1 |String |Operation ID. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operation |M |1 |String |Operation type, create|delete. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|result |M |1 |String |Operation result: finished, error, processing. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|reason |M |1 |String |If failing, need to write fail reason. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|userId |M |1 |String |Operation user ID. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operationContent |M |1 |String |The status detail of current operation which is being executing. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|progress |M |1 |String |Current operation progress. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|operateAt |M |1 |String |Time that it starts to execute operation. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
-|finishedAt |M |1 |String |Time that it finished executing operation. |
-+------------------+---------+-----------+-------+------------------------------------------------------------------------+
Inventory APIs
--------------
@@ -4044,7 +2726,7 @@ Candidates Object
+-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+
|identifiers |Y |1..N |List |A list of identifiers. |
+-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+
-|cloudOwner |C |1 |String |The name of a cloud owner. Only required if identifierType is cloud_region_id. |
+|cloudOwner |C |1 |String |The name of a cloud owner. Only required if identifierType is cloud_region_id. |
+-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+
diff --git a/docs/api/apis/e2eServiceInstances-api.rst b/docs/api/apis/e2eServiceInstances-api.rst
new file mode 100644
index 0000000000..08434efdfd
--- /dev/null
+++ b/docs/api/apis/e2eServiceInstances-api.rst
@@ -0,0 +1,185 @@
+.. 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.
+
+e2eServiceInstances API
+=======================
+
+This API allows to manage:
+
+- e2eServiceInstances (create and delete)
+- operations on e2eServiceInstances (get)
+
+
+Create E2E service instance
++++++++++++++++++++++++++++
+
++--------------------+------------------------------------------------------------+
+|Interface Definition|Description |
++====================+============================================================+
+|URI |/onap/so/infra/e2eServiceInstances/v3 |
++--------------------+------------------------------------------------------------+
+|Operation Type |POST |
++--------------------+------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+------------------------------------------------------------+
+
+Request Body:
+
++---------+---------+-----------+--------------------------+-----------------------------+
+|Attribute|Qualifier|Cardinality|Content |Description |
++=========+=========+===========+==========================+=============================+
+|service |M |1 |Service Object |Content of service object. |
++---------+---------+-----------+--------------------------+-----------------------------+
+
+Service Object
+
++------------------------------+-----------------+------------------------------------+
+|Attribute |Content |Description |
++==============================+=================+====================================+
+|name |String |Service instance name. |
++------------------------------+-----------------+------------------------------------+
+|description |String |Service instance description |
++------------------------------+-----------------+------------------------------------+
+|serviceUuid |String |Model UUID |
++------------------------------+-----------------+------------------------------------+
+|serviceInvariantUuid |String |Model Invariant UUID |
++------------------------------+-----------------+------------------------------------+
+|gloabalSubscriberId |String |Customer Id |
++------------------------------+-----------------+------------------------------------+
+|serviceType |String |service Type |
++------------------------------+-----------------+------------------------------------+
+|parameters |Object |Parameter Object |
++------------------------------+-----------------+------------------------------------+
+
+Parameter Object
+
++------------------------------+-----------------+------------------------------------+
+|Attribute |Content |Description |
++==============================+=================+====================================+
+|locationConstraints |List of object |location infor for each vnf |
++------------------------------+-----------------+------------------------------------+
+|resource |List of Resource |resource of service/resource |
++------------------------------+-----------------+------------------------------------+
+|requestInputs |key-value map |input of service/resource |
++------------------------------+-----------------+------------------------------------+
+
+LocationConstraint Object
+
++------------------------------+-----------------+------------------------------------+
+|Attribute |Content |Description |
++==============================+=================+====================================+
+|vnfProfileId |String |Customization id for VNF |
++------------------------------+-----------------+------------------------------------+
+|locationConstraints |Object |DC location info of VNF |
++------------------------------+-----------------+------------------------------------+
+
+VnfLocationConstraint Object
+
++------------------------------+-----------------+------------------------------------+
+|Attribute |Content |Description |
++==============================+=================+====================================+
+|vimId |String |VIM id from ESR definition |
++------------------------------+-----------------+------------------------------------+
+
+Resource Object
+
++------------------------------+-----------------+------------------------------------+
+|Attribute |Content |Description |
++==============================+=================+====================================+
+|resourceName |String |The resource name |
++------------------------------+-----------------+------------------------------------+
+|resourceInvariantUuid |String |The resource invariant UUID. |
++------------------------------+-----------------+------------------------------------+
+|resourceUuid |String |The resource UUID. |
++------------------------------+-----------------+------------------------------------+
+|resourceCustomizationUuid |String |The resource customization UUID. |
++------------------------------+-----------------+------------------------------------+
+|parameters |Object |Parameter of resource |
++------------------------------+-----------------+------------------------------------+
+
+Response:
+
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content|Description |
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+|serviceId |M |1 |String |Service instance ID. |
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operationId |M |1 |String |Service Operation ID. |
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+
+Delete E2E service instance
++++++++++++++++++++++++++++
+
++--------------------+----------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+======================================================================+
+|URI |/onap/so/infra/e2eServiceInstances/v3/{serviceId} |
++--------------------+----------------------------------------------------------------------+
+|Operation Type |DELETE |
++--------------------+----------------------------------------------------------------------+
+
+Request Parameters:
+
++-------------------+---------+-----------+-------+----------------------------------------+
+|Attribute |Qualifier|Cardinality|Content|Description |
++===================+=========+===========+=======+========================================+
+|globalSubscriberId |M |1 |String |The subscriber id. It is defined in AAI |
++-------------------+---------+-----------+-------+----------------------------------------+
+|serviceType |M |1 |String |The service type. It is defined in AAI |
++-------------------+---------+-----------+-------+----------------------------------------+
+
+Response:
+
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content|Description |
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operationId |M |1 |String |The operation id. |
++-------------+---------+-----------+-------+------------------------------------------------------------------------+
+
+Query E2E service operation result
+++++++++++++++++++++++++++++++++++
+
++--------------------+-----------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+===============================================================================================+
+|URI |/onap/so/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId} |
++--------------------+-----------------------------------------------------------------------------------------------+
+|Operation Type |GET |
++--------------------+-----------------------------------------------------------------------------------------------+
+
+Request Parameters:
+
++--------------+---------+-----------+-------+--------------+
+|Attribute |Qualifier|Cardinality|Content|Description |
++==============+=========+===========+=======+==============+
+|serviceId |M |1 |Service instance ID. |
++--------------+---------+-----------+-------+--------------+
+|operationId |M |1 |Service Operation ID. |
++--------------+---------+-----------+-------+--------------+
+
+Response:
+
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content|Description |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operation |M |1 |String |Operation object identify. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operationId |M |1 |String |Operation ID. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operation |M |1 |String |Operation type, create|delete. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|result |M |1 |String |Operation result: finished, error, processing. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|reason |M |1 |String |If failing, need to write fail reason. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|userId |M |1 |String |Operation user ID. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operationContent |M |1 |String |The status detail of current operation which is being executing. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|progress |M |1 |String |Current operation progress. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|operateAt |M |1 |String |Time that it starts to execute operation. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
+|finishedAt |M |1 |String |Time that it finished executing operation. |
++------------------+---------+-----------+-------+------------------------------------------------------------------------+
diff --git a/docs/api/apis/serviceInstances-api.rst b/docs/api/apis/serviceInstances-api.rst
new file mode 100644
index 0000000000..a46af713dc
--- /dev/null
+++ b/docs/api/apis/serviceInstances-api.rst
@@ -0,0 +1,1192 @@
+.. 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.
+
+serviceInstances API
+====================
+
+
+This API allows to generate some requests to manage:
+
+- serviceInstances (create, delete)
+- volumeGroups attached to a vnf instance (create, delete)
+- vfModules attached to a vnf instance (create, delete)
+- vnfs attached to a service instance (create, delete)
+- orchestrationRequests (get)
+
+links:
+
+- :ref:`create_service_instance`
+- :ref:`delete_service_instance`
+- :ref:`create_volume_group`
+- :ref:`delete_volume_group`
+- :ref:`create_vf_module`
+- :ref:`delete_vf_module`
+- :ref:`create_vnf`
+- :ref:`delete_vnf`
+- :ref:`get_orchestration_request_by_id`
+- :ref:`get_orchestration_request_all`
+
+
+.. _create_service_instance:
+
+Create service instance
++++++++++++++++++++++++
+
++--------------------+--------------------------------------------------------+
+|Interface Definition|Description |
++====================+========================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances |
++--------------------+--------------------------------------------------------+
+|Operation Type |POST |
++--------------------+--------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+--------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+--------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+==========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++-------------------+--------------------------+-------------------------------------------------+
+|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
++-------------------+--------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
++-------------------+--------------------------+-------------------------------------------------+
+|project |project Object |Content of project object. |
++-------------------+--------------------------+-------------------------------------------------+
+|owningEntity |owningEntity Object |Content of owningEntity object. |
++-------------------+--------------------------+-------------------------------------------------+
+|platform |platform Object |Content of platform object. |
++-------------------+--------------------------+-------------------------------------------------+
+|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
++-------------------+--------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+|modelCustomizationUuid |String |The Model Customization UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelVersionId |String |The Model version id |
++-------------------------+------------------+-------------------------------------------------+
+|modelUuid |String |The Model UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInvariantUuid |String |The Model Invariant UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInstanceName |String |The Model Instance name |
++-------------------------+------------------+-------------------------------------------------+
+
+
+SubscriberInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|GlobalSubscriberId |String |Global customer Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|SubscriberName |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|billingAccountNumber |String |billingAccountNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|callbackUrl |String |callbackUrl of the request |
++-------------------------+------------------+-------------------------------------------------+
+|correlator |String |correlator of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderNumber |String |orderNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|productFamilyId |String |productFamilyId of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderVersion |String |orderVersion of the request |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |instanceName of the request |
++-------------------------+------------------+-------------------------------------------------+
+|suppressRollback |String |suppressRollback of the request |
++-------------------------+------------------+-------------------------------------------------+
+|requestorId |String |requestorId of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestParameters Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|SubscriptionServiceType |String |The service type of the Subscription |
++-------------------------+------------------+-------------------------------------------------+
+|UserParams |Array |The product family Id. |
++-------------------------+------------------+-------------------------------------------------+
+|aLaCarte |Boolean | aLaCarte |
++-------------------------+------------------+-------------------------------------------------+
+|autoBuildVfModules |Boolean |autoBuildVfModules |
++-------------------------+------------------+-------------------------------------------------+
+|cascadeDelete |Boolean |cascadeDelete |
++-------------------------+------------------+-------------------------------------------------+
+|usePreload |Boolean |usePreload |
++-------------------------+------------------+-------------------------------------------------+
+|rebuildVolumeGroups |Boolean |rebuildVolumeGroups |
++-------------------------+------------------+-------------------------------------------------+
+|payload |String |payload |
++-------------------------+------------------+-------------------------------------------------+
+|controllerType |String |controllerType |
++-------------------------+------------------+-------------------------------------------------+
+
+UserParams Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|name |String |Tag name of attribute |
++-------------------------+------------------+-------------------------------------------------+
+|value |String |Value of the tag |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+|aicNodeClli |String |aicNodeClli property |
++-------------------------+------------------+-------------------------------------------------+
+
+Project Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|projectName |String |Name of the project |
++-------------------------+------------------+-------------------------------------------------+
+
+OwningEntity Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|owningEntityId |String |owningEntityId of the owingEntity |
++-------------------------+------------------+-------------------------------------------------+
+|owningEntityName |String |owningEntityName of the owingEntity |
++-------------------------+------------------+-------------------------------------------------+
+
+Platform Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|platformName |String |Platform Name |
++-------------------------+------------------+-------------------------------------------------+
+
+LineOfBusiness Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lineOfBusinessName |String |Line Of Business Name |
++-------------------------+------------------+-------------------------------------------------+
+
+
+.. _delete_service_instance:
+
+Delete service instance
++++++++++++++++++++++++
+
++--------------------+--------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId} |
++--------------------+--------------------------------------------------------------------------------+
+|Operation Type |DELETE |
++--------------------+--------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+--------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+
+.. _create_volume_group:
+
+Create Volume Group
++++++++++++++++++++
+
++--------------------+------------------------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+==================================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups |
++--------------------+------------------------------------------------------------------------------------------------------------------+
+|Operation Type |POST |
++--------------------+------------------------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+------------------------------------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+--------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+==========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++-------------------+--------------------------+-------------------------------------------------+
+|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
++-------------------+--------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
++-------------------+--------------------------+-------------------------------------------------+
+|project |project Object |Content of project object. |
++-------------------+--------------------------+-------------------------------------------------+
+|owningEntity |owningEntity Object |Content of owningEntity object. |
++-------------------+--------------------------+-------------------------------------------------+
+|platform |platform Object |Content of platform object. |
++-------------------+--------------------------+-------------------------------------------------+
+|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
++-------------------+--------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+|modelCustomizationUuid |String |The Model Customization UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelVersionId |String |The Model version id |
++-------------------------+------------------+-------------------------------------------------+
+|modelUuid |String |The Model UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInvariantUuid |String |The Model Invariant UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInstanceName |String |The Model Instance name |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+|aicNodeClli |String |aicNodeClli property |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|billingAccountNumber |String |billingAccountNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|callbackUrl |String |callbackUrl of the request |
++-------------------------+------------------+-------------------------------------------------+
+|correlator |String |correlator of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderNumber |String |orderNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|productFamilyId |String |productFamilyId of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderVersion |String |orderVersion of the request |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |instanceName of the request |
++-------------------------+------------------+-------------------------------------------------+
+|suppressRollback |String |suppressRollback of the request |
++-------------------------+------------------+-------------------------------------------------+
+|requestorId |String |requestorId of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|relatedInstance |Object |relatedInstance Object |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|instanceId |String |instanceId |
++-------------------------+------------------+-------------------------------------------------+
+|modelInfo |Object |Content of modelInfo object. |
++-------------------------+------------------+-------------------------------------------------+
+
+.. _delete_volume_group:
+
+Delete Volume Group
++++++++++++++++++++
+
++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+============================================================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volume-groupinstance-id} |
++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+|Operation Type |DELETE |
++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++---------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=====================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+.. _create_vf_module:
+
+Create VF Module
+++++++++++++++++
+
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+===============================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Operation Type |POST |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+---------------------------------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++---------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=====================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|relatedInstanceList |List |Content of relatedInstanceList. |
++---------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|InstanceName |String |The instance Name |
++-------------------------+------------------+-------------------------------------------------+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|SuppressRollback |Boolean |SuppressRollback |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|relatedInstance |Object |relatedInstance Object |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|instanceId |String |instanceId |
++-------------------------+------------------+-------------------------------------------------+
+|modelInfo |Object |Content of modelInfo object. |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |Name of the instance |
++-------------------------+------------------+-------------------------------------------------+
+
+.. _delete_vf_module:
+
+Delete VF Module
+++++++++++++++++
+
++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+=====================================================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleinstance-id} |
++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
+|Operation Type |DELETE |
++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++---------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=====================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+
+.. _create_vnf:
+
+Create VNF
+++++++++++
+
++--------------------+-------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+=====================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs |
++--------------------+-------------------------------------------------------------------------------------+
+|Operation Type |POST |
++--------------------+-------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+-------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+--------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+==========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++-------------------+--------------------------+-------------------------------------------------+
+|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
++-------------------+--------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
++-------------------+--------------------------+-------------------------------------------------+
+|project |project Object |Content of project object. |
++-------------------+--------------------------+-------------------------------------------------+
+|owningEntity |owningEntity Object |Content of owningEntity object. |
++-------------------+--------------------------+-------------------------------------------------+
+|platform |platform Object |Content of platform object. |
++-------------------+--------------------------+-------------------------------------------------+
+|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
++-------------------+--------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+|modelCustomizationUuid |String |The Model Customization UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelVersionId |String |The Model version id |
++-------------------------+------------------+-------------------------------------------------+
+|modelUuid |String |The Model UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInvariantUuid |String |The Model Invariant UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInstanceName |String |The Model Instance name |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|billingAccountNumber |String |billingAccountNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|callbackUrl |String |callbackUrl of the request |
++-------------------------+------------------+-------------------------------------------------+
+|correlator |String |correlator of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderNumber |String |orderNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|productFamilyId |String |productFamilyId of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderVersion |String |orderVersion of the request |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |instanceName of the request |
++-------------------------+------------------+-------------------------------------------------+
+|suppressRollback |String |suppressRollback of the request |
++-------------------------+------------------+-------------------------------------------------+
+|requestorId |String |requestorId of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|relatedInstance |Object |relatedInstance Object |
++-------------------------+------------------+-------------------------------------------------+
+
+relatedInstance List
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|instanceId |String |instanceId |
++-------------------------+------------------+-------------------------------------------------+
+|modelInfo |Object |Content of modelInfo object. |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestParameters Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|UserParams |Array |The product family Id. |
++-------------------------+------------------+-------------------------------------------------+
+
+UserParams Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|name |String |Tag name of attribute |
++-------------------------+------------------+-------------------------------------------------+
+|value |String |Value of the tag |
++-------------------------+------------------+-------------------------------------------------+
+
+.. _delete_vnf:
+
+Delete VNF
+++++++++++
+
++--------------------+-----------------------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+=====================================================================================================+
+|URI |/onap/so/infra/serviceInstantiation/v7/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId} |
++--------------------+-----------------------------------------------------------------------------------------------------+
+|Operation Type |DELETE |
++--------------------+-----------------------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+-----------------------------------------------------------------------------------------------------+
+
+Request Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++---------------------+-------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=====================+=========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++---------------------+-------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++---------------------+-------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+
+CloudConfiguration Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|lcpCloudRegionId |String |CloudRegion Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|tenantId |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestParameters Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|UserParams |Array |The product family Id. |
++-------------------------+------------------+-------------------------------------------------+
+
+UserParams Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|name |String |Tag name of attribute |
++-------------------------+------------------+-------------------------------------------------+
+|value |String |Value of the tag |
++-------------------------+------------------+-------------------------------------------------+
+
+.. _get_orchestration_request_by_id:
+
+GET Orchestration Request
++++++++++++++++++++++++++
+
++--------------------+-------------------------------------------------------------------------------------+
+|Interface Definition|Description |
++====================+=====================================================================================+
+|URI |/onap/so/infra/orchestrationRequests/v7/{request-id} |
++--------------------+-------------------------------------------------------------------------------------+
+|Operation Type |GET |
++--------------------+-------------------------------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+-------------------------------------------------------------------------------------+
+
+Response Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|request |M |1 |request Object |Content of request object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+Request Object
+
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++===================+=========+===========+==========================+===========================================+
+|requestId |M |1 |String |Request Id |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|startTime |M |1 |request Object |Start time. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestScope |M |1 |request Object |Scope of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestType |M |1 |request Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestDetails |M |1 |requestDetails Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestStatus |M |1 |requestStatus Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+--------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+==========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++-------------------+--------------------------+-------------------------------------------------+
+|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
++-------------------+--------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
++-------------------+--------------------------+-------------------------------------------------+
+|project |project Object |Content of project object. |
++-------------------+--------------------------+-------------------------------------------------+
+|owningEntity |owningEntity Object |Content of owningEntity object. |
++-------------------+--------------------------+-------------------------------------------------+
+|platform |platform Object |Content of platform object. |
++-------------------+--------------------------+-------------------------------------------------+
+|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
++-------------------+--------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+|modelCustomizationUuid |String |The Model Customization UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelVersionId |String |The Model version id |
++-------------------------+------------------+-------------------------------------------------+
+|modelUuid |String |The Model UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInvariantUuid |String |The Model Invariant UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInstanceName |String |The Model Instance name |
++-------------------------+------------------+-------------------------------------------------+
+
+SubscriberInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|GlobalSubscriberId |String |Global customer Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|SubscriberName |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|billingAccountNumber |String |billingAccountNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|callbackUrl |String |callbackUrl of the request |
++-------------------------+------------------+-------------------------------------------------+
+|correlator |String |correlator of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderNumber |String |orderNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|productFamilyId |String |productFamilyId of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderVersion |String |orderVersion of the request |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |instanceName of the request |
++-------------------------+------------------+-------------------------------------------------+
+|suppressRollback |String |suppressRollback of the request |
++-------------------------+------------------+-------------------------------------------------+
+|requestorId |String |requestorId of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestParameters Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|SubscriptionServiceType |String |The service type of the Subscription |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestStatus Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|finishTime |String |Time |
++-------------------------+------------------+-------------------------------------------------+
+|requestState |String |state of the request |
++-------------------------+------------------+-------------------------------------------------+
+|statusMessage |String |statusMessage |
++-------------------------+------------------+-------------------------------------------------+
+|percentProgress |String |percentage of progress |
++-------------------------+------------------+-------------------------------------------------+
+
+
+.. _get_orchestration_request_all:
+
+GET Orchestration Requests
+++++++++++++++++++++++++++
+
++--------------------+--------------------------------------------------------------+
+|Interface Definition|Description |
++====================+==============================================================+
+|URI |/onap/so/infra/orchestrationRequests/v7 |
++--------------------+--------------------------------------------------------------+
+|Operation Type |GET |
++--------------------+--------------------------------------------------------------+
+|Content-Type |application/json |
++--------------------+--------------------------------------------------------------+
+
+Response Body:
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|requestList |M |1 |Array |Content of request List. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestList :
+
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++================+=========+===========+==========================+===========================================+
+|request |M |1 |request Object |Content of request object. |
++----------------+---------+-----------+--------------------------+-------------------------------------------+
+
+Request Object
+
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|Attribute |Qualifier|Cardinality|Content |Description |
++===================+=========+===========+==========================+===========================================+
+|requestId |M |1 |String |Request Id. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|startTime |M |1 |request Object |Start time. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestScope |M |1 |request Object |Scope of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestType |M |1 |request Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestDetails |M |1 |requestDetails Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+|requestStatus |M |1 |requestStatus Object |Type of the request. |
++-------------------+---------+-----------+--------------------------+-------------------------------------------+
+
+RequestDetails Object
+
++-------------------+--------------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++===================+==========================+=================================================+
+|modelInfo |modelInfo Object |Content of modelInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestInfo |requestInfo Object |Content of requestInfo object. |
++-------------------+--------------------------+-------------------------------------------------+
+|requestParameters |requestParameters Object |Content of requestParameters object. |
++-------------------+--------------------------+-------------------------------------------------+
+|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. |
++-------------------+--------------------------+-------------------------------------------------+
+|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. |
++-------------------+--------------------------+-------------------------------------------------+
+|project |project Object |Content of project object. |
++-------------------+--------------------------+-------------------------------------------------+
+|owningEntity |owningEntity Object |Content of owningEntity object. |
++-------------------+--------------------------+-------------------------------------------------+
+|platform |platform Object |Content of platform object. |
++-------------------+--------------------------+-------------------------------------------------+
+|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. |
++-------------------+--------------------------+-------------------------------------------------+
+
+ModelInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|ModelType |String |Type of model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelInvariantId |String |The Model Invariant Id. |
++-------------------------+------------------+-------------------------------------------------+
+|ModelNameVersionId |String |The modelname Version Id |
++-------------------------+------------------+-------------------------------------------------+
+|ModelName |String |Name of the Model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelVersion |String |Version of the model |
++-------------------------+------------------+-------------------------------------------------+
+|ModelCustomization Name |String |The Model Customization name |
++-------------------------+------------------+-------------------------------------------------+
+|modelCustomizationUuid |String |The Model Customization UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelVersionId |String |The Model version id |
++-------------------------+------------------+-------------------------------------------------+
+|modelUuid |String |The Model UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInvariantUuid |String |The Model Invariant UUid |
++-------------------------+------------------+-------------------------------------------------+
+|modelInstanceName |String |The Model Instance name |
++-------------------------+------------------+-------------------------------------------------+
+
+SubscriberInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|GlobalSubscriberId |String |Global customer Id (in A&AI) |
++-------------------------+------------------+-------------------------------------------------+
+|SubscriberName |String |Name of the Subscriber |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestInfo Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|Source |String |source of the request |
++-------------------------+------------------+-------------------------------------------------+
+|billingAccountNumber |String |billingAccountNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|callbackUrl |String |callbackUrl of the request |
++-------------------------+------------------+-------------------------------------------------+
+|correlator |String |correlator of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderNumber |String |orderNumber of the request |
++-------------------------+------------------+-------------------------------------------------+
+|productFamilyId |String |productFamilyId of the request |
++-------------------------+------------------+-------------------------------------------------+
+|orderVersion |String |orderVersion of the request |
++-------------------------+------------------+-------------------------------------------------+
+|instanceName |String |instanceName of the request |
++-------------------------+------------------+-------------------------------------------------+
+|suppressRollback |String |suppressRollback of the request |
++-------------------------+------------------+-------------------------------------------------+
+|requestorId |String |requestorId of the request |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestParameters Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|SubscriptionServiceType |String |The service type of the Subscription |
++-------------------------+------------------+-------------------------------------------------+
+
+RequestStatus Object
+
++-------------------------+------------------+-------------------------------------------------+
+|Attribute |Content |Description |
++=========================+==================+=================================================+
+|finishTime |String |Time |
++-------------------------+------------------+-------------------------------------------------+
+|requestState |String |state of the request |
++-------------------------+------------------+-------------------------------------------------+
+|statusMessage |String |statusMessage |
++-------------------------+------------------+-------------------------------------------------+
+|percentProgress |String |percentage of progress |
++-------------------------+------------------+-------------------------------------------------+
diff --git a/docs/api/offered_consumed_apis.rst b/docs/api/offered_consumed_apis.rst
index 0caef0a426..1d0a8f005b 100644
--- a/docs/api/offered_consumed_apis.rst
+++ b/docs/api/offered_consumed_apis.rst
@@ -3,7 +3,7 @@
.. Copyright 2018 Huawei Technologies Co., Ltd.
SO Offered and Consumed APIs
-=====================================
+============================
The list of APIs that SO offers can be found in following table:
@@ -22,8 +22,9 @@ The list of APIs that SO offers can be found in following table:
"swagger json file", "html doc", "yaml doc"
":download:`link <swagger/swagger.json>`", ":download:`link <swagger/swagger.html>`", ":download:`link <swagger/swagger.yaml>`"
-
-The list of APIs that SO offerers for monitroing the BPMN flows could be found in the following table:
+
+The list of APIs that SO offerers for monitoring the BPMN flows
+could be found in the following table:
.. csv-table::
:header: "|Swagger-icon|", "|yml-icon|"
@@ -33,11 +34,13 @@ The list of APIs that SO offerers for monitroing the BPMN flows could be found i
":download:`link <swagger/SO_MONITORING_SWAGGER.json>`", ":download:`link <swagger/SO_MONITORING_SWAGGER.yaml>`"
Further Reading
-----------------------------------------
+---------------
Detailed documentation can be found here:
.. toctree::
:maxdepth: 1
- apis/SO_Interface.rst \ No newline at end of file
+ apis/serviceInstances-api.rst
+ apis/e2eServiceInstances-api.rst
+ apis/consumed-apis.rst
diff --git a/docs/architecture/architecture.rst b/docs/architecture/architecture.rst
index 7636792c41..72b108a271 100644
--- a/docs/architecture/architecture.rst
+++ b/docs/architecture/architecture.rst
@@ -108,6 +108,8 @@ SO Sub-Components
* Tracking capability which VNFM instance has handled with which VNF instance
* BPMN Building Block workflows and Java-based recipes for VNF LCM
* VNFM Simulator for validating SO VNFM Adapter NBI and SBI for integration testing
+ * The SO ETSI CSIT Tests and running them, https://wiki.onap.org/display/DW/SO+ETSI+CSIT
+ * Testing the SO ETSI Alignment manually (Instantiate VNF using SVNFM), https://wiki.onap.org/pages/viewpage.action?pageId=68524128
Third Party and Open Source
---------------------------
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index cdb20c246b..4ad5f5876f 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -8,6 +8,180 @@ Service Orchestrator Release Notes
The SO provides the highest level of service orchestration in the ONAP architecture.
+
+Version: 5.0.1
+-----------------------
+
+:Release Date: 2019-10-11
+
+**Docker Images**
+
+**Dockers released for SO:**
+
+ - onap/so/api-handler-infra,1.5.3
+ - onap/so/bpmn-infra,1.5.3
+ - onap/so/catalog-db-adapter,1.5.3
+ - onap/so/openstack-adapter,1.5.3
+ - onap/so/request-db-adapter,1.5.3
+ - onap/so/sdc-controller,1.5.3
+ - onap/so/sdnc-adapter,1.5.3
+ - onap/so/so-monitoring,1.5.3
+ - onap/so/vfc-adapter,1.5.3
+ - onap/so/vnfm-adapter,1.5.3
+ - onap/so/vnfm-simulator,1.5.3
+
+**Release Purpose**
+
+The R5 El Alto release of ONAP is a maintenance release, focusing on deployability, technical debt, and auto test case improvements.
+
+**New Features**
+
+The main goal of the El-Alto release was to improve documentation, UT improvement for various kinds of resources.
+
+**Epics**
+- [`SO-1756 <https://jira.onap.org/browse/SO-1756>`__\ ] - Enhance SO VNFM Adapter
+
+**Stories**
+- [`SO-2376 <https://jira.onap.org/browse/SO-2376>`__\ ] - Improve fall out case handling
+- [`SO-2363 <https://jira.onap.org/browse/SO-2363>`__\ ] - Update Resume Logic and Add Workflow Listeners
+- [`SO-2353 <https://jira.onap.org/browse/SO-2353>`__\ ] - update logging to match onap logging library
+- [`SO-2352 <https://jira.onap.org/browse/SO-2352>`__\ ] - Improvements to relationship handling in VNFM adapter
+- [`SO-2332 <https://jira.onap.org/browse/SO-2332>`__\ ] - Remove unused table requestdb.active_requests.
+- [`SO-2306 <https://jira.onap.org/browse/SO-2306>`__\ ] - getentity csar logging
+- [`SO-2301 <https://jira.onap.org/browse/SO-2301>`__\ ] - Integrate Logging Library
+- [`SO-2297 <https://jira.onap.org/browse/SO-2297>`__\ ] - updated all sql files including in tests to use
+- [`SO-2291 <https://jira.onap.org/browse/SO-2291>`__\ ] - Created external task utils in a common location
+- [`SO-2283 <https://jira.onap.org/browse/SO-2283>`__\ ] - Convert NetworkCollection to use GetEntity API.
+- [`SO-2282 <https://jira.onap.org/browse/SO-2282>`__\ ] - Convert to use the GetEntity API
+- [`SO-2259 <https://jira.onap.org/browse/SO-2259>`__\ ] - Added default value for when ErrorCode is null in mdc
+- [`SO-2244 <https://jira.onap.org/browse/SO-2244>`__\ ] - Updated VNF and VfModules to use the getEntity API.
+- [`SO-2233 <https://jira.onap.org/browse/SO-2233>`__\ ] - fixed dsl builder to correctly add output
+- [`SO-2232 <https://jira.onap.org/browse/SO-2232>`__\ ] - Initial commit of validation framework to APIH
+- [`SO-2231 <https://jira.onap.org/browse/SO-2231>`__\ ] - asdc controller treat distributionid as requestid in mdc
+- [`SO-2224 <https://jira.onap.org/browse/SO-2224>`__\ ] - Updated vnfc instance groups to use the getEntity API.
+- [`SO-2216 <https://jira.onap.org/browse/SO-2216>`__\ ] - health check now entirely config based
+- [`SO-2205 <https://jira.onap.org/browse/SO-2205>`__\ ] - add rainy day handling with SERVICE_ROLE and type
+- [`SO-2202 <https://jira.onap.org/browse/SO-2202>`__\ ] - Updated cvnfc's to use the getEntity API
+- [`SO-2190 <https://jira.onap.org/browse/SO-2190>`__\ ] - VNFM adapter support two way TLS
+- [`SO-2180 <https://jira.onap.org/browse/SO-2180>`__\ ] - Support oauth for calls from VNFM to VNFM adapter
+- [`SO-2169 <https://jira.onap.org/browse/SO-2169>`__\ ] - Add oauth for calls from VNFM adapter to VNFM
+- [`SO-2157 <https://jira.onap.org/browse/SO-2157>`__\ ] - Upgrade springboot.version from 2.0.5 to 2.1.5
+- [`SO-2147 <https://jira.onap.org/browse/SO-2147>`__\ ] - Converted NetworkResource to use the parser getEntity method
+- [`SO-2143 <https://jira.onap.org/browse/SO-2143>`__\ ] - Implement TLS for calls into VNFM adapter
+- [`SO-2142 <https://jira.onap.org/browse/SO-2142>`__\ ] - mso to enhance get orchestration request to include workflow step
+- [`SO-2122 <https://jira.onap.org/browse/SO-2122>`__\ ] - Added servicename to MDC so that it gets logged and added enter and exit markers
+- [`SO-2121 <https://jira.onap.org/browse/SO-2121>`__\ ] - Removing the application-local.yaml files from the projects to fix CSO pen test issues
+- [`SO-2116 <https://jira.onap.org/browse/SO-2116>`__\ ] - Implement TLS for calls from VNFM adapter to VNFM
+- [`SO-2114 <https://jira.onap.org/browse/SO-2114>`__\ ] - We need to expand column request_status on table archived_infra_requests as well
+- [`SO-2111 <https://jira.onap.org/browse/SO-2111>`__\ ] - add query stack data and populate table step
+- [`SO-2097 <https://jira.onap.org/browse/SO-2097>`__\ ] - Global JJB Migration of SO
+- [`SO-2093 <https://jira.onap.org/browse/SO-2093>`__\ ] - mso will support new requeststate values
+- [`SO-2092 <https://jira.onap.org/browse/SO-2092>`__\ ] - update bpmn to save extsystemerrorsource
+- [`SO-2080 <https://jira.onap.org/browse/SO-2080>`__\ ] - support new query param format
+- [`SO-2068 <https://jira.onap.org/browse/SO-2068>`__\ ] - improved logging when no exception data is found
+- [`SO-2066 <https://jira.onap.org/browse/SO-2066>`__\ ] - SO API Security Matrix
+- [`SO-2064 <https://jira.onap.org/browse/SO-2064>`__\ ] - Alpine porting check
+- [`SO-2057 <https://jira.onap.org/browse/SO-2057>`__\ ] - Update failsafe dependency to 2.0.1
+- [`SO-2055 <https://jira.onap.org/browse/SO-2055>`__\ ] - enhance workflowaction to handle resume func
+- [`SO-2054 <https://jira.onap.org/browse/SO-2054>`__\ ] - add rollback ext system error source
+- [`SO-2052 <https://jira.onap.org/browse/SO-2052>`__\ ] - Javadoc and logging improvement
+- [`SO-2048 <https://jira.onap.org/browse/SO-2048>`__\ ] - Building individual repos for reducing compilation time
+- [`SO-2043 <https://jira.onap.org/browse/SO-2043>`__\ ] - Security updates for maven dependencies
+- [`SO-2035 <https://jira.onap.org/browse/SO-2035>`__\ ] - update apih to accept new uri parameter
+- [`SO-2032 <https://jira.onap.org/browse/SO-2032>`__\ ] - support no payload for alacarte deletes
+- [`SO-2024 <https://jira.onap.org/browse/SO-2024>`__\ ] - Validate ServiceInstance name using createNodesUri.
+- [`SO-2023 <https://jira.onap.org/browse/SO-2023>`__\ ] - add is_data_internal column to request processing data
+- [`SO-2022 <https://jira.onap.org/browse/SO-2022>`__\ ] - Validate name for InstanceGroup, Configuration and Network.
+- [`SO-2021 <https://jira.onap.org/browse/SO-2021>`__\ ] - update multi stage code to accurately skip bbs if true
+- [`SO-2020 <https://jira.onap.org/browse/SO-2020>`__\ ] - mso to validate the name uniqueness during object creation in a ai
+- [`SO-2018 <https://jira.onap.org/browse/SO-2018>`__\ ] - Changes related to eviction of connections from connection pool
+- [`SO-2017 <https://jira.onap.org/browse/SO-2017>`__\ ] - use count format and limit one for exists
+- [`SO-2015 <https://jira.onap.org/browse/SO-2015>`__\ ] - support async operation for vf module operations with sdnc
+- [`SO-2001 <https://jira.onap.org/browse/SO-2001>`__\ ] - Added ext_system_error_source column to requestdb
+- [`SO-1999 <https://jira.onap.org/browse/SO-1999>`__\ ] - replaced String.repeat with static final strings
+- [`SO-1990 <https://jira.onap.org/browse/SO-1990>`__\ ] - resume request copying request body rewrite requestorid
+- [`SO-1976 <https://jira.onap.org/browse/SO-1976>`__\ ] - Enhance naming service support
+- [`SO-1975 <https://jira.onap.org/browse/SO-1975>`__\ ] - Accommodate WAN Networking
+- [`SO-1963 <https://jira.onap.org/browse/SO-1963>`__\ ] - apih resume request handling more generic
+- [`SO-1960 <https://jira.onap.org/browse/SO-1960>`__\ ] - apih to populate original request id
+- [`SO-1914 <https://jira.onap.org/browse/SO-1914>`__\ ] - Renamed NF fields in catalog db pojo
+- [`SO-1902 <https://jira.onap.org/browse/SO-1902>`__\ ] - Added script for adding original_request_id column
+- [`SO-1898 <https://jira.onap.org/browse/SO-1898>`__\ ] - Audit service enhancements
+- [`SO-1897 <https://jira.onap.org/browse/SO-1897>`__\ ] - fix keypair conflict issue in openstack adapter
+- [`SO-1893 <https://jira.onap.org/browse/SO-1893>`__\ ] - Initial checkin of updates for vf module replace
+- [`SO-1867 <https://jira.onap.org/browse/SO-1867>`__\ ] - store openstack request status in requestdb
+- [`SO-1866 <https://jira.onap.org/browse/SO-1866>`__\ ] - Update Rainy day handling to be more robust
+- [`SO-1847 <https://jira.onap.org/browse/SO-1847>`__\ ] - Added inProgress request check to resume
+- [`SO-1831 <https://jira.onap.org/browse/SO-1831>`__\ ] - Resume APIH Functionality
+- [`SO-1807 <https://jira.onap.org/browse/SO-1807>`__\ ] - Store Cloud Request in Database, add to request service
+- [`SO-1697 <https://jira.onap.org/browse/SO-1697>`__\ ] - Support State transition for configuration building blocks
+- [`SO-1538 <https://jira.onap.org/browse/SO-1538>`__\ ] - Integration Test for SO VNFM Adapter - Perform the functional test to validate VNFM Adapter NBI and SOL003-based SBI
+- [`SO-1447 <https://jira.onap.org/browse/SO-1447>`__\ ] - Refine multicloud use of SO cloudsites and identify DB
+- [`SO-1446 <https://jira.onap.org/browse/SO-1446>`__\ ] - Multicloud API updates for generic clouds
+
+**Key Issues Addressed**
+- [`SO-2400 <https://jira.onap.org/browse/SO-2400>`__\ ] - vCPE Create Res Cust Service Error : Execption in create execution list
+- [`SO-2382 <https://jira.onap.org/browse/SO-2382>`__\ ] - SO ConfigAssign Java Exception
+- [`SO-2378 <https://jira.onap.org/browse/SO-2378>`__\ ] - Java lang exception in Homing
+- [`SO-2375 <https://jira.onap.org/browse/SO-2375>`__\ ] - vCPE instantiate gmux fails due to API Handler error
+- [`SO-2357 <https://jira.onap.org/browse/SO-2357>`__\ ] - Distribution of K8S service fails
+- [`SO-2354 <https://jira.onap.org/browse/SO-2354>`__\ ] - vCPE model_customization_id not found on create vfmodule
+- [`SO-2351 <https://jira.onap.org/browse/SO-2351>`__\ ] - SO Distribution Error on Allotted Resource - duplicate primary
+- [`SO-2349 <https://jira.onap.org/browse/SO-2349>`__\ ] - Exception in DMAAP Client when PNF_READY event arrives from PRH
+- [`SO-2337 <https://jira.onap.org/browse/SO-2337>`__\ ] - Git clone not working for CSIT filename too long
+- [`SO-2289 <https://jira.onap.org/browse/SO-2289>`__\ ] - CreateVcpeResCustService_simplified workflow used in PnP PNF registration workflow returns an exception in Dmaap listener
+- [`SO-2229 <https://jira.onap.org/browse/SO-2229>`__\ ] - sdc adapter and openstack container in crash loopback
+- [`SO-2228 <https://jira.onap.org/browse/SO-2228>`__\ ] - SDC Handler crash loopback
+- [`SO-2222 <https://jira.onap.org/browse/SO-2222>`__\ ] - SO 1.5.0-STAGING-latest containers fail liveness probe
+- [`SO-2221 <https://jira.onap.org/browse/SO-2221>`__\ ] - SO 1.5.0-STAGING-latest container fails to start
+- [`SO-2082 <https://jira.onap.org/browse/SO-2082>`__\ ] - Delete Network does not work correctly
+- [`SO-2038 <https://jira.onap.org/browse/SO-2038>`__\ ] - Fix build and harkari-cp version, Get LF to add dependency
+- [`SO-2003 <https://jira.onap.org/browse/SO-2003>`__\ ] - No workflow assigned to 'Dissociate' button in VID
+- [`SO-1934 <https://jira.onap.org/browse/SO-1934>`__\ ] - ETSI Building Block Fails to Execute - Due to variables not being mapped correctly in the workflow
+- [`SO-1892 <https://jira.onap.org/browse/SO-1892>`__\ ] - CatalogDbClent - sql query error
+- [`SO-1809 <https://jira.onap.org/browse/SO-1809>`__\ ] - 'DoDeleteE2EServiceInstance' calls 'AAI GenericGetService' sub-process which is deleted from SO common-bpmn
+- [`SO-1644 <https://jira.onap.org/browse/SO-1644>`__\ ] - SO doesn't keep the proxy settings within the containers
+- [`SO-1605 <https://jira.onap.org/browse/SO-1605>`__\ ] - SO fails on updating Camunda table when DoCreateVfModule for vCPE infra service
+
+**Security Notes**
+
+ Quick Links:
+
+ - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_
+ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_
+
+
+**Known Issues**
+
+- [`SO-2063 <https://jira.onap.org/browse/SO-2063>`__\ ] - AAF integration
+- [`SO-2403 <https://jira.onap.org/browse/SO-2403>`__\ ] - Not Displaying correct Workflow Name
+- [`SO-2430 <https://jira.onap.org/browse/SO-2430>`__\ ] - vCPE Create VFmodule Fails on Query to SDNC
+- [`SO-2433 <https://jira.onap.org/browse/SO-2433>`__\ ] - Not providing user options during Pause For Manual Task
+- [`SO-2434 <https://jira.onap.org/browse/SO-2434>`__\ ] - Displaying Un-needed Mandatory User Inputs for Workflow with Pause
+- [`SO-1754 <https://jira.onap.org/browse/SO-1754>`__\ ] - SO-Mariadb: 'VNF_RESOURCE_CUSTOMIZATION' DB update bug when service is distributed.
+- [`SO-2447 <https://jira.onap.org/browse/SO-2447>`__\ ] - Openstack Adatper fails to find Stack Name and creates duplicate stack with address conflict
+
+OJSI Issues
+
+- [`OJSI-110 <https://jira.onap.org/browse/OJSI-110>`__\ ] - so-monitor exposes plain text HTTP endpoint using port 30224
+- [`OJSI-138 <https://jira.onap.org/browse/OJSI-138>`__\ ] - so exposes plain text HTTP endpoint using port 30277
+- [`OJSI-169 <https://jira.onap.org/browse/OJSI-169>`__\ ] - Port 30224 exposes unprotected service outside of cluster
+- [`OJSI-203 <https://jira.onap.org/browse/OJSI-203>`__\ ] - SO exposes unprotected APIs/UIs (CVE-2019-12128
+
+
+**Upgrade Notes**
+
+ N/A
+
+**Deprecation Notes**
+
+ N/A
+
+**Other**
+
+ N/A
+
+
Version: 1.4.4
-----------------------
@@ -26,6 +200,7 @@ Version: 1.4.4
- onap/so/sdnc-adapter,1.4.4
- onap/so/so-monitoring,1.4.4
- onap/so/vfc-adapter,1.4.4
+ - onap/so/vnfm-adapter,1.4.4
**Release Purpose**
@@ -37,7 +212,7 @@ The main goal of the Dublin release was to:
- Support BroadBand Service Usecase
- SO SOL003 plugin support
- Improve PNF PnP
-
+ - Improve SO internal modularity
**Epics**
@@ -50,7 +225,6 @@ The main goal of the Dublin release was to:
- [`SO-1273 <https://jira.onap.org/browse/SO-1273>`__\ ] - PNF PnP Dublin updates & improvements
- [`SO-1271 <https://jira.onap.org/browse/SO-1271>`__\ ] - PNF PnP Casablanca MR updates
- [`SO-677 <https://jira.onap.org/browse/SO-677>`__\ ] - Improve the issues and findings of the SO Casablanca Release
-- [`SO-166 <https://jira.onap.org/browse/SO-166>`__\ ] - Non-stop operations required.
**Stories**
@@ -220,7 +394,7 @@ The main goal of the Dublin release was to:
Testing Terminate and Delete of ETSI VNFM Adapter is done and has some of the minor issues pending, it will be done in El Alto.
-- [`SO-1742 <https://jira.onap.org/browse/SO-1742>`__\ ] - Test Terminate/Delete VNF with VNFM Adapter
+- [`SO-2013 <https://jira.onap.org/browse/SO-2013>`__\ ] - Test Terminate/Delete VNF with VNFM Adapter
**Upgrade Notes**
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
index 3880bd43b1..4517811494 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java
@@ -116,6 +116,9 @@ public class CamundaVIDRequest {
return serviceInput;
}
+ @JsonProperty(CommonConstants.GENERATE_IDS)
+ private CamundaBooleanInput generateIds;
+
@JsonProperty(CommonConstants.CAMUNDA_SERVICE_INPUT)
public void setServiceInput(CamundaInput serviceInput) {
this.serviceInput = serviceInput;
@@ -347,6 +350,11 @@ public class CamundaVIDRequest {
return "CamundaRequest";
}
+ public CamundaBooleanInput getGenerateIds() {
+ return generateIds;
+ }
-
+ public void setGenerateIds(CamundaBooleanInput generateIds) {
+ this.generateIds = generateIds;
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
index 5dd99f51cd..bc8af6e690 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java
@@ -99,6 +99,7 @@ public class CamundaClient extends RequestClient {
return response;
}
+ @Override
public HttpResponse post(RequestClientParameter parameterObject) throws IOException {
HttpPost post = new HttpPost(url);
logger.debug(CAMUNDA_URL_MESAGE + url);
@@ -110,7 +111,7 @@ public class CamundaClient extends RequestClient {
parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(),
parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(),
parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd(),
- parameterObject.getInstanceGroupId());
+ parameterObject.getInstanceGroupId(), parameterObject.isGenerateIdsOnly());
StringEntity input = new StringEntity(jsonReq);
input.setContentType(CommonConstants.CONTENT_TYPE_JSON);
@@ -169,7 +170,7 @@ public class CamundaClient extends RequestClient {
String serviceInstanceId, String pnfCorrelationId, String vnfId, String vfModuleId, String volumeGroupId,
String networkId, String configurationId, String serviceType, String vnfType, String vfModuleType,
String networkType, String requestDetails, String apiVersion, boolean aLaCarte, String requestUri,
- String paramXsd, String instanceGroupId) {
+ String paramXsd, String instanceGroupId, boolean generateIdsOnly) {
String jsonReq = null;
try {
@@ -196,6 +197,8 @@ public class CamundaClient extends RequestClient {
CamundaInput requestUriInput = new CamundaInput();
CamundaInput recipeParamsInput = new CamundaInput();
CamundaInput instanceGroupIdInput = new CamundaInput();
+ CamundaBooleanInput generateIds = new CamundaBooleanInput();
+
requestIdInput.setValue(StringUtils.defaultString(requestId));
isBaseVfModuleInput.setValue(isBaseVfModule);
@@ -217,6 +220,7 @@ public class CamundaClient extends RequestClient {
requestUriInput.setValue(StringUtils.defaultString(requestUri));
recipeParamsInput.setValue(paramXsd);
instanceGroupIdInput.setValue(StringUtils.defaultString(instanceGroupId));
+ generateIds.setValue(generateIdsOnly);
serviceInput.setValue(requestDetails);
camundaRequest.setServiceInput(serviceInput);
@@ -242,6 +246,7 @@ public class CamundaClient extends RequestClient {
camundaRequest.setRequestUri(requestUriInput);
camundaRequest.setRecipeParams(recipeParamsInput);
camundaRequest.setInstanceGroupId(instanceGroupIdInput);
+ camundaRequest.setGenerateIds(generateIds);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
index e48c98a395..6d2bbfc613 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
@@ -81,6 +81,7 @@ public final class CommonConstants {
public static final String X_LATEST_VERSION = "X-LatestVersion";
public static final String INSTANCE_GROUP_ID = "instanceGroupId";
public static final String INSTANCE_GROUP_INSTANCE_ID = "instanceGroupInstanceId";
+ public static final String GENERATE_IDS = "generateIdsOnly";
private CommonConstants() {
// prevent creating an instance of this class
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
index 20c512af37..3cf3907424 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java
@@ -44,6 +44,7 @@ public class RequestClientParameter {
private String recipeParamXsd;
private String requestUri;
private String instanceGroupId;
+ private boolean generateIdsOnly;
private RequestClientParameter(Builder builder) {
requestId = builder.requestId;
@@ -67,7 +68,7 @@ public class RequestClientParameter {
aLaCarte = builder.aLaCarte;
requestUri = builder.requestUri;
instanceGroupId = builder.instanceGroupId;
-
+ generateIdsOnly = builder.generateIdsOnly;
}
public String getRequestId() {
@@ -154,6 +155,14 @@ public class RequestClientParameter {
return instanceGroupId;
}
+ public boolean isGenerateIdsOnly() {
+ return generateIdsOnly;
+ }
+
+ public void setGenerateIdsOnly(boolean generateIdsOnly) {
+ this.generateIdsOnly = generateIdsOnly;
+ }
+
public static class Builder {
private String requestId;
private boolean isBaseVfModule = false;
@@ -176,6 +185,7 @@ public class RequestClientParameter {
private String recipeParamXsd;
private String requestUri;
private String instanceGroupId;
+ private boolean generateIdsOnly;
public Builder setRequestId(String requestId) {
this.requestId = requestId;
@@ -282,11 +292,14 @@ public class RequestClientParameter {
return this;
}
+ public Builder setGenerateIds(boolean generateIdsOnly) {
+ this.generateIdsOnly = generateIdsOnly;
+ return this;
+ }
+
public RequestClientParameter build() {
return new RequestClientParameter(this);
}
}
-
-
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/ResponseHandler.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/ResponseHandler.java
index 095182fe98..bedce185c5 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/ResponseHandler.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/ResponseHandler.java
@@ -98,8 +98,9 @@ public class ResponseHandler {
if (response != null) {
responseBody = response.getResponse();
} else {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER,
- ErrorCode.BusinessProcesssError).targetEntity("Camunda").targetServiceName("parseCamunda").build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, ErrorCode.BusinessProcessError)
+ .targetEntity("Camunda").targetServiceName("parseCamunda").build();
BPMNFailureException bpmnFailureException =
new BPMNFailureException.Builder(String.valueOf(status), status, ErrorNumbers.ERROR_FROM_BPEL)
.errorInfo(errorLoggerInfo).build();
@@ -123,8 +124,9 @@ public class ResponseHandler {
ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
}
if (status != HttpStatus.SC_ACCEPTED) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER,
- ErrorCode.BusinessProcesssError).targetEntity("BPEL").targetServiceName("parseBpel").build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, ErrorCode.BusinessProcessError)
+ .targetEntity("BPEL").targetServiceName("parseBpel").build();
throw new BPMNFailureException.Builder(String.valueOf(status), status, ErrorNumbers.ERROR_FROM_BPEL)
.errorInfo(errorLoggerInfo).build();
@@ -149,9 +151,9 @@ public class ResponseHandler {
.build();
}
if (status != HttpStatus.SC_NO_CONTENT && status != HttpStatus.SC_ACCEPTED) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER,
- ErrorCode.BusinessProcesssError).targetEntity("CAMUNDATASK").targetServiceName("parseCamundaTask")
- .build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_ERROR_FROM_BPEL_SERVER, ErrorCode.BusinessProcessError)
+ .targetEntity("CAMUNDATASK").targetServiceName("parseCamundaTask").build();
throw new BPMNFailureException.Builder(String.valueOf(status), status, ErrorNumbers.ERROR_FROM_BPEL)
.errorInfo(errorLoggerInfo).build();
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/RequestIdFilter.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/RequestIdFilter.java
index 2fd426dec2..b81ee58aa4 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/RequestIdFilter.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/filters/RequestIdFilter.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import javax.annotation.Priority;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandler.common.ErrorNumbers;
@@ -52,15 +53,20 @@ public class RequestIdFilter implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext context) throws IOException {
String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
+ UriInfo uriInfo = context.getUriInfo();
+ String requestURI = uriInfo.getPath();
- logger.info("Checking if requestId: {} already exists in requestDb InfraActiveRequests table", requestId);
- InfraActiveRequests infraActiveRequests = infraActiveRequestsClient.getInfraActiveRequestbyRequestId(requestId);
+ if (!requestURI.contains("orchestrationRequests")) {
+ logger.info("Checking if requestId: {} already exists in requestDb InfraActiveRequests table", requestId);
+ InfraActiveRequests infraActiveRequests =
+ infraActiveRequestsClient.getInfraActiveRequestbyRequestId(requestId);
- if (infraActiveRequests != null) {
- logger.error(
- "RequestId: {} already exists in RequestDB InfraActiveRequests table, throwing DuplicateRequestIdException",
- requestId);
- throw new DuplicateRequestIdException(createRequestError(requestId, "InfraActiveRequests"));
+ if (infraActiveRequests != null) {
+ logger.error(
+ "RequestId: {} already exists in RequestDB InfraActiveRequests table, throwing DuplicateRequestIdException",
+ requestId);
+ throw new DuplicateRequestIdException(createRequestError(requestId, "InfraActiveRequests"));
+ }
}
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java
index 6957e1fe73..6869a3a213 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java
@@ -29,6 +29,7 @@ public enum Action implements Actions {
deleteInstance,
configureInstance,
replaceInstance,
+ replaceInstanceRetainAssignments,
activateInstance,
deactivateInstance,
enablePort,
@@ -46,5 +47,6 @@ public enum Action implements Actions {
scaleOut,
recreateInstance,
addMembers,
- removeMembers
+ removeMembers,
+ forCustomWorkflow
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
index 5dbe44f58b..5ae0cea549 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
@@ -20,6 +20,8 @@
package org.onap.so.apihandlerinfra;
-public interface Actions {
+import java.io.Serializable;
+
+public interface Actions extends Serializable {
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiException.java
index c7f6459482..ab2ce10690 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiException.java
@@ -29,7 +29,7 @@ public abstract class ApiException extends Exception {
*
*/
private static final long serialVersionUID = 683162058616691134L;
- private int httpResponseCode;
+ private int httpResponseCode = 500;
private String messageID;
private ErrorLoggerInfo errorLoggerInfo;
@@ -49,6 +49,15 @@ public abstract class ApiException extends Exception {
super(message, cause);
}
+ public ApiException(String message, int httpResponseCode) {
+ super(message);
+ this.httpResponseCode = httpResponseCode;
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
public String getMessageID() {
return messageID;
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
index 66b86a6961..62f39d9148 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
@@ -70,73 +70,34 @@ public class ApiExceptionMapper implements ExceptionMapper<ApiException> {
@Override
public Response toResponse(ApiException exception) {
-
- return Response.status(exception.getHttpResponseCode()).entity(buildErrorString(exception)).build();
+ logger.error("Error During API Call", exception);
+ return Response.status(exception.getHttpResponseCode()).entity(buildError(exception)).build();
}
- protected String buildErrorString(ApiException exception) {
+ protected RequestError buildError(ApiException exception) {
String errorText = exception.getMessage();
String messageId = exception.getMessageID();
List<String> variables = exception.getVariables();
- ErrorLoggerInfo errorLoggerInfo = exception.getErrorLoggerInfo();
-
-
if (errorText.length() > 1999) {
errorText = errorText.substring(0, 1999);
}
-
-
-
- List<MediaType> typeList = Optional.ofNullable(headers.getAcceptableMediaTypes()).orElse(new ArrayList<>());
- List<String> typeListString = typeList.stream().map(item -> item.toString()).collect(Collectors.toList());
- MediaType type;
- if (typeListString.stream().anyMatch(item -> item.contains(MediaType.APPLICATION_XML))) {
- type = MediaType.APPLICATION_XML_TYPE;
- } else if (typeListString.stream().anyMatch(item -> typeListString.contains(MediaType.APPLICATION_JSON))) {
- type = MediaType.APPLICATION_JSON_TYPE;
- } else {
- type = MediaType.APPLICATION_JSON_TYPE;
- }
-
- return buildServiceErrorResponse(errorText, messageId, variables, type);
+ return buildServiceErrorResponse(errorText, messageId, variables);
}
- protected String buildServiceErrorResponse(String errorText, String messageId, List<String> variables,
- MediaType type) {
- RequestError re = new RequestError();
- ServiceException se = new ServiceException();
- se.setMessageId(messageId);
- se.setText(errorText);
+ protected RequestError buildServiceErrorResponse(String errorText, String messageId, List<String> variables) {
+ RequestError requestError = new RequestError();
+ ServiceException serviceException = new ServiceException();
+ serviceException.setMessageId(messageId);
+ serviceException.setText(errorText);
if (variables != null) {
for (String variable : variables) {
- se.getVariables().add(variable);
+ serviceException.getVariables().add(variable);
}
}
- re.setServiceException(se);
- String requestErrorStr;
-
- ObjectMapper mapper = createObjectMapper();
-
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
- mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
- try {
- if (MediaType.APPLICATION_JSON_TYPE.equals(type)) {
- requestErrorStr = mapper.writeValueAsString(re);
- } else {
- StringWriter sw = new StringWriter();
- this.getMarshaller().marshal(re, sw);
- requestErrorStr = sw.toString();
- }
- } catch (JsonProcessingException | JAXBException e) {
- String errorMsg =
- "Exception in buildServiceErrorResponse writing exceptionType to string " + e.getMessage();
- logger.error("BuildServiceErrorResponse", e);
- return errorMsg;
- }
-
- return requestErrorStr;
+ requestError.setServiceException(serviceException);
+ return requestError;
}
protected void writeErrorLog(Exception e, String errorText, ErrorLoggerInfo errorLogInfo) {
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/DuplicateRequestException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/DuplicateRequestException.java
index 42198e2d0c..cbbfa16eaa 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/DuplicateRequestException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/DuplicateRequestException.java
@@ -22,7 +22,7 @@ package org.onap.so.apihandlerinfra.exceptions;
public class DuplicateRequestException extends ApiException {
- private static final String duplicateFailMessage = "Error: Locked instance - This %s (%s) "
+ private static final String DUPLICATE_FAIL_MESSAGE = "Error: Locked instance - This %s (%s) "
+ "already has a request being worked with a status of %s (RequestId - %s). The existing request must finish or be cleaned up before proceeding.";
private DuplicateRequestException(Builder builder) {
@@ -36,7 +36,7 @@ public class DuplicateRequestException extends ApiException {
public Builder(String requestScope, String instance, String requestStatus, String requestID,
int httpResponseCode, String messageID) {
- super(String.format(duplicateFailMessage, requestScope, instance, requestStatus, requestID),
+ super(String.format(DUPLICATE_FAIL_MESSAGE, requestScope, instance, requestStatus, requestID),
httpResponseCode, messageID);
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/RequestDbFailureException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/RequestDbFailureException.java
index 577a14674b..a8f868da05 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/RequestDbFailureException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/RequestDbFailureException.java
@@ -22,7 +22,7 @@ package org.onap.so.apihandlerinfra.exceptions;
public class RequestDbFailureException extends ApiException {
- private static final String requestDbFailMessage = "Unable to %s due to error contacting requestDb: %s";
+ private static final String REQUEST_DB_FAIL_MESSAGE = "Unable to %s due to error contacting requestDb: %s";
private RequestDbFailureException(Builder builder) {
super(builder);
@@ -32,7 +32,7 @@ public class RequestDbFailureException extends ApiException {
public Builder(String action, String error, int httpResponseCode, String messageID) {
- super(requestDbFailMessage.format(requestDbFailMessage, action, error), httpResponseCode, messageID);
+ super(REQUEST_DB_FAIL_MESSAGE.format(REQUEST_DB_FAIL_MESSAGE, action, error), httpResponseCode, messageID);
}
public RequestDbFailureException build() {
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ValidateException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ValidateException.java
index 372ed30d8e..ae8256e64f 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ValidateException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ValidateException.java
@@ -28,6 +28,11 @@ public class ValidateException extends ApiException {
}
+ public ValidateException(String errorMessage, int httpResponseCode) {
+ super(errorMessage, httpResponseCode);
+ }
+
+
public static class Builder extends ApiException.Builder<Builder> {
public Builder(String message, int httpResponseCode, String messageID) {
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
index 36d004e87d..94c62a9689 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
@@ -47,11 +47,11 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
+import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.mock.env.MockEnvironment;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.databind.JsonMappingException;
-
/**
* This class implements test methods of Camunda Beans.
*
@@ -164,10 +164,10 @@ public class CamundaClientTest {
String testResult = testClient.wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction,
serviceInstanceId, pnfCorrelationId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId,
serviceType, vnfType, vfModuleType, networkType, requestDetails, apiVersion, aLaCarte, requestUri, "",
- instanceGroupId);
+ instanceGroupId, false);
String expected = inputStream("/WrappedVIDRequest.json");
- assertEquals(expected, testResult);
+ JSONAssert.assertEquals(expected, testResult, false);
}
@Test
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/filters/RequestIdFilterTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/filters/RequestIdFilterTest.java
index 8716047603..1aa6c3c5d9 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/filters/RequestIdFilterTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/filters/RequestIdFilterTest.java
@@ -23,9 +23,13 @@ package org.onap.so.apihandler.filters;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
import java.io.IOException;
+import java.net.URI;
import java.util.Collections;
import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.core.UriInfo;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -53,6 +57,9 @@ public class RequestIdFilterTest {
@Mock
private RequestsDbClient requestsDbClient;
+ @Mock
+ private UriInfo uriInfo;
+
@InjectMocks
@Spy
private RequestIdFilter requestIdFilter;
@@ -70,7 +77,6 @@ public class RequestIdFilterTest {
serviceException.setMessageId("SVC0002");
serviceException.setText(
"RequestId: 32807a28-1a14-4b88-b7b3-2950918aa769 already exists in the RequestDB InfraActiveRequests table");
- serviceException.setVariables(Collections.emptyList());
requestError.setServiceException(serviceException);
return requestError;
}
@@ -87,12 +93,35 @@ public class RequestIdFilterTest {
doReturn(infraActiveRequests).when(requestsDbClient).getInfraActiveRequestbyRequestId(requestId);
doReturn(error).when(requestIdFilter).createRequestError(REQUEST_ID, "InfraActiveRequests");
+ doReturn("/onap/so/infra/serviceInstantiation/v7/serviceInstances").when(uriInfo).getPath();
+ doReturn(uriInfo).when(mockContext).getUriInfo();
thrown.expect(DuplicateRequestIdException.class);
thrown.expectMessage("HTTP 400 Bad Request");
+
+
requestIdFilter.filter(mockContext);
}
+
+ @Test
+ public void filterTestInfraSkipRequestIdLookup() throws IOException {
+ String requestId = REQUEST_ID;
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
+
+ // ExpectedRecord InfraActiveRequests
+ InfraActiveRequests infraActiveRequests = new InfraActiveRequests();
+ infraActiveRequests.setRequestId(REQUEST_ID);
+
+ doReturn("onap/so/infra/orchestrationRequests/v7/" + REQUEST_ID).when(uriInfo).getPath();
+ doReturn(uriInfo).when(mockContext).getUriInfo();
+
+ verify(requestsDbClient, never()).getInfraActiveRequestbyRequestId(REQUEST_ID);
+
+ requestIdFilter.filter(mockContext);
+ }
+
+
@Test
public void createRequestErrorTest() throws IOException {
RequestError requestError = getRequestError();
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java
index 2922aaa896..1a846da65a 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java
@@ -73,26 +73,6 @@ public class ApiExceptionMapperTest {
@InjectMocks
ApiExceptionMapper mapper = new ApiExceptionMapper();
-
- @Before
- public void setUp() {
- when(headers.getAcceptableMediaTypes()).thenReturn(Arrays.asList(MediaType.APPLICATION_JSON_TYPE));
- }
-
- @Test
- public void testObjectMapperError() throws JsonProcessingException {
- ObjectMapper mockedMapper = Mockito.mock(ObjectMapper.class);
- Mockito.when(mockedMapper.writeValueAsString(anyObject())).thenThrow(JsonProcessingException.class);
- ValidateException validateException = new ValidateException.Builder("Test", 0, null).build();
- ApiExceptionMapper mockedException = Mockito.spy(mapper);
- Mockito.doReturn(mockedMapper).when(mockedException).createObjectMapper();
- Response resp = mockedException.toResponse((ApiException) validateException);
-
- /// assertEquals(resp.getStatus(), HttpStatus.SC_BAD_REQUEST);
- assertThat(resp.getEntity().toString(),
- startsWith("Exception in buildServiceErrorResponse writing exceptionType to string"));
- }
-
@Test
public void testValidateResponse() {
ValidateException validateException =
@@ -138,38 +118,4 @@ public class ApiExceptionMapperTest {
assertEquals(resp.getStatus(), HttpStatus.SC_BAD_GATEWAY);
}
-
- @Test
- public void verifyXMLPath() throws JAXBException {
- when(headers.getAcceptableMediaTypes()).thenReturn(Arrays.asList(MediaType.APPLICATION_XML_TYPE));
- BPMNFailureException bpmnException = new BPMNFailureException.Builder("Test Message", HttpStatus.SC_NOT_FOUND,
- ErrorNumbers.SVC_BAD_PARAMETER).build();
- ApiExceptionMapper mapperSpy = Mockito.spy(mapper);
- doReturn(marshaller).when(mapperSpy).getMarshaller();
- Response resp = mapperSpy.toResponse((ApiException) bpmnException);
- verify(marshaller, times(1)).marshal(any(Object.class), any(Writer.class));
- }
-
- @Test
- public void verifyMediaType() {
- ApiExceptionMapper mapperSpy = Mockito.spy(mapper);
- BPMNFailureException bpmnException = new BPMNFailureException.Builder("Test Message", HttpStatus.SC_NOT_FOUND,
- ErrorNumbers.SVC_BAD_PARAMETER).build();
- when(headers.getAcceptableMediaTypes())
- .thenReturn(Arrays.asList(MediaType.APPLICATION_XML_TYPE.withCharset("UTF-8")));
- mapperSpy.toResponse(bpmnException);
- verify(mapperSpy, times(1)).buildServiceErrorResponse(any(String.class), any(String.class),
- ArgumentMatchers.isNull(), eq(MediaType.APPLICATION_XML_TYPE));
- when(headers.getAcceptableMediaTypes())
- .thenReturn(Arrays.asList(MediaType.APPLICATION_JSON_TYPE.withCharset("UTF-8")));
- mapperSpy = Mockito.spy(mapper);
- mapperSpy.toResponse(bpmnException);
- verify(mapperSpy, times(1)).buildServiceErrorResponse(any(String.class), any(String.class),
- ArgumentMatchers.isNull(), eq(MediaType.APPLICATION_JSON_TYPE));
- when(headers.getAcceptableMediaTypes()).thenReturn(null);
- mapperSpy = Mockito.spy(mapper);
- mapperSpy.toResponse(bpmnException);
- verify(mapperSpy, times(1)).buildServiceErrorResponse(any(String.class), any(String.class),
- ArgumentMatchers.isNull(), eq(MediaType.APPLICATION_JSON_TYPE));
- }
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
index b9d0a8c3c6..3353f8c7ce 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
+++ b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json
@@ -1 +1,102 @@
-{"variables":{"bpmnRequest":{"value":"{requestDetails: }","type":"String"},"requestId":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"mso-request-id":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"isBaseVfModule":{"value":true,"type":"Boolean"},"recipeTimeout":{"value":10000,"type":"Integer"},"requestAction":{"value":"createInstance","type":"String"},"serviceInstanceId":{"value":"12345679","type":"String"},"pnfCorrelationId":{"value":"12345679","type":"String"},"vnfId":{"value":"234567891","type":"String"},"vfModuleId":{"value":"345678912","type":"String"},"volumeGroupId":{"value":"456789123","type":"String"},"networkId":{"value":"567891234","type":"String"},"configurationId":{"value":"678912345","type":"String"},"serviceType":{"value":"testService","type":"String"},"vnfType":{"value":"testVnf","type":"String"},"vfModuleType":{"value":"vfModuleType","type":"String"},"networkType":{"value":"networkType","type":"String"},"recipeParams":{"value":"","type":"String"},"host":{"value":null,"type":"String"},"apiVersion":{"value":"6","type":"String"},"aLaCarte":{"value":true,"type":"Boolean"},"requestUri":{"value":"v7/serviceInstances/assign","type":"String"},"instanceGroupId":{"value":"ff305d54-75b4-431b-adb2-eb6b9e5ff000","type":"String"}}} \ No newline at end of file
+{
+ "variables": {
+ "bpmnRequest": {
+ "value": "{requestDetails: }",
+ "type": "String"
+ },
+ "requestId": {
+ "value": "f7ce78bb-423b-11e7-93f8-0050569a796",
+ "type": "String"
+ },
+ "mso-request-id": {
+ "value": "f7ce78bb-423b-11e7-93f8-0050569a796",
+ "type": "String"
+ },
+ "isBaseVfModule": {
+ "value": true,
+ "type": "Boolean"
+ },
+ "recipeTimeout": {
+ "value": 10000,
+ "type": "Integer"
+ },
+ "requestAction": {
+ "value": "createInstance",
+ "type": "String"
+ },
+ "serviceInstanceId": {
+ "value": "12345679",
+ "type": "String"
+ },
+ "pnfCorrelationId": {
+ "value": "12345679",
+ "type": "String"
+ },
+ "vnfId": {
+ "value": "234567891",
+ "type": "String"
+ },
+ "vfModuleId": {
+ "value": "345678912",
+ "type": "String"
+ },
+ "volumeGroupId": {
+ "value": "456789123",
+ "type": "String"
+ },
+ "networkId": {
+ "value": "567891234",
+ "type": "String"
+ },
+ "configurationId": {
+ "value": "678912345",
+ "type": "String"
+ },
+ "serviceType": {
+ "value": "testService",
+ "type": "String"
+ },
+ "vnfType": {
+ "value": "testVnf",
+ "type": "String"
+ },
+ "vfModuleType": {
+ "value": "vfModuleType",
+ "type": "String"
+ },
+ "networkType": {
+ "value": "networkType",
+ "type": "String"
+ },
+ "recipeParams": {
+ "value": "",
+ "type": "String"
+ },
+ "host": {
+ "value": null,
+ "type": "String"
+ },
+ "apiVersion": {
+ "value": "6",
+ "type": "String"
+ },
+ "aLaCarte": {
+ "value": true,
+ "type": "Boolean"
+ },
+ "requestUri": {
+ "value": "v7/serviceInstances/assign",
+ "type": "String"
+ },
+ "instanceGroupId": {
+ "value": "ff305d54-75b4-431b-adb2-eb6b9e5ff000",
+ "type": "String"
+ },
+ "generateIdsOnly": {
+ "value": false,
+ "type": "Boolean"
+ }
+ }
+}
+
+
diff --git a/mso-api-handlers/mso-api-handler-infra/pom.xml b/mso-api-handlers/mso-api-handler-infra/pom.xml
index a3b9827d9f..84a80e6617 100644
--- a/mso-api-handlers/mso-api-handler-infra/pom.xml
+++ b/mso-api-handlers/mso-api-handler-infra/pom.xml
@@ -18,7 +18,7 @@
<camunda.bpm.assert.version>1.2</camunda.bpm.assert.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <swagger-version>1.3.0</swagger-version>
+ <swagger.version>2.0.8</swagger.version>
<jax-rs-version>1.1.1</jax-rs-version>
<json4s-jackson-version>3.6.0</json4s-jackson-version>
<json4s-core-version>3.6.0</json4s-core-version>
@@ -56,10 +56,16 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
<dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- <version>1.5.16</version>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-jaxrs2</artifactId>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
@@ -219,6 +225,17 @@
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.onap.aaf.authz</groupId>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <version>2.1.9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<build>
@@ -271,6 +288,9 @@
<executions>
<execution>
<id>original</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java
deleted file mode 100644
index a3ff1ab95d..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.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.apihandler.filters;
-
-import java.io.IOException;
-import java.net.URI;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.UriInfo;
-import org.onap.so.apihandlerinfra.Constants;
-
-
-@PreMatching
-public class RequestUriFilter implements ContainerRequestFilter {
-
- private String requestURI;
-
- @Override
- public void filter(ContainerRequestContext context) throws IOException {
- UriInfo uriInfo = context.getUriInfo();
- URI baseURI = uriInfo.getBaseUri();
- requestURI = uriInfo.getPath();
-
- if (requestURI.contains("onap/so/infra/serviceInstances")) {
- requestURI = requestURI.replaceFirst("serviceInstances", "serviceInstantiation");
- if (!requestURI.contains(Constants.SERVICE_INSTANCE_PATH)) {
- // Adds /serviceInstances after the version provided in the URI
- requestURI = new StringBuilder(requestURI)
- .insert(requestURI.indexOf(Constants.SERVICE_INSTANTIATION_PATH) + 24,
- Constants.SERVICE_INSTANCE_PATH)
- .toString();
- }
- requestURI = baseURI + requestURI;
- URI uri = URI.create(requestURI);
- context.setRequestUri(uri);
- }
- }
-
- public String getRequestUri() {
- return requestURI;
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
index d0302f2e59..88c4bc3b04 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java
@@ -45,5 +45,6 @@ public enum Action implements Actions {
scaleOut,
recreateInstance,
addMembers,
- removeMembers
+ removeMembers,
+ forCustomWorkflow
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ApiHandlerApplication.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ApiHandlerApplication.java
index 5beb4810ec..482fd8868a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ApiHandlerApplication.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ApiHandlerApplication.java
@@ -21,7 +21,7 @@
package org.onap.so.apihandlerinfra;
import java.util.concurrent.Executor;
-import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
+import org.onap.logging.filter.spring.MDCTaskDecorator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java
index 451fa64585..e9f17c42d0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java
@@ -7,11 +7,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.DatatypeConverter;
-import org.apache.http.HttpStatus;
import org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity;
import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity;
-import org.onap.so.apihandler.common.ErrorNumbers;
-import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.onap.so.utils.CryptoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,6 +21,8 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.stereotype.Component;
@@ -33,15 +34,16 @@ import org.springframework.web.client.RestTemplate;
public class CamundaRequestHandler {
private static Logger logger = LoggerFactory.getLogger(CamundaRequestHandler.class);
-
- @Autowired
- private RestTemplate restTemplate;
+ private static final String TIMEOUT = "30000";
+ private static final String RETRY_TIMEOUT = "15000";
+ private static final String TIMEOUT_PROPERTY = "mso.camunda.request.timeout";
+ private static final String RETRY_TIMEOUT_PROPERTY = "mso.camunda.request.timeout.retry";
@Autowired
private Environment env;
- public ResponseEntity<List<HistoricProcessInstanceEntity>> getCamundaProcessInstanceHistory(String requestId) {
- RetryTemplate retryTemplate = setRetryTemplate();
+ public ResponseEntity<List<HistoricProcessInstanceEntity>> getCamundaProcessInstanceHistory(String requestId,
+ boolean retry) {
String path = env.getProperty("mso.camunda.rest.history.uri") + requestId;
String targetUrl = env.getProperty("mso.camundaURL") + path;
HttpHeaders headers =
@@ -49,86 +51,91 @@ public class CamundaRequestHandler {
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- return retryTemplate.execute(context -> {
- if (context.getLastThrowable() != null) {
- logger.error("Retrying: Last call resulted in exception: ", context.getLastThrowable());
- }
- if (context.getRetryCount() == 0) {
- logger.info("Querying Camunda for process-instance history for requestId: {}", requestId);
- } else {
- logger.info("Retry: {} of 3. Querying Camunda for process-instance history for requestId: {}",
- context.getRetryCount(), requestId);
- }
- return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- });
- }
-
- protected ResponseEntity<List<HistoricActivityInstanceEntity>> getCamundaActivityHistory(String processInstanceId,
- String requestId) throws ContactCamundaException {
- RetryTemplate retryTemplate = setRetryTemplate();
- String path = env.getProperty("mso.camunda.rest.activity.uri") + processInstanceId;
- String targetUrl = env.getProperty("mso.camundaURL") + path;
- HttpHeaders headers =
- setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey"));
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- try {
+ if (retry) {
+ RestTemplate restTemplate = getRestTemplate(retry);
+ RetryTemplate retryTemplate = getRetryTemplate();
return retryTemplate.execute(context -> {
if (context.getLastThrowable() != null) {
logger.error("Retrying: Last call resulted in exception: ", context.getLastThrowable());
}
if (context.getRetryCount() == 0) {
- logger.info(
- "Querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}",
- processInstanceId, requestId);
+ logger.info("Querying Camunda for process-instance history for requestId: {}", requestId);
} else {
logger.info(
- "Retry: {} of 3. Querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}",
- context.getRetryCount(), processInstanceId, requestId);
+ "Retry: Querying Camunda for process-instance history for retryCount: {} and requestId: {}",
+ context.getRetryCount(), requestId);
}
-
return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
});
-
- } catch (RestClientException e) {
- logger.error(
- "Error querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}, exception: {}",
- processInstanceId, requestId, e.getMessage());
- throw new ContactCamundaException.Builder("activity-instance", requestId, e.toString(),
- HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).build();
+ } else {
+ RestTemplate restTemplate = getRestTemplate(retry);
+ return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
}
}
- protected String getTaskName(String requestId) throws ContactCamundaException {
+ protected ResponseEntity<List<HistoricActivityInstanceEntity>> getCamundaActivityHistory(String processInstanceId) {
+ RestTemplate restTemplate = getRestTemplate(false);
+ String path = env.getProperty("mso.camunda.rest.activity.uri") + processInstanceId;
+ String targetUrl = env.getProperty("mso.camundaURL") + path;
+ HttpHeaders headers =
+ setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey"));
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+
+ return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ }
+
+ protected String getTaskName(String requestId) {
ResponseEntity<List<HistoricProcessInstanceEntity>> response = null;
- ResponseEntity<List<HistoricActivityInstanceEntity>> activityResponse = null;
- String processInstanceId = null;
+
+ String taskInformation = null;
try {
- response = getCamundaProcessInstanceHistory(requestId);
+ response = getCamundaProcessInstanceHistory(requestId, false);
} catch (RestClientException e) {
- logger.error("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
+ logger.warn("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
requestId, e.getMessage());
- throw new ContactCamundaException.Builder("process-instance", requestId, e.toString(),
- HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).build();
}
+ if (response != null) {
+ taskInformation = getTaskInformation(response, requestId);
+ }
+ return taskInformation;
+ }
+
+ protected String getTaskInformation(ResponseEntity<List<HistoricProcessInstanceEntity>> response,
+ String requestId) {
List<HistoricProcessInstanceEntity> historicProcessInstanceList = response.getBody();
+ ResponseEntity<List<HistoricActivityInstanceEntity>> activityResponse = null;
+ String processInstanceId = null;
+ String taskInformation = null;
- if (historicProcessInstanceList != null) {
+ if (historicProcessInstanceList != null && !historicProcessInstanceList.isEmpty()) {
Collections.reverse(historicProcessInstanceList);
processInstanceId = historicProcessInstanceList.get(0).getId();
} else {
- return "No processInstances returned for requestId: " + requestId;
+ logger.warn("No processInstances returned for requestId: {} to get TaskInformation", requestId);
}
if (processInstanceId != null) {
- activityResponse = getCamundaActivityHistory(processInstanceId, requestId);
+ try {
+ activityResponse = getCamundaActivityHistory(processInstanceId);
+ } catch (RestClientException e) {
+ logger.warn(
+ "Error querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}, exception: {}",
+ processInstanceId, requestId, e.getMessage());
+ }
} else {
- return "No processInstanceId returned for requestId: " + requestId;
+ logger.warn("No processInstanceId returned for requestId: {} to get TaskInformation", requestId);
}
- return getActivityName(activityResponse.getBody());
+ if (activityResponse != null) {
+ taskInformation = getActivityName(activityResponse.getBody());
+ } else {
+ logger.warn("No activity history information returned for requestId: {} to get TaskInformation", requestId);
+ }
+ return taskInformation;
}
protected String getActivityName(List<HistoricActivityInstanceEntity> activityInstanceList) {
@@ -169,12 +176,31 @@ public class CamundaRequestHandler {
return headers;
}
- protected RetryTemplate setRetryTemplate() {
+ protected RetryTemplate getRetryTemplate() {
RetryTemplate retryTemplate = new RetryTemplate();
Map<Class<? extends Throwable>, Boolean> retryableExceptions = new HashMap<>();
retryableExceptions.put(ResourceAccessException.class, true);
- SimpleRetryPolicy policy = new SimpleRetryPolicy(4, retryableExceptions);
+ SimpleRetryPolicy policy = new SimpleRetryPolicy(2, retryableExceptions);
retryTemplate.setRetryPolicy(policy);
return retryTemplate;
}
+
+ protected RestTemplate getRestTemplate(boolean retry) {
+ int timeout;
+ if (retry) {
+ timeout = Integer.parseInt(env.getProperty(RETRY_TIMEOUT_PROPERTY, RETRY_TIMEOUT));
+ } else {
+ timeout = Integer.parseInt(env.getProperty(TIMEOUT_PROPERTY, TIMEOUT));
+ }
+
+ RestTemplate restTemplate = new RestTemplate();
+ HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
+ factory.setConnectionRequestTimeout(timeout);
+ factory.setReadTimeout(timeout);
+ factory.setConnectTimeout(timeout);
+ restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory));
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
+ return restTemplate;
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
index d3a279fd8e..0bcb0f1c86 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
@@ -76,13 +76,19 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/e2eServiceInstances")
-@Api(value = "/onap/so/infra/e2eServiceInstances", description = "API Requests for E2E Service Instances")
+@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/e2eServiceInstances",
+ description = "API Requests for E2E Service Instances"))
+
public class E2EServiceInstances {
private HashMap<String, String> instanceIdMap = new HashMap<>();
@@ -119,7 +125,8 @@ public class E2EServiceInstances {
@Path("/{version:[vV][3-5]}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class)
+ @Operation(description = "Create an E2E Service Instance on a version provided", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response createE2EServiceInstance(String request, @PathParam("version") String version) throws ApiException {
return processE2EserviceInstances(request, Action.createInstance, null, version);
@@ -135,8 +142,9 @@ public class E2EServiceInstances {
@Path("/{version:[vV][3-5]}/{serviceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId",
- response = Response.class)
+ @Operation(description = "Update an E2E Service Instance on a version provided and serviceId",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response updateE2EServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceId") String serviceId) throws ApiException {
@@ -155,7 +163,9 @@ public class E2EServiceInstances {
@Path("/{version:[vV][3-5]}/{serviceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
+ @Operation(description = "Delete E2E Service Instance on a specified version and serviceId",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response deleteE2EServiceInstance(String request, @PathParam("version") String version,
@PathParam(SERVICE_ID) String serviceId) throws ApiException {
@@ -166,8 +176,9 @@ public class E2EServiceInstances {
@GET
@Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
- @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId",
- response = Response.class)
+ @Operation(description = "Find e2eServiceInstances Requests for a given serviceId and operationId",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
public Response getE2EServiceInstances(@PathParam(SERVICE_ID) String serviceId,
@PathParam("version") String version, @PathParam("operationId") String operationId) {
@@ -184,7 +195,8 @@ public class E2EServiceInstances {
@Path("/{version:[vV][3-5]}/{serviceId}/scale")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Scale E2E Service Instance on a specified version", response = Response.class)
+ @Operation(description = "Scale E2E Service Instance on a specified version", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response scaleE2EServiceInstance(String request, @PathParam("version") String version,
@PathParam(SERVICE_ID) String serviceId) throws ApiException {
@@ -203,9 +215,10 @@ public class E2EServiceInstances {
@Path("/{version:[vV][3-5]}/{serviceId}/modeldifferences")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(
- value = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ",
- response = Response.class)
+ @Operation(
+ description = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response compareModelwithTargetVersion(String request, @PathParam("serviceId") String serviceId,
@PathParam("version") String version) throws ApiException {
@@ -282,7 +295,7 @@ public class E2EServiceInstances {
msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(), "Null response from BPEL");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());
return resp;
}
@@ -320,7 +333,7 @@ public class E2EServiceInstances {
MsoException.ServiceException, "E2E serviceId " + serviceId + " is not found in DB",
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(),
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(),
"Null response from RequestDB when searching by serviceId");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
@@ -422,7 +435,7 @@ public class E2EServiceInstances {
msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(), "Null response from BPEL");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -536,7 +549,7 @@ public class E2EServiceInstances {
msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(), "Null response from BPEL");
logger.debug(END_OF_THE_TRANSACTION + getBPMNResp.getEntity());
return getBPMNResp;
}
@@ -647,7 +660,7 @@ public class E2EServiceInstances {
msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(), "Null response from BPEL");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -747,7 +760,7 @@ public class E2EServiceInstances {
msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(),
- MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ MSO_PROP_APIHANDLER_INFRA, ErrorCode.BusinessProcessError.getValue(), "Null response from BPEL");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -778,7 +791,7 @@ public class E2EServiceInstances {
"Request Failed due to BPEL error with HTTP Status= %1 " + '\n' + camundaJSONResponseBody,
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables, version);
logger.error(LoggingAnchor.FOUR, MessageEnum.APIH_BPEL_RESPONSE_ERROR.toString(),
- requestClient.getUrl(), ErrorCode.BusinessProcesssError.getValue(),
+ requestClient.getUrl(), ErrorCode.BusinessProcessError.getValue(),
"Response from BPEL engine is failed with HTTP Status=" + bpelStatus);
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
@@ -787,7 +800,7 @@ public class E2EServiceInstances {
"Request Failed due to BPEL error with HTTP Status= %1",
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables, version);
logger.error("", MessageEnum.APIH_BPEL_RESPONSE_ERROR.toString(), requestClient.getUrl(),
- ErrorCode.BusinessProcesssError.getValue(), "Response from BPEL engine is empty");
+ ErrorCode.BusinessProcessError.getValue(), "Response from BPEL engine is empty");
logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
new file mode 100644
index 0000000000..80144d8ca1
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
@@ -0,0 +1,33 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import java.util.Set;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.core.convert.converter.GenericConverter;
+import org.springframework.stereotype.Component;
+import com.google.common.collect.ImmutableSet;
+
+@Component
+@ConfigurationPropertiesBinding
+public class GenericStringConverter implements GenericConverter {
+
+ @Autowired
+ private HealthCheckConverter converter;
+
+ @Override
+ public Set<ConvertiblePair> getConvertibleTypes() {
+
+ ConvertiblePair[] pairs = new ConvertiblePair[] {new ConvertiblePair(String.class, Subsystem.class),
+ new ConvertiblePair(String.class, URI.class)};
+ return ImmutableSet.copyOf(pairs);
+ }
+
+ @Override
+ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+
+ return converter.convert(source, sourceType, targetType);
+
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
index 3d4b2c76fb..5327211280 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
@@ -25,11 +25,8 @@ package org.onap.so.apihandlerinfra;
import java.net.URI;
import java.util.Collections;
-import org.onap.so.logger.LoggingAnchor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
+import java.util.List;
+import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.transaction.Transactional;
import javax.ws.rs.DefaultValue;
@@ -42,95 +39,96 @@ import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.HttpStatus;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
-import org.springframework.http.HttpMethod;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/globalhealthcheck")
-@Api(value = "/globalhealthcheck", description = "APIH Infra Global Health Check")
+@OpenAPIDefinition(info = @Info(title = "/globalhealthcheck", description = "APIH Infra Global Health Check"))
public class GlobalHealthcheckHandler {
private static Logger logger = LoggerFactory.getLogger(GlobalHealthcheckHandler.class);
- private static final String CONTEXTPATH_PROPERTY = "management.context-path";
- private static final String PROPERTY_DOMAIN = "mso.health.endpoints";
- private static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".catalogdb";
- private static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".requestdb";
- private static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".sdnc";
- private static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".openstack";
- private static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".bpmn";
- private static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".asdc";
- private static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".requestdbattsvc";
- private static final String DEFAULT_PROPERTY_VALUE = "";
+ protected static final String CONTEXTPATH_PROPERTY = "management.endpoints.web.base-path";
+ protected static final String PROPERTY_DOMAIN = "mso.health";
+ protected static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.catalogdb";
+ protected static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdb";
+ protected static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.sdnc";
+ protected static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".endpoints.openstack";
+ protected static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".endpoints.bpmn";
+ protected static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.asdc";
+ protected static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdbattsvc";
+ protected static final String MSO_AUTH_PROPERTY = PROPERTY_DOMAIN + ".auth";
+ protected static final String DEFAULT_PROPERTY_VALUE = "";
// e.g. /manage
private String actuatorContextPath;
- private String endpointCatalogdb;
- private String endpointRequestdb;
- private String endpointSdnc;
- private String endpointOpenstack;
- private String endpointBpmn;
- private String endpointAsdc;
- private String endpointRequestdbAttsvc;
@Autowired
private Environment env;
@Autowired
private RestTemplate restTemplate;
- private final String health = "/health";
+ @Autowired
+ private HealthCheckConfig config;
+
+ private static final String HEALTH = "/health";
+
+ private String msoAuth;
@PostConstruct
protected void init() {
actuatorContextPath = env.getProperty(CONTEXTPATH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointCatalogdb = env.getProperty(CATALOGDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointRequestdb = env.getProperty(REQUESTDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointSdnc = env.getProperty(SDNC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointOpenstack = env.getProperty(OPENSTACK_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointBpmn = env.getProperty(BPMN_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointAsdc = env.getProperty(ASDC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointRequestdbAttsvc = env.getProperty(REQUESTDBATTSVC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
+ msoAuth = env.getProperty(MSO_AUTH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
}
@GET
@Produces("application/json")
- @ApiOperation(value = "Performing global health check", response = Response.class)
+ @Operation(description = "Performing global health check", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response globalHealthcheck(@DefaultValue("true") @QueryParam("enableBpmn") boolean enableBpmn,
@Context ContainerRequestContext requestContext) {
Response HEALTH_CHECK_RESPONSE = null;
// Build internal response object
- HealthcheckResponse rsp = new HealthcheckResponse();
+ HealthCheckResponse rsp = new HealthCheckResponse();
try {
// Generated RequestId
String requestId = requestContext.getProperty("requestId").toString();
logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
- // set APIH status, this is the main entry point
- rsp.setApih(HealthcheckStatus.UP.toString());
- // set BPMN
- rsp.setBpmn(querySubsystemHealth(MsoSubsystems.BPMN));
- // set SDNCAdapter
- rsp.setSdncAdapter(querySubsystemHealth(MsoSubsystems.SDNC));
- // set ASDCController
- rsp.setAsdcController(querySubsystemHealth(MsoSubsystems.ASDC));
- // set CatalogDbAdapter
- rsp.setCatalogdbAdapter(querySubsystemHealth(MsoSubsystems.CATALOGDB));
- // set RequestDbAdapter
- rsp.setRequestdbAdapter(querySubsystemHealth(MsoSubsystems.REQUESTDB));
- // set OpenStackAdapter
- rsp.setOpenstackAdapter(querySubsystemHealth(MsoSubsystems.OPENSTACK));
- // set RequestDbAdapterAttSvc
- rsp.setRequestdbAdapterAttsvc(querySubsystemHealth(MsoSubsystems.REQUESTDBATT));
+ List<Endpoint> endpoints = config.getEndpoints().stream().filter(item -> {
+ if (!enableBpmn && SoSubsystems.BPMN.equals(item.getSubsystem())) {
+ return false;
+ } else {
+ return true;
+ }
+ }).collect(Collectors.toList());
+
+ for (Endpoint endpoint : endpoints) {
+ rsp.getSubsystems().add(querySubsystemHealth(endpoint));
+ }
+
// set Message
rsp.setMessage(String.format("HttpStatus: %s", HttpStatus.SC_OK));
logger.info(rsp.toString());
@@ -149,70 +147,51 @@ public class GlobalHealthcheckHandler {
protected HttpEntity<String> buildHttpEntityForRequest() {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
- headers.set("Content-Type", "application/json");
+ headers.set(HttpHeaders.CONTENT_TYPE, "application/json");
+ headers.set(HttpHeaders.AUTHORIZATION, msoAuth);
HttpEntity<String> entity = new HttpEntity<>("parameters", headers);
return entity;
}
- protected String querySubsystemHealth(MsoSubsystems subsystem) {
+ protected HealthCheckSubsystem querySubsystemHealth(Endpoint subsystem) {
+ HealthCheckStatus status = HealthCheckStatus.DOWN;
+ URI uri = subsystem.getUri();
try {
// get port number for the subsystem
- String ept = getEndpointUrlForSubsystemEnum(subsystem);
-
// build final endpoint url
- UriBuilder builder = UriBuilder.fromPath(ept).path(actuatorContextPath).path(health);
- URI uri = builder.build();
- logger.info("Calculated URL: {}", uri.toString());
+ uri = UriBuilder.fromUri(subsystem.getUri()).path(actuatorContextPath).path(HEALTH).build();
+ logger.info("Calculated URL: {}", uri);
ResponseEntity<SubsystemHealthcheckResponse> result = restTemplate.exchange(uri, HttpMethod.GET,
buildHttpEntityForRequest(), SubsystemHealthcheckResponse.class);
- return processResponseFromSubsystem(result, subsystem);
+ status = processResponseFromSubsystem(result, subsystem);
+
} catch (Exception ex) {
logger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() ", ex);
- return HealthcheckStatus.DOWN.toString();
}
+
+ return new HealthCheckSubsystem(subsystem.getSubsystem(), uri, status);
}
- protected String processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
- MsoSubsystems subsystem) {
+ protected HealthCheckStatus processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
+ Endpoint endpoint) {
if (result == null || result.getStatusCodeValue() != HttpStatus.SC_OK) {
logger.error(String.format("Globalhealthcheck: checking subsystem: %s failed ! result object is: %s",
- subsystem, result == null ? "NULL" : result));
- return HealthcheckStatus.DOWN.toString();
+ endpoint.getSubsystem(), result == null ? "NULL" : result));
+ return HealthCheckStatus.DOWN;
}
SubsystemHealthcheckResponse body = result.getBody();
String status = body.getStatus();
if ("UP".equalsIgnoreCase(status)) {
- return HealthcheckStatus.UP.toString();
+ return HealthCheckStatus.UP;
} else {
- logger.error("{}, query health endpoint did not return UP status!", subsystem);
- return HealthcheckStatus.DOWN.toString();
+ logger.error("{}, query health endpoint did not return UP status!", endpoint.getSubsystem());
+ return HealthCheckStatus.DOWN;
}
}
-
- protected String getEndpointUrlForSubsystemEnum(MsoSubsystems subsystem) {
- switch (subsystem) {
- case SDNC:
- return this.endpointSdnc;
- case ASDC:
- return this.endpointAsdc;
- case BPMN:
- return this.endpointBpmn;
- case CATALOGDB:
- return this.endpointCatalogdb;
- case OPENSTACK:
- return this.endpointOpenstack;
- case REQUESTDB:
- return this.endpointRequestdb;
- case REQUESTDBATT:
- return this.endpointRequestdbAttsvc;
- default:
- return "";
- }
- }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
new file mode 100644
index 0000000000..1899cdd765
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
@@ -0,0 +1,84 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health.enpoints")
+public class HealthCheck {
+
+ private Subsystem subsystem;
+ private URI uri;
+ private HealthCheckStatus status = HealthCheckStatus.DOWN;
+
+ public HealthCheck() {
+
+ }
+
+ public HealthCheck(String subsystem, String uri) {
+ this.subsystem = SoSubsystems.valueOf(subsystem.toUpperCase());
+ this.uri = UriBuilder.fromUri(uri).build();
+ }
+
+ public HealthCheck(Subsystem subsystem, URI uri) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ }
+
+ public HealthCheck(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ this.status = status;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem component) {
+ this.subsystem = component;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public HealthCheckStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(HealthCheckStatus status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("subsystem", subsystem).append("uri", uri).append("status", status)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof HealthCheck)) {
+ return false;
+ }
+ HealthCheck castOther = (HealthCheck) other;
+ return new EqualsBuilder().append(subsystem, castOther.subsystem).append(uri, castOther.uri)
+ .append(status, castOther.status).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(subsystem).append(uri).append(status).toHashCode();
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
new file mode 100644
index 0000000000..11fd94bc91
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
@@ -0,0 +1,83 @@
+/*-
+ * ============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.apihandlerinfra;
+
+import java.net.URI;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.annotation.Validated;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health")
+@Validated
+public class HealthCheckConfig {
+
+ @NotNull
+ private List<Endpoint> endpoints;
+
+ public List<Endpoint> getEndpoints() {
+ return endpoints;
+ }
+
+ public void setEndpoints(List<Endpoint> endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("endpoints", this.endpoints).toString();
+ }
+
+ @Validated
+ public static class Endpoint {
+ @NotNull
+ private Subsystem subsystem;
+ @NotNull
+ private URI uri;
+
+ public Endpoint() {
+
+ }
+
+ public Endpoint(Subsystem subsystem, URI uri) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem subsystem) {
+ this.subsystem = subsystem;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
new file mode 100644
index 0000000000..ed06018e7b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
@@ -0,0 +1,22 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HealthCheckConverter {
+
+
+ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+ if (sourceType.getType() == String.class && targetType.getType() == Subsystem.class) {
+ return SoSubsystems.valueOf(((String) source).toUpperCase());
+ } else if (sourceType.getType() == String.class && targetType.getType() == URI.class) {
+ return UriBuilder.fromUri((String) source).build();
+ } else {
+ return source;
+ }
+ }
+
+}
diff --git a/adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/BPRestCallbackTest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
index 21917c3d2c..5400249c65 100644
--- a/adapters/mso-workflow-message-adapter/src/test/java/org/onap/so/adapters/workflowmessage/BPRestCallbackTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * 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.
@@ -17,26 +17,33 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+package org.onap.so.apihandlerinfra;
-package org.onap.so.adapters.workflowmessage;
+import java.util.ArrayList;
+import java.util.List;
-import org.apache.http.entity.ContentType;
-import org.junit.Test;
-import org.mockito.Mock;
+public class HealthCheckResponse {
-import static junit.framework.Assert.assertFalse;
-public class BPRestCallbackTest {
+ private List<HealthCheckSubsystem> subsystems = new ArrayList<>();
+ private String message;
- @Mock
- ContentType contentType;
- @Test
- public void testSendExceptionCase() {
+ public List<HealthCheckSubsystem> getSubsystems() {
+ return subsystems;
+ }
+
+ public void setSubsystems(List<HealthCheckSubsystem> subsystems) {
+ this.subsystems = subsystems;
+ }
- BPRestCallback test = new BPRestCallback();
- test.send("workflowMessageUrl/", "messageType", "correlator", contentType,"message");
- assertFalse(test.send("workflowMessageUrl/", "messageType", "correlator", contentType,"message"));
+ public String getMessage() {
+ return message;
+ }
- }
+ public void setMessage(String message) {
+ this.message = message;
}
+
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
index 077a3c2d60..6b31c1f1ed 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
@@ -19,12 +19,12 @@
*/
package org.onap.so.apihandlerinfra;
-public enum HealthcheckStatus {
+public enum HealthCheckStatus {
UP("UP"), DOWN("DOWN");
private String status;
- private HealthcheckStatus(String status) {
+ private HealthCheckStatus(String status) {
this.status = status;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
new file mode 100644
index 0000000000..e1335b952c
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
@@ -0,0 +1,40 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+
+public class HealthCheckSubsystem {
+
+ private Subsystem subsystem;
+ private URI uri;
+ private HealthCheckStatus status;
+
+ public HealthCheckSubsystem(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ this.status = status;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem subsystem) {
+ this.subsystem = subsystem;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public HealthCheckStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(HealthCheckStatus status) {
+ this.status = status;
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
deleted file mode 100644
index fad3dd4055..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
+++ /dev/null
@@ -1,116 +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.apihandlerinfra;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-public class HealthcheckResponse {
- private String apih;
- private String bpmn;
- private String sdncAdapter;
- private String asdcController;
- private String catalogdbAdapter;
- private String requestdbAdapter;
- private String openstackAdapter;
- private String requestdbAdapterAttsvc;
- private String message = "";
-
- public String getApih() {
- return apih;
- }
-
- public void setApih(String apih) {
- this.apih = apih;
- }
-
- public String getBpmn() {
- return bpmn;
- }
-
- public void setBpmn(String bpmn) {
- this.bpmn = bpmn;
- }
-
- public String getSdncAdapter() {
- return sdncAdapter;
- }
-
- public void setSdncAdapter(String sdncAdapter) {
- this.sdncAdapter = sdncAdapter;
- }
-
- public String getAsdcController() {
- return asdcController;
- }
-
- public void setAsdcController(String asdcController) {
- this.asdcController = asdcController;
- }
-
- public String getCatalogdbAdapter() {
- return catalogdbAdapter;
- }
-
- public void setCatalogdbAdapter(String catalogdbAdapter) {
- this.catalogdbAdapter = catalogdbAdapter;
- }
-
- public String getRequestdbAdapter() {
- return requestdbAdapter;
- }
-
- public void setRequestdbAdapter(String requestdbAdapter) {
- this.requestdbAdapter = requestdbAdapter;
- }
-
- public String getOpenstackAdapter() {
- return openstackAdapter;
- }
-
- public void setOpenstackAdapter(String openstackAdapter) {
- this.openstackAdapter = openstackAdapter;
- }
-
- public String getRequestdbAdapterAttsvc() {
- return requestdbAdapterAttsvc;
- }
-
- public void setRequestdbAdapterAttsvc(String requestdbAdapterAttsvc) {
- this.requestdbAdapterAttsvc = requestdbAdapterAttsvc;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this).append("apih", this.apih).append("pbmn", this.bpmn)
- .append("sdncAdapter", this.sdncAdapter).append("asdcController", this.asdcController)
- .append("catalogdbAdapter", this.catalogdbAdapter).append("requestdbAdapter", this.requestdbAdapter)
- .append("openstackAdapter", this.openstackAdapter)
- .append("requestdbAdapterAttsvc", this.requestdbAdapterAttsvc).append("message", this.message)
- .toString();
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
index 15572f2b39..dbdc274bc6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
@@ -23,8 +23,6 @@
package org.onap.so.apihandlerinfra;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
import org.apache.http.HttpStatus;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.RequestClientParameter;
@@ -61,10 +59,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.HashMap;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/instanceManagement")
-@Api(value = "/onap/so/infra/instanceManagement", description = "Infrastructure API Requests for Instance Management")
+@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/instanceManagement",
+ description = "Infrastructure API Requests for Instance Management"))
public class InstanceManagement {
private static Logger logger = LoggerFactory.getLogger(InstanceManagement.class);
@@ -87,9 +93,10 @@ public class InstanceManagement {
@Path("/{version:[vV][1]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/workflows/{workflowUuid}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Execute custom workflow", response = Response.class)
+ @Operation(description = "Execute custom workflow", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
- public Response executeCustomWorkflow(String request, @PathParam("version") String version,
+ public Response executeVNFCustomWorkflow(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@PathParam("workflowUuid") String workflowUuid, @Context ContainerRequestContext requestContext)
throws ApiException {
@@ -102,6 +109,26 @@ public class InstanceManagement {
requestContext);
}
+ @POST
+ @Path("/{version:[vV][1]}/serviceInstances/{serviceInstanceId}/pnfs/{pnfId}/workflows/{workflowUuid}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @Operation(description = "Execute custom workflow", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
+ @Transactional
+ public Response executePNFCustomWorkflow(String request, @PathParam("version") String version,
+ @PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("pnfId") String pnfId,
+ @PathParam("workflowUuid") String workflowUuid, @Context ContainerRequestContext requestContext)
+ throws ApiException {
+ String requestId = requestHandlerUtils.getRequestId(requestContext);
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("serviceInstanceId", serviceInstanceId);
+ instanceIdMap.put("pnfId", pnfId);
+ instanceIdMap.put("workflowUuid", workflowUuid);
+ return processPNFCustomWorkflowRequest(request, Action.forCustomWorkflow, instanceIdMap, version, requestId,
+ requestContext);
+ }
+
private Response processCustomWorkflowRequest(String requestJSON, Actions action,
HashMap<String, String> instanceIdMap, String version, String requestId,
ContainerRequestContext requestContext) throws ApiException {
@@ -210,6 +237,93 @@ public class InstanceManagement {
recipeLookupResult.getOrchestrationURI(), requestScope);
}
+ private Response processPNFCustomWorkflowRequest(String requestJSON, Actions action,
+ HashMap<String, String> instanceIdMap, String version, String requestId,
+ ContainerRequestContext requestContext) throws ApiException {
+ Boolean aLaCarte = false;
+ ServiceInstancesRequest sir;
+ String apiVersion = version.substring(1);
+
+ String serviceInstanceId = "";
+ String pnfId = "";
+ String workflowUuid = "";
+ if (instanceIdMap != null) {
+ serviceInstanceId = instanceIdMap.get("serviceInstanceId");
+ pnfId = instanceIdMap.get("pnfId");
+ workflowUuid = instanceIdMap.get("workflowUuid");
+ }
+
+ String requestUri = requestHandlerUtils.getRequestUri(requestContext, uriPrefix);
+ sir = requestHandlerUtils.convertJsonToServiceInstanceRequest(requestJSON, action, requestId, requestUri);
+ sir.setServiceInstanceId(serviceInstanceId);
+ sir.setPnfId(pnfId);
+ String requestScope = ModelType.pnf.name();
+ InfraActiveRequests currentActiveReq =
+ msoRequest.createRequestObject(sir, action, requestId, Status.IN_PROGRESS, requestJSON, requestScope);
+
+ try {
+ requestHandlerUtils.validateHeaders(requestContext);
+ } catch (ValidationException e) {
+ logger.error("Exception occurred", e);
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_VALIDATION_ERROR, ErrorCode.SchemaError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ ValidateException validateException =
+ new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
+ ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
+ requestHandlerUtils.updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
+ throw validateException;
+ }
+
+ requestHandlerUtils.parseRequest(sir, instanceIdMap, action, version, requestJSON, aLaCarte, requestId,
+ currentActiveReq);
+ requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap);
+
+ InfraActiveRequests dup = null;
+ boolean inProgress = false;
+
+ dup = requestHandlerUtils.duplicateCheck(action, instanceIdMap, null, requestScope, currentActiveReq);
+
+ if (dup != null) {
+ inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq);
+ }
+
+ if (dup != null && inProgress) {
+ requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, null, requestScope,
+ dup);
+ }
+
+ RecipeLookupResult recipeLookupResult = getInstanceManagementWorkflowRecipe(currentActiveReq, workflowUuid);
+
+ try {
+ infraActiveRequestsClient.save(currentActiveReq);
+ } catch (Exception e) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ throw new RequestDbFailureException.Builder(SAVE_TO_DB, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR,
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build();
+ }
+
+ RequestClientParameter requestClientParameter = null;
+ try {
+ requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId)
+ .setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).setRequestAction(action.toString())
+ .setServiceInstanceId(serviceInstanceId).setPnfCorrelationId(pnfId)
+ .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(requestJSON, null, aLaCarte, action))
+ .setApiVersion(apiVersion).setRequestUri(requestUri).build();
+ } catch (IOException e) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.SchemaError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ throw new ValidateException.Builder("Unable to generate RequestClientParamter object" + e.getMessage(),
+ HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_BAD_PARAMETER).errorInfo(errorLoggerInfo)
+ .build();
+ }
+ return requestHandlerUtils.postBPELRequest(currentActiveReq, requestClientParameter,
+ recipeLookupResult.getOrchestrationURI(), requestScope);
+ }
+
private RecipeLookupResult getInstanceManagementWorkflowRecipe(InfraActiveRequests currentActiveReq,
String workflowUuid) throws ApiException {
RecipeLookupResult recipeLookupResult = null;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
index 00d36b3ff9..b7288e4c91 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -20,12 +20,16 @@
package org.onap.so.apihandlerinfra;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import javax.annotation.PostConstruct;
+import javax.servlet.ServletConfig;
import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Context;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletProperties;
+import org.onap.logging.filter.base.Constants;
import org.onap.so.apihandler.filters.RequestIdFilter;
-import org.onap.so.apihandler.filters.RequestUriFilter;
import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper;
import org.onap.so.apihandlerinfra.infra.rest.Network;
import org.onap.so.apihandlerinfra.infra.rest.ServiceInstance;
@@ -40,12 +44,17 @@ import org.onap.so.apihandlerinfra.infra.rest.exception.mapper.WorkflowEngineCon
import org.onap.so.apihandlerinfra.tenantisolation.CloudOrchestration;
import org.onap.so.apihandlerinfra.tenantisolation.CloudResourcesOrchestration;
import org.onap.so.apihandlerinfra.tenantisolation.ModelDistributionRequest;
-import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
+import org.onap.so.utils.Components;
import org.onap.so.web.exceptions.RuntimeExceptionMapper;
import org.springframework.context.annotation.Configuration;
-import io.swagger.jaxrs.config.BeanConfig;
-import io.swagger.jaxrs.listing.ApiListingResource;
-import io.swagger.jaxrs.listing.SwaggerSerializers;
+import io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder;
+import io.swagger.v3.jaxrs2.integration.resources.AcceptHeaderOpenApiResource;
+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("/")
@@ -53,6 +62,7 @@ public class JerseyConfiguration extends ResourceConfig {
@PostConstruct
public void setUp() {
+ System.setProperty(Constants.Property.PARTNER_NAME, Components.APIH.toString());
register(GlobalHealthcheckHandler.class);
register(NodeHealthcheckHandler.class);
register(ServiceInstances.class);
@@ -65,14 +75,13 @@ public class JerseyConfiguration extends ResourceConfig {
register(Network.class);
register(Volumes.class);
register(ServiceInstance.class);
- register(JaxRsFilterLogging.class);
+ register(SOAuditLogContainerFilter.class);
register(ManualTasks.class);
register(TasksHandler.class);
- register(ApiListingResource.class);
- register(SwaggerSerializers.class);
+ register(OpenApiResource.class);
+ register(AcceptHeaderOpenApiResource.class);
register(ApiExceptionMapper.class);
register(RuntimeExceptionMapper.class);
- register(RequestUriFilter.class);
register(RequestIdFilter.class);
register(E2EServiceInstances.class);
register(WorkflowSpecificationsHandler.class);
@@ -88,12 +97,21 @@ public class JerseyConfiguration extends ResourceConfig {
register(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class);
register(ModelDistributionRequest.class);
property(ServletProperties.FILTER_FORWARD_ON_404, true);
- BeanConfig beanConfig = new BeanConfig();
- beanConfig.setVersion("1.0.2");
- beanConfig.setSchemes(new String[] {"https"});
- beanConfig.setResourcePackage("org.onap.so.apihandlerinfra");
- beanConfig.setPrettyPrint(true);
- beanConfig.setScan(true);
+
+ OpenAPI oas = new OpenAPI();
+ Info info = new Info();
+ info.title("Swagger apihandlerinfra bootstrap code");
+ info.setVersion("1.0.2");
+
+ SwaggerConfiguration oasConfig = new SwaggerConfiguration().openAPI(oas).prettyPrint(true)
+ .resourcePackages(Stream.of("org.onap.so.apihandlerinfra").collect(Collectors.toSet()));
+
+ try {
+ new JaxrsOpenApiContextBuilder().application(this).openApiConfiguration(oasConfig).buildContext(true);
+ } catch (OpenApiConfigurationException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
index b9b7fcc0d4..7e4452aeb3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
@@ -34,7 +34,6 @@ import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.onap.so.logger.LoggingAnchor;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.onap.so.apihandler.common.ErrorNumbers;
@@ -52,6 +51,7 @@ import org.onap.so.apihandlerinfra.tasksbeans.Value;
import org.onap.so.apihandlerinfra.tasksbeans.Variables;
import org.onap.so.exceptions.ValidationException;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,8 +60,11 @@ import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
-import io.swagger.annotations.ApiOperation;
-
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Path("/tasks")
@Component
@@ -85,7 +88,8 @@ public class ManualTasks {
@Path("/{version:[vV]1}/{taskId}/complete")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Complete specified task", response = Response.class)
+ @Operation(description = "Complete specified task", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response completeTask(String request, @PathParam("version") String version,
@PathParam("taskId") String taskId, @Context ContainerRequestContext requestContext) throws ApiException {
@@ -196,8 +200,9 @@ public class ManualTasks {
}
if (response == null) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- ErrorCode.BusinessProcesssError).errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, ErrorCode.BusinessProcessError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
BPMNFailureException bpmnFailureException =
@@ -225,7 +230,7 @@ public class ManualTasks {
} catch (JsonProcessingException e) {
ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
- ErrorCode.BusinessProcesssError).build();
+ ErrorCode.BusinessProcessError).build();
ValidateException validateException =
@@ -239,7 +244,7 @@ public class ManualTasks {
return builder.buildResponse(HttpStatus.SC_ACCEPTED, requestId, completeResp, apiVersion);
} else {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcessError)
.build();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
index 4bcc0d4111..e3e840bbcd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
@@ -140,18 +140,7 @@ public class MsoRequest {
}
re.setServiceException(se);
}
-
- String requestErrorStr = null;
-
- try {
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(Include.NON_DEFAULT);
- requestErrorStr = mapper.writeValueAsString(re);
- } catch (Exception e) {
- logger.error("Exception in buildServiceErrorResponse writing exceptionType to string ", e);
- }
-
- return builder.buildResponse(httpResponseCode, null, requestErrorStr, version);
+ return builder.buildResponse(httpResponseCode, null, re, version);
}
@@ -278,7 +267,6 @@ public class MsoRequest {
String vnfType = "";
aq.setRequestId(requestId);
aq.setRequestAction(action.toString());
- aq.setAction(action.toString());
aq.setRequestUrl(MDC.get(LogConstants.HTTP_URL));
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
@@ -313,7 +301,7 @@ public class MsoRequest {
if (servInsReq.getRequestDetails().getCloudConfiguration() != null) {
CloudConfiguration cloudConfiguration = servInsReq.getRequestDetails().getCloudConfiguration();
if (cloudConfiguration.getLcpCloudRegionId() != null) {
- aq.setAicCloudRegion(cloudConfiguration.getLcpCloudRegionId());
+ aq.setCloudRegion(cloudConfiguration.getLcpCloudRegionId());
}
if (cloudConfiguration.getTenantId() != null) {
@@ -330,9 +318,16 @@ public class MsoRequest {
aq.setVnfId(servInsReq.getVnfInstanceId());
}
+ if (servInsReq.getPnfId() != null) {
+ aq.setRequestScope(requestScope);
+ aq.setPnfId(servInsReq.getPnfId());
+ }
+
if (ModelType.service.name().equalsIgnoreCase(requestScope)) {
- if (servInsReq.getRequestDetails().getRequestInfo().getInstanceName() != null) {
- aq.setServiceInstanceName(requestInfo.getInstanceName());
+ if (servInsReq.getRequestDetails().getRequestInfo() != null) {
+ if (servInsReq.getRequestDetails().getRequestInfo().getInstanceName() != null) {
+ aq.setServiceInstanceName(requestInfo.getInstanceName());
+ }
}
}
@@ -410,7 +405,6 @@ public class MsoRequest {
taskRequest.getRequestDetails().getRequestInfo();
aq.setRequestId(requestId);
aq.setRequestAction(action.name());
- aq.setAction(action.name());
aq.setRequestUrl(MDC.get(LogConstants.HTTP_URL));
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
index 3337c62afd..e56ee24baf 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
@@ -22,7 +22,19 @@
package org.onap.so.apihandlerinfra;
-import java.net.UnknownHostException;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+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 org.apache.http.HttpStatus;
+import org.onap.so.logger.LoggingAnchor;
+import org.onap.so.logger.MessageEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -30,17 +42,10 @@ import javax.ws.rs.Produces;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
-import org.onap.so.logger.LoggingAnchor;
-import org.apache.http.HttpStatus;
-import org.onap.so.logger.MessageEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import java.net.UnknownHostException;
@Path("/nodehealthcheck")
-@Api(value = "/nodehealthcheck", description = "API Handler Infra Node Health Check")
+@OpenAPIDefinition(info = @Info(title = "/nodehealthcheck", description = "API Handler Infra Node Health Check"))
@Component
public class NodeHealthcheckHandler {
@@ -53,7 +58,8 @@ public class NodeHealthcheckHandler {
@GET
@Produces("text/html")
- @ApiOperation(value = "Performing node health check", response = Response.class)
+ @Operation(description = "Performing node health check", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response nodeHealthcheck(@Context ContainerRequestContext requestContext) throws UnknownHostException {
// Generated RequestId
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
index 6f36fb2aff..ae68cc6032 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
@@ -9,9 +9,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -42,7 +42,9 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.EnumUtils;
import org.apache.http.HttpStatus;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
@@ -69,19 +71,27 @@ import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.utils.UUIDChecker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Path("onap/so/infra/orchestrationRequests")
-@Api(value = "onap/so/infra/orchestrationRequests", description = "API Requests for Orchestration requests")
+@OpenAPIDefinition(info = @Info(title = "onap/so/infra/orchestrationRequests",
+ description = "API Requests for Orchestration requests"))
+
@Component
public class OrchestrationRequests {
private static Logger logger = LoggerFactory.getLogger(OrchestrationRequests.class);
+ private static final String ERROR_MESSAGE_PREFIX = "Error Source: %s, Error Message: %s";
@Autowired
private RequestsDbClient requestsDbClient;
@@ -97,7 +107,8 @@ public class OrchestrationRequests {
@GET
@Path("/{version:[vV][4-7]}/{requestId}")
- @ApiOperation(value = "Find Orchestrated Requests for a given requestId", response = Response.class)
+ @Operation(description = "Find Orchestrated Requests for a given requestId", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
@Transactional
public Response getOrchestrationRequest(@PathParam("requestId") String requestId,
@@ -118,51 +129,45 @@ public class OrchestrationRequests {
throw new ValidateException.Builder("Request Id " + requestId + " is not a valid UUID",
HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).errorInfo(errorLoggerInfo).build();
}
- try {
- infraActiveRequest = requestsDbClient.getInfraActiveRequestbyRequestId(requestId);
- requestProcessingData = requestsDbClient.getRequestProcessingDataBySoRequestId(requestId);
-
- } catch (Exception e) {
- logger.error("Exception occurred", e);
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.AvailabilityError).build();
-
- ValidateException validateException =
- new ValidateException.Builder("Exception while communciate with Request DB - Infra Request Lookup",
- HttpStatus.SC_NOT_FOUND, ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB).cause(e)
- .errorInfo(errorLoggerInfo).build();
-
- throw validateException;
-
- }
- if (infraActiveRequest == null) {
+ infraActiveRequest = infraActiveRequestLookup(requestId);
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- ErrorCode.BusinessProcesssError).build();
+ if (isRequestProcessingDataRequired(format)) {
+ try {
+ requestProcessingData = requestsDbClient.getExternalRequestProcessingDataBySoRequestId(requestId);
+ } catch (Exception e) {
+ logger.error(
+ "Exception occurred while communicating with RequestDb during requestProcessingData lookup ",
+ e);
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.AvailabilityError)
+ .build();
- ValidateException validateException =
- new ValidateException.Builder("Orchestration RequestId " + requestId + " is not found in DB",
- HttpStatus.SC_NO_CONTENT, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR)
- .errorInfo(errorLoggerInfo).build();
+ ValidateException validateException = new ValidateException.Builder(
+ "Exception occurred while communicating with RequestDb during requestProcessingData lookup",
+ HttpStatus.SC_NOT_FOUND, ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB).cause(e)
+ .errorInfo(errorLoggerInfo).build();
- throw validateException;
+ throw validateException;
+ }
}
Request request = mapInfraActiveRequestToRequest(infraActiveRequest, includeCloudRequest, format);
- if (!requestProcessingData.isEmpty()) {
+ if (null != requestProcessingData && !requestProcessingData.isEmpty()) {
request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData));
}
request.setRequestId(requestId);
orchestrationResponse.setRequest(request);
- return builder.buildResponse(HttpStatus.SC_OK, requestId, orchestrationResponse, apiVersion);
+ return builder.buildResponse(HttpStatus.SC_OK, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID), orchestrationResponse,
+ apiVersion);
}
@GET
@Path("/{version:[vV][4-7]}")
- @ApiOperation(value = "Find Orchestrated Requests for a URI Information", response = Response.class)
+ @Operation(description = "Find Orchestrated Requests for a URI Information", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Produces(MediaType.APPLICATION_JSON)
@Transactional
public Response getOrchestrationRequest(@Context UriInfo ui, @PathParam("version") String version,
@@ -198,28 +203,34 @@ public class OrchestrationRequests {
orchestrationList = new GetOrchestrationListResponse();
List<RequestList> requestLists = new ArrayList<>();
+
for (InfraActiveRequests infraActive : activeRequests) {
- List<RequestProcessingData> requestProcessingData =
- requestsDbClient.getRequestProcessingDataBySoRequestId(infraActive.getRequestId());
RequestList requestList = new RequestList();
Request request = mapInfraActiveRequestToRequest(infraActive, includeCloudRequest, format);
- if (!requestProcessingData.isEmpty()) {
- request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData));
+ if (isRequestProcessingDataRequired(format)) {
+ List<RequestProcessingData> requestProcessingData =
+ requestsDbClient.getRequestProcessingDataBySoRequestId(infraActive.getRequestId());
+ if (null != requestProcessingData && !requestProcessingData.isEmpty()) {
+ request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData));
+ }
}
+
requestList.setRequest(request);
requestLists.add(requestList);
}
orchestrationList.setRequestList(requestLists);
- return builder.buildResponse(HttpStatus.SC_OK, null, orchestrationList, apiVersion);
+ return builder.buildResponse(HttpStatus.SC_OK, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID), orchestrationList,
+ apiVersion);
}
@POST
@Path("/{version: [vV][4-7]}/{requestId}/unlock")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Unlock Orchestrated Requests for a given requestId", response = Response.class)
+ @Operation(description = "Unlock Orchestrated Requests for a given requestId", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId,
@PathParam("version") String version) throws ApiException {
@@ -227,8 +238,6 @@ public class OrchestrationRequests {
logger.debug("requestId is: {}", requestId);
ServiceInstancesRequest sir;
- InfraActiveRequests infraActiveRequest;
-
try {
ObjectMapper mapper = new ObjectMapper();
sir = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
@@ -258,41 +267,26 @@ public class OrchestrationRequests {
throw validateException;
}
- infraActiveRequest = requestsDbClient.getInfraActiveRequestbyRequestId(requestId);
- if (infraActiveRequest == null) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
- ErrorCode.BusinessProcesssError).build();
-
- ValidateException validateException =
- new ValidateException.Builder("Null response from RequestDB when searching by RequestId",
- HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo)
- .build();
-
- throw validateException;
+ InfraActiveRequests infraActiveRequest = infraActiveRequestLookup(requestId);
+ String status = infraActiveRequest.getRequestStatus();
+ if (Status.IN_PROGRESS.toString().equalsIgnoreCase(status) || Status.PENDING.toString().equalsIgnoreCase(status)
+ || Status.PENDING_MANUAL_TASK.toString().equalsIgnoreCase(status)) {
+ infraActiveRequest.setRequestStatus(Status.UNLOCKED.toString());
+ infraActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
+ infraActiveRequest.setRequestId(requestId);
+ requestsDbClient.save(infraActiveRequest);
} else {
- String status = infraActiveRequest.getRequestStatus();
- if (Status.IN_PROGRESS.toString().equalsIgnoreCase(status)
- || Status.PENDING.toString().equalsIgnoreCase(status)
- || Status.PENDING_MANUAL_TASK.toString().equalsIgnoreCase(status)) {
- infraActiveRequest.setRequestStatus(Status.UNLOCKED.toString());
- infraActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
- infraActiveRequest.setRequestId(requestId);
- requestsDbClient.save(infraActiveRequest);
- } else {
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.DataError)
- .build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.DataError).build();
- ValidateException validateException = new ValidateException.Builder(
- "Orchestration RequestId " + requestId + " has a status of " + status
- + " and can not be unlocked",
- HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo)
- .build();
+ ValidateException validateException = new ValidateException.Builder(
+ "Orchestration RequestId " + requestId + " has a status of " + status + " and can not be unlocked",
+ HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo)
+ .build();
- throw validateException;
- }
+ throw validateException;
}
return Response.status(HttpStatus.SC_NO_CONTENT).entity("").build();
}
@@ -411,7 +405,11 @@ public class OrchestrationRequests {
protected String mapRequestStatusToRequest(InfraActiveRequests iar, String format) {
if (iar.getRequestStatus() != null) {
- if (!StringUtils.isBlank(format) && OrchestrationRequestFormat.DETAIL.toString().equalsIgnoreCase(format)) {
+ boolean requestFormat = false;
+ if (format != null) {
+ requestFormat = EnumUtils.isValidEnum(OrchestrationRequestFormat.class, format.toUpperCase());
+ }
+ if (requestFormat) {
return iar.getRequestStatus();
} else {
if (Status.ABORTED.toString().equalsIgnoreCase(iar.getRequestStatus())
@@ -428,7 +426,7 @@ public class OrchestrationRequests {
}
protected void mapRequestStatusAndExtSysErrSrcToRequest(InfraActiveRequests iar, RequestStatus status,
- String format) throws ContactCamundaException {
+ String format) {
String rollbackStatusMessage = iar.getRollbackStatusMessage();
String flowStatusMessage = iar.getFlowStatus();
String retryStatusMessage = iar.getRetryStatusMessage();
@@ -444,7 +442,12 @@ public class OrchestrationRequests {
String statusMessages = null;
if (iar.getStatusMessage() != null) {
- statusMessages = "STATUS: " + iar.getStatusMessage();
+ if (StringUtils.isNotBlank(iar.getExtSystemErrorSource())) {
+ statusMessages = "STATUS: "
+ + String.format(ERROR_MESSAGE_PREFIX, iar.getExtSystemErrorSource(), iar.getStatusMessage());
+ } else {
+ statusMessages = "STATUS: " + iar.getStatusMessage();
+ }
}
if (OrchestrationRequestFormat.STATUSDETAIL.toString().equalsIgnoreCase(format)) {
@@ -532,4 +535,43 @@ public class OrchestrationRequests {
addedRequestProcessingData.add(finalProcessingData);
return addedRequestProcessingData;
}
+
+ protected boolean isRequestProcessingDataRequired(String format) {
+ if (StringUtils.isNotEmpty(format) && format.equalsIgnoreCase(OrchestrationRequestFormat.SIMPLE.name())) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ protected InfraActiveRequests infraActiveRequestLookup(String requestId) throws ApiException {
+ InfraActiveRequests infraActiveRequest = null;
+ try {
+ infraActiveRequest = requestsDbClient.getInfraActiveRequestbyRequestId(requestId);
+ } catch (Exception e) {
+ logger.error("Exception occurred while communicating with RequestDb during InfraActiveRequest lookup ", e);
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.AvailabilityError).build();
+
+ ValidateException validateException = new ValidateException.Builder(
+ "Exception occurred while communicating with RequestDb during InfraActiveRequest lookup",
+ HttpStatus.SC_NOT_FOUND, ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB).cause(e)
+ .errorInfo(errorLoggerInfo).build();
+
+ throw validateException;
+ }
+
+ if (infraActiveRequest == null) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, ErrorCode.BusinessProcessError)
+ .build();
+
+ ValidateException validateException = new ValidateException.Builder(
+ "Null response from RequestDB when searching by RequestId " + requestId, HttpStatus.SC_NOT_FOUND,
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo).build();
+
+ throw validateException;
+ }
+ return infraActiveRequest;
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
index 9ab95a2319..0c6ad0ba22 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
@@ -55,13 +56,22 @@ import org.onap.so.apihandlerinfra.exceptions.BPMNFailureException;
import org.onap.so.apihandlerinfra.exceptions.ClientConnectionException;
import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
import org.onap.so.apihandlerinfra.exceptions.DuplicateRequestException;
+import org.onap.so.apihandlerinfra.exceptions.RecipeNotFoundException;
import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.apihandlerinfra.exceptions.VfModuleNotFoundException;
import org.onap.so.apihandlerinfra.infra.rest.handler.AbstractRestHandler;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
import org.onap.so.constants.Status;
+import org.onap.so.db.catalog.beans.NetworkResource;
+import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.Recipe;
+import org.onap.so.db.catalog.beans.ServiceRecipe;
import org.onap.so.db.catalog.beans.VfModule;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+import org.onap.so.db.catalog.beans.VnfRecipe;
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -69,13 +79,19 @@ import org.onap.so.exceptions.ValidationException;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.LogConstants;
import org.onap.so.logger.MessageEnum;
+import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
+import org.onap.so.serviceinstancebeans.Networks;
import org.onap.so.serviceinstancebeans.RelatedInstance;
import org.onap.so.serviceinstancebeans.RelatedInstanceList;
+import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.RequestParameters;
+import org.onap.so.serviceinstancebeans.Service;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
+import org.onap.so.serviceinstancebeans.VfModules;
+import org.onap.so.serviceinstancebeans.Vnfs;
import org.onap.so.utils.UUIDChecker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -84,7 +100,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestClientException;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -94,7 +109,9 @@ public class RequestHandlerUtils extends AbstractRestHandler {
private static Logger logger = LoggerFactory.getLogger(RequestHandlerUtils.class);
- private static final String SAVE_TO_DB = "save instance to db";
+ protected static final String SAVE_TO_DB = "save instance to db";
+ private static final String NAME = "name";
+ private static final String VALUE = "value";
@Autowired
private Environment env;
@@ -103,9 +120,6 @@ public class RequestHandlerUtils extends AbstractRestHandler {
private RequestClientFactory reqClientFactory;
@Autowired
- private RequestsDbClient infraActiveRequestsClient;
-
- @Autowired
private ResponseBuilder builder;
@Autowired
@@ -119,13 +133,14 @@ public class RequestHandlerUtils extends AbstractRestHandler {
public Response postBPELRequest(InfraActiveRequests currentActiveReq, RequestClientParameter requestClientParameter,
String orchestrationUri, String requestScope) throws ApiException {
- RequestClient requestClient = null;
HttpResponse response = null;
+ RequestClient requestClient = null;
+
try {
requestClient = reqClientFactory.getRequestClient(orchestrationUri);
response = requestClient.post(requestClientParameter);
} catch (Exception e) {
-
+ logger.error("Error posting request to BPMN", e);
ErrorLoggerInfo errorLoggerInfo =
new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, ErrorCode.AvailabilityError)
.errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
@@ -134,19 +149,17 @@ public class RequestHandlerUtils extends AbstractRestHandler {
new ClientConnectionException.Builder(url, HttpStatus.SC_BAD_GATEWAY,
ErrorNumbers.SVC_NO_SERVER_RESOURCES).cause(e).errorInfo(errorLoggerInfo).build();
updateStatus(currentActiveReq, Status.FAILED, clientException.getMessage());
-
throw clientException;
}
if (response == null) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- ErrorCode.BusinessProcesssError).errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, ErrorCode.BusinessProcessError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
ClientConnectionException clientException = new ClientConnectionException.Builder(requestClient.getUrl(),
HttpStatus.SC_BAD_GATEWAY, ErrorNumbers.SVC_NO_SERVER_RESOURCES).errorInfo(errorLoggerInfo).build();
-
updateStatus(currentActiveReq, Status.FAILED, clientException.getMessage());
-
throw clientException;
}
@@ -208,7 +221,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
if (camundaJSONResponseBody != null && !camundaJSONResponseBody.isEmpty()) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcessError)
.errorSource(requestClient.getUrl()).build();
BPMNFailureException bpmnException =
new BPMNFailureException.Builder(String.valueOf(bpelStatus) + camundaJSONResponseBody, bpelStatus,
@@ -220,7 +233,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
} else {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcessError)
.errorSource(requestClient.getUrl()).build();
@@ -232,6 +245,9 @@ public class RequestHandlerUtils extends AbstractRestHandler {
}
}
+
+
+ @Override
public void updateStatus(InfraActiveRequests aq, Status status, String errorMessage)
throws RequestDbFailureException {
if ((status == Status.FAILED) || (status == Status.COMPLETE)) {
@@ -259,12 +275,18 @@ public class RequestHandlerUtils extends AbstractRestHandler {
} else if (action == Action.addMembers || action == Action.removeMembers) {
return (ModelType.instanceGroup.toString());
} else {
- String requestScope;
+ String requestScope = requestScopeFromUri(requestUri);;
+
+ if (sir.getRequestDetails() == null) {
+ return requestScope;
+ }
+ if (sir.getRequestDetails().getModelInfo() == null) {
+ return requestScope;
+ }
if (sir.getRequestDetails().getModelInfo().getModelType() == null) {
- requestScope = requestScopeFromUri(requestUri);
- } else {
- requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
+ return requestScope;
}
+ requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
return requestScope;
}
}
@@ -291,11 +313,27 @@ public class RequestHandlerUtils extends AbstractRestHandler {
return requestUri;
}
+ public void checkForDuplicateRequests(Actions action, HashMap<String, String> instanceIdMap, String requestScope,
+ InfraActiveRequests currentActiveReq, String instanceName) throws ApiException {
+ InfraActiveRequests dup = null;
+ boolean inProgress = false;
+
+ dup = duplicateCheck(action, instanceIdMap, instanceName, requestScope, currentActiveReq);
+
+ if (dup != null) {
+ inProgress = camundaHistoryCheck(dup, currentActiveReq);
+ }
+
+ if (dup != null && inProgress) {
+ buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, instanceName, requestScope, dup);
+ }
+ }
+
public InfraActiveRequests duplicateCheck(Actions action, HashMap<String, String> instanceIdMap,
String instanceName, String requestScope, InfraActiveRequests currentActiveReq) throws ApiException {
InfraActiveRequests dup = null;
try {
- if (!(instanceName == null && requestScope.equals("service") && (action == Action.createInstance
+ if (!(instanceName == null && "service".equals(requestScope) && (action == Action.createInstance
|| action == Action.activateInstance || action == Action.assignInstance))) {
dup = infraActiveRequestsClient.checkInstanceNameDuplicate(instanceIdMap, instanceName, requestScope);
}
@@ -318,7 +356,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
String requestId = duplicateRecord.getRequestId();
ResponseEntity<List<HistoricProcessInstanceEntity>> response = null;
try {
- response = camundaRequestHandler.getCamundaProcessInstanceHistory(requestId);
+ response = camundaRequestHandler.getCamundaProcessInstanceHistory(requestId, true);
} catch (RestClientException e) {
logger.error("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
requestId, e.getMessage());
@@ -334,7 +372,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
}
for (HistoricProcessInstance instance : response.getBody()) {
- if (instance.getState().equals("ACTIVE")) {
+ if (("ACTIVE").equals(instance.getState())) {
return true;
} else {
updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
@@ -412,6 +450,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
throw dupException;
}
+ @Override
public String getRequestId(ContainerRequestContext requestContext) throws ValidateException {
String requestId = null;
if (requestContext.getProperty("requestId") != null) {
@@ -472,6 +511,9 @@ public class RequestHandlerUtils extends AbstractRestHandler {
if (instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID) != null) {
currentActiveReq.setInstanceGroupId(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID));
}
+ if (instanceIdMap.get("PnfId") != null) {
+ currentActiveReq.setPnfId(instanceIdMap.get("PnfId"));
+ }
}
}
@@ -479,24 +521,11 @@ public class RequestHandlerUtils extends AbstractRestHandler {
boolean isAlaCarte, Actions action) throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(Include.NON_NULL);
- if (msoRawRequest != null) {
- ServiceInstancesRequest sir = mapper.readValue(msoRawRequest, ServiceInstancesRequest.class);
- if (serviceInstRequest != null && serviceInstRequest.getRequestDetails() != null
- && serviceInstRequest.getRequestDetails().getRequestParameters() != null) {
- if (!isAlaCarte && Action.createInstance.equals(action)) {
- sir.getRequestDetails()
- .setCloudConfiguration(serviceInstRequest.getRequestDetails().getCloudConfiguration());
- sir.getRequestDetails().getRequestParameters().setUserParams(
- serviceInstRequest.getRequestDetails().getRequestParameters().getUserParams());
- }
- sir.getRequestDetails().getRequestParameters()
- .setUsePreload(serviceInstRequest.getRequestDetails().getRequestParameters().getUsePreload());
- }
-
- logger.debug("Value as string: {}", mapper.writeValueAsString(sir));
- return mapper.writeValueAsString(sir);
+ if (serviceInstRequest != null) {
+ return mapper.writeValueAsString(serviceInstRequest);
+ } else {
+ return msoRawRequest;
}
- return null;
}
public Optional<String> retrieveModelName(RequestParameters requestParams) {
@@ -590,6 +619,8 @@ public class RequestHandlerUtils extends AbstractRestHandler {
requestScope = ModelType.configuration.name();
} else if (requestUri.contains(ModelType.vnf.name())) {
requestScope = ModelType.vnf.name();
+ } else if (requestUri.contains(ModelType.pnf.name())) {
+ requestScope = ModelType.pnf.name();
} else {
requestScope = ModelType.service.name();
}
@@ -612,7 +643,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
if (infraActiveRequest != null) {
request.setTenantId(infraActiveRequest.getTenantId());
request.setRequestBody(updateRequestorIdInRequestBody(infraActiveRequest, requestorId));
- request.setAicCloudRegion(infraActiveRequest.getAicCloudRegion());
+ request.setCloudRegion(infraActiveRequest.getCloudRegion());
request.setRequestScope(infraActiveRequest.getRequestScope());
request.setRequestAction(infraActiveRequest.getRequestAction());
setInstanceIdAndName(infraActiveRequest, request);
@@ -699,4 +730,567 @@ public class RequestHandlerUtils extends AbstractRestHandler {
"(?s)(\"requestInfo\"\\s*?:\\s*?\\{.*?\"requestorId\"\\s*?:\\s*?\")(.*?)(\"[ ]*(?:,|\\R|\\}))",
"$1" + newRequestorId + "$3");
}
+
+ public RecipeLookupResult getServiceInstanceOrchestrationURI(ServiceInstancesRequest sir, Actions action,
+ boolean alaCarteFlag, InfraActiveRequests currentActiveReq) throws ApiException {
+ RecipeLookupResult recipeLookupResult = null;
+ // if the aLaCarte flag is set to TRUE, the API-H should choose the VID_DEFAULT recipe for the requested action
+ ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
+ // Query MSO Catalog DB
+
+ if (action == Action.applyUpdatedConfig || action == Action.inPlaceSoftwareUpdate) {
+ recipeLookupResult = getDefaultVnfUri(sir, action);
+ } else if (action == Action.addMembers || action == Action.removeMembers) {
+ recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
+ } else if (modelInfo.getModelType().equals(ModelType.service)) {
+ try {
+ recipeLookupResult = getServiceURI(sir, action, alaCarteFlag);
+ } catch (IOException e) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+
+
+ ValidateException validateException =
+ new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
+ ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
+
+ updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
+
+ throw validateException;
+ }
+ } else if (modelInfo.getModelType().equals(ModelType.vfModule)
+ || modelInfo.getModelType().equals(ModelType.volumeGroup)
+ || modelInfo.getModelType().equals(ModelType.vnf)) {
+ try {
+ recipeLookupResult = getVnfOrVfModuleUri(sir, action);
+ } catch (ValidationException e) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+
+
+ ValidateException validateException =
+ new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
+ ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
+
+ updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
+
+ throw validateException;
+ }
+ } else if (modelInfo.getModelType().equals(ModelType.network)) {
+ try {
+ recipeLookupResult = getNetworkUri(sir, action);
+ } catch (ValidationException e) {
+
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+
+
+ ValidateException validateException =
+ new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
+ ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
+ updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
+
+ throw validateException;
+ }
+ } else if (modelInfo.getModelType().equals(ModelType.instanceGroup)) {
+ recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
+ }
+
+ if (recipeLookupResult == null) {
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError)
+ .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+
+
+ RecipeNotFoundException recipeNotFoundExceptionException =
+ new RecipeNotFoundException.Builder("Recipe could not be retrieved from catalog DB.",
+ HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_GENERAL_SERVICE_ERROR).errorInfo(errorLoggerInfo)
+ .build();
+
+ updateStatus(currentActiveReq, Status.FAILED, recipeNotFoundExceptionException.getMessage());
+ throw recipeNotFoundExceptionException;
+ }
+ return recipeLookupResult;
+ }
+
+ protected RecipeLookupResult getServiceURI(ServiceInstancesRequest servInstReq, Actions action,
+ boolean alaCarteFlag) throws IOException {
+ // SERVICE REQUEST
+ // Construct the default service name
+ // TODO need to make this a configurable property
+ String defaultServiceModelName = getDefaultModel(servInstReq);
+ RequestDetails requestDetails = servInstReq.getRequestDetails();
+ ModelInfo modelInfo = requestDetails.getModelInfo();
+ org.onap.so.db.catalog.beans.Service serviceRecord;
+ List<org.onap.so.db.catalog.beans.Service> serviceRecordList;
+ ServiceRecipe recipe = null;
+
+ if (alaCarteFlag) {
+ serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
+ if (serviceRecord != null) {
+ recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(serviceRecord.getModelUUID(),
+ action.toString());
+ }
+ } else {
+ serviceRecord = catalogDbClient.getServiceByID(modelInfo.getModelVersionId());
+ recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(modelInfo.getModelVersionId(),
+ action.toString());
+ if (recipe == null) {
+ serviceRecordList = catalogDbClient
+ .getServiceByModelInvariantUUIDOrderByModelVersionDesc(modelInfo.getModelInvariantId());
+ if (!serviceRecordList.isEmpty()) {
+ for (org.onap.so.db.catalog.beans.Service record : serviceRecordList) {
+ recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(record.getModelUUID(),
+ action.toString());
+ if (recipe != null) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // if an aLaCarte flag was sent in the request, throw an error if the recipe was not found
+ RequestParameters reqParam = requestDetails.getRequestParameters();
+ if (reqParam != null && alaCarteFlag && recipe == null) {
+ return null;
+ } else if (!alaCarteFlag && recipe != null && Action.createInstance.equals(action)) {
+ mapToLegacyRequest(requestDetails);
+ } else if (recipe == null) { // aLaCarte wasn't sent, so we'll try the default
+ serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
+ recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(serviceRecord.getModelUUID(),
+ action.toString());
+ }
+ if (modelInfo.getModelVersionId() == null) {
+ modelInfo.setModelVersionId(serviceRecord.getModelUUID());
+ }
+ if (recipe == null) {
+ return null;
+ }
+ return new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout());
+ }
+
+ protected void mapToLegacyRequest(RequestDetails requestDetails) throws IOException {
+ RequestParameters reqParam;
+ if (requestDetails.getRequestParameters() == null) {
+ reqParam = new RequestParameters();
+ } else {
+ reqParam = requestDetails.getRequestParameters();
+ }
+ if (requestDetails.getCloudConfiguration() == null) {
+ CloudConfiguration cloudConfig = configureCloudConfig(reqParam);
+ if (cloudConfig != null) {
+ requestDetails.setCloudConfiguration(cloudConfig);
+ }
+ }
+
+ List<Map<String, Object>> userParams = configureUserParams(reqParam);
+ if (!userParams.isEmpty()) {
+ if (reqParam == null) {
+ requestDetails.setRequestParameters(new RequestParameters());
+ }
+ requestDetails.getRequestParameters().setUserParams(userParams);
+ }
+ }
+
+ private Service serviceMapper(Map<String, Object> params) throws IOException {
+ ObjectMapper obj = new ObjectMapper();
+ String input = obj.writeValueAsString(params.get("service"));
+ return obj.readValue(input, Service.class);
+ }
+
+ private void addUserParams(Map<String, Object> targetUserParams, List<Map<String, String>> sourceUserParams) {
+ for (Map<String, String> map : sourceUserParams) {
+ for (Map.Entry<String, String> entry : map.entrySet()) {
+ targetUserParams.put(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ protected List<Map<String, Object>> configureUserParams(RequestParameters reqParams) throws IOException {
+ logger.debug("Configuring UserParams for Macro Request");
+ Map<String, Object> userParams = new HashMap<>();
+
+ for (Map<String, Object> params : reqParams.getUserParams()) {
+ if (params.containsKey("service")) {
+ Service service = serviceMapper(params);
+
+ addUserParams(userParams, service.getInstanceParams());
+
+ for (Networks network : service.getResources().getNetworks()) {
+ addUserParams(userParams, network.getInstanceParams());
+ }
+
+ for (Vnfs vnf : service.getResources().getVnfs()) {
+ addUserParams(userParams, vnf.getInstanceParams());
+
+ for (VfModules vfModule : vnf.getVfModules()) {
+ addUserParams(userParams, vfModule.getInstanceParams());
+ }
+ }
+ }
+ }
+
+ return mapFlatMapToNameValue(userParams);
+ }
+
+ protected List<Map<String, Object>> mapFlatMapToNameValue(Map<String, Object> flatMap) {
+ List<Map<String, Object>> targetUserParams = new ArrayList<>();
+
+ for (Map.Entry<String, Object> map : flatMap.entrySet()) {
+ Map<String, Object> targetMap = new HashMap<>();
+ targetMap.put(NAME, map.getKey());
+ targetMap.put(VALUE, map.getValue());
+ targetUserParams.add(targetMap);
+ }
+ return targetUserParams;
+ }
+
+ protected CloudConfiguration configureCloudConfig(RequestParameters reqParams) throws IOException {
+
+ for (Map<String, Object> params : reqParams.getUserParams()) {
+ if (params.containsKey("service")) {
+ Service service = serviceMapper(params);
+
+ Optional<CloudConfiguration> targetConfiguration = addCloudConfig(service.getCloudConfiguration());
+
+ if (targetConfiguration.isPresent()) {
+ return targetConfiguration.get();
+ } else {
+ for (Networks network : service.getResources().getNetworks()) {
+ targetConfiguration = addCloudConfig(network.getCloudConfiguration());
+ if (targetConfiguration.isPresent()) {
+ return targetConfiguration.get();
+ }
+ }
+
+ for (Vnfs vnf : service.getResources().getVnfs()) {
+ targetConfiguration = addCloudConfig(vnf.getCloudConfiguration());
+
+ if (targetConfiguration.isPresent()) {
+ return targetConfiguration.get();
+ }
+
+ for (VfModules vfModule : vnf.getVfModules()) {
+ targetConfiguration = addCloudConfig(vfModule.getCloudConfiguration());
+
+ if (targetConfiguration.isPresent()) {
+ return targetConfiguration.get();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private RecipeLookupResult getDefaultVnfUri(ServiceInstancesRequest sir, Actions action) {
+ String defaultSource = getDefaultModel(sir);
+ VnfRecipe vnfRecipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
+ if (vnfRecipe == null) {
+ return null;
+ }
+ return new RecipeLookupResult(vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout());
+ }
+
+
+ private RecipeLookupResult getNetworkUri(ServiceInstancesRequest sir, Actions action) throws ValidationException {
+ String defaultNetworkType = getDefaultModel(sir);
+ ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
+ String modelName = modelInfo.getModelName();
+ Recipe recipe = null;
+
+ if (modelInfo.getModelCustomizationId() != null) {
+ NetworkResourceCustomization networkResourceCustomization = catalogDbClient
+ .getNetworkResourceCustomizationByModelCustomizationUUID(modelInfo.getModelCustomizationId());
+ if (networkResourceCustomization != null) {
+ NetworkResource networkResource = networkResourceCustomization.getNetworkResource();
+ if (networkResource != null) {
+ if (modelInfo.getModelVersionId() == null) {
+ modelInfo.setModelVersionId(networkResource.getModelUUID());
+ }
+ recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(networkResource.getModelName(),
+ action.toString());
+ } else {
+ throw new ValidationException("no catalog entry found");
+ }
+ } else if (action != Action.deleteInstance) {
+ throw new ValidationException("modelCustomizationId for networkResourceCustomization lookup", true);
+ }
+ } else {
+ // ok for version < 3 and action delete
+ if (modelName != null) {
+ recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(modelName, action.toString());
+ }
+ }
+
+ if (recipe == null) {
+ recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(defaultNetworkType, action.toString());
+ }
+
+ return recipe != null ? new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout()) : null;
+ }
+
+
+ private Optional<CloudConfiguration> addCloudConfig(CloudConfiguration sourceCloudConfiguration) {
+ CloudConfiguration targetConfiguration = new CloudConfiguration();
+ if (sourceCloudConfiguration != null) {
+ targetConfiguration.setAicNodeClli(sourceCloudConfiguration.getAicNodeClli());
+ targetConfiguration.setTenantId(sourceCloudConfiguration.getTenantId());
+ targetConfiguration.setLcpCloudRegionId(sourceCloudConfiguration.getLcpCloudRegionId());
+ targetConfiguration.setCloudOwner(sourceCloudConfiguration.getCloudOwner());
+ return Optional.of(targetConfiguration);
+ }
+ return Optional.empty();
+ }
+
+ private RecipeLookupResult getVnfOrVfModuleUri(ServiceInstancesRequest servInstReq, Actions action)
+ throws ValidationException {
+
+ ModelInfo modelInfo = servInstReq.getRequestDetails().getModelInfo();
+ String vnfComponentType = modelInfo.getModelType().name();
+
+ RelatedInstanceList[] instanceList = null;
+ if (servInstReq.getRequestDetails() != null) {
+ instanceList = servInstReq.getRequestDetails().getRelatedInstanceList();
+ }
+
+ Recipe recipe;
+ String defaultSource = getDefaultModel(servInstReq);
+ String modelCustomizationId = modelInfo.getModelCustomizationId();
+ String modelCustomizationName = modelInfo.getModelCustomizationName();
+ String relatedInstanceModelVersionId = null;
+ String relatedInstanceModelInvariantId = null;
+ String relatedInstanceVersion = null;
+ String relatedInstanceModelCustomizationName = null;
+
+ if (instanceList != null) {
+
+ for (RelatedInstanceList relatedInstanceList : instanceList) {
+
+ RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance();
+ ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo();
+ if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) {
+ relatedInstanceModelVersionId = relatedInstanceModelInfo.getModelVersionId();
+ relatedInstanceVersion = relatedInstanceModelInfo.getModelVersion();
+ }
+
+ if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf)) {
+ relatedInstanceModelVersionId = relatedInstanceModelInfo.getModelVersionId();
+ relatedInstanceModelInvariantId = relatedInstanceModelInfo.getModelInvariantId();
+ relatedInstanceVersion = relatedInstanceModelInfo.getModelVersion();
+ relatedInstanceModelCustomizationName = relatedInstanceModelInfo.getModelCustomizationName();
+ }
+ }
+
+ if (modelInfo.getModelType().equals(ModelType.vnf)) {
+ // a. For a vnf request (only create, no update currently):
+ // i. (v3-v4) If modelInfo.modelCustomizationId is provided, use it to validate catalog DB has record in
+ // vnf_resource_customization.model_customization_uuid.
+ // ii. (v2-v4) If modelInfo.modelCustomizationId is NOT provided (because it is a pre-1702 ASDC model or
+ // pre-v3), then modelInfo.modelCustomizationName must have
+ // been provided (else create request should be rejected). APIH should use the
+ // relatedInstance.modelInfo[service].modelVersionId** + modelInfo[vnf].modelCustomizationName
+ // to “join�? service_to_resource_customizations with vnf_resource_customization to confirm a
+ // vnf_resource_customization.model_customization_uuid record exists.
+ // **If relatedInstance.modelInfo[service].modelVersionId was not provided, use
+ // relatedInstance.modelInfo[service].modelInvariantId + modelVersion instead to lookup modelVersionId
+ // (MODEL_UUID) in SERVICE table.
+ // iii. Regardless of how the value was provided/obtained above, APIH must always populate
+ // vnfModelCustomizationId in bpmnRequest. It would be assumed it was MSO generated
+ // during 1707 data migration if VID did not provide it originally on request.
+ // iv. Note: continue to construct the “vnf-type�? value and pass to BPMN (must still be populated
+ // in A&AI).
+ // 1. If modelCustomizationName is NOT provided on a vnf/vfModule request, use modelCustomizationId to
+ // look it up in our catalog to construct vnf-type value to pass to BPMN.
+
+ VnfResource vnfResource = null;
+ VnfResourceCustomization vrc = null;
+ // Validation for vnfResource
+
+ if (modelCustomizationId != null) {
+ vrc = catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(modelCustomizationId);
+ if (vrc != null) {
+ vnfResource = vrc.getVnfResources();
+ }
+ } else {
+ org.onap.so.db.catalog.beans.Service service =
+ catalogDbClient.getServiceByID(relatedInstanceModelVersionId);
+ if (service == null) {
+ service = catalogDbClient.getServiceByModelVersionAndModelInvariantUUID(relatedInstanceVersion,
+ relatedInstanceModelInvariantId);
+ }
+
+ if (service == null) {
+ throw new ValidationException("service in relatedInstance");
+ }
+ for (VnfResourceCustomization vnfResourceCustom : service.getVnfCustomizations()) {
+ if (vnfResourceCustom.getModelInstanceName().equals(modelCustomizationName)) {
+ vrc = vnfResourceCustom;
+ }
+ }
+
+ if (vrc != null) {
+ vnfResource = vrc.getVnfResources();
+ modelInfo.setModelCustomizationId(vrc.getModelCustomizationUUID());
+ modelInfo.setModelCustomizationUuid(vrc.getModelCustomizationUUID());
+ }
+ }
+
+ if (vnfResource == null) {
+ throw new ValidationException("vnfResource");
+ } else {
+ if (modelInfo.getModelVersionId() == null) {
+ modelInfo.setModelVersionId(vnfResource.getModelUUID());
+ }
+ }
+
+ VnfRecipe vnfRecipe = null;
+
+ if (vrc != null) {
+ String nfRole = vrc.getNfRole();
+ if (nfRole != null) {
+ vnfRecipe =
+ catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(vrc.getNfRole(), action.toString());
+ }
+ }
+
+ if (vnfRecipe == null) {
+ vnfRecipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
+ }
+
+ if (vnfRecipe == null) {
+ return null;
+ }
+
+ return new RecipeLookupResult(vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout());
+ } else {
+ /*
+ * (v5-v7) If modelInfo.modelCustomizationId is NOT provided (because it is a pre-1702 ASDC model or
+ * pre-v3), then modelInfo.modelCustomizationName must have // been provided (else create request should
+ * be rejected). APIH should use the relatedInstance.modelInfo[vnf].modelVersionId +
+ * modelInfo[vnf].modelCustomizationName // to join vnf_to_resource_customizations with
+ * vf_resource_customization to confirm a vf_resource_customization.model_customization_uuid record
+ * exists. // Once the vnfs model_customization_uuid has been obtained, use it to find all vfModule
+ * customizations for that vnf customization in the vnf_res_custom_to_vf_module_custom join table. //
+ * For each vf_module_cust_model_customization_uuid value returned, use that UUID to query
+ * vf_module_customization table along with modelInfo[vfModule|volumeGroup].modelVersionId to // confirm
+ * record matches request data (and to identify the modelCustomizationId associated with the vfModule in
+ * the request). This means taking each record found // in vf_module_customization and looking up in
+ * vf_module (using vf_module_customization’s FK into vf_module) to find a match on
+ * MODEL_INVARIANT_UUID (modelInvariantId) // and MODEL_VERSION (modelVersion).
+ */
+ VfModuleCustomization vfmc = null;
+ VnfResource vnfr;
+ VnfResourceCustomization vnfrc;
+ VfModule vfModule = null;
+
+ if (modelInfo.getModelCustomizationId() != null) {
+ vfmc = catalogDbClient
+ .getVfModuleCustomizationByModelCuztomizationUUID(modelInfo.getModelCustomizationId());
+ } else {
+ vnfr = catalogDbClient.getVnfResourceByModelUUID(relatedInstanceModelVersionId);
+ if (vnfr == null) {
+ vnfr = catalogDbClient.getFirstVnfResourceByModelInvariantUUIDAndModelVersion(
+ relatedInstanceModelInvariantId, relatedInstanceVersion);
+ }
+ vnfrc = catalogDbClient.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources(
+ relatedInstanceModelCustomizationName, vnfr);
+
+ List<VfModuleCustomization> list = vnfrc.getVfModuleCustomizations();
+
+ String vfModuleModelUUID = modelInfo.getModelVersionId();
+ for (VfModuleCustomization vf : list) {
+ VfModuleCustomization vfmCustom;
+ if (vfModuleModelUUID != null) {
+ vfmCustom = catalogDbClient
+ .getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
+ vf.getModelCustomizationUUID(), vfModuleModelUUID);
+ if (vfmCustom != null) {
+ vfModule = vfmCustom.getVfModule();
+ }
+ } else {
+ vfmCustom = catalogDbClient
+ .getVfModuleCustomizationByModelCuztomizationUUID(vf.getModelCustomizationUUID());
+ if (vfmCustom != null) {
+ vfModule = vfmCustom.getVfModule();
+ } else {
+ vfModule = catalogDbClient.getVfModuleByModelInvariantUUIDAndModelVersion(
+ relatedInstanceModelInvariantId, relatedInstanceVersion);
+ }
+ }
+
+ if (vfModule != null) {
+ modelInfo.setModelCustomizationId(vf.getModelCustomizationUUID());
+ modelInfo.setModelCustomizationUuid(vf.getModelCustomizationUUID());
+ break;
+ }
+ }
+ }
+
+ if (vfmc == null && vfModule == null) {
+ throw new ValidationException("vfModuleCustomization");
+ } else if (vfModule == null && vfmc != null) {
+ vfModule = vfmc.getVfModule(); // can't be null as vfModuleModelUUID is not-null property in
+ // VfModuleCustomization table
+ }
+
+ if (modelInfo.getModelVersionId() == null) {
+ modelInfo.setModelVersionId(vfModule.getModelUUID());
+ }
+
+
+ recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ vfModule.getModelUUID(), vnfComponentType, action.toString());
+ if (recipe == null) {
+ List<VfModule> vfModuleRecords = catalogDbClient
+ .getVfModuleByModelInvariantUUIDOrderByModelVersionDesc(vfModule.getModelInvariantUUID());
+ if (!vfModuleRecords.isEmpty()) {
+ for (VfModule record : vfModuleRecords) {
+ recipe = catalogDbClient
+ .getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ record.getModelUUID(), vnfComponentType, action.toString());
+ if (recipe != null) {
+ break;
+ }
+ }
+ }
+ }
+ if (recipe == null) {
+ recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ defaultSource, vnfComponentType, action.toString());
+ if (recipe == null) {
+ recipe = catalogDbClient.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(
+ vnfComponentType, action.toString());
+ }
+
+ if (recipe == null) {
+ return null;
+ }
+ }
+ }
+ } else {
+
+ if (modelInfo.getModelType().equals(ModelType.vnf)) {
+ recipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
+ if (recipe == null) {
+ return null;
+ }
+ } else {
+ recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ defaultSource, vnfComponentType, action.toString());
+
+ if (recipe == null) {
+ return null;
+ }
+ }
+ }
+
+ return new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout());
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java
index ed300d95c2..65537cbba0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java
@@ -57,11 +57,17 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpClientErrorException;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Path("onap/so/infra/orchestrationRequests")
-@Api(value = "onap/so/infra/orchestrationRequests")
+@OpenAPIDefinition(info = @Info(title = "onap/so/infra/orchestrationRequests"))
+
@Component
public class ResumeOrchestrationRequest {
private static Logger logger = LoggerFactory.getLogger(ResumeOrchestrationRequest.class);
@@ -84,7 +90,8 @@ public class ResumeOrchestrationRequest {
@Path("/{version:[vV][7]}/{requestId}/resume")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Resume request for a given requestId", response = Response.class)
+ @Operation(description = "Resume request for a given requestId", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response resumeOrchestrationRequest(@PathParam("requestId") String requestId,
@PathParam("version") String version, @Context ContainerRequestContext requestContext) throws ApiException {
@@ -115,8 +122,9 @@ public class ResumeOrchestrationRequest {
if (infraActiveRequest == null) {
logger.error("No infraActiveRequest record found for requestId: {} in requesteDb lookup", requestId);
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
- ErrorCode.BusinessProcesssError).build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.BusinessProcessError)
+ .build();
ValidateException validateException = new ValidateException.Builder(
"Null response from requestDB when searching by requestId: " + requestId, HttpStatus.SC_NOT_FOUND,
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo).build();
@@ -144,7 +152,7 @@ public class ResumeOrchestrationRequest {
Boolean aLaCarte = sir.getRequestDetails().getRequestParameters().getALaCarte();
String pnfCorrelationId = serviceInstances.getPnfCorrelationId(sir);
- RecipeLookupResult recipeLookupResult = serviceInstances.getServiceInstanceOrchestrationURI(sir, action,
+ RecipeLookupResult recipeLookupResult = requestHandlerUtils.getServiceInstanceOrchestrationURI(sir, action,
msoRequest.getAlacarteFlag(sir), currentActiveRequest);
requestDbSave(currentActiveRequest);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index 5b827d9cf8..175b212c86 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -24,10 +24,7 @@
package org.onap.so.apihandlerinfra;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.Optional;
import javax.transaction.Transactional;
import javax.ws.rs.Consumes;
@@ -47,21 +44,14 @@ import org.onap.so.apihandler.common.CommonConstants;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
-import org.onap.so.apihandlerinfra.exceptions.RecipeNotFoundException;
import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
+import org.onap.so.apihandlerinfra.infra.rest.BpmnRequestBuilder;
+import org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFoundException;
import org.onap.so.apihandlerinfra.infra.rest.handler.AbstractRestHandler;
+import org.onap.so.apihandlerinfra.infra.rest.validators.RequestValidatorListenerRunner;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
import org.onap.so.constants.Status;
-import org.onap.so.db.catalog.beans.NetworkResource;
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.Recipe;
-import org.onap.so.db.catalog.beans.ServiceRecipe;
-import org.onap.so.db.catalog.beans.VfModule;
-import org.onap.so.db.catalog.beans.VfModuleCustomization;
-import org.onap.so.db.catalog.beans.VnfRecipe;
-import org.onap.so.db.catalog.beans.VnfResource;
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -71,38 +61,31 @@ import org.onap.so.logger.MessageEnum;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
-import org.onap.so.serviceinstancebeans.Networks;
-import org.onap.so.serviceinstancebeans.RelatedInstance;
-import org.onap.so.serviceinstancebeans.RelatedInstanceList;
import org.onap.so.serviceinstancebeans.RequestDetails;
-import org.onap.so.serviceinstancebeans.RequestParameters;
import org.onap.so.serviceinstancebeans.RequestReferences;
-import org.onap.so.serviceinstancebeans.Service;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.onap.so.serviceinstancebeans.VfModules;
-import org.onap.so.serviceinstancebeans.Vnfs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/serviceInstantiation")
-@Api(value = "/onap/so/infra/serviceInstantiation", description = "Infrastructure API Requests for Service Instances")
+@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/serviceInstantiation",
+ description = "Infrastructure API Requests for Service Instances"))
public class ServiceInstances extends AbstractRestHandler {
private static Logger logger = LoggerFactory.getLogger(MsoRequest.class);
- private static String NAME = "name";
- private static String VALUE = "value";
private static String uriPrefix = "/serviceInstantiation/";
private static final String SAVE_TO_DB = "save instance to db";
@@ -124,11 +107,18 @@ public class ServiceInstances extends AbstractRestHandler {
@Autowired
private RequestHandlerUtils requestHandlerUtils;
+ @Autowired
+ private RequestValidatorListenerRunner requestValidatorListenerRunner;
+
+ @Autowired
+ private BpmnRequestBuilder bpmnRequestBuilder;
+
@POST
@Path("/{version:[vV][5-7]}/serviceInstances")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create a Service Instance on a version provided", response = Response.class)
+ @Operation(description = "Create a Service Instance on a version provided", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createServiceInstance(String request, @PathParam("version") String version,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -141,7 +131,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/activate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Activate provided Service Instance", response = Response.class)
+ @Operation(description = "Activate provided Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response activateServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -157,7 +148,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/deactivate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Deactivate provided Service Instance", response = Response.class)
+ @Operation(description = "Deactivate provided Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deactivateServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -173,7 +165,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided Service Instance", response = Response.class)
+ @Operation(description = "Delete provided Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -189,7 +182,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/serviceInstances/assign")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Assign Service Instance", response = Response.class)
+ @Operation(description = "Assign Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response assignServiceInstance(String request, @PathParam("version") String version,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -202,7 +196,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/unassign")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Unassign Service Instance", response = Response.class)
+ @Operation(description = "Unassign Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response unassignServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -218,7 +213,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create Port Mirroring Configuration", response = Response.class)
+ @Operation(description = "Create Port Mirroring Configuration", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createPortConfiguration(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -234,7 +230,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided Port", response = Response.class)
+ @Operation(description = "Delete provided Port", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deletePortConfiguration(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -252,7 +249,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Enable Port Mirroring", response = Response.class)
+ @Operation(description = "Enable Port Mirroring", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response enablePort(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -270,7 +268,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Disable Port Mirroring", response = Response.class)
+ @Operation(description = "Disable Port Mirroring", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response disablePort(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -288,7 +287,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Activate Port Mirroring", response = Response.class)
+ @Operation(description = "Activate Port Mirroring", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response activatePort(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -306,7 +306,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Deactivate Port Mirroring", response = Response.class)
+ @Operation(description = "Deactivate Port Mirroring", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deactivatePort(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -324,7 +325,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/addRelationships")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Add Relationships to a Service Instance", response = Response.class)
+ @Operation(description = "Add Relationships to a Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response addRelationships(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -340,7 +342,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/removeRelationships")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Remove Relationships from Service Instance", response = Response.class)
+ @Operation(description = "Remove Relationships from Service Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response removeRelationships(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -356,7 +359,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create VNF on a specified version and serviceInstance", response = Response.class)
+ @Operation(description = "Create VNF on a specified version and serviceInstance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createVnfInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -377,7 +381,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Replace provided VNF instance", response = Response.class)
+ @Operation(description = "Replace provided VNF instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response replaceVnfInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -394,8 +399,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update VNF on a specified version, serviceInstance and vnfInstance",
- response = Response.class)
+ @Operation(description = "Update VNF on a specified version, serviceInstance and vnfInstance",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response updateVnfInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -412,7 +418,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Apply updated configuration", response = Response.class)
+ @Operation(description = "Apply updated configuration", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response applyUpdatedConfig(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -428,7 +435,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/recreate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Recreate VNF Instance", response = Response.class)
+ @Operation(description = "Recreate VNF Instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
public Response recreateVnfInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -440,12 +448,12 @@ public class ServiceInstances extends AbstractRestHandler {
requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
}
-
@DELETE
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided VNF instance", response = Response.class)
+ @Operation(description = "Delete provided VNF instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteVnfInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -462,8 +470,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create VfModule on a specified version, serviceInstance and vnfInstance",
- response = Response.class)
+ @Operation(description = "Create VfModule on a specified version, serviceInstance and vnfInstance",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createVfModuleInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -480,8 +489,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create VfModule on a specified version, serviceInstance and vnfInstance",
- response = Response.class)
+ @Operation(description = "Create VfModule on a specified version, serviceInstance and vnfInstance",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response replaceVfModuleInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -500,8 +510,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule",
- response = Response.class)
+ @Operation(description = "Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response updateVfModuleInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -520,7 +531,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Perform VNF software update", response = Response.class)
+ @Operation(description = "Perform VNF software update", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response inPlaceSoftwareUpdate(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -537,7 +549,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided VfModule instance", response = Response.class)
+ @Operation(description = "Delete provided VfModule instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteVfModuleInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -556,7 +569,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Deactivate and Cloud Delete VfModule instance", response = Response.class)
+ @Operation(description = "Deactivate and Cloud Delete VfModule instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deactivateAndCloudDeleteVfModuleInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -576,7 +590,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "VF Auto Scale Out", response = Response.class)
+ @Operation(description = "VF Auto Scale Out", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response scaleOutVfModule(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -589,13 +604,13 @@ public class ServiceInstances extends AbstractRestHandler {
requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
}
-
@POST
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create VolumeGroup on a specified version, serviceInstance, vnfInstance",
- response = Response.class)
+ @Operation(description = "Create VolumeGroup on a specified version, serviceInstance, vnfInstance",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createVolumeGroupInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -612,8 +627,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup",
- response = Response.class)
+ @Operation(description = "Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response updateVolumeGroupInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -632,7 +648,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided VolumeGroup instance", response = Response.class)
+ @Operation(description = "Delete provided VolumeGroup instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteVolumeGroupInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
@@ -651,8 +668,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create NetworkInstance on a specified version and serviceInstance ",
- response = Response.class)
+ @Operation(description = "Create NetworkInstance on a specified version and serviceInstance ",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createNetworkInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
@@ -668,8 +686,9 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update VolumeGroup on a specified version, serviceInstance, networkInstance",
- response = Response.class)
+ @Operation(description = "Update VolumeGroup on a specified version, serviceInstance, networkInstance",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response updateNetworkInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -687,7 +706,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided Network instance", response = Response.class)
+ @Operation(description = "Delete provided Network instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteNetworkInstance(String request, @PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
@@ -705,7 +725,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/instanceGroups")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create instanceGroups", response = Response.class)
+ @Operation(description = "Create instanceGroups", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createInstanceGroups(String request, @PathParam("version") String version,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -718,7 +739,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete instanceGroup", response = Response.class)
+ @Operation(description = "Delete instanceGroup", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteInstanceGroups(@PathParam("version") String version,
@PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext)
@@ -734,7 +756,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}/addMembers")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Add instanceGroup members", response = Response.class)
+ @Operation(description = "Add instanceGroup members", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response addInstanceGroupMembers(String request, @PathParam("version") String version,
@PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext)
@@ -750,7 +773,8 @@ public class ServiceInstances extends AbstractRestHandler {
@Path("/{version:[vV][7]}/instanceGroups/{instanceGroupId}/removeMembers")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Remove instanceGroup members", response = Response.class)
+ @Operation(description = "Remove instanceGroup members", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response removeInstanceGroupMembers(String request, @PathParam("version") String version,
@PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext)
@@ -762,8 +786,36 @@ public class ServiceInstances extends AbstractRestHandler {
requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
}
+ /**
+ * This method is used for POST a request to the BPEL client (BPMN).
+ *
+ * Convert the requestJson to ServiceInstanceRequest(sir), create the msoRequest object, check whether this request
+ * is already being processed in requestdb for duplicate check.
+ *
+ * Based on the alacarte flag, sir and msoRequest will do the recipe lookup from the service and servicerecipe table
+ * of catalogdb, and get the OrchestrationURI.
+ *
+ * If the present request is not the duplicate request then this request will be saved in the requestdb. and will
+ * POST a request to the BPMN engine at the OrchestrationURI fetched.
+ *
+ * @param requestJSON Json fetched as body in the API call
+ * @param action Type of action to be performed
+ * @param instanceIdMap Map of instance ids of service/vnf/vf/configuration etc..
+ * @param version Supported version of API
+ * @param requestId Unique id for the request
+ * @param requestUri
+ * @return response object
+ * @throws ApiException
+ */
public Response serviceInstances(String requestJSON, Actions action, HashMap<String, String> instanceIdMap,
String version, String requestId, String requestUri) throws ApiException {
+ return serviceInstances(requestJSON, action, instanceIdMap, version, requestId, requestUri, null);
+
+ }
+
+ public Response serviceInstances(String requestJSON, Actions action, HashMap<String, String> instanceIdMap,
+ String version, String requestId, String requestUri, HashMap<String, String> queryParams)
+ throws ApiException {
String serviceInstanceId;
Boolean aLaCarte = null;
ServiceInstancesRequest sir;
@@ -771,16 +823,28 @@ public class ServiceInstances extends AbstractRestHandler {
sir = requestHandlerUtils.convertJsonToServiceInstanceRequest(requestJSON, action, requestId, requestUri);
action = handleReplaceInstance(action, sir);
+ requestValidatorListenerRunner.runValidations(requestUri, instanceIdMap, sir, queryParams);
+
String requestScope = requestHandlerUtils.deriveRequestScope(action, sir, requestUri);
InfraActiveRequests currentActiveReq =
msoRequest.createRequestObject(sir, action, requestId, Status.IN_PROGRESS, requestJSON, requestScope);
if (sir.getRequestDetails().getRequestParameters() != null) {
aLaCarte = sir.getRequestDetails().getRequestParameters().getALaCarte();
}
+
requestHandlerUtils.parseRequest(sir, instanceIdMap, action, version, requestJSON, aLaCarte, requestId,
currentActiveReq);
+ if ((action == Action.replaceInstance || action == Action.replaceInstanceRetainAssignments)
+ && (requestScope.equals(ModelType.vnf.toString()) || requestScope.equals(ModelType.vfModule.toString()))
+ && sir.getRequestDetails().getCloudConfiguration() == null) {
+ CloudConfiguration cloudConfiguration =
+ getCloudConfigurationOnReplace(requestScope, instanceIdMap, currentActiveReq);
+ sir.getRequestDetails().setCloudConfiguration(cloudConfiguration);
+ setCloudConfigurationCurrentActiveRequest(cloudConfiguration, currentActiveReq);
+ }
requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap);
+
int requestVersion = Integer.parseInt(version.substring(1));
String instanceName = null;
if (sir.getRequestDetails().getRequestInfo() != null) {
@@ -798,19 +862,9 @@ public class ServiceInstances extends AbstractRestHandler {
currentActiveReq.setNetworkType(networkType);
}
- InfraActiveRequests dup = null;
- boolean inProgress = false;
+ requestHandlerUtils.checkForDuplicateRequests(action, instanceIdMap, requestScope, currentActiveReq,
+ instanceName);
- dup = requestHandlerUtils.duplicateCheck(action, instanceIdMap, instanceName, requestScope, currentActiveReq);
-
- if (dup != null) {
- inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq);
- }
-
- if (dup != null && inProgress) {
- requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, instanceName,
- requestScope, dup);
- }
ServiceInstancesResponse serviceResponse = new ServiceInstancesResponse();
RequestReferences referencesResponse = new RequestReferences();
@@ -819,7 +873,7 @@ public class ServiceInstances extends AbstractRestHandler {
serviceResponse.setRequestReferences(referencesResponse);
RecipeLookupResult recipeLookupResult =
- getServiceInstanceOrchestrationURI(sir, action, alaCarteFlag, currentActiveReq);
+ requestHandlerUtils.getServiceInstanceOrchestrationURI(sir, action, alaCarteFlag, currentActiveReq);
String serviceInstanceType = requestHandlerUtils.getServiceType(requestScope, sir, alaCarteFlag);
ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
@@ -864,6 +918,7 @@ public class ServiceInstances extends AbstractRestHandler {
try {
infraActiveRequestsClient.save(currentActiveReq);
} catch (Exception e) {
+ logger.error("Exception occurred", e);
ErrorLoggerInfo errorLoggerInfo =
new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError)
.errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
@@ -871,12 +926,15 @@ public class ServiceInstances extends AbstractRestHandler {
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build();
}
- if (!requestScope.equalsIgnoreCase(ModelType.service.name()) && action != Action.recreateInstance) {
+ if (!requestScope.equalsIgnoreCase(ModelType.service.name()) && action != Action.recreateInstance
+ && !(requestScope.equalsIgnoreCase(ModelType.vnf.name())
+ && (action == Action.replaceInstance || action == Action.replaceInstanceRetainAssignments))) {
aLaCarte = true;
} else if (aLaCarte == null) {
aLaCarte = false;
}
+
RequestClientParameter requestClientParameter = null;
try {
requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId)
@@ -889,6 +947,7 @@ public class ServiceInstances extends AbstractRestHandler {
.setApiVersion(apiVersion).setALaCarte(aLaCarte).setRequestUri(requestUri)
.setInstanceGroupId(instanceGroupId).build();
} catch (IOException e) {
+ logger.error("Exception occurred", e);
ErrorLoggerInfo errorLoggerInfo =
new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.SchemaError)
.errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
@@ -914,6 +973,21 @@ public class ServiceInstances extends AbstractRestHandler {
return action;
}
+ /**
+ * This method deletes the Instance Groups.
+ *
+ * This method will check whether the request is not duplicate in requestdb. if its not then will save as a new
+ * request. And will send a POST request to BEPL client to delete the Insatnce Groups.
+ *
+ * @param action
+ * @param instanceIdMap
+ * @param version
+ * @param requestId
+ * @param requestUri
+ * @param requestContext
+ * @return
+ * @throws ApiException
+ */
public Response deleteInstanceGroups(Actions action, HashMap<String, String> instanceIdMap, String version,
String requestId, String requestUri, ContainerRequestContext requestContext) throws ApiException {
String instanceGroupId = instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID);
@@ -940,18 +1014,7 @@ public class ServiceInstances extends AbstractRestHandler {
throw validateException;
}
- InfraActiveRequests dup =
- requestHandlerUtils.duplicateCheck(action, instanceIdMap, null, requestScope, currentActiveReq);
- boolean inProgress = false;
-
- if (dup != null) {
- inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq);
- }
-
- if (dup != null && inProgress) {
- requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, null, requestScope,
- dup);
- }
+ requestHandlerUtils.checkForDuplicateRequests(action, instanceIdMap, requestScope, currentActiveReq, null);
ServiceInstancesResponse serviceResponse = new ServiceInstancesResponse();
@@ -967,6 +1030,7 @@ public class ServiceInstances extends AbstractRestHandler {
try {
infraActiveRequestsClient.save(currentActiveReq);
} catch (Exception e) {
+ logger.error("Exception occurred", e);
ErrorLoggerInfo errorLoggerInfo =
new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError)
.errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
@@ -979,6 +1043,7 @@ public class ServiceInstances extends AbstractRestHandler {
.setRequestAction(action.toString()).setApiVersion(apiVersion).setALaCarte(aLaCarte)
.setRequestUri(requestUri).setInstanceGroupId(instanceGroupId).build();
+
return requestHandlerUtils.postBPELRequest(currentActiveReq, requestClientParameter,
recipeLookupResult.getOrchestrationURI(), requestScope);
}
@@ -989,582 +1054,11 @@ public class ServiceInstances extends AbstractRestHandler {
.orElse("");
}
- protected RecipeLookupResult getServiceInstanceOrchestrationURI(ServiceInstancesRequest sir, Actions action,
- boolean alaCarteFlag, InfraActiveRequests currentActiveReq) throws ApiException {
- RecipeLookupResult recipeLookupResult = null;
- // if the aLaCarte flag is set to TRUE, the API-H should choose the VID_DEFAULT recipe for the requested action
- ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
- // Query MSO Catalog DB
-
- if (action == Action.applyUpdatedConfig || action == Action.inPlaceSoftwareUpdate) {
- recipeLookupResult = getDefaultVnfUri(sir, action);
- } else if (action == Action.addMembers || action == Action.removeMembers) {
- recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
- } else if (modelInfo.getModelType().equals(ModelType.service)) {
- try {
- recipeLookupResult = getServiceURI(sir, action, alaCarteFlag);
- } catch (IOException e) {
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
- .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
-
-
- ValidateException validateException =
- new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
- ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
-
- requestHandlerUtils.updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
-
- throw validateException;
- }
- } else if (modelInfo.getModelType().equals(ModelType.vfModule)
- || modelInfo.getModelType().equals(ModelType.volumeGroup)
- || modelInfo.getModelType().equals(ModelType.vnf)) {
- try {
- recipeLookupResult = getVnfOrVfModuleUri(sir, action);
- } catch (ValidationException e) {
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
- .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
-
-
- ValidateException validateException =
- new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
- ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
-
- requestHandlerUtils.updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
-
- throw validateException;
- }
- } else if (modelInfo.getModelType().equals(ModelType.network)) {
- try {
- recipeLookupResult = getNetworkUri(sir, action);
- } catch (ValidationException e) {
-
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError)
- .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
-
-
- ValidateException validateException =
- new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST,
- ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build();
- requestHandlerUtils.updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage());
-
- throw validateException;
- }
- } else if (modelInfo.getModelType().equals(ModelType.instanceGroup)) {
- recipeLookupResult = new RecipeLookupResult("/mso/async/services/WorkflowActionBB", 180);
- }
-
- if (recipeLookupResult == null) {
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError)
- .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
-
-
- RecipeNotFoundException recipeNotFoundExceptionException =
- new RecipeNotFoundException.Builder("Recipe could not be retrieved from catalog DB.",
- HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_GENERAL_SERVICE_ERROR).errorInfo(errorLoggerInfo)
- .build();
-
- requestHandlerUtils.updateStatus(currentActiveReq, Status.FAILED,
- recipeNotFoundExceptionException.getMessage());
- throw recipeNotFoundExceptionException;
- }
- return recipeLookupResult;
- }
-
- protected RecipeLookupResult getServiceURI(ServiceInstancesRequest servInstReq, Actions action,
- boolean alaCarteFlag) throws IOException {
- // SERVICE REQUEST
- // Construct the default service name
- // TODO need to make this a configurable property
- String defaultServiceModelName = requestHandlerUtils.getDefaultModel(servInstReq);
- RequestDetails requestDetails = servInstReq.getRequestDetails();
- ModelInfo modelInfo = requestDetails.getModelInfo();
- org.onap.so.db.catalog.beans.Service serviceRecord;
- List<org.onap.so.db.catalog.beans.Service> serviceRecordList;
- ServiceRecipe recipe = null;
-
- if (alaCarteFlag) {
- serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
- if (serviceRecord != null) {
- recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(serviceRecord.getModelUUID(),
- action.toString());
- }
- } else {
- serviceRecord = catalogDbClient.getServiceByID(modelInfo.getModelVersionId());
- recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(modelInfo.getModelVersionId(),
- action.toString());
- if (recipe == null) {
- serviceRecordList = catalogDbClient
- .getServiceByModelInvariantUUIDOrderByModelVersionDesc(modelInfo.getModelInvariantId());
- if (!serviceRecordList.isEmpty()) {
- for (org.onap.so.db.catalog.beans.Service record : serviceRecordList) {
- recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(record.getModelUUID(),
- action.toString());
- if (recipe != null) {
- break;
- }
- }
- }
- }
- }
-
- // if an aLaCarte flag was sent in the request, throw an error if the recipe was not found
- RequestParameters reqParam = requestDetails.getRequestParameters();
- if (reqParam != null && alaCarteFlag && recipe == null) {
- return null;
- } else if (!alaCarteFlag && recipe != null && Action.createInstance.equals(action)) {
- mapToLegacyRequest(requestDetails);
- } else if (recipe == null) { // aLaCarte wasn't sent, so we'll try the default
- serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
- recipe = catalogDbClient.getFirstByServiceModelUUIDAndAction(serviceRecord.getModelUUID(),
- action.toString());
- }
- if (modelInfo.getModelVersionId() == null) {
- modelInfo.setModelVersionId(serviceRecord.getModelUUID());
- }
- if (recipe == null) {
- return null;
- }
- return new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout());
- }
-
- protected void mapToLegacyRequest(RequestDetails requestDetails) throws IOException {
- RequestParameters reqParam;
- if (requestDetails.getRequestParameters() == null) {
- reqParam = new RequestParameters();
- } else {
- reqParam = requestDetails.getRequestParameters();
- }
- if (requestDetails.getCloudConfiguration() == null) {
- CloudConfiguration cloudConfig = configureCloudConfig(reqParam);
- if (cloudConfig != null) {
- requestDetails.setCloudConfiguration(cloudConfig);
- }
- }
-
- List<Map<String, Object>> userParams = configureUserParams(reqParam);
- if (!userParams.isEmpty()) {
- if (reqParam == null) {
- requestDetails.setRequestParameters(new RequestParameters());
- }
- requestDetails.getRequestParameters().setUserParams(userParams);
- }
- }
-
- protected CloudConfiguration configureCloudConfig(RequestParameters reqParams) throws IOException {
-
- for (Map<String, Object> params : reqParams.getUserParams()) {
- if (params.containsKey("service")) {
- Service service = serviceMapper(params);
-
- Optional<CloudConfiguration> targetConfiguration = addCloudConfig(service.getCloudConfiguration());
-
- if (targetConfiguration.isPresent()) {
- return targetConfiguration.get();
- } else {
- for (Networks network : service.getResources().getNetworks()) {
- targetConfiguration = addCloudConfig(network.getCloudConfiguration());
- if (targetConfiguration.isPresent()) {
- return targetConfiguration.get();
- }
- }
-
- for (Vnfs vnf : service.getResources().getVnfs()) {
- targetConfiguration = addCloudConfig(vnf.getCloudConfiguration());
-
- if (targetConfiguration.isPresent()) {
- return targetConfiguration.get();
- }
-
- for (VfModules vfModule : vnf.getVfModules()) {
- targetConfiguration = addCloudConfig(vfModule.getCloudConfiguration());
-
- if (targetConfiguration.isPresent()) {
- return targetConfiguration.get();
- }
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private Optional<CloudConfiguration> addCloudConfig(CloudConfiguration sourceCloudConfiguration) {
- CloudConfiguration targetConfiguration = new CloudConfiguration();
- if (sourceCloudConfiguration != null) {
- targetConfiguration.setAicNodeClli(sourceCloudConfiguration.getAicNodeClli());
- targetConfiguration.setTenantId(sourceCloudConfiguration.getTenantId());
- targetConfiguration.setLcpCloudRegionId(sourceCloudConfiguration.getLcpCloudRegionId());
- targetConfiguration.setCloudOwner(sourceCloudConfiguration.getCloudOwner());
- return Optional.of(targetConfiguration);
- }
- return Optional.empty();
- }
-
- protected List<Map<String, Object>> configureUserParams(RequestParameters reqParams) throws IOException {
- logger.debug("Configuring UserParams for Macro Request");
- Map<String, Object> userParams = new HashMap<>();
-
- for (Map<String, Object> params : reqParams.getUserParams()) {
- if (params.containsKey("service")) {
- Service service = serviceMapper(params);
-
- addUserParams(userParams, service.getInstanceParams());
-
- for (Networks network : service.getResources().getNetworks()) {
- addUserParams(userParams, network.getInstanceParams());
- }
-
- for (Vnfs vnf : service.getResources().getVnfs()) {
- addUserParams(userParams, vnf.getInstanceParams());
-
- for (VfModules vfModule : vnf.getVfModules()) {
- addUserParams(userParams, vfModule.getInstanceParams());
- }
- }
- }
- }
-
- return mapFlatMapToNameValue(userParams);
- }
-
- private Service serviceMapper(Map<String, Object> params) throws IOException {
- ObjectMapper obj = new ObjectMapper();
- String input = obj.writeValueAsString(params.get("service"));
- return obj.readValue(input, Service.class);
- }
-
- private void addUserParams(Map<String, Object> targetUserParams, List<Map<String, String>> sourceUserParams) {
- for (Map<String, String> map : sourceUserParams) {
- for (Map.Entry<String, String> entry : map.entrySet()) {
- targetUserParams.put(entry.getKey(), entry.getValue());
- }
- }
- }
-
- protected List<Map<String, Object>> mapFlatMapToNameValue(Map<String, Object> flatMap) {
- List<Map<String, Object>> targetUserParams = new ArrayList<>();
-
- for (Map.Entry<String, Object> map : flatMap.entrySet()) {
- Map<String, Object> targetMap = new HashMap<>();
- targetMap.put(NAME, map.getKey());
- targetMap.put(VALUE, map.getValue());
- targetUserParams.add(targetMap);
- }
- return targetUserParams;
- }
-
- private RecipeLookupResult getVnfOrVfModuleUri(ServiceInstancesRequest servInstReq, Actions action)
- throws ValidationException {
-
- ModelInfo modelInfo = servInstReq.getRequestDetails().getModelInfo();
- String vnfComponentType = modelInfo.getModelType().name();
-
- RelatedInstanceList[] instanceList = null;
- if (servInstReq.getRequestDetails() != null) {
- instanceList = servInstReq.getRequestDetails().getRelatedInstanceList();
- }
-
- Recipe recipe;
- String defaultSource = requestHandlerUtils.getDefaultModel(servInstReq);
- String modelCustomizationId = modelInfo.getModelCustomizationId();
- String modelCustomizationName = modelInfo.getModelCustomizationName();
- String relatedInstanceModelVersionId = null;
- String relatedInstanceModelInvariantId = null;
- String relatedInstanceVersion = null;
- String relatedInstanceModelCustomizationName = null;
-
- if (instanceList != null) {
-
- for (RelatedInstanceList relatedInstanceList : instanceList) {
-
- RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance();
- ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo();
- if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) {
- relatedInstanceModelVersionId = relatedInstanceModelInfo.getModelVersionId();
- relatedInstanceVersion = relatedInstanceModelInfo.getModelVersion();
- }
-
- if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf)) {
- relatedInstanceModelVersionId = relatedInstanceModelInfo.getModelVersionId();
- relatedInstanceModelInvariantId = relatedInstanceModelInfo.getModelInvariantId();
- relatedInstanceVersion = relatedInstanceModelInfo.getModelVersion();
- relatedInstanceModelCustomizationName = relatedInstanceModelInfo.getModelCustomizationName();
- }
- }
-
- if (modelInfo.getModelType().equals(ModelType.vnf)) {
- // a. For a vnf request (only create, no update currently):
- // i. (v3-v4) If modelInfo.modelCustomizationId is provided, use it to validate catalog DB has record in
- // vnf_resource_customization.model_customization_uuid.
- // ii. (v2-v4) If modelInfo.modelCustomizationId is NOT provided (because it is a pre-1702 ASDC model or
- // pre-v3), then modelInfo.modelCustomizationName must have
- // been provided (else create request should be rejected). APIH should use the
- // relatedInstance.modelInfo[service].modelVersionId** + modelInfo[vnf].modelCustomizationName
- // to “join�? service_to_resource_customizations with vnf_resource_customization to confirm a
- // vnf_resource_customization.model_customization_uuid record exists.
- // **If relatedInstance.modelInfo[service].modelVersionId was not provided, use
- // relatedInstance.modelInfo[service].modelInvariantId + modelVersion instead to lookup modelVersionId
- // (MODEL_UUID) in SERVICE table.
- // iii. Regardless of how the value was provided/obtained above, APIH must always populate
- // vnfModelCustomizationId in bpmnRequest. It would be assumed it was MSO generated
- // during 1707 data migration if VID did not provide it originally on request.
- // iv. Note: continue to construct the “vnf-type�? value and pass to BPMN (must still be populated
- // in A&AI).
- // 1. If modelCustomizationName is NOT provided on a vnf/vfModule request, use modelCustomizationId to
- // look it up in our catalog to construct vnf-type value to pass to BPMN.
-
- VnfResource vnfResource = null;
- VnfResourceCustomization vrc = null;
- // Validation for vnfResource
-
- if (modelCustomizationId != null) {
- vrc = catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(modelCustomizationId);
- if (vrc != null) {
- vnfResource = vrc.getVnfResources();
- }
- } else {
- org.onap.so.db.catalog.beans.Service service =
- catalogDbClient.getServiceByID(relatedInstanceModelVersionId);
- if (service == null) {
- service = catalogDbClient.getServiceByModelVersionAndModelInvariantUUID(relatedInstanceVersion,
- relatedInstanceModelInvariantId);
- }
-
- if (service == null) {
- throw new ValidationException("service in relatedInstance");
- }
- for (VnfResourceCustomization vnfResourceCustom : service.getVnfCustomizations()) {
- if (vnfResourceCustom.getModelInstanceName().equals(modelCustomizationName)) {
- vrc = vnfResourceCustom;
- }
- }
-
- if (vrc != null) {
- vnfResource = vrc.getVnfResources();
- modelInfo.setModelCustomizationId(vrc.getModelCustomizationUUID());
- modelInfo.setModelCustomizationUuid(vrc.getModelCustomizationUUID());
- }
- }
-
- if (vnfResource == null) {
- throw new ValidationException("vnfResource");
- } else {
- if (modelInfo.getModelVersionId() == null) {
- modelInfo.setModelVersionId(vnfResource.getModelUUID());
- }
- }
-
- VnfRecipe vnfRecipe = null;
-
- if (vrc != null) {
- String nfRole = vrc.getNfRole();
- if (nfRole != null) {
- vnfRecipe =
- catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(vrc.getNfRole(), action.toString());
- }
- }
-
- if (vnfRecipe == null) {
- vnfRecipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
- }
-
- if (vnfRecipe == null) {
- return null;
- }
-
- return new RecipeLookupResult(vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout());
- } else {
- /*
- * (v5-v7) If modelInfo.modelCustomizationId is NOT provided (because it is a pre-1702 ASDC model or
- * pre-v3), then modelInfo.modelCustomizationName must have // been provided (else create request should
- * be rejected). APIH should use the relatedInstance.modelInfo[vnf].modelVersionId +
- * modelInfo[vnf].modelCustomizationName // to join vnf_to_resource_customizations with
- * vf_resource_customization to confirm a vf_resource_customization.model_customization_uuid record
- * exists. // Once the vnfs model_customization_uuid has been obtained, use it to find all vfModule
- * customizations for that vnf customization in the vnf_res_custom_to_vf_module_custom join table. //
- * For each vf_module_cust_model_customization_uuid value returned, use that UUID to query
- * vf_module_customization table along with modelInfo[vfModule|volumeGroup].modelVersionId to // confirm
- * record matches request data (and to identify the modelCustomizationId associated with the vfModule in
- * the request). This means taking each record found // in vf_module_customization and looking up in
- * vf_module (using vf_module_customization’s FK into vf_module) to find a match on
- * MODEL_INVARIANT_UUID (modelInvariantId) // and MODEL_VERSION (modelVersion).
- */
- VfModuleCustomization vfmc = null;
- VnfResource vnfr;
- VnfResourceCustomization vnfrc;
- VfModule vfModule = null;
-
- if (modelInfo.getModelCustomizationId() != null) {
- vfmc = catalogDbClient
- .getVfModuleCustomizationByModelCuztomizationUUID(modelInfo.getModelCustomizationId());
- } else {
- vnfr = catalogDbClient.getVnfResourceByModelUUID(relatedInstanceModelVersionId);
- if (vnfr == null) {
- vnfr = catalogDbClient.getFirstVnfResourceByModelInvariantUUIDAndModelVersion(
- relatedInstanceModelInvariantId, relatedInstanceVersion);
- }
- vnfrc = catalogDbClient.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources(
- relatedInstanceModelCustomizationName, vnfr);
-
- List<VfModuleCustomization> list = vnfrc.getVfModuleCustomizations();
-
- String vfModuleModelUUID = modelInfo.getModelVersionId();
- for (VfModuleCustomization vf : list) {
- VfModuleCustomization vfmCustom;
- if (vfModuleModelUUID != null) {
- vfmCustom = catalogDbClient
- .getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
- vf.getModelCustomizationUUID(), vfModuleModelUUID);
- if (vfmCustom != null) {
- vfModule = vfmCustom.getVfModule();
- }
- } else {
- vfmCustom = catalogDbClient
- .getVfModuleCustomizationByModelCuztomizationUUID(vf.getModelCustomizationUUID());
- if (vfmCustom != null) {
- vfModule = vfmCustom.getVfModule();
- } else {
- vfModule = catalogDbClient.getVfModuleByModelInvariantUUIDAndModelVersion(
- relatedInstanceModelInvariantId, relatedInstanceVersion);
- }
- }
-
- if (vfModule != null) {
- modelInfo.setModelCustomizationId(vf.getModelCustomizationUUID());
- modelInfo.setModelCustomizationUuid(vf.getModelCustomizationUUID());
- break;
- }
- }
- }
-
- if (vfmc == null && vfModule == null) {
- throw new ValidationException("vfModuleCustomization");
- } else if (vfModule == null && vfmc != null) {
- vfModule = vfmc.getVfModule(); // can't be null as vfModuleModelUUID is not-null property in
- // VfModuleCustomization table
- }
-
- if (modelInfo.getModelVersionId() == null) {
- modelInfo.setModelVersionId(vfModule.getModelUUID());
- }
-
-
- recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
- vfModule.getModelUUID(), vnfComponentType, action.toString());
- if (recipe == null) {
- List<VfModule> vfModuleRecords = catalogDbClient
- .getVfModuleByModelInvariantUUIDOrderByModelVersionDesc(vfModule.getModelInvariantUUID());
- if (!vfModuleRecords.isEmpty()) {
- for (VfModule record : vfModuleRecords) {
- recipe = catalogDbClient
- .getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
- record.getModelUUID(), vnfComponentType, action.toString());
- if (recipe != null) {
- break;
- }
- }
- }
- }
- if (recipe == null) {
- recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
- defaultSource, vnfComponentType, action.toString());
- if (recipe == null) {
- recipe = catalogDbClient.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(
- vnfComponentType, action.toString());
- }
-
- if (recipe == null) {
- return null;
- }
- }
- }
- } else {
-
- if (modelInfo.getModelType().equals(ModelType.vnf)) {
- recipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
- if (recipe == null) {
- return null;
- }
- } else {
- recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
- defaultSource, vnfComponentType, action.toString());
-
- if (recipe == null) {
- return null;
- }
- }
- }
-
- return new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout());
- }
-
- private RecipeLookupResult getDefaultVnfUri(ServiceInstancesRequest sir, Actions action) {
-
- String defaultSource = requestHandlerUtils.getDefaultModel(sir);
-
- VnfRecipe vnfRecipe = catalogDbClient.getFirstVnfRecipeByNfRoleAndAction(defaultSource, action.toString());
-
- if (vnfRecipe == null) {
- return null;
- }
-
- return new RecipeLookupResult(vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout());
- }
-
-
- private RecipeLookupResult getNetworkUri(ServiceInstancesRequest sir, Actions action) throws ValidationException {
-
- String defaultNetworkType = requestHandlerUtils.getDefaultModel(sir);
-
- ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
- String modelName = modelInfo.getModelName();
- Recipe recipe = null;
-
- if (modelInfo.getModelCustomizationId() != null) {
- NetworkResourceCustomization networkResourceCustomization = catalogDbClient
- .getNetworkResourceCustomizationByModelCustomizationUUID(modelInfo.getModelCustomizationId());
- if (networkResourceCustomization != null) {
- NetworkResource networkResource = networkResourceCustomization.getNetworkResource();
- if (networkResource != null) {
- if (modelInfo.getModelVersionId() == null) {
- modelInfo.setModelVersionId(networkResource.getModelUUID());
- }
- recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(networkResource.getModelName(),
- action.toString());
- } else {
- throw new ValidationException("no catalog entry found");
- }
- } else if (action != Action.deleteInstance) {
- throw new ValidationException("modelCustomizationId for networkResourceCustomization lookup", true);
- }
- } else {
- // ok for version < 3 and action delete
- if (modelName != null) {
- recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(modelName, action.toString());
- }
- }
-
- if (recipe == null) {
- recipe = catalogDbClient.getFirstNetworkRecipeByModelNameAndAction(defaultNetworkType, action.toString());
- }
-
- return recipe != null ? new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout()) : null;
- }
-
-
private Response configurationRecipeLookup(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
String version, String requestId, String requestUri) throws ApiException {
String serviceInstanceId;
Boolean aLaCarte = null;
String apiVersion = version.substring(1);
- boolean inProgress = false;
ServiceInstancesRequest sir;
sir = requestHandlerUtils.convertJsonToServiceInstanceRequest(requestJSON, action, requestId, requestUri);
@@ -1574,30 +1068,20 @@ public class ServiceInstances extends AbstractRestHandler {
if (sir.getRequestDetails().getRequestParameters() != null) {
aLaCarte = sir.getRequestDetails().getRequestParameters().getALaCarte();
}
+
requestHandlerUtils.parseRequest(sir, instanceIdMap, action, version, requestJSON, aLaCarte, requestId,
currentActiveReq);
requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap);
String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
- InfraActiveRequests dup = null;
-
- dup = requestHandlerUtils.duplicateCheck(action, instanceIdMap, instanceName, requestScope, currentActiveReq);
-
- if (dup != null) {
- inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq);
- }
-
- if (instanceIdMap != null && dup != null && inProgress) {
- requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, instanceName,
- requestScope, dup);
- }
+ requestHandlerUtils.checkForDuplicateRequests(action, instanceIdMap, requestScope, currentActiveReq,
+ instanceName);
ServiceInstancesResponse serviceResponse = new ServiceInstancesResponse();
RequestReferences referencesResponse = new RequestReferences();
referencesResponse.setRequestId(requestId);
serviceResponse.setRequestReferences(referencesResponse);
-
String orchestrationUri = env.getProperty(CommonConstants.ALACARTE_ORCHESTRATION);
String timeOut = env.getProperty(CommonConstants.ALACARTE_RECIPE_TIMEOUT);
@@ -1609,7 +1093,6 @@ public class ServiceInstances extends AbstractRestHandler {
new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.DataError)
.errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
-
ValidateException validateException = new ValidateException.Builder(error, HttpStatus.SC_NOT_FOUND,
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR).errorInfo(errorLoggerInfo).build();
@@ -1669,4 +1152,35 @@ public class ServiceInstances extends AbstractRestHandler {
requestScope);
}
+ protected CloudConfiguration getCloudConfigurationOnReplace(String requestScope,
+ HashMap<String, String> instanceIdMap, InfraActiveRequests currentActiveReq) throws ApiException {
+ logger.debug("Replace request is missing cloudConfiguration, autofilling from create.");
+ CloudConfiguration cloudConfiguration = null;
+ if (requestScope.equals(ModelType.vfModule.toString())) {
+ cloudConfiguration = bpmnRequestBuilder.getCloudConfigurationVfModuleReplace(
+ instanceIdMap.get("vnfInstanceId"), instanceIdMap.get("vfModuleInstanceId"));
+ } else {
+ cloudConfiguration = bpmnRequestBuilder.mapCloudConfigurationVnf(instanceIdMap.get("vnfInstanceId"));
+ }
+
+ if (cloudConfiguration == null) {
+ String errorMessage = "CloudConfiguration not found during autofill for replace request.";
+ logger.error(errorMessage);
+ updateStatus(currentActiveReq, Status.FAILED, errorMessage);
+ throw new CloudConfigurationNotFoundException(
+ "CloudConfiguration not found during autofill for replace request.");
+ }
+ return cloudConfiguration;
+ }
+
+ protected void setCloudConfigurationCurrentActiveRequest(CloudConfiguration cloudConfiguration,
+ InfraActiveRequests currentActiveRequest) {
+ if (cloudConfiguration.getLcpCloudRegionId() != null) {
+ currentActiveRequest.setCloudRegion(cloudConfiguration.getLcpCloudRegionId());
+ }
+
+ if (cloudConfiguration.getTenantId() != null) {
+ currentActiveRequest.setTenantId(cloudConfiguration.getTenantId());
+ }
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
index 13f1e52068..b76cd42bb3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
@@ -19,18 +19,19 @@
*/
package org.onap.so.apihandlerinfra;
-public enum MsoSubsystems {
+public enum SoSubsystems implements Subsystem {
APIH("API Handler"),
ASDC("ASDC Controller"),
BPMN("BPMN Infra"),
CATALOGDB("CatalogDb Adapter"),
OPENSTACK("Openstack Adapter"),
REQUESTDB("RequestDB Adapter"),
- REQUESTDBATT("RequestDB Adapter ATT Svc"),
- SDNC("SDNC Adapter");
+ SDNC("SDNC Adapter"),
+ SOAPPCORCHESTRATOR("SO APPC Orchestrator");
+
private String subsystem;
- private MsoSubsystems(String subsystem) {
+ private SoSubsystems(String subsystem) {
this.subsystem = subsystem;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
new file mode 100644
index 0000000000..88626f3168
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
@@ -0,0 +1,5 @@
+package org.onap.so.apihandlerinfra;
+
+public interface Subsystem {
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
index 3c4c90cc37..edc287ce0a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
@@ -36,7 +36,6 @@ import javax.ws.rs.core.UriBuilder;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.json.JSONArray;
-import org.json.JSONException;
import org.json.JSONObject;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.RequestClient;
@@ -60,11 +59,16 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Path("onap/so/infra/tasks")
-@Api(value = "onap/so/infra/tasks", description = "Queries of Manual Tasks")
+@OpenAPIDefinition(info = @Info(title = "onap/so/infra/tasks", description = "Queries of Manual Tasks"))
@Component
public class TasksHandler {
@@ -82,7 +86,8 @@ public class TasksHandler {
@Path("/{version:[vV]1}")
@GET
- @ApiOperation(value = "Finds Manual Tasks", response = Response.class)
+ @Operation(description = "Finds Manual Tasks", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response queryFilters(@QueryParam("taskId") String taskId,
@QueryParam("originalRequestId") String originalRequestId,
@@ -198,7 +203,7 @@ public class TasksHandler {
} else {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.BusinessProcessError)
.build();
throw new BPMNFailureException.Builder(String.valueOf(bpelStatus), bpelStatus,
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo).build();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WebSecurityConfigImpl.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WebSecurityConfigImpl.java
deleted file mode 100644
index 632f371af5..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.apihandlerinfra;
-
-import org.onap.so.security.MSOSpringFirewall;
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.web.firewall.StrictHttpFirewall;
-import org.springframework.util.StringUtils;
-
-@EnableWebSecurity
-@Configuration("att-security-config")
-@Order(2)
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",")).and()
- .httpBasic();
-
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
-
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index b57bb5d1d8..925d10179f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -59,11 +59,17 @@ import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Path("onap/so/infra/workflowSpecifications")
-@Api(value = "onap/so/infra/workflowSpecifications", description = "Queries of Workflow Specifications")
+@OpenAPIDefinition(info = @Info(title = "onap/so/infra/workflowSpecifications",
+ description = "Queries of Workflow Specifications"))
@Component
public class WorkflowSpecificationsHandler {
@@ -79,7 +85,8 @@ public class WorkflowSpecificationsHandler {
@Path("/{version:[vV]1}/workflows")
@GET
- @ApiOperation(value = "Finds Workflow Specifications", response = Response.class)
+ @Operation(description = "Finds Workflow Specifications", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response queryWorkflowSpecifications(@QueryParam("vnfModelVersionId") String vnfModelVersionId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java
new file mode 100644
index 0000000000..344e5438c9
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java
@@ -0,0 +1,85 @@
+package org.onap.so.apihandlerinfra.infra.rest;
+
+import java.util.Optional;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.aai.domain.yang.L3Network;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.VfModule;
+import org.onap.aai.domain.yang.VolumeGroup;
+import org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AAIDataRetrieval {
+
+ private static final String VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID = "VF Module Not Found In Inventory, VnfId: ";
+
+ private AAIResourcesClient aaiResourcesClient;
+
+ private static final Logger logger = LoggerFactory.getLogger(AAIDataRetrieval.class);
+
+ public ServiceInstance getServiceInstance(String serviceInstanceId) {
+ return this.getAaiResourcesClient()
+ .get(ServiceInstance.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId))
+ .orElseGet(() -> {
+ logger.debug("No Service Instance found in A&AI ServiceInstanceId: {}", serviceInstanceId);
+ return null;
+ });
+ }
+
+
+ public VfModule getAAIVfModule(String vnfId, String vfModuleId) {
+ return this.getAaiResourcesClient()
+ .get(VfModule.class, AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId))
+ .orElseGet(() -> {
+ logger.debug("No Vf Module found in A&AI VnfId: {}" + ", VfModuleId: {}", vnfId, vfModuleId);
+ return null;
+ });
+ }
+
+ public GenericVnf getGenericVnf(String vnfId) {
+ return this.getAaiResourcesClient()
+ .get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
+ .orElseGet(() -> {
+ logger.debug("No Generic VNF found in A&AI VnfId: {}", vnfId);
+ return null;
+ });
+ }
+
+ public VolumeGroup getVolumeGroup(String vnfId, String volumeGroupId) throws AAIEntityNotFound {
+ AAIResultWrapper wrapper =
+ this.getAaiResourcesClient().get(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ .relatedTo(AAIObjectType.VOLUME_GROUP, volumeGroupId));
+ Optional<VolumeGroup> volume = wrapper.asBean(VolumeGroup.class);
+ if (volume.isPresent()) {
+ return volume.get();
+ } else {
+ logger.debug("No VolumeGroup in A&AI found: {}", vnfId);
+ return null;
+ }
+ }
+
+ public L3Network getNetwork(String networkId) {
+ return this.getAaiResourcesClient()
+ .get(L3Network.class, AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId))
+ .orElseGet(() -> {
+ logger.debug("No Network found in A&AI NetworkId: {}", networkId);
+ return null;
+ });
+ }
+
+ protected AAIResourcesClient getAaiResourcesClient() {
+ if (aaiResourcesClient == null) {
+ aaiResourcesClient = new AAIResourcesClient();
+ }
+ return aaiResourcesClient;
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java
index bb5b4edfe4..f37713d5b2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilder.java
@@ -33,10 +33,7 @@ import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound;
import org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFoundException;
import org.onap.so.client.aai.AAIObjectType;
-import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.AAIResultWrapper;
-import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -75,30 +72,42 @@ public class BpmnRequestBuilder {
@Autowired
private RequestsDbClient infraActiveRequestsClient;
+ @Autowired
+ private AAIDataRetrieval aaiDataRet;
+
private ObjectMapper mapper = new ObjectMapper();
- private AAIResourcesClient aaiResourcesClient;
public ServiceInstancesRequest buildVFModuleDeleteRequest(String vnfId, String vfModuleId, ModelType modelType)
throws AAIEntityNotFound {
- GenericVnf vnf = getGenericVnf(vnfId);
+ GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
if (vnf == null) {
throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
}
- VfModule vfModule = getAAIVfModule(vnfId, vfModuleId);
+ VfModule vfModule = aaiDataRet.getAAIVfModule(vnfId, vfModuleId);
if (vfModule == null) {
throw new AAIEntityNotFound(VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " vfModuleId: " + vfModuleId);
}
return createServiceInstancesRequest(vnf, vfModule, modelType);
}
+ public CloudConfiguration getCloudConfigurationVfModuleReplace(String vnfId, String vfModuleId)
+ throws AAIEntityNotFound {
+ GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
+ if (vnf == null) {
+ throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
+ }
+
+ return mapCloudConfiguration(vnf, vfModuleId);
+ }
+
public ServiceInstancesRequest buildVolumeGroupDeleteRequest(String vnfId, String volumeGroupId)
throws AAIEntityNotFound {
- GenericVnf vnf = getGenericVnf(vnfId);
+ GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
if (vnf == null) {
throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
}
- VolumeGroup volumeGroup = getVolumeGroup(vnfId, volumeGroupId);
+ VolumeGroup volumeGroup = aaiDataRet.getVolumeGroup(vnfId, volumeGroupId);
if (volumeGroup == null) {
throw new AAIEntityNotFound(
VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " volumeGroupId: " + volumeGroupId);
@@ -107,7 +116,7 @@ public class BpmnRequestBuilder {
}
public ServiceInstancesRequest buildServiceDeleteRequest(String serviceInstanceId) throws AAIEntityNotFound {
- ServiceInstance serviceInstance = getServiceInstance(serviceInstanceId);
+ ServiceInstance serviceInstance = aaiDataRet.getServiceInstance(serviceInstanceId);
if (serviceInstance == null) {
throw new AAIEntityNotFound(
"ServiceInstance Not Found In Inventory, ServiceInstanceId: " + serviceInstanceId);
@@ -116,7 +125,7 @@ public class BpmnRequestBuilder {
}
public ServiceInstancesRequest buildVnfDeleteRequest(String vnfId) throws AAIEntityNotFound {
- GenericVnf vnf = getGenericVnf(vnfId);
+ GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
if (vnf == null) {
throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
}
@@ -124,7 +133,7 @@ public class BpmnRequestBuilder {
}
public ServiceInstancesRequest buildNetworkDeleteRequest(String networkId) throws AAIEntityNotFound {
- L3Network network = getNetwork(networkId);
+ L3Network network = aaiDataRet.getNetwork(networkId);
if (network == null) {
throw new AAIEntityNotFound("Network Not Found In Inventory, NetworkId: " + networkId);
}
@@ -175,7 +184,7 @@ public class BpmnRequestBuilder {
}
requestDetails.setModelInfo(mapVfModuleModelInformation(vfModule, modelType));
- requestDetails.setCloudConfiguration(mapCloudConfiguration(vnf, vfModule));
+ requestDetails.setCloudConfiguration(mapCloudConfiguration(vnf, vfModule.getVfModuleId()));
requestDetails.setRequestParameters(createRequestParameters());
return requestDetails;
}
@@ -265,7 +274,7 @@ public class BpmnRequestBuilder {
return modelInfo;
}
- public CloudConfiguration mapCloudConfiguration(GenericVnf vnf, VfModule vfModule) {
+ public CloudConfiguration mapCloudConfiguration(GenericVnf vnf, String vfModuleId) {
CloudConfiguration cloudConfig = new CloudConfiguration();
AAIResultWrapper wrapper = new AAIResultWrapper(vnf);
Optional<org.onap.so.client.aai.entities.Relationships> relationshipsOpt = wrapper.getRelationships();
@@ -282,7 +291,7 @@ public class BpmnRequestBuilder {
}
if (tenantId == null || cloudOwner == null || lcpRegionId == null) {
- Map<String, String[]> filters = createQueryRequest("vfModuleId", vfModule.getVfModuleId());
+ Map<String, String[]> filters = createQueryRequest("vfModuleId", vfModuleId);
Optional<ServiceInstancesRequest> request = findServiceInstanceRequest(filters);
if (request.isPresent()) {
if (request.get().getRequestDetails() != null
@@ -371,6 +380,36 @@ public class BpmnRequestBuilder {
return cloudConfig;
}
+ public CloudConfiguration mapCloudConfigurationVnf(String vnfId) {
+ CloudConfiguration cloudConfig = new CloudConfiguration();
+ String tenantId = null;
+ String cloudOwner = null;
+ String lcpRegionId = null;
+
+ Map<String, String[]> filters = createQueryRequest("vnfId", vnfId);
+ Optional<ServiceInstancesRequest> request = findServiceInstanceRequest(filters);
+ if (request.isPresent()) {
+ if (request.get().getRequestDetails() != null
+ && request.get().getRequestDetails().getCloudConfiguration() != null) {
+ if (request.get().getRequestDetails().getCloudConfiguration().getTenantId() != null) {
+ tenantId = request.get().getRequestDetails().getCloudConfiguration().getTenantId();
+ }
+ if (request.get().getRequestDetails().getCloudConfiguration().getCloudOwner() != null) {
+ cloudOwner = request.get().getRequestDetails().getCloudConfiguration().getCloudOwner();
+ }
+ if (request.get().getRequestDetails().getCloudConfiguration().getLcpCloudRegionId() != null) {
+ lcpRegionId = request.get().getRequestDetails().getCloudConfiguration().getLcpCloudRegionId();
+ }
+ }
+ } else {
+ throw new CloudConfigurationNotFoundException(CLOUD_CONFIGURATION_COULD_NOT_BE_FOUND);
+ }
+ cloudConfig.setTenantId(tenantId);
+ cloudConfig.setCloudOwner(cloudOwner);
+ cloudConfig.setLcpCloudRegionId(lcpRegionId);
+ return cloudConfig;
+ }
+
public Optional<ServiceInstancesRequest> findServiceInstanceRequest(Map<String, String[]> filters) {
List<InfraActiveRequests> completeRequests = infraActiveRequestsClient.getRequest(filters);
InfraActiveRequests foundRequest = completeRequests.get(0);
@@ -407,72 +446,5 @@ public class BpmnRequestBuilder {
return requestParams;
}
- public VfModule getAAIVfModule(String vnfId, String vfModuleId) {
- return this.getAaiResourcesClient()
- .get(VfModule.class, AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId))
- .orElseGet(() -> {
- logger.debug("No Vf Module found in A&AI VnfId: {}" + ", VfModuleId: {}", vnfId, vfModuleId);
- return null;
- });
- }
-
- public GenericVnf getGenericVnf(String vnfId) {
- return this.getAaiResourcesClient()
- .get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
- .orElseGet(() -> {
- logger.debug("No Generic VNF found in A&AI VnfId: {}", vnfId);
- return null;
- });
- }
-
- public VolumeGroup getVolumeGroup(String vnfId, String volumeGroupId) throws AAIEntityNotFound {
- GenericVnf vnf = getGenericVnf(vnfId);
- AAIResultWrapper wrapper = new AAIResultWrapper(vnf);
- List<AAIResourceUri> listVserverWrapper;
- Optional<AAIResourceUri> volumeGroupURI;
- if (wrapper.getRelationships().isPresent()) {
- listVserverWrapper = wrapper.getRelationships().get().getRelatedUris(AAIObjectType.VOLUME_GROUP);
- volumeGroupURI = listVserverWrapper.stream()
- .filter(resourceURI -> resourceURI.getURIKeys().get("volume-group-id").equals(volumeGroupId))
- .findFirst();
- } else {
- throw new AAIEntityNotFound(
- VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " volumeGroupId: " + volumeGroupId);
- }
- return this.getAaiResourcesClient().get(VolumeGroup.class, volumeGroupURI.get()).orElseGet(() -> {
- logger.debug("No VolumeGroup in A&AI found: {}", vnfId);
- return null;
- });
- }
-
- public ServiceInstance getServiceInstance(String serviceInstanceId) {
- return this.getAaiResourcesClient()
- .get(ServiceInstance.class,
- AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId))
- .orElseGet(() -> {
- logger.debug("No Service Instance found in A&AI ServiceInstanceId: {}", serviceInstanceId);
- return null;
- });
- }
-
- public L3Network getNetwork(String networkId) {
- return this.getAaiResourcesClient()
- .get(L3Network.class, AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId))
- .orElseGet(() -> {
- logger.debug("No Network found in A&AI NetworkId: {}", networkId);
- return null;
- });
- }
-
- public AAIResourcesClient getAaiResourcesClient() {
- if (aaiResourcesClient == null) {
- aaiResourcesClient = new AAIResourcesClient();
- }
- return aaiResourcesClient;
- }
-
- public void setAaiResourcesClient(AAIResourcesClient aaiResourcesClient) {
- this.aaiResourcesClient = aaiResourcesClient;
- }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
index ec3df21fdb..483ac47235 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
@@ -44,7 +44,11 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/serviceInstantiation")
@@ -61,7 +65,8 @@ public class Network {
@Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete provided Network instance", response = Response.class)
+ @Operation(description = "Delete provided Network instance", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deleteNetworkInstance(@PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
index 07e8092449..135667d3e4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
@@ -44,7 +44,11 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/serviceInstantiation")
@@ -61,7 +65,8 @@ public class ServiceInstance {
@Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete a Service instance", response = ServiceInstancesResponse.class)
+ @Operation(description = "Delete a Service instance", responses = @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class)))))
@Transactional
public Response deleteServiceInstance(@PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @Context ContainerRequestContext requestContext)
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
index 1b9eb1f802..4a86d944cf 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
@@ -45,7 +45,11 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/serviceInstantiation")
@@ -62,7 +66,8 @@ public class VfModules {
@Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete a VfModule instance", response = ServiceInstancesResponse.class)
+ @Operation(description = "Delete a VfModule instance", responses = @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class)))))
@Transactional
public Response deleteVfModuleInstance(@PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
index a8ccdeecac..edb09083d4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
@@ -43,7 +43,11 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/serviceInstantiation")
@@ -60,7 +64,8 @@ public class Vnf {
@Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete a Vnf instance", response = ServiceInstancesResponse.class)
+ @Operation(description = "Delete a Vnf instance", responses = @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class)))))
@Transactional
public Response deleteVnfInstance(@PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
index d3e394d6d8..3154c86046 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
@@ -46,7 +46,11 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component("VolumesV8")
@Path("/onap/so/infra/serviceInstantiation")
@@ -66,7 +70,8 @@ public class Volumes {
@Path("/{version:[vV][8]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Delete a VfModule instance", response = ServiceInstancesResponse.class)
+ @Operation(description = "Delete a VfModule instance", responses = @ApiResponse(content = @Content(
+ array = @ArraySchema(schema = @Schema(implementation = ServiceInstancesResponse.class)))))
@Transactional
public Response deleteVfModuleInstance(@PathParam("version") String version,
@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/exception/AAIEntityNotFound.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/exception/AAIEntityNotFound.java
index 2153d9a628..e7753b2134 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/exception/AAIEntityNotFound.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/exception/AAIEntityNotFound.java
@@ -20,7 +20,9 @@
package org.onap.so.apihandlerinfra.infra.rest.exception;
-public class AAIEntityNotFound extends Exception {
+import org.onap.so.apihandlerinfra.exceptions.ApiException;
+
+public class AAIEntityNotFound extends ApiException {
public AAIEntityNotFound(String errorMessage) {
super(errorMessage);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java
index e11732ddc4..20e27a5265 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java
@@ -111,7 +111,7 @@ public abstract class AbstractRestHandler {
String instanceName, String requestScope, InfraActiveRequests currentActiveReq) throws ApiException {
InfraActiveRequests dup = null;
try {
- if (!(instanceName == null && requestScope.equals("service") && (action == Action.createInstance
+ if (!(instanceName == null && "service".equals(requestScope) && (action == Action.createInstance
|| action == Action.activateInstance || action == Action.assignInstance))) {
dup = infraActiveRequestsClient.checkInstanceNameDuplicate(instanceIdMap, instanceName, requestScope);
}
@@ -175,7 +175,7 @@ public abstract class AbstractRestHandler {
selfLinkUrl = Optional.of(new URL(aUrl.getProtocol(), aUrl.getHost(), aUrl.getPort(), selfLinkPath));
} catch (Exception e) {
selfLinkUrl = Optional.empty(); // ignore
- logger.error(e.getMessage());
+ logger.error("Exception in buildSelfLinkUrl", e);
}
return selfLinkUrl;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandler.java
index 7b095fc9d0..a6d2fa2e1b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandler.java
@@ -51,7 +51,6 @@ public class NetworkRestHandler extends AbstractRestHandler {
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
InfraActiveRequests deleteRequest = new InfraActiveRequests();
deleteRequest.setRequestAction(Action.deleteInstance.toString());
- deleteRequest.setAction(Action.deleteInstance.toString());
deleteRequest.setStartTime(startTimeStamp);
deleteRequest.setServiceInstanceId(serviceInstanceId);
deleteRequest.setNetworkId(networkId);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandler.java
index afadf36157..36e7b7ced6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandler.java
@@ -54,7 +54,6 @@ public class ServiceInstanceRestHandler extends AbstractRestHandler {
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
InfraActiveRequests deleteRequest = new InfraActiveRequests();
deleteRequest.setRequestAction(Action.deleteInstance.toString());
- deleteRequest.setAction(Action.deleteInstance.toString());
deleteRequest.setStartTime(startTimeStamp);
deleteRequest.setServiceInstanceId(serviceInstanceId);
deleteRequest.setRequestId(requestId);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VFModuleRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VFModuleRestHandler.java
index 0762803488..380649a3ca 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VFModuleRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VFModuleRestHandler.java
@@ -51,7 +51,6 @@ public class VFModuleRestHandler extends AbstractRestHandler {
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
InfraActiveRequests deleteRequest = new InfraActiveRequests();
deleteRequest.setRequestAction(Action.deleteInstance.toString());
- deleteRequest.setAction(Action.deleteInstance.toString());
deleteRequest.setStartTime(startTimeStamp);
deleteRequest.setServiceInstanceId(serviceInstanceId);
deleteRequest.setVnfId(vnfId);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandler.java
index e157d926f3..c11ae56b0d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandler.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +27,6 @@ import java.util.HashMap;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Constants;
-import org.onap.so.apihandlerinfra.infra.rest.exception.NoRecipeException;
import org.onap.so.constants.Status;
import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.catalog.beans.VnfRecipe;
@@ -51,7 +51,6 @@ public class VnfRestHandler extends AbstractRestHandler {
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
InfraActiveRequests deleteRequest = new InfraActiveRequests();
deleteRequest.setRequestAction(Action.deleteInstance.toString());
- deleteRequest.setAction(Action.deleteInstance.toString());
deleteRequest.setStartTime(startTimeStamp);
deleteRequest.setServiceInstanceId(serviceInstanceId);
deleteRequest.setVnfId(vnfId);
@@ -100,8 +99,7 @@ public class VnfRestHandler extends AbstractRestHandler {
checkDuplicateRequest(instanceIdMap, ModelType.vnf, instanceName, requestId);
}
- public Recipe findVnfModuleRecipe(String modelCustomizationId, String modelType, String action)
- throws NoRecipeException {
+ public Recipe findVnfModuleRecipe(String modelCustomizationId, String modelType, String action) {
VnfRecipe recipe = new VnfRecipe();
recipe.setOrchestrationUri("/mso/async/services/WorkflowActionBB");
return recipe;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandler.java
index 48a8aa2cd8..15aa71f936 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandler.java
@@ -48,7 +48,6 @@ public class VolumeRestHandler extends AbstractRestHandler {
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
InfraActiveRequests deleteRequest = new InfraActiveRequests();
deleteRequest.setRequestAction(Action.deleteInstance.toString());
- deleteRequest.setAction(Action.deleteInstance.toString());
deleteRequest.setStartTime(startTimeStamp);
deleteRequest.setServiceInstanceId(serviceInstanceId);
deleteRequest.setVnfId(vnfId);
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidator.java
index e644f9e030..4aa60152dd 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidator.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,26 +18,23 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.logging.jaxrs.filter;
+package org.onap.so.apihandlerinfra.infra.rest.validators;
import java.util.Map;
-import org.slf4j.MDC;
-import org.springframework.core.task.TaskDecorator;
+import java.util.Optional;
+import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
-public class MDCTaskDecorator implements TaskDecorator {
+public interface RequestValidator {
- @Override
- public Runnable decorate(Runnable runnable) {
- Map<String, String> contextMap = MDC.getCopyOfContextMap();
- return () -> {
- try {
- if (contextMap != null) {
- MDC.setContextMap(contextMap);
- runnable.run();
- }
- } finally {
- MDC.clear();
- }
- };
- }
+
+ /**
+ * Should this validator run for given request
+ *
+ * @return
+ */
+ public boolean shouldRunFor(String uri, ServiceInstancesRequest request);
+
+
+ public Optional<String> validate(Map<String, String> instanceIdMap, ServiceInstancesRequest request,
+ Map<String, String> queryParams);
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidatorListenerRunner.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidatorListenerRunner.java
new file mode 100644
index 0000000000..d689c6b7a5
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/RequestValidatorListenerRunner.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.apihandlerinfra.infra.rest.validators;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import javax.annotation.PostConstruct;
+import org.javatuples.Pair;
+import org.onap.so.apihandlerinfra.exceptions.ApiException;
+import org.onap.so.apihandlerinfra.exceptions.ValidateException;
+import org.onap.so.listener.ListenerRunner;
+import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RequestValidatorListenerRunner extends ListenerRunner {
+
+ private static Logger logger = LoggerFactory.getLogger(RequestValidatorListenerRunner.class);
+
+ protected List<RequestValidator> requestValidators;
+
+ @PostConstruct
+ protected void init() {
+ requestValidators = new ArrayList<>(
+ Optional.ofNullable(context.getBeansOfType(RequestValidator.class)).orElse(new HashMap<>()).values());
+ }
+
+ public boolean runValidations(String requestURI, Map<String, String> instanceIdMap, ServiceInstancesRequest request,
+ Map<String, String> queryParams) throws ApiException {
+ logger.info("Running local validations");
+ List<Pair<String, Optional<String>>> results =
+ runValidations(requestValidators, instanceIdMap, request, queryParams, requestURI);
+ if (!results.isEmpty()) {
+ throw new ValidateException("Failed Validations:\n"
+ + results.stream().map(item -> String.format("%s: %s", item.getValue0(), item.getValue1().get()))
+ .collect(Collectors.joining("\n")),
+ 400);
+ }
+
+ return true;
+ }
+
+ protected List<Pair<String, Optional<String>>> runValidations(List<? extends RequestValidator> validators,
+ Map<String, String> instanceIdMap, ServiceInstancesRequest request, Map<String, String> queryParams,
+ String requestURI) {
+
+ List<? extends RequestValidator> filtered =
+ filterListeners(validators, (item -> item.shouldRunFor(requestURI, request)));
+
+ List<Pair<String, Optional<String>>> results = new ArrayList<>();
+ filtered.forEach(item -> results
+ .add(new Pair<>(item.getClass().getName(), item.validate(instanceIdMap, request, queryParams))));
+
+ return results.stream().filter(item -> item.getValue1().isPresent()).collect(Collectors.toList());
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java
index d3fb7986ce..877376cc79 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestration.java
@@ -61,12 +61,18 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/cloudResources")
-@Api(value = "/onap/so/infra/cloudResources", description = "API Requests for cloud resources - Tenant Isolation")
+@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/cloudResources",
+ description = "API Requests for cloud resources - Tenant Isolation"))
public class CloudOrchestration {
private static Logger logger = LoggerFactory.getLogger(CloudOrchestration.class);
@@ -85,7 +91,8 @@ public class CloudOrchestration {
@Path("/{version:[vV][1]}/operationalEnvironments")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Create an Operational Environment", response = Response.class)
+ @Operation(description = "Create an Operational Environment", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response createOperationEnvironment(String request, @PathParam("version") String version,
@Context ContainerRequestContext requestContext) throws ApiException {
@@ -97,7 +104,8 @@ public class CloudOrchestration {
@Path("/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/activate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Activate an Operational Environment", response = Response.class)
+ @Operation(description = "Activate an Operational Environment", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response activateOperationEnvironment(String request, @PathParam("version") String version,
@PathParam("operationalEnvironmentId") String operationalEnvironmentId,
@@ -112,7 +120,8 @@ public class CloudOrchestration {
@Path("/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/deactivate")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Deactivate an Operational Environment", response = Response.class)
+ @Operation(description = "Deactivate an Operational Environment", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response deactivateOperationEnvironment(String request, @PathParam("version") String version,
@PathParam("operationalEnvironmentId") String operationalEnvironmentId,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
index e9cd303c0b..43f957174c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
@@ -62,13 +62,18 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("onap/so/infra/cloudResourcesRequests")
-@Api(value = "onap/so/infra/cloudResourcesRequests",
- description = "API GET Requests for cloud resources - Tenant Isolation")
+@OpenAPIDefinition(info = @Info(title = "onap/so/infra/cloudResourcesRequests",
+ description = "API GET Requests for cloud resources - Tenant Isolation"))
public class CloudResourcesOrchestration {
private static Logger logger = LoggerFactory.getLogger(CloudResourcesOrchestration.class);
@@ -83,7 +88,7 @@ public class CloudResourcesOrchestration {
@Path("/{version: [vV][1]}/{requestId}/unlock")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Unlock CloudOrchestration requests for a specified requestId")
+ @Operation(description = "Unlock CloudOrchestration requests for a specified requestId")
@Transactional
public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId,
@PathParam("version") String version) throws ApiException {
@@ -129,8 +134,9 @@ public class CloudResourcesOrchestration {
}
if (infraActiveRequest == null) {
- ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
- ErrorCode.BusinessProcesssError).build();
+ ErrorLoggerInfo errorLoggerInfo =
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.BusinessProcessError)
+ .build();
ValidateException validateException =
new ValidateException.Builder("Orchestration RequestId " + requestId + " is not found in DB",
HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR)
@@ -167,8 +173,9 @@ public class CloudResourcesOrchestration {
@Path("/{version:[vV][1]}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Get status of an Operational Environment based on filter criteria",
- response = Response.class)
+ @Operation(description = "Get status of an Operational Environment based on filter criteria",
+ responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response getOperationEnvironmentStatusFilter(@Context UriInfo ui, @PathParam("version") String version)
throws ApiException {
@@ -197,7 +204,7 @@ public class CloudResourcesOrchestration {
if (requestDB == null) {
ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- ErrorCode.BusinessProcesssError).build();
+ ErrorCode.BusinessProcessError).build();
ValidateException validateException =
new ValidateException.Builder("Orchestration RequestId " + requestId + " is not found in DB",
HttpStatus.SC_NO_CONTENT, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR)
@@ -221,7 +228,7 @@ public class CloudResourcesOrchestration {
orchestrationMap = tenantIsolationRequest.getOrchestrationFilters(queryParams);
} catch (ValidationException ex) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
ValidateException validateException =
new ValidateException.Builder(ex.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
index 216588432b..2f922220c9 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
@@ -55,12 +55,18 @@ import org.springframework.stereotype.Component;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
@Component
@Path("/onap/so/infra/modelDistributions")
-@Api(value = "/onap/so/infra/modelDistributions", description = "API Requests for Model Distributions")
+@OpenAPIDefinition(
+ info = @Info(title = "/onap/so/infra/modelDistributions", description = "API Requests for Model Distributions"))
public class ModelDistributionRequest {
private static Logger logger = LoggerFactory.getLogger(ModelDistributionRequest.class);
@@ -71,7 +77,8 @@ public class ModelDistributionRequest {
@Path("/{version:[vV][1]}/distributions/{distributionId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Update model distribution status", response = Response.class)
+ @Operation(description = "Update model distribution status", responses = @ApiResponse(
+ content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
@Transactional
public Response updateModelDistributionStatus(String requestJSON, @PathParam("version") String version,
@PathParam("distributionId") String distributionId) throws ApiException {
@@ -137,10 +144,8 @@ public class ModelDistributionRequest {
se.setMessageId(messageId);
se.setText(text);
if (variables != null) {
- if (variables != null) {
- for (String variable : variables) {
- se.getVariables().add(variable);
- }
+ for (String variable : variables) {
+ se.getVariables().add(variable);
}
}
re.setServiceException(se);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java
index efdc52b837..b1eb71ea04 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java
@@ -92,6 +92,7 @@ public class TenantIsolationRequest {
requestJSON = mapper.writeValueAsString(request.getRequestDetails());
} catch (JsonProcessingException e) {
+ logger.error("Exception in JSON processing", e);
throw new ValidationException("Parse ServiceInstanceRequest to JSON string", true);
}
@@ -267,7 +268,6 @@ public class TenantIsolationRequest {
aq.setRequestId(requestId);
aq.setRequestAction(action.name());
- aq.setAction(action.name());
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
@@ -325,6 +325,7 @@ public class TenantIsolationRequest {
orchestrationFilterParams.put(queryParam, value);
}
} catch (Exception e) {
+ logger.error("Exception in getOrchestrationFilters", e);
throw new ValidationException(e.getMessage(), true);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java
index 340d143b42..e9ce0bf99a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java
@@ -72,7 +72,7 @@ public class DmaapOperationalEnvClient {
public void dmaapPublishOperationalEnvRequest(String operationalEnvironmentId, String operationalEnvironmentName,
String operationalEnvironmentType, String tenantContext, String workloadContext, String action)
- throws ApiException, IOException, InterruptedException {
+ throws ApiException {
String request = this.buildRequest(operationalEnvironmentId, operationalEnvironmentName,
operationalEnvironmentType, tenantContext, workloadContext, action);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
index b5ba9281a6..65d3109445 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
@@ -38,7 +38,7 @@ import org.onap.so.client.HttpClientFactory;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.onap.so.utils.CryptoUtils;
-import org.onap.so.utils.TargetEntity;
+import org.onap.logging.filter.base.ONAPComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -50,12 +50,19 @@ public class SDCClientHelper {
private static Logger logger = LoggerFactory.getLogger(SDCClientHelper.class);
private static final String SDC_CONTENT_TYPE = "application/json";
private static final String SDC_ACCEPT_TYPE = "application/json";
- private static String PARTIAL_SDC_URI = "/sdc/v1/catalog/services/";
+ private static final String PARTIAL_SDC_URI = "/sdc/v1/catalog/services/";
- private static String MESSAGE_UNDEFINED_ERROR = "Undefined Error Message!";
- private static String MESSAGE_UNEXPECTED_FORMAT = "Unexpected response format from SDC.";
+ private static final String MESSAGE_UNDEFINED_ERROR = "Undefined Error Message!";
+ private static final String MESSAGE_UNEXPECTED_FORMAT = "Unexpected response format from SDC.";
private final HttpClientFactory httpClientFactory = new HttpClientFactory();
+ private static final String STATUS_CODE = "statusCode";
+ private static final String MESSAGE = "message";
+ private static final String MESSAGE_ID = "messageId";
+ private static final String REQUEST_ERROR = "requestError";
+ private static final String SERVICE_EXCEPTION = "serviceException";
+ private static final String POLICY_EXCEPTION = "policyException";
+
@Value("${mso.sdc.endpoint}")
private String sdcEndpoint;
@Value("${mso.sdc.activate.userid}")
@@ -87,19 +94,18 @@ public class SDCClientHelper {
if (basicAuthCred == null || "".equals(basicAuthCred)) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
- ValidateException validateException = new ValidateException.Builder(
+
+ throw new ValidateException.Builder(
" SDC credentials 'mso.sdc.client.auth' not setup in properties file!",
HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo)
.build();
-
- throw validateException;
}
URL url = new URL(urlString);
- HttpClient httpClient = httpClientFactory.newJsonClient(url, TargetEntity.SDC);
+ HttpClient httpClient = httpClientFactory.newJsonClient(url, ONAPComponents.SDC);
httpClient.addBasicAuthHeader(sdcClientAuth, msoKey);
httpClient.addAdditionalHeader("X-ECOMP-InstanceID", sdcActivateInstanceId);
httpClient.addAdditionalHeader("X-ECOMP-RequestID", UUID.randomUUID().toString());
@@ -114,12 +120,12 @@ public class SDCClientHelper {
sdcResponseJsonObj = enhanceJsonResponse(new JSONObject(responseData), statusCode);
} catch (Exception ex) {
- logger.debug("calling SDC Exception message: {}", ex.getMessage());
+ logger.debug("calling SDC Exception message:", ex);
String errorMessage = " Encountered Error while calling SDC POST Activate. " + ex.getMessage();
logger.debug(errorMessage);
- sdcResponseJsonObj.put("statusCode", String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()));
- sdcResponseJsonObj.put("messageId", "");
- sdcResponseJsonObj.put("message", errorMessage);
+ sdcResponseJsonObj.put(STATUS_CODE, String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()));
+ sdcResponseJsonObj.put(MESSAGE_ID, "");
+ sdcResponseJsonObj.put(MESSAGE, errorMessage);
}
return sdcResponseJsonObj;
@@ -137,13 +143,11 @@ public class SDCClientHelper {
return client.post(jsonPayload);
} catch (Exception ex) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
- ValidateException validateException =
- new ValidateException.Builder("Bad request could not post payload", HttpStatus.SC_BAD_REQUEST,
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(ex).errorInfo(errorLoggerInfo).build();
- throw validateException;
+ throw new ValidateException.Builder("Bad request could not post payload", HttpStatus.SC_BAD_REQUEST,
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(ex).errorInfo(errorLoggerInfo).build();
}
}
@@ -154,7 +158,7 @@ public class SDCClientHelper {
* @param statusCode - int
* @return enhancedAsdcResponseJsonObj - JSONObject object
*/
- public JSONObject enhanceJsonResponse(JSONObject sdcResponseJsonObj, int statusCode) throws JSONException {
+ public JSONObject enhanceJsonResponse(JSONObject sdcResponseJsonObj, int statusCode) {
JSONObject enhancedAsdcResponseJsonObj = new JSONObject();
@@ -163,31 +167,31 @@ public class SDCClientHelper {
if (statusCode == Response.Status.ACCEPTED.getStatusCode()) { // Accepted
enhancedAsdcResponseJsonObj.put("distributionId", sdcResponseJsonObj.get("distributionId"));
- enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode));
- enhancedAsdcResponseJsonObj.put("messageId", "");
- enhancedAsdcResponseJsonObj.put("message", "Success");
+ enhancedAsdcResponseJsonObj.put(STATUS_CODE, Integer.toString(statusCode));
+ enhancedAsdcResponseJsonObj.put(MESSAGE_ID, "");
+ enhancedAsdcResponseJsonObj.put(MESSAGE, "Success");
} else { // error
- if (sdcResponseJsonObj.has("requestError")) {
- JSONObject requestErrorObj = sdcResponseJsonObj.getJSONObject("requestError");
- if (sdcResponseJsonObj.getJSONObject("requestError").has("serviceException")) {
- message = requestErrorObj.getJSONObject("serviceException").getString("text");
- messageId = requestErrorObj.getJSONObject("serviceException").getString("messageId");
+ if (sdcResponseJsonObj.has(REQUEST_ERROR)) {
+ JSONObject requestErrorObj = sdcResponseJsonObj.getJSONObject(REQUEST_ERROR);
+ if (sdcResponseJsonObj.getJSONObject(REQUEST_ERROR).has(SERVICE_EXCEPTION)) {
+ message = requestErrorObj.getJSONObject(SERVICE_EXCEPTION).getString("text");
+ messageId = requestErrorObj.getJSONObject(SERVICE_EXCEPTION).getString(MESSAGE_ID);
}
- if (sdcResponseJsonObj.getJSONObject("requestError").has("policyException")) {
- message = requestErrorObj.getJSONObject("policyException").getString("text");
- messageId = requestErrorObj.getJSONObject("policyException").getString("messageId");
+ if (sdcResponseJsonObj.getJSONObject(REQUEST_ERROR).has(POLICY_EXCEPTION)) {
+ message = requestErrorObj.getJSONObject(POLICY_EXCEPTION).getString("text");
+ messageId = requestErrorObj.getJSONObject(POLICY_EXCEPTION).getString(MESSAGE_ID);
}
- enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode));
- enhancedAsdcResponseJsonObj.put("messageId", messageId);
- enhancedAsdcResponseJsonObj.put("message", message);
+ enhancedAsdcResponseJsonObj.put(STATUS_CODE, Integer.toString(statusCode));
+ enhancedAsdcResponseJsonObj.put(MESSAGE_ID, messageId);
+ enhancedAsdcResponseJsonObj.put(MESSAGE, message);
} else {
// unexpected format
- enhancedAsdcResponseJsonObj.put("statusCode",
+ enhancedAsdcResponseJsonObj.put(STATUS_CODE,
String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()));
- enhancedAsdcResponseJsonObj.put("messageId", MESSAGE_UNDEFINED_ERROR);
- enhancedAsdcResponseJsonObj.put("message", MESSAGE_UNEXPECTED_FORMAT);
+ enhancedAsdcResponseJsonObj.put(MESSAGE_ID, MESSAGE_UNDEFINED_ERROR);
+ enhancedAsdcResponseJsonObj.put(MESSAGE, MESSAGE_UNEXPECTED_FORMAT);
}
}
return enhancedAsdcResponseJsonObj;
@@ -214,7 +218,7 @@ public class SDCClientHelper {
* @return String json
* @throws JSONException
*/
- public String buildJsonWorkloadContext(String workloadContext) throws JSONException {
+ public String buildJsonWorkloadContext(String workloadContext) {
return new JSONObject().put("workloadContext", workloadContext).toString();
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfOperationalEnvironment.java
index 3957f86bab..0005d26016 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfOperationalEnvironment.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfOperationalEnvironment.java
@@ -109,7 +109,7 @@ public class ActivateVnfOperationalEnvironment {
logger.debug(" aai workloadContext: {}", workloadContext);
if (!vidWorkloadContext.equals(workloadContext)) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
throw new ValidateException.Builder(
" The vid workloadContext did not match from aai record. " + " vid workloadContext:"
@@ -119,7 +119,7 @@ public class ActivateVnfOperationalEnvironment {
}
if (ecompOperationalEnvironmentId == null) {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
throw new ValidateException.Builder(
" The ECOMP OE was not in aai record; the value of relationship.relationship-data key: "
@@ -183,7 +183,7 @@ public class ActivateVnfOperationalEnvironment {
} else {
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
String dbErrorMessage = " Failure calling SDC: statusCode: " + statusCode + "; messageId: "
+ jsonResponse.get("messageId") + "; message: " + jsonResponse.get("message");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java
index 3005abaf9b..624a7f6945 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java
@@ -61,16 +61,14 @@ public class ActivateVnfStatusOperationalEnvironment {
private OperationalEnvServiceModelStatus queryServiceModelResponse = null;
private boolean isOverallSuccess = false;
- private final int RETRY_COUNT_ZERO = 0;
- private final String ERROR_REASON_ABORTED = "ABORTED";
- private final String RECOVERY_ACTION_RETRY = "RETRY";
- private final String RECOVERY_ACTION_ABORT = "ABORT";
- private final String RECOVERY_ACTION_SKIP = "SKIP";
- private final String DISTRIBUTION_STATUS_OK = DistributionStatus.DISTRIBUTION_COMPLETE_OK.toString();
- private final String DISTRIBUTION_STATUS_ERROR = DistributionStatus.DISTRIBUTION_COMPLETE_ERROR.toString();
- private final String DISTRIBUTION_STATUS_SENT = "SENT";
-
- private final String MESSAGE_UNDEFINED_ID = "Undefined Error Message!";
+ private static final int RETRY_COUNT_ZERO = 0;
+ private static final String ERROR_REASON_ABORTED = "ABORTED";
+ private static final String RECOVERY_ACTION_RETRY = "RETRY";
+ private static final String RECOVERY_ACTION_ABORT = "ABORT";
+ private static final String RECOVERY_ACTION_SKIP = "SKIP";
+ private static final String DISTRIBUTION_STATUS_OK = DistributionStatus.DISTRIBUTION_COMPLETE_OK.toString();
+ private static final String DISTRIBUTION_STATUS_ERROR = DistributionStatus.DISTRIBUTION_COMPLETE_ERROR.toString();
+ private static final String DISTRIBUTION_STATUS_SENT = "SENT";
@Autowired
private ActivateVnfDBHelper dbHelper;
@@ -130,6 +128,7 @@ public class ActivateVnfStatusOperationalEnvironment {
}
} catch (Exception e) {
+ logger.error("Exception in execute", e);
requestDb.updateInfraFailureCompletion(e.getMessage(), this.origRequestId,
this.queryServiceModelResponse.getVnfOperationalEnvId());
}
@@ -251,7 +250,7 @@ public class ActivateVnfStatusOperationalEnvironment {
String dbErrorMessage = "Failure calling SDC: statusCode: " + statusCode + "; messageId: "
+ jsonResponse.get("messageId") + "; message: " + jsonResponse.get("message");
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
ValidateException validateException =
new ValidateException.Builder(dbErrorMessage, HttpStatus.SC_BAD_REQUEST,
@@ -305,7 +304,7 @@ public class ActivateVnfStatusOperationalEnvironment {
if (status.equals("Failure") && queryServiceModelResponseList.size() == count) {
this.errorMessage = "Overall Activation process is a Failure. " + status;
ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError)
+ new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcessError)
.build();
ValidateException validateException =
new ValidateException.Builder(this.errorMessage, HttpStatus.SC_BAD_REQUEST,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
index 2207c52048..a89032f50c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java
@@ -48,11 +48,6 @@ public class CloudConfigurationValidation implements ValidationRule {
|| action == Action.updateInstance)) {
throw new ValidationException("cloudConfiguration");
}
- if ((requestScope.equalsIgnoreCase(ModelType.vnf.name())
- || requestScope.equalsIgnoreCase(ModelType.vfModule.name()))
- && action == Action.replaceInstance) {
- throw new ValidationException("cloudConfiguration");
- }
if (requestScope.equalsIgnoreCase(ModelType.configuration.name())
&& (action == Action.enablePort || action == Action.disablePort
|| action == Action.activateInstance || action == Action.deactivateInstance)) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
index 01e3de99ec..c05ef98fbb 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CustomWorkflowValidation.java
@@ -35,13 +35,13 @@ public class CustomWorkflowValidation implements ValidationRule {
CloudConfiguration cloudConfiguration = info.getSir().getRequestDetails().getCloudConfiguration();
if (cloudConfiguration == null) {
- throw new ValidationException("cloudConfiguration");
+ // throw new ValidationException("cloudConfiguration");
} else if (Strings.isNullOrEmpty((cloudConfiguration.getCloudOwner()))) {
- throw new ValidationException("cloudOwner");
+ // throw new ValidationException("cloudOwner");
} else if (Strings.isNullOrEmpty((cloudConfiguration.getLcpCloudRegionId()))) {
- throw new ValidationException("lcpCloudRegionId");
+ // throw new ValidationException("lcpCloudRegionId");
} else if (Strings.isNullOrEmpty((cloudConfiguration.getTenantId()))) {
- throw new ValidationException("tenantId");
+ // throw new ValidationException("tenantId");
}
if (requestParameters == null) {
throw new ValidationException("requestParameters");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
index 71405b0f63..20be2b5a8b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
@@ -43,7 +43,8 @@ public class PlatformLOBValidation implements ValidationRule {
platform = info.getSir().getRequestDetails().getPlatform();
lineOfBusiness = info.getSir().getRequestDetails().getLineOfBusiness();
- if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance) {
+ if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance
+ && !info.getReqParameters().getEnforceValidNfValues()) {
if (reqVersion > 5 && platform == null) {
throw new ValidationException("platform");
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
index 584269715a..cebbd6389c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
@@ -41,10 +41,12 @@ public class ProjectOwningEntityValidation implements ValidationRule {
String requestScope = info.getRequestScope();
Actions action = info.getAction();
+
project = info.getSir().getRequestDetails().getProject();
owningEntity = info.getSir().getRequestDetails().getOwningEntity();
if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.service.name())
- && action == Action.createInstance || action == Action.assignInstance) {
+ && !info.getReqParameters().getEnforceValidNfValues() && action == Action.createInstance
+ || action == Action.assignInstance) {
if (reqVersion > 5 && owningEntity == null) {
throw new ValidationException("owningEntity");
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-aaf.yaml b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-aaf.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-aaf.yaml
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-basic.yaml b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-basic.yaml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-basic.yaml
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java
deleted file mode 100644
index 276b438529..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 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.apihandler.filters;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import java.io.IOException;
-import java.net.URI;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.core.UriInfo;
-import org.junit.Test;
-import org.onap.so.apihandlerinfra.BaseTest;
-
-
-
-public class RequestUriFilterTest extends BaseTest {
-
- @Test
- public void filterTest() throws IOException {
- RequestUriFilter URIFilter = new RequestUriFilter();
- URI baseURI = URI.create("http://localhost:58879/");
- String requestURI = "onap/so/infra/serviceInstances/v5";
-
- ContainerRequestContext mockContext = mock(ContainerRequestContext.class);
- UriInfo mockInfo = mock(UriInfo.class);
-
- when(mockContext.getUriInfo()).thenReturn(mockInfo);
- when(mockInfo.getBaseUri()).thenReturn(baseURI);
- when(mockInfo.getPath()).thenReturn(requestURI);
-
-
- URIFilter.filter(mockContext);
- assertEquals("http://localhost:58879/onap/so/infra/serviceInstantiation/v5/serviceInstances",
- URIFilter.getRequestUri());
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java
index e6b5163f59..4dc281b3fc 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java
@@ -17,311 +17,39 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.onap.so.apihandlerinfra;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity;
-import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity;
-import org.junit.Before;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import javax.ws.rs.core.MediaType;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
-import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.core.env.Environment;
-import org.springframework.http.HttpEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.ResourceAccessException;
-import org.springframework.web.client.RestTemplate;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@RunWith(MockitoJUnitRunner.class)
-public class CamundaRequestHandlerTest {
-
- @Mock
- private RestTemplate restTemplate;
- @Mock
- private Environment env;
+public class CamundaRequestHandlerTest extends BaseTest {
- @InjectMocks
- @Spy
+ @Autowired
private CamundaRequestHandler camundaRequestHandler;
+ @Value("${wiremock.server.port}")
+ private String wiremockPort;
+
@Rule
public ExpectedException thrown = ExpectedException.none();
- private static final String REQUEST_ID = "eca3a1b1-43ab-457e-ab1c-367263d148b4";
- private ResponseEntity<List<HistoricActivityInstanceEntity>> activityInstanceResponse = null;
- private ResponseEntity<List<HistoricProcessInstanceEntity>> processInstanceResponse = null;
- private List<HistoricActivityInstanceEntity> activityInstanceList = null;
- private List<HistoricProcessInstanceEntity> processInstanceList = null;
-
-
-
- @Before
- public void setup() throws IOException {
- ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- activityInstanceList = mapper.readValue(
- new String(Files.readAllBytes(
- Paths.get("src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json"))),
- new TypeReference<List<HistoricActivityInstanceEntity>>() {});
- processInstanceList = mapper.readValue(
- new String(Files.readAllBytes(
- Paths.get("src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json"))),
- new TypeReference<List<HistoricProcessInstanceEntity>>() {});
- processInstanceResponse =
- new ResponseEntity<List<HistoricProcessInstanceEntity>>(processInstanceList, HttpStatus.ACCEPTED);
- activityInstanceResponse =
- new ResponseEntity<List<HistoricActivityInstanceEntity>>(activityInstanceList, HttpStatus.ACCEPTED);
-
- doReturn("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_").when(env)
- .getProperty("mso.camunda.rest.history.uri");
- doReturn("/sobpmnengine/history/activity-instance?processInstanceId=").when(env)
- .getProperty("mso.camunda.rest.activity.uri");
- doReturn("auth").when(env).getRequiredProperty("mso.camundaAuth");
- doReturn("key").when(env).getRequiredProperty("mso.msoKey");
- doReturn("http://localhost:8089").when(env).getProperty("mso.camundaURL");
- }
-
- public HttpHeaders setHeaders() {
- HttpHeaders headers = new HttpHeaders();
- List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>();
- acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON);
- headers.setAccept(acceptableMediaTypes);
- headers.add(HttpHeaders.AUTHORIZATION, "auth");
-
- return headers;
- }
-
- @Test
- public void getActivityNameTest() throws IOException {
- String expectedActivityName = "Last task executed: BB to Execute";
- String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
-
- assertEquals(expectedActivityName, actualActivityName);
- }
-
- @Test
- public void getActivityNameNullActivityNameTest() throws IOException {
- String expectedActivityName = "Task name is null.";
- HistoricActivityInstanceEntity activityInstance = new HistoricActivityInstanceEntity();
- List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
- activityInstanceList.add(activityInstance);
-
- String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
-
- assertEquals(expectedActivityName, actualActivityName);
- }
-
- @Test
- public void getActivityNameNullListTest() throws IOException {
- String expectedActivityName = "No results returned on activityInstance history lookup.";
- List<HistoricActivityInstanceEntity> activityInstanceList = null;
- String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
-
- assertEquals(expectedActivityName, actualActivityName);
- }
-
@Test
- public void getActivityNameEmptyListTest() throws IOException {
- String expectedActivityName = "No results returned on activityInstance history lookup.";
- List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
- String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
-
- assertEquals(expectedActivityName, actualActivityName);
- }
-
- @Test
- public void getTaskNameTest() throws IOException, ContactCamundaException {
- doReturn(processInstanceResponse).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
- doReturn(activityInstanceResponse).when(camundaRequestHandler)
- .getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
- doReturn("Last task executed: BB to Execute").when(camundaRequestHandler).getActivityName(activityInstanceList);
- String expectedTaskName = "Last task executed: BB to Execute";
-
- String actualTaskName = camundaRequestHandler.getTaskName(REQUEST_ID);
-
- assertEquals(expectedTaskName, actualTaskName);
- }
-
- @Test
- public void getTaskNameNullProcessInstanceListTest() throws IOException, ContactCamundaException {
- ResponseEntity<List<HistoricProcessInstanceEntity>> response = new ResponseEntity<>(null, HttpStatus.OK);
- doReturn(response).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
- String expected = "No processInstances returned for requestId: " + REQUEST_ID;
-
- String actual = camundaRequestHandler.getTaskName(REQUEST_ID);
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void getTaskNameNullProcessInstanceIdTest() throws IOException, ContactCamundaException {
- HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
- List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
- processInstanceList.add(processInstance);
- ResponseEntity<List<HistoricProcessInstanceEntity>> response =
- new ResponseEntity<>(processInstanceList, HttpStatus.OK);
- doReturn(response).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
- String expected = "No processInstanceId returned for requestId: " + REQUEST_ID;
-
- String actual = camundaRequestHandler.getTaskName(REQUEST_ID);
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void getTaskNameProcessInstanceLookupFailureTest() throws IOException, ContactCamundaException {
- doThrow(HttpClientErrorException.class).when(camundaRequestHandler)
- .getCamundaProcessInstanceHistory(REQUEST_ID);
-
- thrown.expect(ContactCamundaException.class);
- camundaRequestHandler.getTaskName(REQUEST_ID);
- }
-
- @Test
- public void getCamundaActivityHistoryTest() throws IOException, ContactCamundaException {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
- + "c4c6b647-a26e-11e9-b144-0242ac14000b";
- doReturn(activityInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
- ResponseEntity<List<HistoricActivityInstanceEntity>> actualResponse =
- camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
- assertEquals(activityInstanceResponse, actualResponse);
- }
-
- @Test
- public void getCamundaActivityHistoryErrorTest() {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
- + "c4c6b647-a26e-11e9-b144-0242ac14000b";
- doThrow(new ResourceAccessException("IOException")).when(restTemplate).exchange(targetUrl, HttpMethod.GET,
- requestEntity, new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
-
- try {
- camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
- } catch (ContactCamundaException e) {
- // Exception thrown after retries are completed
- }
-
- verify(restTemplate, times(4)).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
- }
-
- @Test
- public void getCamundaProccesInstanceHistoryTest() throws IOException, ContactCamundaException {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl =
- "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
- doReturn(processInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
-
- ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
- camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
- assertEquals(processInstanceResponse, actualResponse);
- }
-
- @Test
- public void getCamundaProccesInstanceHistoryRetryTest() {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl =
- "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
- doThrow(new ResourceAccessException("I/O error")).when(restTemplate).exchange(targetUrl, HttpMethod.GET,
- requestEntity, new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
-
- try {
- camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
- } catch (ResourceAccessException e) {
- // Exception thrown after retries are completed
- }
- verify(restTemplate, times(4)).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- }
-
- @Test
- public void getCamundaProccesInstanceHistoryNoRetryTest() {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl =
- "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
- doThrow(HttpClientErrorException.class).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
-
- try {
- camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
- } catch (HttpStatusCodeException e) {
- // Exception thrown, no retries
- }
- verify(restTemplate, times(1)).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- }
-
- @Test
- public void getCamundaProccesInstanceHistoryFailThenSuccessTest() throws IOException, ContactCamundaException {
- HttpHeaders headers = setHeaders();
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
- String targetUrl =
- "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
- when(restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {}))
- .thenThrow(new ResourceAccessException("I/O Exception")).thenReturn(processInstanceResponse);
- doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
-
- ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
- camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
- assertEquals(processInstanceResponse, actualResponse);
- verify(restTemplate, times(2)).exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- }
-
- @Test
- public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
- String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
- String key = "07a7159d3bf51a0e53be7a8f89699be7";
-
- HttpHeaders headers = camundaRequestHandler.setCamundaHeaders(encryptedAuth, key);
- List<org.springframework.http.MediaType> acceptedType = headers.getAccept();
-
- String expectedAcceptedType = "application/json";
- assertEquals(expectedAcceptedType, acceptedType.get(0).toString());
- String basicAuth = headers.getFirst(HttpHeaders.AUTHORIZATION);
- String expectedBasicAuth = "Basic dXNlcjpwYXNzd29yZA==";
+ public void timeoutTest() {
+ wireMockServer.stubFor(get(
+ ("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_6718de35-b9a5-4670-b19f-a0f4ac22bfaf"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/HistoryCheckResponse.json")
+ .withStatus(org.apache.http.HttpStatus.SC_OK).withFixedDelay(40000)));
- assertEquals(expectedBasicAuth, basicAuth);
+ thrown.expect(ResourceAccessException.class);
+ camundaRequestHandler.getCamundaProcessInstanceHistory("6718de35-b9a5-4670-b19f-a0f4ac22bfaf", false);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerUnitTest.java
new file mode 100644
index 0000000000..261b64f2e6
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerUnitTest.java
@@ -0,0 +1,378 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.apihandlerinfra;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
+import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.HttpStatusCodeException;
+import org.springframework.web.client.ResourceAccessException;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@RunWith(MockitoJUnitRunner.class)
+public class CamundaRequestHandlerUnitTest {
+
+ @Mock
+ private RestTemplate restTemplate;
+
+ @Mock
+ private RestTemplate restTemplateRetry;
+
+ @Mock
+ private Environment env;
+
+ @InjectMocks
+ @Spy
+ private CamundaRequestHandler camundaRequestHandler;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ private static final String REQUEST_ID = "eca3a1b1-43ab-457e-ab1c-367263d148b4";
+ private ResponseEntity<List<HistoricActivityInstanceEntity>> activityInstanceResponse = null;
+ private ResponseEntity<List<HistoricProcessInstanceEntity>> processInstanceResponse = null;
+ private List<HistoricActivityInstanceEntity> activityInstanceList = null;
+ private List<HistoricProcessInstanceEntity> processInstanceList = null;
+
+
+
+ @Before
+ public void setup() throws IOException {
+ ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ activityInstanceList = mapper.readValue(
+ new String(Files.readAllBytes(
+ Paths.get("src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json"))),
+ new TypeReference<List<HistoricActivityInstanceEntity>>() {});
+ processInstanceList = mapper.readValue(
+ new String(Files.readAllBytes(
+ Paths.get("src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json"))),
+ new TypeReference<List<HistoricProcessInstanceEntity>>() {});
+ processInstanceResponse =
+ new ResponseEntity<List<HistoricProcessInstanceEntity>>(processInstanceList, HttpStatus.ACCEPTED);
+ activityInstanceResponse =
+ new ResponseEntity<List<HistoricActivityInstanceEntity>>(activityInstanceList, HttpStatus.ACCEPTED);
+
+ doReturn("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_").when(env)
+ .getProperty("mso.camunda.rest.history.uri");
+ doReturn("/sobpmnengine/history/activity-instance?processInstanceId=").when(env)
+ .getProperty("mso.camunda.rest.activity.uri");
+ doReturn("auth").when(env).getRequiredProperty("mso.camundaAuth");
+ doReturn("key").when(env).getRequiredProperty("mso.msoKey");
+ doReturn("http://localhost:8089").when(env).getProperty("mso.camundaURL");
+
+ HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
+ factory.setReadTimeout(30000);
+ factory.setConnectTimeout(30000);
+ restTemplate.setRequestFactory(factory);
+ doReturn(restTemplate).when(camundaRequestHandler).getRestTemplate(false);
+
+ HttpComponentsClientHttpRequestFactory factoryRetry = new HttpComponentsClientHttpRequestFactory();
+ factoryRetry.setReadTimeout(15000);
+ factoryRetry.setConnectTimeout(15000);
+ restTemplate.setRequestFactory(factoryRetry);
+ doReturn(restTemplateRetry).when(camundaRequestHandler).getRestTemplate(true);
+ }
+
+ public HttpHeaders setHeaders() {
+ HttpHeaders headers = new HttpHeaders();
+ List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>();
+ acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON);
+ headers.setAccept(acceptableMediaTypes);
+ headers.add(HttpHeaders.AUTHORIZATION, "auth");
+
+ return headers;
+ }
+
+ @Test
+ public void getActivityNameTest() throws IOException {
+ String expectedActivityName = "Last task executed: BB to Execute";
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameNullActivityNameTest() throws IOException {
+ String expectedActivityName = "Task name is null.";
+ HistoricActivityInstanceEntity activityInstance = new HistoricActivityInstanceEntity();
+ List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
+ activityInstanceList.add(activityInstance);
+
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameNullListTest() throws IOException {
+ String expectedActivityName = "No results returned on activityInstance history lookup.";
+ List<HistoricActivityInstanceEntity> activityInstanceList = null;
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameEmptyListTest() throws IOException {
+ String expectedActivityName = "No results returned on activityInstance history lookup.";
+ List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getCamundActivityHistoryNullTest() throws IOException, ContactCamundaException {
+ HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
+ processInstance.setId("c4c6b647-a26e-11e9-b144-0242ac14000b");
+ List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
+ processInstanceList.add(processInstance);
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response =
+ new ResponseEntity<>(processInstanceList, HttpStatus.OK);
+ doReturn(null).when(camundaRequestHandler).getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b");
+
+ String actualTaskName = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
+
+ assertNull(actualTaskName);
+ }
+
+ @Test
+ public void getCamundActivityHistoryErrorTest() throws IOException, ContactCamundaException {
+ HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
+ processInstance.setId("c4c6b647-a26e-11e9-b144-0242ac14000b");
+ List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
+ processInstanceList.add(processInstance);
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response =
+ new ResponseEntity<>(processInstanceList, HttpStatus.OK);
+ doThrow(RestClientException.class).when(camundaRequestHandler)
+ .getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b");
+
+ String actualTaskName = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
+
+ assertNull(actualTaskName);
+ }
+
+ @Test
+ public void getTaskName() throws IOException, ContactCamundaException {
+ doReturn(processInstanceResponse).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID,
+ false);
+ doReturn(activityInstanceResponse).when(camundaRequestHandler)
+ .getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b");
+ doReturn("Last task executed: BB to Execute").when(camundaRequestHandler).getActivityName(activityInstanceList);
+ String expectedTaskName = "Last task executed: BB to Execute";
+
+ String actualTaskName = camundaRequestHandler.getTaskName(REQUEST_ID);
+
+ assertEquals(expectedTaskName, actualTaskName);
+ }
+
+ @Test
+ public void getTaskNameNullProcessInstanceListTest() throws IOException, ContactCamundaException {
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response = new ResponseEntity<>(null, HttpStatus.OK);
+
+ String actual = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
+
+ assertNull(actual);
+ }
+
+ @Test
+ public void getTaskNameNullProcessInstanceIdTest() throws IOException, ContactCamundaException {
+ HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
+ List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
+ processInstanceList.add(processInstance);
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response =
+ new ResponseEntity<>(processInstanceList, HttpStatus.OK);
+
+ String actual = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
+
+ assertNull(actual);
+ }
+
+ @Test
+ public void getTaskNameEmptyProcessInstanceListTest() throws IOException, ContactCamundaException {
+ List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response =
+ new ResponseEntity<>(processInstanceList, HttpStatus.OK);
+
+ String actual = camundaRequestHandler.getTaskInformation(response, REQUEST_ID);
+
+ assertNull(actual);
+ }
+
+ @Test
+ public void getTaskNameProcessInstanceLookupFailureTest() throws IOException, ContactCamundaException {
+ doThrow(HttpClientErrorException.class).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID,
+ false);
+
+ String result = camundaRequestHandler.getTaskName(REQUEST_ID);
+ assertNull(result);
+ }
+
+ @Test
+ public void getCamundaActivityHistoryTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
+ + "c4c6b647-a26e-11e9-b144-0242ac14000b";
+ doReturn(activityInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+ ResponseEntity<List<HistoricActivityInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b");
+ assertEquals(activityInstanceResponse, actualResponse);
+ }
+
+ @Test
+ public void getCamundaActivityHistoryErrorTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
+ + "c4c6b647-a26e-11e9-b144-0242ac14000b";
+ doThrow(new ResourceAccessException("IOException")).when(restTemplate).exchange(targetUrl, HttpMethod.GET,
+ requestEntity, new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ thrown.expect(ResourceAccessException.class);
+ camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b");
+
+ verify(restTemplate, times(1)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doReturn(processInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID, false);
+ assertEquals(processInstanceResponse, actualResponse);
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryRetryTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doThrow(new ResourceAccessException("I/O error")).when(restTemplateRetry).exchange(targetUrl, HttpMethod.GET,
+ requestEntity, new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ thrown.expect(ResourceAccessException.class);
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID, true);
+
+ verify(restTemplateRetry, times(2)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryNoRetryTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doThrow(HttpClientErrorException.class).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ thrown.expect(HttpStatusCodeException.class);
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID, false);
+
+ verify(restTemplate, times(1)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryFailThenSuccessTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ when(restTemplateRetry.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {}))
+ .thenThrow(new ResourceAccessException("I/O Exception")).thenReturn(processInstanceResponse);
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID, true);
+
+ assertEquals(processInstanceResponse, actualResponse);
+ verify(restTemplateRetry, times(2)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
+ String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
+ String key = "07a7159d3bf51a0e53be7a8f89699be7";
+
+ HttpHeaders headers = camundaRequestHandler.setCamundaHeaders(encryptedAuth, key);
+ List<org.springframework.http.MediaType> acceptedType = headers.getAccept();
+
+ String expectedAcceptedType = "application/json";
+ assertEquals(expectedAcceptedType, acceptedType.get(0).toString());
+ String basicAuth = headers.getFirst(HttpHeaders.AUTHORIZATION);
+ String expectedBasicAuth = "Basic dXNlcjpwYXNzd29yZA==";
+
+ assertEquals(expectedBasicAuth, basicAuth);
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/E2EServiceInstancesTest.java
index 7ddab572e3..979aa8fbb1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/E2EServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/E2EServiceInstancesTest.java
@@ -62,14 +62,13 @@ public class E2EServiceInstancesTest extends BaseTest {
wireMockServer.stubFor(post(urlPathEqualTo("/testOrchestrationUri")).willReturn(aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/")).withRequestBody(equalToJson(
- "{\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"Error parsing request: No valid requestorId is specified\",\"progress\":100,\"startTime\":1533541051247,\"endTime\":1533541051247,\"source\":null,\"vnfId\":null,\"vnfName\":null,\"vnfType\":null,\"serviceType\":null,\"aicNodeClli\":null,\"tenantId\":null,\"provStatus\":null,\"vnfParams\":null,\"vnfOutputs\":null,\"requestBody\":\"{\\r\\n \\\"service\\\":{\\r\\n \\\"name\\\":\\\"so_test4\\\",\\r\\n \\\"description\\\":\\\"so_test2\\\",\\r\\n \\\"serviceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561519\\\",\\r\\n \\\"serviceUuid\\\":\\\"592f9437-a9c0-4303-b9f6-c445bb7e9814\\\",\\r\\n \\\"globalSubscriberId\\\":\\\"123457\\\",\\r\\n \\\"serviceType\\\":\\\"voLTE\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"resources\\\":[\\r\\n {\\r\\n \\\"resourceName\\\":\\\"vIMS\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561516\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561512\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-vBAS-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\"\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-vMME-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\"\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"vEPC\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"61c3e96e-0970-4871-b6e0-3b6de7561516\\\",\\r\\n \\\"resourceUuid\\\":\\\"62c3e96e-0970-4871-b6e0-3b6de7561512\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-CSCF-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad1\\\"\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"underlayvpn\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561513\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561514\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"overlayvpn\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561517\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561518\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n\\r\\n ]\\r\\n }\\r\\n }\\r\\n ],\\r\\n \\\"requestInputs\\\":{\\r\\n \\\"externalDataNetworkName\\\":\\\"Flow_out_net\\\",\\r\\n \\\"m6000_mng_ip\\\":\\\"181.18.20.2\\\",\\r\\n \\\"externalCompanyFtpDataNetworkName\\\":\\\"Flow_out_net\\\",\\r\\n \\\"externalPluginManageNetworkName\\\":\\\"plugin_net_2014\\\",\\r\\n \\\"externalManageNetworkName\\\":\\\"mng_net_2017\\\",\\r\\n \\\"sfc_data_network\\\":\\\"sfc_data_net_2016\\\",\\r\\n \\\"NatIpRange\\\":\\\"210.1.1.10-210.1.1.20\\\",\\r\\n \\\"location\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\",\\r\\n \\\"sdncontroller\\\":\\\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\\\"\\r\\n }\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n}\",\"responseBody\":null,\"lastModifiedBy\":\"APIH\",\"modifyTime\":null,\"requestType\":null,\"volumeGroupId\":null,\"volumeGroupName\":null,\"vfModuleId\":null,\"vfModuleName\":null,\"vfModuleModelName\":null,\"aaiServiceId\":null,\"aicCloudRegion\":null,\"callBackUrl\":null,\"correlator\":null,\"serviceInstanceId\":null,\"serviceInstanceName\":null,\"requestScope\":\"service\",\"requestAction\":\"createInstance\",\"networkId\":null,\"networkName\":null,\"networkType\":null,\"requestorId\":null,\"configurationId\":null,\"configurationName\":null,\"operationalEnvId\":null,\"operationalEnvName\":null,\"requestURI\":\"d167c9d0-1785-4e93-b319-996ebbcc3272\"}"))
+ "{\"requestStatus\":\"FAILED\",\"statusMessage\":\"Error parsing request: No valid requestorId is specified\",\"progress\":100,\"startTime\":1533541051247,\"endTime\":1533541051247,\"source\":null,\"vnfId\":null,\"vnfName\":null,\"vnfType\":null,\"serviceType\":null,\"tenantId\":null,\"vnfParams\":null,\"vnfOutputs\":null,\"requestBody\":\"{\\r\\n \\\"service\\\":{\\r\\n \\\"name\\\":\\\"so_test4\\\",\\r\\n \\\"description\\\":\\\"so_test2\\\",\\r\\n \\\"serviceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561519\\\",\\r\\n \\\"serviceUuid\\\":\\\"592f9437-a9c0-4303-b9f6-c445bb7e9814\\\",\\r\\n \\\"globalSubscriberId\\\":\\\"123457\\\",\\r\\n \\\"serviceType\\\":\\\"voLTE\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"resources\\\":[\\r\\n {\\r\\n \\\"resourceName\\\":\\\"vIMS\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561516\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561512\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-vBAS-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\"\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-vMME-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\"\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"vEPC\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"61c3e96e-0970-4871-b6e0-3b6de7561516\\\",\\r\\n \\\"resourceUuid\\\":\\\"62c3e96e-0970-4871-b6e0-3b6de7561512\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n {\\r\\n \\\"vnfProfileId\\\":\\\"zte-CSCF-1.0\\\",\\r\\n \\\"locationConstraints\\\":{\\r\\n \\\"vimId\\\":\\\"4050083f-465f-4838-af1e-47a545222ad1\\\"\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"underlayvpn\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561513\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561514\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n\\r\\n ]\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"resourceName\\\":\\\"overlayvpn\\\",\\r\\n \\\"resourceInvariantUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561517\\\",\\r\\n \\\"resourceUuid\\\":\\\"60c3e96e-0970-4871-b6e0-3b6de7561518\\\",\\r\\n \\\"parameters\\\":{\\r\\n \\\"locationConstraints\\\":[\\r\\n\\r\\n ]\\r\\n }\\r\\n }\\r\\n ],\\r\\n \\\"requestInputs\\\":{\\r\\n \\\"externalDataNetworkName\\\":\\\"Flow_out_net\\\",\\r\\n \\\"m6000_mng_ip\\\":\\\"181.18.20.2\\\",\\r\\n \\\"externalCompanyFtpDataNetworkName\\\":\\\"Flow_out_net\\\",\\r\\n \\\"externalPluginManageNetworkName\\\":\\\"plugin_net_2014\\\",\\r\\n \\\"externalManageNetworkName\\\":\\\"mng_net_2017\\\",\\r\\n \\\"sfc_data_network\\\":\\\"sfc_data_net_2016\\\",\\r\\n \\\"NatIpRange\\\":\\\"210.1.1.10-210.1.1.20\\\",\\r\\n \\\"location\\\":\\\"4050083f-465f-4838-af1e-47a545222ad0\\\",\\r\\n \\\"sdncontroller\\\":\\\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\\\"\\r\\n }\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n}\",\"responseBody\":null,\"lastModifiedBy\":\"APIH\",\"modifyTime\":null,\"volumeGroupId\":null,\"volumeGroupName\":null,\"vfModuleId\":null,\"vfModuleName\":null,\"vfModuleModelName\":null,\"cloudRegion\":null,\"callBackUrl\":null,\"correlator\":null,\"serviceInstanceId\":null,\"serviceInstanceName\":null,\"requestScope\":\"service\",\"requestAction\":\"createInstance\",\"networkId\":null,\"networkName\":null,\"networkType\":null,\"requestorId\":null,\"configurationId\":null,\"configurationName\":null,\"operationalEnvId\":null,\"operationalEnvName\":null,\"requestURI\":\"d167c9d0-1785-4e93-b319-996ebbcc3272\"}"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
Service defaultService = new Service();
defaultService.setModelUUID("d88da85c-d9e8-4f73-b837-3a72a431622a");
ServiceRecipe serviceRecipe = new ServiceRecipe();
serviceRecipe.setServiceModelUUID(defaultService.getModelUUID());
- serviceRecipe.setAction(Action.scaleInstance.name());
serviceRecipe.setRecipeTimeout(180);
serviceRecipe.setOrchestrationUri("/testOrchestrationUri");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
index 928b488f6a..0291cfd2ea 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
@@ -20,70 +20,67 @@
package org.onap.so.apihandlerinfra;
-import static org.junit.Assert.assertArrayEquals;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyObject;
+import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.anyString;
import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import org.springframework.test.util.ReflectionTestUtils;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
import org.json.JSONException;
-import org.junit.Rule;
import org.junit.Test;
-import org.mockito.InjectMocks;
+import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
-import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.mock.mockito.SpyBean;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.client.RestTemplate;
+import com.fasterxml.jackson.core.JsonProcessingException;
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = {GenericStringConverter.class, HealthCheckConverter.class},
+ initializers = {ConfigFileApplicationContextInitializer.class})
+@ActiveProfiles("test")
+@EnableConfigurationProperties({HealthCheckConfig.class})
public class GlobalHealthcheckHandlerTest {
- @Mock
- RestTemplate restTemplate;
+ @MockBean
+ private RestTemplate restTemplate;
- @Mock
- ContainerRequestContext requestContext;
+ @MockBean
+ private ContainerRequestContext requestContext;
- @InjectMocks
- @Spy
- GlobalHealthcheckHandler globalhealth;
-
- @Rule
- public MockitoRule mockitoRule = MockitoJUnit.rule();
+ @SpyBean
+ private GlobalHealthcheckHandler globalhealth;
@Test
public void testQuerySubsystemHealthNullResult() {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8080");
Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(null);
- String result = globalhealth.querySubsystemHealth(MsoSubsystems.BPMN);
- System.out.println(result);
- assertEquals(HealthcheckStatus.DOWN.toString(), result);
+ HealthCheckSubsystem result = globalhealth
+ .querySubsystemHealth(new Endpoint(SoSubsystems.BPMN, UriBuilder.fromPath("http://localhost").build()));
+ assertEquals(HealthCheckStatus.DOWN, result.getStatus());
}
@Test
public void testQuerySubsystemHealthNotNullResult() {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
subSystemResponse.setStatus("UP");
@@ -92,20 +89,13 @@ public class GlobalHealthcheckHandlerTest {
Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(r);
- String result = globalhealth.querySubsystemHealth(MsoSubsystems.ASDC);
- System.out.println(result);
- assertEquals(HealthcheckStatus.UP.toString(), result);
+ HealthCheckSubsystem result = globalhealth
+ .querySubsystemHealth(new Endpoint(SoSubsystems.ASDC, UriBuilder.fromPath("http://localhost").build()));
+ assertEquals(HealthCheckStatus.UP, result.getStatus());
}
private Response globalHealthcheck(String status) {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
- ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
- ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
- ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
@@ -116,70 +106,41 @@ public class GlobalHealthcheckHandlerTest {
Mockito.when(requestContext.getProperty(anyString())).thenReturn("1234567890");
Response response = globalhealth.globalHealthcheck(true, requestContext);
-
return response;
}
@Test
- public void globalHealthcheckAllUPTest() throws JSONException {
- Response response = globalHealthcheck("UP");
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- HealthcheckResponse root;
- root = (HealthcheckResponse) response.getEntity();
- String apistatus = root.getApih();
- assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String bpmnstatus = root.getBpmn();
- assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String sdncstatus = root.getSdncAdapter();
- assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ public void globalHealthcheckAllUPTest() throws JSONException, JsonProcessingException {
- String asdcstatus = root.getAsdcController();
- assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ HealthCheckResponse expected = new HealthCheckResponse();
- String catastatus = root.getCatalogdbAdapter();
- assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String reqdbstatus = root.getRequestdbAdapter();
- assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String openstatus = root.getOpenstackAdapter();
- assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ for (Subsystem system : SoSubsystems.values()) {
+ expected.getSubsystems().add(new HealthCheckSubsystem(system,
+ UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.UP));
+ }
+ expected.setMessage("HttpStatus: 200");
+ Response response = globalHealthcheck("UP");
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ HealthCheckResponse root;
+ root = (HealthCheckResponse) response.getEntity();
+ assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
- String reqdbattstatus = root.getRequestdbAdapterAttsvc();
- assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
}
@Test
public void globalHealthcheckAllDOWNTest() throws JSONException {
+ HealthCheckResponse expected = new HealthCheckResponse();
+
+ for (Subsystem system : SoSubsystems.values()) {
+ expected.getSubsystems().add(new HealthCheckSubsystem(system,
+ UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.DOWN));
+ }
+ expected.setMessage("HttpStatus: 200");
Response response = globalHealthcheck("DOWN");
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- HealthcheckResponse root;
- root = (HealthcheckResponse) response.getEntity();
- String apistatus = root.getApih();
- assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String bpmnstatus = root.getBpmn();
- assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String sdncstatus = root.getSdncAdapter();
- assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String asdcstatus = root.getAsdcController();
- assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String catastatus = root.getCatalogdbAdapter();
- assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String reqdbstatus = root.getRequestdbAdapter();
- assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String openstatus = root.getOpenstackAdapter();
- assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String reqdbattstatus = root.getRequestdbAdapterAttsvc();
- assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
+ HealthCheckResponse root;
+ root = (HealthCheckResponse) response.getEntity();
+ assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
}
@Test
@@ -189,40 +150,15 @@ public class GlobalHealthcheckHandlerTest {
assertEquals(MediaType.APPLICATION_JSON, he.getHeaders().getContentType());
}
- @Test
- public void getEndpointUrlForSubsystemEnumTest() {
- ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
- ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
- ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
- ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
-
- String result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.ASDC);
- assertEquals("http://localhost:8080", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.SDNC);
- assertEquals("http://localhost:8081", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.BPMN);
- assertEquals("http://localhost:8082", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.CATALOGDB);
- assertEquals("http://localhost:8083", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.OPENSTACK);
- assertEquals("http://localhost:8084", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDB);
- assertEquals("http://localhost:8085", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDBATT);
- assertEquals("http://localhost:8086", result);
- }
@Test
public void processResponseFromSubsystemTest() {
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
subSystemResponse.setStatus("UP");
ResponseEntity<SubsystemHealthcheckResponse> r = new ResponseEntity<>(subSystemResponse, HttpStatus.OK);
- String result = globalhealth.processResponseFromSubsystem(r, MsoSubsystems.BPMN);
- assertEquals("UP", result);
+ Endpoint endpoint = new Endpoint(SoSubsystems.BPMN, UriBuilder.fromUri("http://localhost").build());
+ HealthCheckStatus result = globalhealth.processResponseFromSubsystem(r, endpoint);
+ assertEquals(HealthCheckStatus.UP, result);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java
index 9fc9e4a51b..5c78af3601 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java
@@ -29,9 +29,10 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
-import static org.onap.so.logger.HttpHeadersConstants.ONAP_REQUEST_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_REQUEST_ID;
import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
-import static org.onap.so.logger.MdcConstants.CLIENT_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_PARTNER_NAME;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.TRANSACTION_ID;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -81,10 +82,10 @@ public class InstanceManagementTest extends BaseTest {
// set headers
headers = new HttpHeaders();
headers.set(ONAPLogConstants.Headers.PARTNER_NAME, "test_name");
- headers.set(HttpHeadersConstants.TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAP_REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAPLogConstants.MDCs.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
headers.set(REQUESTOR_ID, "xxxxxx");
try { // generate one-time port number to avoid RANDOM port number later.
initialUrl = new URL(createURLWithPort(Constants.ORCHESTRATION_REQUESTS_PATH));
@@ -171,4 +172,32 @@ public class InstanceManagementTest extends BaseTest {
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
}
+
+ @Test
+ public void executePNFCustomWorkflow() throws IOException {
+ wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/testingPNFWorkflow"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/TestResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ wireMockServer.stubFor(get(urlMatching(
+ ".*/workflow/search/findByArtifactUUID[?]artifactUUID=81526781-e55c-4cb7-adb3-97e09d9c76bf"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb("workflow_pnf_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ // expected response
+ ServiceInstancesResponse expectedResponse = new ServiceInstancesResponse();
+ RequestReferences requestReferences = new RequestReferences();
+ requestReferences.setInstanceId("1882939");
+ requestReferences.setRequestSelfLink(createExpectedSelfLink("v1", "32807a28-1a14-4b88-b7b3-2950918aa76d"));
+ expectedResponse.setRequestReferences(requestReferences);
+ uri = instanceManagementUri + "v1"
+ + "/serviceInstances/5df8b6de-2083-11e7-93ae-92361f002676/pnfs/testpnfcId/workflows/81526781-e55c-4cb7-adb3-97e09d9c76bf";
+ ResponseEntity<String> response =
+ sendRequest(inputStream("/ExecutePNFCustomWorkflow.json"), uri, HttpMethod.POST, headers);
+
+ assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
+ assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
index ad0a878931..b8d1e56cf7 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
@@ -26,24 +26,13 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static com.shazam.shazamcrest.MatcherAssert.assertThat;
-import static org.onap.so.logger.MdcConstants.ECOMP_REQUEST_ID;
-import static org.onap.so.logger.MdcConstants.ENDTIME;
-import static org.onap.so.logger.MdcConstants.INVOCATION_ID;
-import static org.onap.so.logger.MdcConstants.PARTNERNAME;
-import static org.onap.so.logger.MdcConstants.RESPONSECODE;
-import static org.onap.so.logger.MdcConstants.RESPONSEDESC;
-import static org.onap.so.logger.MdcConstants.SERVICE_NAME;
-import static org.onap.so.logger.MdcConstants.STATUSCODE;
-import static org.onap.so.logger.MdcConstants.CLIENT_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ECOMP_REQUEST_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_PARTNER_NAME;
import java.io.IOException;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.junit.Test;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandlerinfra.tasksbeans.RequestDetails;
import org.onap.so.apihandlerinfra.tasksbeans.RequestInfo;
import org.onap.so.apihandlerinfra.tasksbeans.TaskRequestReference;
@@ -59,7 +48,6 @@ import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.http.Fault;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class ManualTasksTest extends BaseTest {
@@ -89,7 +77,7 @@ public class ManualTasksTest extends BaseTest {
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
headers.set(ECOMP_REQUEST_ID, "987654321");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
HttpEntity<TasksRequest> entity = new HttpEntity<TasksRequest>(taskReq, headers);
UriComponentsBuilder builder =
@@ -108,34 +96,6 @@ public class ManualTasksTest extends BaseTest {
// then
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
assertThat(realResponse, sameBeanAs(expectedResponse));
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("tasks/v1/55/complete", mdc.get(SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(STATUSCODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ENDTIME));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("202", mdc.get(RESPONSECODE));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("tasks/v1/55/complete", mdc.get(SERVICE_NAME));
- assertEquals("COMPLETE", mdc.get(STATUSCODE));
- assertNotNull(mdc.get(RESPONSEDESC));
- assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0));
- assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
- assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
- assertEquals("1.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- }
}
@Test
@@ -152,7 +112,7 @@ public class ManualTasksTest extends BaseTest {
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
headers.set(ECOMP_REQUEST_ID, "987654321");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
HttpEntity<String> entity = new HttpEntity<String>(invalidRequest, headers);
UriComponentsBuilder builder =
@@ -161,7 +121,6 @@ public class ManualTasksTest extends BaseTest {
restTemplate.exchange(builder.toUriString(), HttpMethod.POST, entity, String.class);
ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
@@ -189,7 +148,7 @@ public class ManualTasksTest extends BaseTest {
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
headers.set(ECOMP_REQUEST_ID, "987654321");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
HttpEntity<TasksRequest> entity = new HttpEntity<TasksRequest>(taskReq, headers);
UriComponentsBuilder builder =
@@ -198,7 +157,6 @@ public class ManualTasksTest extends BaseTest {
restTemplate.exchange(builder.toUriString(), HttpMethod.POST, entity, String.class);
ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
@@ -230,7 +188,7 @@ public class ManualTasksTest extends BaseTest {
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
headers.set(ECOMP_REQUEST_ID, "987654321");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
HttpEntity<TasksRequest> entity = new HttpEntity<TasksRequest>(taskReq, headers);
UriComponentsBuilder builder =
@@ -240,7 +198,6 @@ public class ManualTasksTest extends BaseTest {
ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
index 86bf8060a7..f1d5a5487f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
@@ -278,10 +278,6 @@ public class MsoRequestTest extends BaseTest {
ServiceInstancesRequest.class),
instanceIdMapTest, Action.createInstance, 5},
{"No valid cloudConfiguration is specified",
- mapper.readValue(inputStream("/CloudConfiguration/CloudConfigurationVnf.json"),
- ServiceInstancesRequest.class),
- instanceIdMapTest, Action.replaceInstance, 5},
- {"No valid cloudConfiguration is specified",
mapper.readValue(inputStream("/CloudConfiguration/CloudConfigurationConfig.json"),
ServiceInstancesRequest.class),
instanceIdMapTest, Action.enablePort, 5},
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
index 12f0ffcc11..aa6a3836c1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
@@ -45,6 +45,7 @@ import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@@ -64,7 +65,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -107,6 +107,18 @@ public class OrchestrationRequestsTest extends BaseTest {
.withBody(new String(Files.readAllBytes(Paths.get(
"src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json"))))
.withStatus(HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(
+ ("/requestProcessingData/search/findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc?SO_REQUEST_ID=00032ab7-1a18-42e5-965d-8ea592502018&IS_INTERNAL_DATA=false"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(new String(Files.readAllBytes(Paths.get(
+ "src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json"))))
+ .withStatus(HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(
+ ("/requestProcessingData/search/findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc?SO_REQUEST_ID=00032ab7-3fb3-42e5-965d-8ea592502017&IS_INTERNAL_DATA=false"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(new String(Files.readAllBytes(Paths.get(
+ "src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json"))))
+ .withStatus(HttpStatus.SC_OK)));
}
@Test
@@ -117,10 +129,21 @@ public class OrchestrationRequestsTest extends BaseTest {
Request request = ORCHESTRATION_LIST.getRequestList().get(1).getRequest();
testResponse.setRequest(request);
+ testResponse.getRequest().setRequestProcessingData(new ArrayList<RequestProcessingData>());
+ RequestProcessingData e = new RequestProcessingData();
+ e.setGroupingId("7d2e8c07-4d10-456d-bddc-37abf38ca714");
+ e.setTag("pincFabricConfigRequest");
+ List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
+ HashMap<String, String> data1 = new HashMap<String, String>();
+ data1.put("requestAction", "assign");
+ data.add(data1);
+ e.setDataPairs(data);
+ testResponse.getRequest().getRequestProcessingData().add(e);
String testRequestId = request.getRequestId();
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ headers.set(ONAPLogConstants.Headers.REQUEST_ID, "1e45215d-b7b3-4c5a-9316-65bdddaf649f");
HttpEntity<Request> entity = new HttpEntity<Request>(null, headers);
UriComponentsBuilder builder = UriComponentsBuilder
@@ -136,7 +159,41 @@ public class OrchestrationRequestsTest extends BaseTest {
assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
assertEquals("7.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- assertEquals("00032ab7-1a18-42e5-965d-8ea592502018", response.getHeaders().get("X-TransactionID").get(0));
+ assertEquals("1e45215d-b7b3-4c5a-9316-65bdddaf649f", response.getHeaders().get("X-TransactionID").get(0));
+ assertNotNull(response.getBody().getRequest().getFinishTime());
+ }
+
+ @Test
+ public void getOrchestrationRequestSimpleTest() throws Exception {
+ setupTestGetOrchestrationRequest();
+ // TEST VALID REQUEST
+ GetOrchestrationResponse testResponse = new GetOrchestrationResponse();
+
+ Request request = ORCHESTRATION_LIST.getRequestList().get(1).getRequest();
+ request.setRequestProcessingData(null);
+ testResponse.setRequest(request);
+
+ String testRequestId = request.getRequestId();
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ headers.set(ONAPLogConstants.Headers.REQUEST_ID, "e5e3c007-9fe9-4a20-8691-bdd20e14504d");
+ HttpEntity<Request> entity = new HttpEntity<Request>(null, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder
+ .fromHttpUrl(createURLWithPort("/onap/so/infra/orchestrationRequests/v7/" + testRequestId))
+ .queryParam("format", "simple");
+
+ ResponseEntity<GetOrchestrationResponse> response =
+ restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, GetOrchestrationResponse.class);
+
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ assertThat(response.getBody(), sameBeanAs(testResponse).ignoring("request.startTime")
+ .ignoring("request.finishTime").ignoring("request.requestStatus.timeStamp"));
+ assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0));
+ assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
+ assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
+ assertEquals("7.0.0", response.getHeaders().get("X-LatestVersion").get(0));
+ assertEquals("e5e3c007-9fe9-4a20-8691-bdd20e14504d", response.getHeaders().get("X-TransactionID").get(0));
assertNotNull(response.getBody().getRequest().getFinishTime());
}
@@ -148,6 +205,16 @@ public class OrchestrationRequestsTest extends BaseTest {
Request request = ORCHESTRATION_LIST.getRequestList().get(8).getRequest();
testResponse.setRequest(request);
+ testResponse.getRequest().setRequestProcessingData(new ArrayList<RequestProcessingData>());
+ RequestProcessingData e = new RequestProcessingData();
+ e.setGroupingId("7d2e8c07-4d10-456d-bddc-37abf38ca714");
+ e.setTag("pincFabricConfigRequest");
+ List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
+ HashMap<String, String> data1 = new HashMap<String, String>();
+ data1.put("requestAction", "assign");
+ data.add(data1);
+ e.setDataPairs(data);
+ testResponse.getRequest().getRequestProcessingData().add(e);
String testRequestId = request.getRequestId();
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON);
@@ -184,10 +251,21 @@ public class OrchestrationRequestsTest extends BaseTest {
request.setCloudRequestData(cloudRequestData);
testResponse.setRequest(request);
String testRequestId = request.getRequestId();
+ testResponse.getRequest().setRequestProcessingData(new ArrayList<RequestProcessingData>());
+ RequestProcessingData e = new RequestProcessingData();
+ e.setGroupingId("7d2e8c07-4d10-456d-bddc-37abf38ca714");
+ e.setTag("pincFabricConfigRequest");
+ List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
+ HashMap<String, String> data1 = new HashMap<String, String>();
+ data1.put("requestAction", "assign");
+ data.add(data1);
+ e.setDataPairs(data);
+ testResponse.getRequest().getRequestProcessingData().add(e);
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ headers.set(ONAPLogConstants.Headers.REQUEST_ID, "0321e28d-3dde-4b31-9b28-1e0f07231b93");
HttpEntity<Request> entity = new HttpEntity<Request>(null, headers);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(
@@ -204,7 +282,7 @@ public class OrchestrationRequestsTest extends BaseTest {
assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
assertEquals("7.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- assertEquals("00032ab7-3fb3-42e5-965d-8ea592502017", response.getHeaders().get("X-TransactionID").get(0));
+ assertEquals("0321e28d-3dde-4b31-9b28-1e0f07231b93", response.getHeaders().get("X-TransactionID").get(0));
}
@Test
@@ -281,7 +359,6 @@ public class OrchestrationRequestsTest extends BaseTest {
public void testUnlockOrchestrationRequest() throws Exception {
setupTestUnlockOrchestrationRequest("0017f68c-eb2d-45bb-b7c7-ec31b37dc349", "UNLOCKED");
ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
String requestJSON =
new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/Request.json")));
HttpHeaders headers = new HttpHeaders();
@@ -317,7 +394,6 @@ public class OrchestrationRequestsTest extends BaseTest {
public void testUnlockOrchestrationRequest_invalid_Json() throws Exception {
setupTestUnlockOrchestrationRequest_invalid_Json();
ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
String requestJSON =
new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/Request.json")));
HttpHeaders headers = new HttpHeaders();
@@ -335,7 +411,7 @@ public class OrchestrationRequestsTest extends BaseTest {
expectedRequestError = new RequestError();
se = new ServiceException();
se.setMessageId(ErrorNumbers.SVC_DETAILED_SERVICE_ERROR);
- se.setText("Null response from RequestDB when searching by RequestId");
+ se.setText("Null response from RequestDB when searching by RequestId " + INVALID_REQUEST_ID);
expectedRequestError.setServiceException(se);
builder = UriComponentsBuilder.fromHttpUrl(
@@ -345,7 +421,7 @@ public class OrchestrationRequestsTest extends BaseTest {
actualRequestError = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatusCode().value());
- assertThat(actualRequestError, sameBeanAs(expectedRequestError));
+ assertThat(expectedRequestError, sameBeanAs(actualRequestError));
}
@Test
@@ -408,6 +484,7 @@ public class OrchestrationRequestsTest extends BaseTest {
assertThat(actualProcessingData, sameBeanAs(expectedDataList));
}
+
public void setupTestGetOrchestrationRequest() throws Exception {
// For testGetOrchestrationRequest
wireMockServer.stubFor(any(urlPathEqualTo("/infraActiveRequests/00032ab7-1a18-42e5-965d-8ea592502018"))
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
index 5023155768..47aa3cccb5 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
@@ -21,10 +21,12 @@
package org.onap.so.apihandlerinfra;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
import javax.ws.rs.core.Response;
import org.apache.commons.lang.StringUtils;
@@ -38,6 +40,7 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
+import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.constants.OrchestrationRequestFormat;
import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -232,6 +235,21 @@ public class OrchestrationRequestsUnitTest {
}
@Test
+ public void mapRequestStatusAndExtSysErrSrcToRequestErrorMessageTest() throws ApiException {
+ InstanceReferences instanceReferences = new InstanceReferences();
+ instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ iar.setExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
+ iar.setFlowStatus(null);
+ iar.setStatusMessage("Error retrieving cloud region from AAI");
+
+ Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
+ OrchestrationRequestFormat.DETAIL.toString());
+
+ assertTrue(actual.getRequestStatus().getStatusMessage()
+ .contains("Error Source: " + ROLLBACK_EXT_SYSTEM_ERROR_SOURCE));
+ }
+
+ @Test
public void mapRequestStatusAndExtSysErrSrcToRequestFlowStatusSuccessfulCompletionTest() throws ApiException {
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
@@ -295,6 +313,14 @@ public class OrchestrationRequestsUnitTest {
assertEquals(Status.ABORTED.toString(), result);
}
+ @Test
+ public void mapRequestStatusToRequestForFormatStatusDetailTest() throws ApiException {
+ iar.setRequestStatus(Status.ABORTED.toString());
+ String result = orchestrationRequests.mapRequestStatusToRequest(iar, "statusDetail");
+
+ assertEquals(Status.ABORTED.toString(), result);
+ }
+
@Test
public void mapRequestStatusToRequestForFormatEmptyStringTest() throws ApiException {
@@ -303,4 +329,13 @@ public class OrchestrationRequestsUnitTest {
assertEquals(Status.FAILED.toString(), result);
}
+
+ @Test
+ public void infraActiveRequestNullValidationExceptionTest() throws ApiException {
+ iar.setRequestId(REQUEST_ID);
+ thrown.expect(ValidateException.class);
+ thrown.expectMessage(containsString("Null response from RequestDB when searching by RequestId " + REQUEST_ID));
+ orchestrationRequests.infraActiveRequestLookup(iar.getRequestId());
+ }
+
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
index e4532cd8d7..abdf38dfa6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
@@ -30,9 +30,10 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.onap.so.logger.HttpHeadersConstants.ONAP_REQUEST_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_REQUEST_ID;
import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
-import static org.onap.so.logger.MdcConstants.CLIENT_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_PARTNER_NAME;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.TRANSACTION_ID;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -95,10 +96,10 @@ public class RequestHandlerUtilsTest extends BaseTest {
// set headers
headers = new HttpHeaders();
headers.set(ONAPLogConstants.Headers.PARTNER_NAME, "test_name");
- headers.set(HttpHeadersConstants.TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAP_REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAPLogConstants.MDCs.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
headers.set(REQUESTOR_ID, "xxxxxx");
try { // generate one-time port number to avoid RANDOM port number later.
initialUrl = new URL(createURLWithPort(Constants.ORCHESTRATION_REQUESTS_PATH));
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
index d4b0c3aad1..557771d298 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
@@ -25,10 +25,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.Timestamp;
+import java.util.HashMap;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -102,7 +104,7 @@ public class RequestHandlerUtilsUnitTest {
private void setInfraActiveRequest() throws IOException {
infraActiveRequest.setTenantId("tenant-id");
infraActiveRequest.setRequestBody(getRequestBody("/RequestBody.json"));
- infraActiveRequest.setAicCloudRegion("cloudRegion");
+ infraActiveRequest.setCloudRegion("cloudRegion");
infraActiveRequest.setRequestScope("service");
infraActiveRequest.setServiceInstanceId(SERVICE_INSTANCE_ID);
infraActiveRequest.setServiceInstanceName(SERVICE_INSTANCE_NAME);
@@ -117,7 +119,7 @@ public class RequestHandlerUtilsUnitTest {
currentActiveRequest.setStartTime(startTimeStamp);
currentActiveRequest.setTenantId("tenant-id");
currentActiveRequest.setRequestBody(getRequestBody("/RequestBodyNewRequestorId.json"));
- currentActiveRequest.setAicCloudRegion("cloudRegion");
+ currentActiveRequest.setCloudRegion("cloudRegion");
currentActiveRequest.setRequestScope("service");
currentActiveRequest.setRequestStatus(Status.IN_PROGRESS.toString());
currentActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
@@ -441,4 +443,28 @@ public class RequestHandlerUtilsUnitTest {
assertEquals(expected, result);
}
+ @Test
+ public void checkForDuplicateRequestsTest() throws ApiException {
+ InfraActiveRequests currentActiveReq = new InfraActiveRequests();
+ currentActiveReq.setCloudRegion("testRegion");
+ currentActiveReq.setRequestId("792a3158-d9a3-49fd-b3ac-ab09842d6a1a");
+ Action action = Action.createInstance;
+ String requestScope = ModelType.service.toString();
+
+ InfraActiveRequests duplicate = new InfraActiveRequests();
+
+ HashMap<String, String> instanceIdMap = new HashMap<String, String>();
+ String instanceName = "instanceName";
+
+ doReturn(duplicate).when(requestHandler).duplicateCheck(action, instanceIdMap, instanceName, requestScope,
+ currentActiveReq);
+ doReturn(true).when(requestHandler).camundaHistoryCheck(duplicate, currentActiveReq);
+ doNothing().when(requestHandler).buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap,
+ instanceName, requestScope, duplicate);
+
+ requestHandler.checkForDuplicateRequests(action, instanceIdMap, requestScope, currentActiveReq, instanceName);
+ verify(requestHandler).buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, instanceName,
+ requestScope, duplicate);
+ }
+
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequestTest.java
index 1e755419be..7191e297ec 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequestTest.java
@@ -21,6 +21,7 @@ package org.onap.so.apihandlerinfra;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyString;
@@ -30,7 +31,6 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -56,10 +56,10 @@ import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
import org.onap.so.serviceinstancebeans.ModelInfo;
+import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.springframework.web.client.HttpClientErrorException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.onap.so.serviceinstancebeans.ModelType;
@RunWith(MockitoJUnitRunner.class)
public class ResumeOrchestrationRequestTest {
@@ -149,7 +149,7 @@ public class ResumeOrchestrationRequestTest {
private void setInfraActiveRequest() throws IOException {
infraActiveRequest.setTenantId("tenant-id");
infraActiveRequest.setRequestBody(getRequestBody("/RequestBody.json"));
- infraActiveRequest.setAicCloudRegion("cloudRegion");
+ infraActiveRequest.setCloudRegion("cloudRegion");
infraActiveRequest.setRequestScope(SERVICE);
infraActiveRequest.setServiceInstanceId(SERVICE_INSTANCE_ID);
infraActiveRequest.setServiceInstanceName(SERVICE_INSTANCE_NAME);
@@ -173,7 +173,7 @@ public class ResumeOrchestrationRequestTest {
currentActiveRequest.setStartTime(startTimeStamp);
currentActiveRequest.setTenantId("tenant-id");
currentActiveRequest.setRequestBody(getRequestBody("/RequestBody.json"));
- currentActiveRequest.setAicCloudRegion("cloudRegion");
+ currentActiveRequest.setCloudRegion("cloudRegion");
currentActiveRequest.setRequestScope(SERVICE);
currentActiveRequest.setServiceInstanceId(SERVICE_INSTANCE_ID);
currentActiveRequest.setServiceInstanceName(SERVICE_INSTANCE_NAME);
@@ -258,7 +258,7 @@ public class ResumeOrchestrationRequestTest {
when(requestHandler.convertJsonToServiceInstanceRequest(anyString(), any(Actions.class), anyString(),
anyString())).thenReturn(sir);
when(serviceInstances.getPnfCorrelationId(any(ServiceInstancesRequest.class))).thenReturn("pnfCorrelationId");
- doReturn(lookupResult).when(serviceInstances).getServiceInstanceOrchestrationURI(sir, action, aLaCarte,
+ doReturn(lookupResult).when(requestHandler).getServiceInstanceOrchestrationURI(sir, action, aLaCarte,
currentActiveRequest);
doReturn(requestClientParameter).when(resumeReq).setRequestClientParameter(lookupResult, version,
infraActiveRequest, currentActiveRequest, "pnfCorrelationId", aLaCarte, sir);
@@ -311,7 +311,7 @@ public class ResumeOrchestrationRequestTest {
anyString())).thenReturn(sirNullALaCarte);
when(serviceInstances.getPnfCorrelationId(any(ServiceInstancesRequest.class))).thenReturn("pnfCorrelationId");
doReturn(false).when(msoRequest).getAlacarteFlag(sirNullALaCarte);
- doReturn(lookupResult).when(serviceInstances).getServiceInstanceOrchestrationURI(sirNullALaCarte, action, false,
+ doReturn(lookupResult).when(requestHandler).getServiceInstanceOrchestrationURI(sirNullALaCarte, action, false,
currentActiveRequest);
doReturn(requestClientParameter).when(resumeReq).setRequestClientParameter(lookupResult, version,
infraActiveRequest, currentActiveRequest, "pnfCorrelationId", aLaCarte, sirNullALaCarte);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index e28e36d307..006b82ac58 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -29,21 +29,13 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
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.onap.so.logger.HttpHeadersConstants.ONAP_REQUEST_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_PARTNER_NAME;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_REQUEST_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.TRANSACTION_ID;
import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
-import static org.onap.so.logger.HttpHeadersConstants.TRANSACTION_ID;
-import static org.onap.so.logger.MdcConstants.CLIENT_ID;
-import static org.onap.so.logger.MdcConstants.ENDTIME;
-import static org.onap.so.logger.MdcConstants.INVOCATION_ID;
-import static org.onap.so.logger.MdcConstants.PARTNERNAME;
-import static org.onap.so.logger.MdcConstants.RESPONSECODE;
-import static org.onap.so.logger.MdcConstants.RESPONSEDESC;
-import static org.onap.so.logger.MdcConstants.SERVICE_NAME;
-import static org.onap.so.logger.MdcConstants.STATUSCODE;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -64,7 +56,6 @@ import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceRecipe;
import org.onap.so.db.request.beans.InfraActiveRequests;
-import org.onap.so.logger.HttpHeadersConstants;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelInfo;
import org.onap.so.serviceinstancebeans.ModelType;
@@ -89,12 +80,10 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.http.Fault;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class ServiceInstancesTest extends BaseTest {
private final ObjectMapper mapper = new ObjectMapper();
- private ObjectMapper errorMapper = new ObjectMapper();
@Autowired
private ServiceInstances servInstances;
@@ -116,15 +105,13 @@ public class ServiceInstancesTest extends BaseTest {
@Before
public void beforeClass() {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- errorMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- errorMapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
// set headers
headers = new HttpHeaders();
headers.set(ONAPLogConstants.Headers.PARTNER_NAME, "test_name");
- headers.set(HttpHeadersConstants.TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAP_REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
headers.set(ONAPLogConstants.MDCs.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
- headers.set(CLIENT_ID, "VID");
+ headers.set(ONAP_PARTNER_NAME, "VID");
headers.set(REQUESTOR_ID, "xxxxxx");
try { // generate one-time port number to avoid RANDOM port number later.
initialUrl = new URL(createURLWithPort(Constants.ORCHESTRATION_REQUESTS_PATH));
@@ -132,7 +119,7 @@ public class ServiceInstancesTest extends BaseTest {
} catch (MalformedURLException e) {
e.printStackTrace();
}
- wireMockServer.stubFor(post(urlMatching(".*/infraActiveRequests.*")).willReturn(aResponse()
+ wireMockServer.stubFor(post(urlMatching(".*/infraActiveRequests/")).willReturn(aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).withStatus(HttpStatus.SC_OK)));
Mockito.doReturn(null).when(requestsDbClient).getInfraActiveRequestbyRequestId(Mockito.any());
}
@@ -225,35 +212,6 @@ public class ServiceInstancesTest extends BaseTest {
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
-
-
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("onap/so/infra/serviceInstantiation/v5/serviceInstances", mdc.get(SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(STATUSCODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ENDTIME));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("202", mdc.get(RESPONSECODE));
- assertEquals("UNKNOWN", mdc.get(PARTNERNAME));
- assertEquals("onap/so/infra/serviceInstantiation/v5/serviceInstances", mdc.get(SERVICE_NAME));
- assertEquals("COMPLETE", mdc.get(STATUSCODE));
- assertNotNull(mdc.get(RESPONSEDESC));
- assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
- assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
- assertEquals("5.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- }
}
@Test
@@ -285,14 +243,13 @@ public class ServiceInstancesTest extends BaseTest {
requestReferences.setInstanceId("1882939");
requestReferences.setRequestSelfLink(createExpectedSelfLink("v5", "32807a28-1a14-4b88-b7b3-2950918aa76d"));
expectedResponse.setRequestReferences(requestReferences);
- uri = servInstanceUriPrev7 + "v5";
+ uri = servInstanceuri + "v5";
ResponseEntity<String> response =
sendRequest(inputStream("/ServiceInstancePrev7.json"), uri, HttpMethod.POST, headers);
// then
- assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ assertEquals(404, response.getStatusCode().value());
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
- assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
}
@Test
@@ -896,7 +853,7 @@ public class ServiceInstancesTest extends BaseTest {
ResponseEntity<String> response =
sendRequest(inputStream("/VnfWithServiceRelatedInstanceFail.json"), uri, HttpMethod.POST);
- assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
+ assertEquals(404, response.getStatusCode().value());
}
@Test
@@ -905,7 +862,7 @@ public class ServiceInstancesTest extends BaseTest {
ResponseEntity<String> response = sendRequest(inputStream("/NoVnfResource.json"), uri, HttpMethod.POST);
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals("No valid vnfResource is specified", realResponse.getServiceException().getText());
}
@@ -948,6 +905,45 @@ public class ServiceInstancesTest extends BaseTest {
}
@Test
+ public void replaceVnfInstanceNoCloudConfig() throws IOException {
+ wireMockServer.stubFor(post(urlMatching(".*/infraActiveRequests/v1/getInfraActiveRequests.*"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("infra/VnfLookup.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/TestResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(urlMatching(
+ ".*/vnfResourceCustomization/search/findByModelCustomizationUUID[?]MODEL_CUSTOMIZATION_UUID=68dc9a92-214c-11e7-93ae-92361f002671"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb(
+ "vnfResourceCustomization_ReplaceVnf_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(urlMatching(".*/vnfResourceCustomization/1/vnfResources"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb("vnfResources_ReplaceVnf_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(urlMatching(
+ ".*/vnfRecipe/search/findFirstVnfRecipeByNfRoleAndAction[?]nfRole=GR-API-DEFAULT&action=replaceInstance"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb("vnfRecipeReplaceInstance_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ // expected response
+ ServiceInstancesResponse expectedResponse = new ServiceInstancesResponse();
+ RequestReferences requestReferences = new RequestReferences();
+ requestReferences.setInstanceId("1882939");
+ requestReferences.setRequestSelfLink(createExpectedSelfLink("v7", "32807a28-1a14-4b88-b7b3-2950918aa76d"));
+ expectedResponse.setRequestReferences(requestReferences);
+ uri = servInstanceuri + "v7"
+ + "/serviceInstances/f7ce78bb-423b-11e7-93f8-0050569a7968/vnfs/ff305d54-75b4-431b-adb2-eb6b9e5ff000/replace";
+ ResponseEntity<String> response =
+ sendRequest(inputStream("/ReplaceVnfNoCloudConfig.json"), uri, HttpMethod.POST, headers);
+
+ assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
+ assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
+ }
+
+ @Test
public void replaceVnfRecreateInstance() throws IOException {
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/RecreateInfraVce"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
@@ -1338,7 +1334,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/VfModuleInvalid.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals("No valid vfModuleCustomization is specified", realResponse.getServiceException().getText());
}
@@ -1379,6 +1375,44 @@ public class ServiceInstancesTest extends BaseTest {
}
@Test
+ public void replaceVfModuleInstanceNoCloudConfigurationTest() throws IOException {
+ wireMockServer.stubFor(
+ get(urlPathEqualTo("/aai/v19/network/generic-vnfs/generic-vnf/ff305d54-75b4-431b-adb2-eb6b9e5ff000"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("infra/Vnf.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/TestResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer
+ .stubFor(get(urlMatching(".*/vfModule/search/findFirstVfModuleByModelInvariantUUIDAndModelVersion[?]"
+ + "modelInvariantUUID=78ca26d0-246d-11e7-93ae-92361f002671&modelVersion=2"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb("vfModule_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(get(urlMatching(
+ ".*/vnfComponentsRecipe/search/findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction"
+ + "[?]vfModuleModelUUID=GR-API-DEFAULT&vnfComponentType=vfModule&action=replaceInstance"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(getWiremockResponseForCatalogdb(
+ "vnfComponentRecipeDeleteVfModule_Response.json"))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ // expected response
+ ServiceInstancesResponse expectedResponse = new ServiceInstancesResponse();
+ RequestReferences requestReferences = new RequestReferences();
+ requestReferences.setInstanceId("1882939");
+ requestReferences.setRequestSelfLink(createExpectedSelfLink("v7", "32807a28-1a14-4b88-b7b3-2950918aa76d"));
+ expectedResponse.setRequestReferences(requestReferences);
+ uri = servInstanceuri + "v7"
+ + "/serviceInstances/f7ce78bb-423b-11e7-93f8-0050569a7968/vnfs/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vfModules/ff305d54-75b4-431b-adb2-eb6b9e5ff000/replace";
+ ResponseEntity<String> response =
+ sendRequest(inputStream("/ReplaceVfModuleNoCloudConfig.json"), uri, HttpMethod.POST, headers);
+
+ assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
+ ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
+ assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
+ }
+
+ @Test
public void updateVfModuleInstance() throws IOException {
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
@@ -1429,7 +1463,6 @@ public class ServiceInstancesTest extends BaseTest {
public void createVfModuleNoModelType() throws IOException {
InfraActiveRequests expectedRecord = new InfraActiveRequests();
expectedRecord.setRequestStatus("FAILED");
- expectedRecord.setAction("createInstance");
expectedRecord.setStatusMessage("Error parsing request: No valid modelType is specified");
expectedRecord.setProgress(100L);
expectedRecord.setSource("VID");
@@ -2142,7 +2175,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals("Request Failed due to BPEL error with HTTP Status = 202{\"instanceId\": \"1882939\"}",
realResponse.getServiceException().getText());
}
@@ -2177,7 +2210,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals("Exception caught mapping Camunda JSON response to object",
realResponse.getServiceException().getText());
}
@@ -2210,7 +2243,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertTrue(realResponse.getServiceException().getText()
.contains("<aetgt:ErrorMessage>Exception in create execution list 500"));
}
@@ -2248,14 +2281,12 @@ public class ServiceInstancesTest extends BaseTest {
requestReferences.setInstanceId("1882939");
requestReferences.setRequestSelfLink(createExpectedSelfLink("v5", "32807a28-1a14-4b88-b7b3-2950918aa76d"));
expectedResponse.setRequestReferences(requestReferences);
- uri = servInstanceUriPrev7 + "v5";
+ uri = servInstanceuri + "v5";
ResponseEntity<String> response =
sendRequest(inputStream("/MacroServiceInstance.json"), uri, HttpMethod.POST, headers);
// then
- assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
- ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
- assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
+ assertEquals(404, response.getStatusCode().value());
}
@Test
@@ -2266,7 +2297,7 @@ public class ServiceInstancesTest extends BaseTest {
RequestParameters requestParameters = request.getRequestDetails().getRequestParameters();
String userParamsTxt = inputStream("/userParams.txt");
- List<Map<String, Object>> userParams = servInstances.configureUserParams(requestParameters);
+ List<Map<String, Object>> userParams = requestHandlerUtils.configureUserParams(requestParameters);
System.out.println(userParams);
assertTrue(userParams.size() > 0);
assertTrue(userParams.get(0).containsKey("name"));
@@ -2280,7 +2311,7 @@ public class ServiceInstancesTest extends BaseTest {
ServiceInstancesRequest request =
mapper.readValue(inputStream("/MacroServiceInstance.json"), ServiceInstancesRequest.class);
CloudConfiguration cloudConfig =
- servInstances.configureCloudConfig(request.getRequestDetails().getRequestParameters());
+ requestHandlerUtils.configureCloudConfig(request.getRequestDetails().getRequestParameters());
assertEquals("mdt25b", cloudConfig.getLcpCloudRegionId());
assertEquals("aefb697db6524ddebfe4915591b0a347", cloudConfig.getTenantId());
@@ -2293,7 +2324,7 @@ public class ServiceInstancesTest extends BaseTest {
mapper.readValue(inputStream("/MacroServiceInstance.json"), ServiceInstancesRequest.class);
ServiceInstancesRequest expected =
mapper.readValue(inputStream("/LegacyMacroServiceInstance.json"), ServiceInstancesRequest.class);
- servInstances.mapToLegacyRequest(request.getRequestDetails());
+ requestHandlerUtils.mapToLegacyRequest(request.getRequestDetails());
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(request));
assertThat(request, sameBeanAs(expected));
}
@@ -2380,7 +2411,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.NOT_ACCEPTABLE.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals("Exception caught mapping Camunda JSON response to object",
realResponse.getServiceException().getText());
}
@@ -2396,7 +2427,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to check for duplicate instance due to error contacting requestDb: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2419,7 +2450,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.CONFLICT.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Error: Locked instance - This service (testService9) already has a request being worked with a status of UNLOCKED (RequestId - f0a35706-efc4-4e27-80ea-a995d7a2a40f). The existing request must finish or be cleaned up before proceeding.",
realResponse.getServiceException().getText());
@@ -2441,7 +2472,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to get process-instance history from Camunda for requestId: f0a35706-efc4-4e27-80ea-a995d7a2a40f due to error: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2458,7 +2489,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to check for duplicate instance due to error contacting requestDb: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2490,7 +2521,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to save instance to db due to error contacting requestDb: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2510,7 +2541,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstancePortConfiguration.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to save instance to db due to error contacting requestDb: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2527,7 +2558,7 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/ServiceInstanceParseFail.json"), uri, HttpMethod.POST, headers);
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(
"Unable to save instance to db due to error contacting requestDb: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Server Error",
realResponse.getServiceException().getText());
@@ -2572,15 +2603,6 @@ public class ServiceInstancesTest extends BaseTest {
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
assertEquals(response.getHeaders().get(TRANSACTION_ID).get(0), "32807a28-1a14-4b88-b7b3-2950918aa76d");
-
- for (ILoggingEvent logEvent : TestAppender.events) {
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d", mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertEquals("VID", mdc.get(PARTNERNAME));
- }
- }
}
@Test
@@ -2632,7 +2654,7 @@ public class ServiceInstancesTest extends BaseTest {
ResponseEntity<String> response = sendRequest(null, uri, HttpMethod.DELETE);
// then
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(realResponse.getServiceException().getText(), "No valid X-ONAP-RequestID header is specified");
}
@@ -2645,7 +2667,7 @@ public class ServiceInstancesTest extends BaseTest {
ResponseEntity<String> response = sendRequest(null, uri, HttpMethod.DELETE, noPartnerHeaders);
// then
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(realResponse.getServiceException().getText(), "No valid X-ONAP-PartnerName header is specified");
}
@@ -2664,7 +2686,7 @@ public class ServiceInstancesTest extends BaseTest {
// then
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(realResponse.getServiceException().getText(), "No valid X-RequestorID header is specified");
}
@@ -2752,7 +2774,7 @@ public class ServiceInstancesTest extends BaseTest {
ResponseEntity<String> response = sendRequest(inputStream("/UpdateNetwork.json"), uri, HttpMethod.PUT, headers);
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
- RequestError realResponse = errorMapper.readValue(response.getBody(), RequestError.class);
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
assertEquals(realResponse.getServiceException().getText(),
"No valid modelCustomizationId for networkResourceCustomization lookup is specified");
}
@@ -2934,15 +2956,20 @@ public class ServiceInstancesTest extends BaseTest {
Actions action = servInstances.handleReplaceInstance(Action.replaceInstance, sir);
assertEquals(Action.replaceInstanceRetainAssignments, action);
}
- /*
- * @Test public void buildSelfLinkUrlTest() throws Exception { // v - version String incomingUrl =
- * "http://localhost:8080/onap/infra/so/serviceInstantiation/v7/serviceInstances"; String expectedSelfLink =
- * "http://localhost:8080/orchestrationRequests/v7/efce3167-5e45-4666-9d4d-22e23648e5d1"; String requestId =
- * "efce3167-5e45-4666-9d4d-22e23648e5d1"; Optional<URL> actualSelfLinkUrl = buildSelfLinkUrl(incomingUrl,
- * requestId); assertEquals(expectedSelfLink, actualSelfLinkUrl.get().toString()); // V - Version String
- * incomingUrlV = "http://localhost:8080/onap/infra/so/serviceInstantiation/V7/serviceInstances"; String
- * expectedSelfLinkV = "http://localhost:8080/orchestrationRequests/V7/efce3167-5e45-4666-9d4d-22e23648e5d1";
- * Optional<URL> actualSelfLinkUrlV = buildSelfLinkUrl(incomingUrlV, requestId); assertEquals(expectedSelfLinkV,
- * actualSelfLinkUrlV.get().toString()); }
- */
+
+ @Test
+ public void getCloudConfigurationAAIEntityNotFoundTest() throws IOException {
+ RequestError expectedResponse =
+ mapper.readValue(inputStream("/AAIEntityNotFoundResponse.json"), RequestError.class);
+ uri = servInstanceuri + "v7"
+ + "/serviceInstances/f7ce78bb-423b-11e7-93f8-0050569a7968/vnfs/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vfModules/ff305d54-75b4-431b-adb2-eb6b9e5ff000/replace";
+ ResponseEntity<String> response =
+ sendRequest(inputStream("/ReplaceVfModuleNoCloudConfig.json"), uri, HttpMethod.POST, headers);
+
+ assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ RequestError realResponse = mapper.readValue(response.getBody(), RequestError.class);
+ assertThat(expectedResponse, sameBeanAs(realResponse));
+ }
+
}
+
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesUnitTest.java
new file mode 100644
index 0000000000..d399de0b7a
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesUnitTest.java
@@ -0,0 +1,100 @@
+package org.onap.so.apihandlerinfra;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import java.util.HashMap;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.apihandlerinfra.exceptions.ApiException;
+import org.onap.so.apihandlerinfra.infra.rest.BpmnRequestBuilder;
+import org.onap.so.apihandlerinfra.infra.rest.exception.CloudConfigurationNotFoundException;
+import org.onap.so.apihandlerinfra.vnfbeans.ModelType;
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.serviceinstancebeans.CloudConfiguration;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ServiceInstancesUnitTest {
+
+ @Mock
+ private BpmnRequestBuilder bpmnRequestBuilder;
+
+ @Spy
+ @InjectMocks
+ private ServiceInstances serviceInstances;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+
+ @Test
+ public void getCloudConfigurationOnReplaceVnfTest() throws ApiException {
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setTenantId("tenantId");
+ cloudConfiguration.setLcpCloudRegionId("lcpCloudRegionId");
+ String requestScope = ModelType.vnf.toString();
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("vnfInstanceId", "17c10d8e-48f4-4ee6-b162-a801943df6d6");
+ InfraActiveRequests currentActiveRequest = new InfraActiveRequests();
+
+ doReturn(cloudConfiguration).when(bpmnRequestBuilder)
+ .mapCloudConfigurationVnf("17c10d8e-48f4-4ee6-b162-a801943df6d6");
+ CloudConfiguration result =
+ serviceInstances.getCloudConfigurationOnReplace(requestScope, instanceIdMap, currentActiveRequest);
+
+ assertEquals(cloudConfiguration, result);
+ }
+
+ @Test
+ public void getCloudConfigurationOnReplaceVfModuleTest() throws ApiException {
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setTenantId("tenantId");
+ cloudConfiguration.setLcpCloudRegionId("lcpCloudRegionId");
+ String requestScope = ModelType.vfModule.toString();
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("vnfInstanceId", "17c10d8e-48f4-4ee6-b162-a801943df6d6");
+ instanceIdMap.put("vfModuleInstanceId", "17c10d8e-48f4-4ee6-b162-a801943df6d8");
+ InfraActiveRequests currentActiveRequest = new InfraActiveRequests();
+
+ doReturn(cloudConfiguration).when(bpmnRequestBuilder).getCloudConfigurationVfModuleReplace(
+ "17c10d8e-48f4-4ee6-b162-a801943df6d6", "17c10d8e-48f4-4ee6-b162-a801943df6d8");
+ CloudConfiguration result =
+ serviceInstances.getCloudConfigurationOnReplace(requestScope, instanceIdMap, currentActiveRequest);
+
+ assertEquals(cloudConfiguration, result);
+ }
+
+ @Test
+ public void getCloudConfigurationReturnsNullTest() throws ApiException {
+ String requestScope = ModelType.vfModule.toString();
+ HashMap<String, String> instanceIdMap = new HashMap<>();
+ instanceIdMap.put("vnfInstanceId", "17c10d8e-48f4-4ee6-b162-a801943df6d6");
+ instanceIdMap.put("vfModuleInstanceId", "17c10d8e-48f4-4ee6-b162-a801943df6d8");
+ InfraActiveRequests currentActiveRequest = new InfraActiveRequests();
+
+ doReturn(null).when(bpmnRequestBuilder).getCloudConfigurationVfModuleReplace(
+ "17c10d8e-48f4-4ee6-b162-a801943df6d6", "17c10d8e-48f4-4ee6-b162-a801943df6d8");
+ thrown.expect(CloudConfigurationNotFoundException.class);
+ thrown.expectMessage("CloudConfiguration not found during autofill for replace request.");
+
+ serviceInstances.getCloudConfigurationOnReplace(requestScope, instanceIdMap, currentActiveRequest);
+ }
+
+ @Test
+ public void setCloudConfigurationCurrentActiveRequestTest() {
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setTenantId("tenantId");
+ cloudConfiguration.setLcpCloudRegionId("lcpCloudRegionId");
+
+ InfraActiveRequests currentActiveRequest = new InfraActiveRequests();
+ serviceInstances.setCloudConfigurationCurrentActiveRequest(cloudConfiguration, currentActiveRequest);
+
+ assertEquals("tenantId", currentActiveRequest.getTenantId());
+ assertEquals("lcpCloudRegionId", currentActiveRequest.getCloudRegion());
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilderTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilderTest.java
index 3644dd8e7f..faac11715a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilderTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/BpmnRequestBuilderTest.java
@@ -22,8 +22,12 @@ package org.onap.so.apihandlerinfra.infra.rest;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Optional;
import org.junit.Before;
import org.junit.Rule;
@@ -32,7 +36,6 @@ import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.ServiceInstance;
@@ -40,10 +43,14 @@ import org.onap.aai.domain.yang.VfModule;
import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.constants.Status;
import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.serviceinstancebeans.CloudConfiguration;
import org.onap.so.serviceinstancebeans.ModelType;
+import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -55,15 +62,19 @@ public class BpmnRequestBuilderTest {
@Rule
public ExpectedException exceptionRule = ExpectedException.none();
+
+ @Mock
+ private AAIResourcesClient aaiResourcesClient;
+
@InjectMocks
- @Spy
- BpmnRequestBuilder reqBuilder;
+ private AAIDataRetrieval aaiData = spy(AAIDataRetrieval.class);
@Mock
private RequestsDbClient requestDBClient;
- @Mock
- private AAIResourcesClient aaiResourcesClient;
+ @InjectMocks
+ private BpmnRequestBuilder reqBuilder = spy(BpmnRequestBuilder.class);
+
private ObjectMapper mapper = new ObjectMapper();
@@ -71,8 +82,7 @@ public class BpmnRequestBuilderTest {
@Before
public void setup() {
- reqBuilder.setAaiResourcesClient(aaiResourcesClient);
-
+ // aaiData.setAaiResourcesClient(aaiResourcesClient);
}
@Test
@@ -80,11 +90,11 @@ public class BpmnRequestBuilderTest {
ServiceInstance service =
provider.getMapper().readValue(new File(RESOURCE_PATH + "ServiceInstance.json"), ServiceInstance.class);
- doReturn(service).when(reqBuilder).getServiceInstance("serviceId");
+ doReturn(service).when(aaiData).getServiceInstance("serviceId");
ServiceInstancesRequest expectedRequest = mapper
.readValue(new File(RESOURCE_PATH + "ExpectedServiceRequest.json"), ServiceInstancesRequest.class);
- expectedRequest.getRequestDetails().getModelInfo().setModelId(null);
- // bad getter/setter setting multiple fields
+ expectedRequest.getRequestDetails().getModelInfo().setModelId(null); // bad getter/setter setting multiple
+ // fields
ServiceInstancesRequest actualRequest = reqBuilder.buildServiceDeleteRequest("serviceId");
assertThat(actualRequest, sameBeanAs(expectedRequest));
}
@@ -128,13 +138,59 @@ public class BpmnRequestBuilderTest {
AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "vnfId"));
VolumeGroup volumeGroup =
provider.getMapper().readValue(new File(RESOURCE_PATH + "VolumeGroup.json"), VolumeGroup.class);
-
- doReturn(Optional.of(volumeGroup)).when(aaiResourcesClient).get(VolumeGroup.class, AAIUriFactory
- .createResourceUri(AAIObjectType.VOLUME_GROUP, "cloudOwner", "regionOne", "volumeGroupId"));
+ AAIResultWrapper wrapper = new AAIResultWrapper(volumeGroup);
+ doReturn(wrapper).when(aaiResourcesClient)
+ .get(AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "vnfId")
+ .relatedTo(AAIObjectType.VOLUME_GROUP, "volumeGroupId"));
ServiceInstancesRequest expectedRequest = mapper
.readValue(new File(RESOURCE_PATH + "ExpectedVolumeGroupRequest.json"), ServiceInstancesRequest.class);
ServiceInstancesRequest actualRequest = reqBuilder.buildVolumeGroupDeleteRequest("vnfId", "volumeGroupId");
assertThat(actualRequest, sameBeanAs(expectedRequest));
}
+
+ @Test
+ public void test_getCloudConfigurationVfModuleReplace() throws Exception {
+ String vnfId = "vnfId";
+ String vfModuleId = "vfModuleId";
+
+ GenericVnf vnf = provider.getMapper().readValue(new File(RESOURCE_PATH + "Vnf.json"), GenericVnf.class);
+
+ doReturn(Optional.of(vnf)).when(aaiResourcesClient).get(GenericVnf.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId));
+
+ CloudConfiguration result = reqBuilder.getCloudConfigurationVfModuleReplace(vnfId, vfModuleId);
+ assertEquals("0422ffb57ba042c0800a29dc85ca70f8", result.getTenantId());
+ assertEquals("cloudOwner", result.getCloudOwner());
+ assertEquals("regionOne", result.getLcpCloudRegionId());
+ }
+
+ @Test
+ public void test_mapCloudConfigurationVnf() throws Exception {
+ String vnfId = "6fb01019-c3c4-41fe-b307-d1c56850b687";
+ Map<String, String[]> filters = new HashMap<>();
+ filters.put("vnfId", new String[] {"EQ", vnfId});
+ filters.put("requestStatus", new String[] {"EQ", Status.COMPLETE.toString()});
+ filters.put("action", new String[] {"EQ", "createInstance"});
+
+ ServiceInstancesRequest serviceRequest = new ServiceInstancesRequest();
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ RequestDetails requestDetails = new RequestDetails();
+ cloudConfiguration.setCloudOwner("cloudOwner");
+ cloudConfiguration.setTenantId("tenantId");
+ cloudConfiguration.setLcpCloudRegionId("lcpCloudRegionId");
+ requestDetails.setCloudConfiguration(cloudConfiguration);
+ serviceRequest.setRequestDetails(requestDetails);
+
+ doReturn(filters).when(reqBuilder).createQueryRequest("vnfId", vnfId);
+ doReturn(Optional.of(serviceRequest)).when(reqBuilder).findServiceInstanceRequest(filters);
+
+
+ CloudConfiguration result = reqBuilder.mapCloudConfigurationVnf(vnfId);
+ assertEquals("tenantId", result.getTenantId());
+ assertEquals("cloudOwner", result.getCloudOwner());
+ assertEquals("lcpCloudRegionId", result.getLcpCloudRegionId());
+ }
+
}
+
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandlerTest.java
index 59308215ac..0ae963ab15 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/NetworkRestHandlerTest.java
@@ -108,7 +108,6 @@ public class NetworkRestHandlerTest {
public void test_createInfraActiveRequestForDelete() throws Exception {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
- expected.setAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
expected.setNetworkId("networkId");
expected.setRequestId("requestId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandlerTest.java
index c1e6347943..602eb51f41 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/ServiceInstanceRestHandlerTest.java
@@ -154,7 +154,6 @@ public class ServiceInstanceRestHandlerTest {
public void test_createInfraActiveRequestForDelete() throws Exception {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
- expected.setAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
expected.setRequestId("requestId");
expected.setRequestorId("userId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VfModuleRestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VfModuleRestHandlerTest.java
index 7d146791fe..ca81124833 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VfModuleRestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VfModuleRestHandlerTest.java
@@ -154,7 +154,6 @@ public class VfModuleRestHandlerTest {
public void test_createInfraActiveRequestForDelete() throws Exception {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
- expected.setAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
expected.setVnfId("vnfId");
expected.setVfModuleId("vfModuleId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandlerTest.java
index 03725ec85b..3ae3abb16d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VnfRestHandlerTest.java
@@ -119,7 +119,6 @@ public class VnfRestHandlerTest {
public void test_createInfraActiveRequestForDelete() throws Exception {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
- expected.setAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
expected.setVnfId("vnfId");
expected.setRequestId("requestId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandlerTest.java
index efa27743ef..1315f13892 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/infra/rest/handler/VolumeRestHandlerTest.java
@@ -109,7 +109,6 @@ public class VolumeRestHandlerTest {
public void test_createInfraActiveRequestForDelete() throws Exception {
InfraActiveRequests expected = new InfraActiveRequests();
expected.setRequestAction(Action.deleteInstance.toString());
- expected.setAction(Action.deleteInstance.toString());
expected.setServiceInstanceId("serviceInstanceId");
expected.setVnfId("vnfId");
expected.setVolumeGroupId("volumeGroupId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestrationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestrationTest.java
index a74c11c08b..71784fa286 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestrationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudOrchestrationTest.java
@@ -262,7 +262,6 @@ public class CloudOrchestrationTest extends BaseTest {
iar.setRequestId("requestId");
iar.setOperationalEnvName("myVnfOpEnv");
iar.setRequestStatus(Status.IN_PROGRESS.toString());
- iar.setAction(Action.create.toString());
iar.setRequestAction(Action.create.toString());
iar.setRequestScope("UNKNOWN");
// iarRepo.saveAndFlush(iar);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
index 5f12060059..1917ee592f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
@@ -271,7 +271,6 @@ public class CloudResourcesOrchestrationTest extends BaseTest {
InfraActiveRequests iar = new InfraActiveRequests();
iar.setRequestId("requestId-getOpEnvFilterEx1");
iar.setRequestScope("requestScope");
- iar.setRequestType("requestType");
iar.setOperationalEnvId("operationalEnvironmentId");
iar.setOperationalEnvName("operationalEnvName");
iar.setRequestorId("xxxxxx");
@@ -296,7 +295,6 @@ public class CloudResourcesOrchestrationTest extends BaseTest {
InfraActiveRequests iar = new InfraActiveRequests();
iar.setRequestId("requestIdFilterException2");
iar.setRequestScope("requestScope");
- iar.setRequestType("requestType");
iar.setOperationalEnvId("operationalEnvId");
iar.setOperationalEnvName("operationalEnvName");
iar.setRequestorId("xxxxxx");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
index 3114f91096..8d8f4969d7 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
@@ -95,7 +95,7 @@ public class CreateEcompOperationalEnvironmentTest extends BaseTest {
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withBody(mapper.writeValueAsString(iar)).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/")).withRequestBody(containing(
- "{\"requestId\":\"123\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL, operationalEnvironmentId - operationalEnvId; Success Message: SUCCESSFULLY Created ECOMP OperationalEnvironment.\",\"rollbackStatusMessage\":null,\"flowStatus\":null,\"retryStatusMessage\":null,\"progress\":100"))
+ "{\"requestId\":\"123\",\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL, operationalEnvironmentId - operationalEnvId; Success Message: SUCCESSFULLY Created ECOMP OperationalEnvironment.\",\"progress\":100"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
@@ -127,7 +127,7 @@ public class CreateEcompOperationalEnvironmentTest extends BaseTest {
.withBody(mapper.writeValueAsString(iar)).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
.withRequestBody(containing("{\"requestId\":\"" + uuid
- + "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message:"))
+ + "\",\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message:"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java
index ebed4fa16b..6c00f8db27 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java
@@ -151,7 +151,7 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest {
ObjectMapper mapper = new ObjectMapper();
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
.withRequestBody(containing("{\"requestId\":\"" + requestId
- + "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
+ + "\",\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
@@ -188,7 +188,7 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest {
ObjectMapper mapper = new ObjectMapper();
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
.withRequestBody(containing("{\"requestId\":\"" + requestId
- + "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
+ + "\",\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/DeactivateVnfOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/DeactivateVnfOperationalEnvironmentTest.java
index 16738e9799..9911bb8cb8 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/DeactivateVnfOperationalEnvironmentTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/DeactivateVnfOperationalEnvironmentTest.java
@@ -64,7 +64,7 @@ public class DeactivateVnfOperationalEnvironmentTest extends BaseTest {
public void init() {
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
.withRequestBody(containing("{\"requestId\":\"" + requestId
- + "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
+ + "\",\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
}
@@ -129,7 +129,7 @@ public class DeactivateVnfOperationalEnvironmentTest extends BaseTest {
.withBody(mapper.writeValueAsString(iar)).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
.withRequestBody(containing("{\"requestId\":\"" + requestId
- + "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE"))
+ + "\",\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
index f178a3c0cb..2e9576cf7c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
@@ -28,12 +28,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
import java.io.File;
import java.nio.file.Files;
import java.util.List;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -48,7 +45,6 @@ import org.onap.so.client.grm.beans.ServiceEndPointLookupRequest;
import org.onap.so.client.grm.beans.ServiceEndPointRequest;
import org.onap.so.client.grm.exceptions.GRMClientCallFailed;
import org.slf4j.MDC;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class GRMClientTest extends BaseTest {
@@ -79,36 +75,10 @@ public class GRMClientTest extends BaseTest {
List<ServiceEndPoint> list = sel.getServiceEndPointList();
assertEquals(3, list.size());
- boolean foundInvoke = false;
- boolean foundInvokeReturn = false;
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsClientLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("INVOKE")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("GRM", mdc.get("TargetEntity"));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- foundInvoke = true;
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsClientLogging")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("INVOKE_RETURN")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("200", mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("COMPLETED", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- foundInvokeReturn = true;
- }
-
- if (!foundInvoke)
- fail("INVOKE Marker not found");
-
- if (!foundInvokeReturn)
- fail("INVOKE RETURN Marker not found");
-
wireMockServer.verify(postRequestedFor(urlEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
.withHeader(ONAPLogConstants.Headers.INVOCATION_ID.toString(), matching(uuidRegex))
.withHeader(ONAPLogConstants.Headers.REQUEST_ID.toString(), matching(uuidRegex))
- .withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO")));
- TestAppender.events.clear();
+ .withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO.APIH")));
}
@Test
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql
index 6d8e2e8b09..f5373a1f15 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/InfraActiveRequestsReset.sql
@@ -1,16 +1,17 @@
-INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00032ab7-na18-42e5-965d-8ea592502018', '00032ab7-fake-42e5-965d-8ea592502018', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc350', null, 'createInstance', 'IN_PROGRESS', 'Error parsing request.
- No valid instanceName is specified', null, '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID',
- '1882938', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null,
- '{"serviceInstanceId":"1882939","vnfInstanceId":"1882938","networkInstanceId":"1882937","volumeGroupInstanceId":"1882935","vfModuleInstanceId":"1882934","requestDetails":{"requestInfo":{"source":"VID","requestorId":"xxxxxx","instanceName":"testService9"},"requestParameters":{"aLaCarte":true,"autoBuildVfModules":false,"subscriptionServiceType":"test"},"modelInfo":{"modelInvariantId":"f7ce78bb-423b-11e7-93f8-0050569a7965","modelVersion":"1","modelVersionId":"10","modelType":"service","modelName":"serviceModel","modelInstanceName":"modelInstanceName","modelCustomizationId":"f7ce78bb-423b-11e7-93f8-0050569a796"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"}}}',
- null, 'APIH', null, null, '1882935', null, '1882934', null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', '1882939', 'testService10', 'xxxxxx', 'test', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+INSERT INTO requestdb.infra_active_requests(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00032ab7-na18-42e5-965d-8ea592502018', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+
+
+INSERT INTO requestdb.infra_active_requests(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00164b9e-784d-48a8-8973-bbad6ef818ed', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc350', 'IN_PROGRESS', 'Error parsing request.
+ No valid instanceName is specified', null, '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', '1882938', null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null,
+ '{"serviceInstanceId":"1882939","vnfInstanceId":"1882938","networkInstanceId":"1882937","volumeGroupInstanceId":"1882935","vfModuleInstanceId":"1882934","requestDetails":{"requestInfo":{"source":"VID","requestorId":"xxxxxx","instanceName":"testService9"},"requestParameters":{"aLaCarte":true,"autoBuildVfModules":false,"subscriptionServiceType":"test"},"modelInfo":{"modelInvariantId":"f7ce78bb-423b-11e7-93f8-0050569a7965","modelVersion":"1","modelVersionId":"10","modelType":"service","modelName":"serviceModel","modelInstanceName":"modelInstanceName","modelCustomizationId":"f7ce78bb-423b-11e7-93f8-0050569a796"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"}}}', null, 'APIH', null, '1882935', null, '1882934', null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', '1882939', 'testService10', 'xxxxxx', 'test', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+
COMMIT; \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json
new file mode 100644
index 0000000000..c746020e7f
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/getRequestProcessingDataArray.json
@@ -0,0 +1,8 @@
+[{
+ "id": 1,
+ "soRequestId": "00032ab7-na18-42e5-965d-8ea592502018",
+ "groupingId": "7d2e8c07-4d10-456d-bddc-37abf38ca714",
+ "name": "requestAction",
+ "value": "assign",
+ "tag": "pincFabricConfigRequest"
+}]
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/AAIEntityNotFoundResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/AAIEntityNotFoundResponse.json
new file mode 100644
index 0000000000..2004a82ed7
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/AAIEntityNotFoundResponse.json
@@ -0,0 +1,8 @@
+{
+ "requestError": {
+ "serviceException": {
+ "messageId": "SVC0001",
+ "text": "Generic Vnf Not Found In Inventory, VnfId: ff305d54-75b4-431b-adb2-eb6b9e5ff000"
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ExecutePNFCustomWorkflow.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ExecutePNFCustomWorkflow.json
new file mode 100644
index 0000000000..63021b611f
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ExecutePNFCustomWorkflow.json
@@ -0,0 +1,20 @@
+{
+ "requestDetails": {
+ "requestParameters": {
+ "userParams": [{
+ "nrmObj": {
+ "EUtranGenericCell" : [
+ {"cellLocalId":1, "pci":5},
+ {"cellLocalId":2, "pci":6}
+ ],
+ "ExternalEUtranCell" : [
+ {"cellLocalId":3, "eNBId": "x"},
+ {"cellLocalId":4, "eNBId": "y"}
+ ],
+ "EUtranRelation": [{"scellLocalId":5, "tcellLocalId":6}]
+ }
+ }],
+ "payload": "[{\"GNBDUFunction\":{\"gNBId\":1,\"gNBDUId\":5}}]"
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVfModuleNoCloudConfig.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVfModuleNoCloudConfig.json
new file mode 100644
index 0000000000..766d49bee8
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVfModuleNoCloudConfig.json
@@ -0,0 +1,28 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "xxxxxx",
+ "instanceName": "testService60"
+ },
+ "requestParameters": {
+ "aLaCarte": true,
+ "autoBuildVfModules": false,
+ "subscriptionServiceType": "test"
+ },
+ "modelInfo":{
+ "modelInvariantId": "f7ce78bb-423b-11e7-93f8-0050569a7968",
+ "modelVersion":"2",
+ "modelVersionId":"78ca26d0-246d-11e7-93ae-92361f002671",
+ "modelType":"vfModule",
+ "modelName":"serviceModel",
+ "modelCustomizationId": "a7f1d08e-b02d-11e6-80f5-76304dec7eb7"
+ },
+ "subscriberInfo": {
+ "globalSubscriberId": "MSO_1610_dev",
+ "subscriberName": "MSO_1610_dev"
+ }
+ }
+}
+
+
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVnfNoCloudConfig.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVnfNoCloudConfig.json
new file mode 100644
index 0000000000..46873588c0
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ReplaceVnfNoCloudConfig.json
@@ -0,0 +1,58 @@
+{
+ "vnfInstanceId": "ff305d54-75b4-431b-adb2-eb6b9e5ff000",
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff",
+ "modelName": "vSAMP12..base..module-0",
+ "modelVersion": "1",
+ "modelVersionId": "1",
+ "modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671"
+ },
+ "requestInfo": {
+ "instanceName": "VNFTEST-10",
+ "source": "VID",
+ "suppressRollback": true,
+ "requestorId": "xxxxxx",
+ "productFamilyId": "FamilyID"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "f7ce78bb-423b-11e7-93f8-0050569a7968",
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe",
+ "modelName": "vSAMP12",
+ "modelVersion": "1.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "ff305d54-75b4-431b-adb2-eb6b9e5ff000",
+ "instanceDirection": "source",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelInvariantId": "ff5256d1-5a33-55df-13ab-12abad84e7ff",
+ "modelVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe",
+ "modelName": "vSAMP12",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "b0ed83ec-b7b4-4c70-91c2-63feeaf8609b"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "aLaCarte": true,
+ "userParams": []
+ },
+ "platform": {
+ "platformName": "platformName"
+ },
+ "lineOfBusiness": {
+ "lineOfBusinessName": "lobName"
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceInstanceNoOE.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceInstanceNoOE.json
new file mode 100644
index 0000000000..a6aa3e1c25
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceInstanceNoOE.json
@@ -0,0 +1,33 @@
+{
+ "serviceInstanceId":"1882939",
+ "vnfInstanceId":"1882938",
+ "networkInstanceId":"1882937",
+ "volumeGroupInstanceId":"1882935",
+ "vfModuleInstanceId":"1882934",
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "xxxxxx",
+ "instanceName": "testService9"
+ },
+ "requestParameters": {
+ "aLaCarte": true,
+ "autoBuildVfModules": false,
+ "subscriptionServiceType": "test",
+ "disableOwningEntityProject": true
+ },
+ "modelInfo":{
+ "modelInvariantId": "f7ce78bb-423b-11e7-93f8-0050569a7965",
+ "modelVersion":"1",
+ "modelVersionId":"10",
+ "modelType":"service",
+ "modelName":"serviceModel",
+ "modelInstanceName":"modelInstanceName",
+ "modelCustomizationId":"f7ce78bb-423b-11e7-93f8-0050569a796"
+ },
+ "subscriberInfo": {
+ "globalSubscriberId": "someTestId",
+ "subscriberName": "someTestId"
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/createInfraActiveRequests.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/createInfraActiveRequests.json
index 6be015694c..c79900a15d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/createInfraActiveRequests.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/createInfraActiveRequests.json
@@ -1,7 +1,5 @@
{
"requestId":"f0a35706-efc4-4e27-80ea-a995d7a2a40f",
- "clientRequestId":null,
- "action":"activateInstance",
"requestStatus":"UNLOCKED",
"statusMessage":null,
"progress":20,
@@ -12,23 +10,19 @@
"vnfName":null,
"vnfType":null,
"serviceType":null,
- "aicNodeClli":null,
"tenantId":null,
- "provStatus":null,
"vnfParams":null,
"vnfOutputs":null,
"requestBody":"{\"modelInfo\":{\"modelCustomizationName\":null,\"modelInvariantId\":\"1587cf0e-f12f-478d-8530-5c55ac578c39\",\"modelType\":\"configuration\",\"modelNameVersionId\":null,\"modelName\":null,\"modelVersion\":null,\"modelCustomizationUuid\":null,\"modelVersionId\":\"36a3a8ea-49a6-4ac8-b06c-89a545444455\",\"modelCustomizationId\":\"68dc9a92-214c-11e7-93ae-92361f002671\",\"modelUuid\":null,\"modelInvariantUuid\":null,\"modelInstanceName\":null},\"requestInfo\":{\"billingAccountNumber\":null,\"callbackUrl\":null,\"correlator\":null,\"orderNumber\":null,\"productFamilyId\":null,\"orderVersion\":null,\"source\":\"VID\",\"instanceName\":null,\"suppressRollback\":false,\"requestorId\":\"xxxxxx\"},\"relatedInstanceList\":[{\"relatedInstance\":{\"instanceName\":null,\"instanceId\":\"9e15a443-af65-4f05-9000-47ae495e937d\",\"modelInfo\":{\"modelCustomizationName\":null,\"modelInvariantId\":\"de19ae10-9a25-11e7-abc4-cec278b6b50a\",\"modelType\":\"service\",\"modelNameVersionId\":null,\"modelName\":\"Infra_Configuration_Service\",\"modelVersion\":\"1.0\",\"modelCustomizationUuid\":null,\"modelVersionId\":\"ee938612-9a25-11e7-abc4-cec278b6b50a\",\"modelCustomizationId\":null,\"modelUuid\":null,\"modelInvariantUuid\":null,\"modelInstanceName\":null},\"instanceDirection\":null}}],\"subscriberInfo\":null,\"cloudConfiguration\":{\"aicNodeClli\":null,\"tenantId\":null,\"lcpCloudRegionId\":\"n6\"},\"requestParameters\":{\"subscriptionServiceType\":null,\"userParams\":[],\"aLaCarte\":false,\"autoBuildVfModules\":false,\"cascadeDelete\":false,\"usePreload\":true},\"project\":null,\"owningEntity\":null,\"platform\":null,\"lineOfBusiness\":null}",
"responseBody":null,
"lastModifiedBy":"APIH",
"modifyTime":1532945172000,
- "requestType":null,
"volumeGroupId":null,
"volumeGroupName":null,
"vfModuleId":null,
"vfModuleName":null,
"vfModuleModelName":null,
- "aaiServiceId":null,
- "aicCloudRegion":"n6",
+ "cloudRegion":"n6",
"callBackUrl":null,
"correlator":null,
"serviceInstanceId":"9e15a443-af65-4f05-9000-47ae495e937d",
@@ -47,4 +41,4 @@
},
"requestURI":"http://localhost:8087/infraActiveRequests/%1$s"
-} \ No newline at end of file
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequest.json
index d63525b297..db33df4d76 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequest.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequest.json
@@ -1,6 +1,4 @@
{
- "clientRequestId": null,
- "action": "deleteInstance",
"requestStatus": "%2$s",
"statusMessage": null,
"progress": 20,
@@ -11,23 +9,19 @@
"vnfName": null,
"vnfType": null,
"serviceType": null,
- "aicNodeClli": null,
"tenantId": null,
- "provStatus": null,
"vnfParams": null,
"vnfOutputs": null,
"requestBody": "{\"modelInfo\":{\"modelCustomizationName\":null,\"modelInvariantId\":\"1587cf0e-f12f-478d-8530-5c55ac578c39\",\"modelType\":\"configuration\",\"modelNameVersionId\":null,\"modelName\":null,\"modelVersion\":null,\"modelCustomizationUuid\":null,\"modelVersionId\":\"36a3a8ea-49a6-4ac8-b06c-89a545444455\",\"modelCustomizationId\":\"68dc9a92-214c-11e7-93ae-92361f002671\",\"modelUuid\":null,\"modelInvariantUuid\":null,\"modelInstanceName\":null},\"requestInfo\":{\"billingAccountNumber\":null,\"callbackUrl\":null,\"correlator\":null,\"orderNumber\":null,\"productFamilyId\":null,\"orderVersion\":null,\"source\":\"VID\",\"instanceName\":null,\"suppressRollback\":false,\"requestorId\":\"xxxxxx\"},\"relatedInstanceList\":[{\"relatedInstance\":{\"instanceName\":null,\"instanceId\":\"9e15a443-af65-4f05-9000-47ae495e937d\",\"modelInfo\":{\"modelCustomizationName\":null,\"modelInvariantId\":\"de19ae10-9a25-11e7-abc4-cec278b6b50a\",\"modelType\":\"service\",\"modelNameVersionId\":null,\"modelName\":\"Infra_Configuration_Service\",\"modelVersion\":\"1.0\",\"modelCustomizationUuid\":null,\"modelVersionId\":\"ee938612-9a25-11e7-abc4-cec278b6b50a\",\"modelCustomizationId\":null,\"modelUuid\":null,\"modelInvariantUuid\":null,\"modelInstanceName\":null},\"instanceDirection\":null}}],\"subscriberInfo\":null,\"cloudConfiguration\":{\"aicNodeClli\":null,\"tenantId\":null,\"lcpCloudRegionId\":\"n6\"},\"requestParameters\":{\"subscriptionServiceType\":null,\"userParams\":[],\"aLaCarte\":false,\"autoBuildVfModules\":false,\"cascadeDelete\":false,\"usePreload\":true},\"project\":null,\"owningEntity\":null,\"platform\":null,\"lineOfBusiness\":null}",
"responseBody": null,
"lastModifiedBy": "APIH",
"modifyTime": "2018-07-30T10:06:12.000+0000",
- "requestType": null,
"volumeGroupId": null,
"volumeGroupName": null,
"vfModuleId": null,
"vfModuleName": null,
"vfModuleModelName": null,
- "aaiServiceId": null,
- "aicCloudRegion": "n6",
+ "cloudRegion": "n6",
"callBackUrl": null,
"correlator": null,
"serviceInstanceId": "9e15a443-af65-4f05-9000-47ae495e937d",
@@ -51,4 +45,4 @@
"href": "http://localhost:8087/infraActiveRequests/%1$s"
}
}
-} \ No newline at end of file
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequestNoBody.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequestNoBody.json
index 21568e5273..f36ae0f9da 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequestNoBody.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/InfraActiveRequests/getInfraActiveRequestNoBody.json
@@ -1,5 +1,4 @@
{
- "clientRequestId": null,
"action": "deleteInstance",
"requestStatus": "%2$s",
"statusMessage": null,
@@ -11,23 +10,19 @@
"vnfName": null,
"vnfType": null,
"serviceType": null,
- "aicNodeClli": null,
"tenantId": null,
- "provStatus": null,
"vnfParams": null,
"vnfOutputs": null,
"requestBody": null,
"responseBody": null,
"lastModifiedBy": "APIH",
"modifyTime": "2018-07-30T10:06:12.000+0000",
- "requestType": null,
"volumeGroupId": null,
"volumeGroupName": null,
"vfModuleId": null,
"vfModuleName": null,
"vfModuleModelName": null,
- "aaiServiceId": null,
- "aicCloudRegion": "n6",
+ "cloudRegion": "n6",
"callBackUrl": null,
"correlator": null,
"serviceInstanceId": "9e15a443-af65-4f05-9000-47ae495e937d",
@@ -51,4 +46,4 @@
"href": "http://localhost:8087/infraActiveRequests/%1$s"
}
}
-} \ No newline at end of file
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json
new file mode 100644
index 0000000000..133d8bed9b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json
@@ -0,0 +1,5 @@
+{
+ "artifactUUID": "81526781-e55c-4cb7-adb3-97e09d9c76bf",
+ "artifactName": "testingPNFWorkflow.bpmn",
+ "name": "testingPNFWorkflow"
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/Vnf.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/Vnf.json
index 09f6d81da3..0b03f56caa 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/Vnf.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/Vnf.json
@@ -101,7 +101,7 @@
},
{
"relationship-key": "volume-group.volume-group-id",
- "relationship-value": "18b220c8-af84-4b82-a8c0-41bbea6328a6"
+ "relationship-value": "volumeGroupId"
}
]
},
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/VnfLookup.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/VnfLookup.json
new file mode 100644
index 0000000000..eef0776f5d
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/infra/VnfLookup.json
@@ -0,0 +1,30 @@
+[
+ {
+ "requestId":"b15f30dc-56b1-4a1a-aaf1-156c0d685142",
+ "action":"createInstance",
+ "requestStatus":"COMPLETE",
+ "statusMessage":"ALaCarte-Vnf-createInstance request was executed correctly.",
+ "flowStatus":"Successfully completed all Building Blocks",
+ "progress":100,
+ "startTime":"2019-11-11T19:28:56.000+0000",
+ "endTime":"2019-11-11T19:29:15.000+0000",
+ "source":"VID",
+ "vnfId":"5b20c24e-cabb-4725-8f88-57ca99a8ffe1",
+ "vnfName":"Robot_VNF_For_Volume_Group",
+ "vnfType":"Vf zrdm5bpxmc02092017-Service/Vf zrdm5bpxmc02092017-VF 0",
+ "tenantId":"0422ffb57ba042c0800a29dc85ca70f8",
+ "requestBody":"{\"requestDetails\": {\"relatedInstanceList\": [{\"relatedInstance\": {\"instanceId\": \"f5435110-b276-4920-9261-a18a5582d357\", \"modelInfo\": {\"modelVersionId\": \"bad955c3-29b2-4a27-932e-28e942cc6480\", \"modelVersion\": \"1\", \"modelName\": \"Vf zrdm5bpxmc02092017-Service\", \"modelInvariantId\": \"b16a9398-ffa3-4041-b78c-2956b8ad9c7b\", \"modelType\": \"service\"}}}], \"requestParameters\": {\"userParams\": [], \"enforceValidNfValues\": false, \"testApi\": \"GR_API\"}, \"lineOfBusiness\": {\"lineOfBusinessName\": \"vSAMP12_14-2XXX-Aug18-9001 - LOB\"}, \"requestInfo\": {\"source\": \"VID\", \"requestorId\": \"az2016\", \"instanceName\": \"Robot_VNF_For_Volume_Group\", \"suppressRollback\": false, \"productFamilyId\": \"06f76284-8710-11e6-ae22-56b6b6499611\"}, \"platform\": {\"platformName\": \"vSAMP12_14-2XXX-Aug18-9001 - Platform\"}, \"modelInfo\": {\"modelName\": \"Vf zrdm5bpxmc02092017-VF\", \"modelVersion\": \"1\", \"modelInvariantId\": \"23122c9b-dd7f-483f-bf0a-e069303db2f7\", \"modelType\": \"vnf\", \"modelCustomizationName\": \"Vf zrdm5bpxmc02092017-VF 0\", \"modelVersionId\": \"d326f424-2312-4dd6-b7fe-364fadbd1ef5\", \"modelCustomizationId\": \"96c23a4a-6887-4b2c-9cce-1e4ea35eaade\"}, \"cloudConfiguration\": {\"cloudOwner\": \"cloudOwner\", \"tenantId\": \"0422ffb57ba042c0800a29dc85ca70f8\", \"lcpCloudRegionId\": \"regionOne\"}}}",
+ "lastModifiedBy":"CamundaBPMN",
+ "modifyTime":"2019-11-11T19:29:15.000+0000",
+ "cloudRegion":"regionOne",
+ "serviceInstanceId":"f5435110-b276-4920-9261-a18a5582d357",
+ "requestScope":"vnf",
+ "requestAction":"createInstance",
+ "requestorId":"az2016",
+ "requestUrl":"http://192.168.99.100:9100/onap/so/infra/serviceInstantiation/v7/serviceInstances/f5435110-b276-4920-9261-a18a5582d357/vnfs",
+ "cloudApiRequests":[
+
+ ],
+ "requestURI":"b15f30dc-56b1-4a1a-aaf1-156c0d685142"
+ }
+]
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
index 2e1c6a9bdc..1d6722278c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
@@ -9,14 +9,22 @@ server:
mso:
health:
endpoints:
- catalogdb: http://localhost:${wiremock.server.port}
- requestdb: http://localhost:${wiremock.server.port}
- sdnc: http://localhost:${wiremock.server.port}
- openstack: http://localhost:${wiremock.server.port}
- bpmn: http://localhost:${wiremock.server.port}
- asdc: http://localhost:${wiremock.server.port}
- requestdbattsvc: http://localhost:${wiremock.server.port}
-
+ - subsystem: apih
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: asdc
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: bpmn
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: catalogdb
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: openstack
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: requestdb
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: sdnc
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: soappcorchestrator
+ uri: http://localhost:${wiremock.server.port}
infra-requests:
archived:
period: 180
@@ -118,7 +126,13 @@ mariaDB4j:
port: 3307
databaseName: catalogdb
databaseName2: requestdb
-
+#Actuator
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ exposure:
+ include: "*"
org:
onap:
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql
index 22f68e0579..5a1c532d0e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/data.sql
@@ -1,27 +1,22 @@
--Changes here should also be made in InfraActiveRequestsReset.sql to be re-inserted after tests
-INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00032ab7-na18-42e5-965d-8ea592502018', '00032ab7-fake-42e5-965d-8ea592502018', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, null),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('5ffbabd6-b793-4377-a1ab-082670fbc7ac', '5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'deleteInstance', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', null, 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-INSERT INTO requestdb.infra_active_requests(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, null),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc350', null, 'createInstance', 'IN_PROGRESS', 'Error parsing request.
- No valid instanceName is specified', null, '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID',
- '1882938', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null,
- '{"serviceInstanceId":"1882939","vnfInstanceId":"1882938","networkInstanceId":"1882937","volumeGroupInstanceId":"1882935","vfModuleInstanceId":"1882934","requestDetails":{"requestInfo":{"source":"VID","requestorId":"xxxxxx","instanceName":"testService9"},"requestParameters":{"aLaCarte":true,"autoBuildVfModules":false,"subscriptionServiceType":"test"},"modelInfo":{"modelInvariantId":"f7ce78bb-423b-11e7-93f8-0050569a7965","modelVersion":"1","modelVersionId":"10","modelType":"service","modelName":"serviceModel","modelInstanceName":"modelInstanceName","modelCustomizationId":"f7ce78bb-423b-11e7-93f8-0050569a796"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"}}}',
- null, 'APIH', null, null, '1882935', null, '1882934', null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', '1882939', 'testService10', 'xxxxxx', 'test', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-
+INSERT INTO requestdb.infra_active_requests(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00032ab7-na18-42e5-965d-8ea592502018', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, null),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_v10_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"Infra_v10_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_v10_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true}}', null, 'APIH', null, null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_v10_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, '{"requestDetails": {"modelInfo":{"modelType":"vfModule","modelName":"test::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"n6"}}}', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('5ffbabd6-b793-4377-a1ab-082670fbc7ac', 'PENDING', 'Vf Module deletion pending.', '0', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails": {"modelInfo": {"modelType": "vfModule","modelName": "test::base::module-0","modelVersionId": "20c4431c-246d-11e7-93ae-92361f002671","modelInvariantId": "78ca26d0-246d-11e7-93ae-92361f002671","modelVersion": "2","modelCustomizationId": "cb82ffd8-252a-11e7-93ae-92361f002671"},"cloudConfiguration": {"lcpCloudRegionId": "n6","tenantId": "0422ffb57ba042c0800a29dc85ca70f8"},"requestInfo": {"instanceName": "MSO-DEV-VF-1806BB-v10-base-it2-1","source": "VID","suppressRollback": false,"requestorId": "xxxxxx"},"relatedInstanceList": [{"relatedInstance": {"instanceId": "76fa8849-4c98-473f-b431-2590b192a653","modelInfo": {"modelType": "service","modelName": "Infra_v10_Service","modelVersionId": "5df8b6de-2083-11e7-93ae-92361f002671","modelInvariantId": "9647dfc4-2083-11e7-93ae-92361f002671","modelVersion": "1.0"}}},{"relatedInstance": {"instanceId": "d57970e1-5075-48a5-ac5e-75f2d6e10f4c","modelInfo": {"modelType": "vnf","modelName": "v10","modelVersionId": "ff2ae348-214a-11e7-93ae-92361f002671","modelInvariantId": "2fff5b20-214b-11e7-93ae-92361f002671","modelVersion": "1.0","modelCustomizationId": "68dc9a92-214c-11e7-93ae-92361f002671","modelCustomizationName": "v10 1"}}}],"requestParameters": {"usePreload": true,"userParams": []}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'test::base::module-0', 'n6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+
+INSERT INTO requestdb.infra_active_requests(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00164b9e-784d-48a8-8973-bbad6ef818ed', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-n6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, 'n6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-n6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, null),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"Infra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"n6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, 'n6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc350', 'IN_PROGRESS', 'Error parsing request.
+ No valid instanceName is specified', null, '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', '1882938', null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"serviceInstanceId":"1882939","vnfInstanceId":"1882938","networkInstanceId":"1882937","volumeGroupInstanceId":"1882935","vfModuleInstanceId":"1882934","requestDetails":{"requestInfo":{"source":"VID","requestorId":"xxxxxx","instanceName":"testService9"},"requestParameters":{"aLaCarte":true,"autoBuildVfModules":false,"subscriptionServiceType":"test"},"modelInfo":{"modelInvariantId":"f7ce78bb-423b-11e7-93f8-0050569a7965","modelVersion":"1","modelVersionId":"10","modelType":"service","modelName":"serviceModel","modelInstanceName":"modelInstanceName","modelCustomizationId":"f7ce78bb-423b-11e7-93f8-0050569a796"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"}}}', null, 'APIH', null, '1882935', null, '1882934', null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', '1882939', 'testService10', 'xxxxxx', 'test', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
INSERT INTO requestdb.site_status(SITE_NAME, STATUS, CREATION_TIMESTAMP) VALUES
('testSite', 0, '2017-11-30 15:48:09');
-
-
INSERT INTO requestdb.activate_operational_env_service_model_distribution_status(OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID, SERVICE_MOD_VER_FINAL_DISTR_STATUS, RECOVERY_ACTION, RETRY_COUNT_LEFT, WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME, VNF_OPERATIONAL_ENV_ID) VALUES
('1dfe7154-eae0-44f2-8e7a-8e5e7882e55d', '37305814-4949-45ce-ae24-c378c7ed07d1', '483646fe-36cc-4e90-895a-c472f6da3f74', 'DISTRIBUTION_COMPLETE_OK', 'RETRY', 0, 'VNF_D2D', '2018-02-02 18:44:27', '2018-02-02 18:45:06', 'vnf_1234'),
('1dfe7154-eae0-44f2-8e7a-8e5e7882e55d', '7bfa2197-8cbb-4080-b369-56c4d53c4573', '483646fe-36cc-4e90-895a-c472f6da3f74', 'DISTRIBUTION_COMPLETE_OK', 'SKIP', 0, 'VNF_D2D', '2018-02-02 18:44:27', '2018-02-02 18:44:56', 'vnf_1235');
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
index 731d2bec4d..050780c9a2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
@@ -809,6 +809,10 @@ CREATE TABLE `service` (
`OVERALL_DISTRIBUTION_STATUS` varchar(45),
`ONAP_GENERATED_NAMING` TINYINT(1) DEFAULT NULL,
`NAMING_POLICY` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -963,6 +967,7 @@ CREATE TABLE `vf_module_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VF_MODULE_MODEL_UUID` varchar(200) NOT NULL,
`VNF_RESOURCE_CUSTOMIZATION_ID` int(13) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`ID`),
KEY `fk_vf_module_customization__vf_module1_idx` (`VF_MODULE_MODEL_UUID`),
KEY `fk_vf_module_customization__heat_env__heat_environment1_idx` (`HEAT_ENVIRONMENT_ARTIFACT_UUID`),
@@ -1111,7 +1116,9 @@ CREATE TABLE `vnf_resource_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_MODEL_UUID` varchar(200) NOT NULL,
+ `NF_DATA_VALID` tinyint(1) DEFAULT '0',
`VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`),
KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`),
@@ -1192,6 +1199,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
`RESOURCE_INPUT` varchar(2000) DEFAULT NULL,
`CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
`CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -1247,8 +1255,6 @@ USE requestdb;
CREATE TABLE `infra_active_requests` (
`REQUEST_ID` varchar(45) NOT NULL,
- `CLIENT_REQUEST_ID` varchar(45) DEFAULT NULL,
- `ACTION` varchar(45) DEFAULT NULL,
`REQUEST_STATUS` varchar(20) DEFAULT NULL,
`STATUS_MESSAGE` longtext DEFAULT NULL,
`PROGRESS` bigint(20) DEFAULT NULL,
@@ -1256,26 +1262,23 @@ CREATE TABLE `infra_active_requests` (
`END_TIME` datetime DEFAULT NULL,
`SOURCE` varchar(45) DEFAULT NULL,
`VNF_ID` varchar(45) DEFAULT NULL,
+ `PNF_ID` varchar(45) DEFAULT NULL,
`VNF_NAME` varchar(80) DEFAULT NULL,
`VNF_TYPE` varchar(200) DEFAULT NULL,
`SERVICE_TYPE` varchar(45) DEFAULT NULL,
- `AIC_NODE_CLLI` varchar(11) DEFAULT NULL,
`TENANT_ID` varchar(45) DEFAULT NULL,
- `PROV_STATUS` varchar(20) DEFAULT NULL,
`VNF_PARAMS` longtext,
`VNF_OUTPUTS` longtext,
`REQUEST_BODY` longtext,
`RESPONSE_BODY` longtext,
`LAST_MODIFIED_BY` varchar(100) DEFAULT NULL,
`MODIFY_TIME` datetime DEFAULT NULL,
- `REQUEST_TYPE` varchar(20) DEFAULT NULL,
`VOLUME_GROUP_ID` varchar(45) DEFAULT NULL,
`VOLUME_GROUP_NAME` varchar(45) DEFAULT NULL,
`VF_MODULE_ID` varchar(45) DEFAULT NULL,
`VF_MODULE_NAME` varchar(200) DEFAULT NULL,
`VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL,
- `AAI_SERVICE_ID` varchar(50) DEFAULT NULL,
- `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL,
+ `CLOUD_REGION` varchar(11) DEFAULT NULL,
`CALLBACK_URL` varchar(200) DEFAULT NULL,
`CORRELATOR` varchar(80) DEFAULT NULL,
`NETWORK_ID` varchar(45) DEFAULT NULL,
@@ -1294,14 +1297,11 @@ CREATE TABLE `infra_active_requests` (
`ORIGINAL_REQUEST_ID` varchar(45) DEFAULT NULL,
`EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
`ROLLBACK_EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
- PRIMARY KEY (`REQUEST_ID`),
- UNIQUE KEY `UK_bhu6w8p7wvur4pin0gjw2d5ak` (`CLIENT_REQUEST_ID`)
+ PRIMARY KEY (`REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `archived_infra_requests` (
`REQUEST_ID` varchar(45) NOT NULL,
- `CLIENT_REQUEST_ID` varchar(45) DEFAULT NULL,
- `ACTION` varchar(45) DEFAULT NULL,
`REQUEST_STATUS` varchar(20) DEFAULT NULL,
`STATUS_MESSAGE` longtext DEFAULT NULL,
`PROGRESS` bigint(20) DEFAULT NULL,
@@ -1312,23 +1312,19 @@ CREATE TABLE `archived_infra_requests` (
`VNF_NAME` varchar(80) DEFAULT NULL,
`VNF_TYPE` varchar(200) DEFAULT NULL,
`SERVICE_TYPE` varchar(45) DEFAULT NULL,
- `AIC_NODE_CLLI` varchar(11) DEFAULT NULL,
`TENANT_ID` varchar(45) DEFAULT NULL,
- `PROV_STATUS` varchar(20) DEFAULT NULL,
`VNF_PARAMS` longtext,
`VNF_OUTPUTS` longtext,
`REQUEST_BODY` longtext,
`RESPONSE_BODY` longtext,
`LAST_MODIFIED_BY` varchar(100) DEFAULT NULL,
`MODIFY_TIME` datetime DEFAULT NULL,
- `REQUEST_TYPE` varchar(20) DEFAULT NULL,
`VOLUME_GROUP_ID` varchar(45) DEFAULT NULL,
`VOLUME_GROUP_NAME` varchar(45) DEFAULT NULL,
`VF_MODULE_ID` varchar(45) DEFAULT NULL,
`VF_MODULE_NAME` varchar(200) DEFAULT NULL,
`VF_MODULE_MODEL_NAME` varchar(200) DEFAULT NULL,
- `AAI_SERVICE_ID` varchar(50) DEFAULT NULL,
- `AIC_CLOUD_REGION` varchar(11) DEFAULT NULL,
+ `CLOUD_REGION` varchar(11) DEFAULT NULL,
`CALLBACK_URL` varchar(200) DEFAULT NULL,
`CORRELATOR` varchar(80) DEFAULT NULL,
`NETWORK_ID` varchar(45) DEFAULT NULL,
@@ -1344,8 +1340,7 @@ CREATE TABLE `archived_infra_requests` (
`OPERATIONAL_ENV_ID` varchar(45) DEFAULT NULL,
`OPERATIONAL_ENV_NAME` varchar(200) DEFAULT NULL,
`REQUEST_URL` varchar(500) DEFAULT NULL,
- PRIMARY KEY (`REQUEST_ID`),
- UNIQUE KEY `UK_bhu6w8p7wvur4pin0gjw2d59h` (`CLIENT_REQUEST_ID`)
+ PRIMARY KEY (`REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `site_status` (
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
index 8566afe9e1..485ed8357f 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
@@ -29,7 +29,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource(collectionResourceRel = "archivedInfraRequests", path = "archivedInfraRequests")
public interface ArchivedInfraRequestsRepository extends JpaRepository<ArchivedInfraRequests, String> {
- List<InfraActiveRequests> findByActionAndRequestStatusAndVfModuleId(String action, String requestStatus,
- String vfModuleId);
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java
index a14699827d..927477e146 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java
@@ -25,6 +25,7 @@ import java.util.List;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@@ -32,14 +33,6 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
public interface InfraActiveRequestsRepository
extends JpaRepository<InfraActiveRequests, String>, InfraActiveRequestsRepositoryCustom {
- InfraActiveRequests findOneByRequestIdOrClientRequestId(String requestId, String clientRequestId);
-
- InfraActiveRequests findOneByRequestIdOrClientRequestIdAndRequestType(String requestId, String clientRequestId,
- String requestType);
-
- List<InfraActiveRequests> findByActionAndRequestStatusAndVfModuleId(String action, String requestStatus,
- String vfModuleId);
-
InfraActiveRequests findOneByRequestId(String string);
InfraActiveRequests findOneByRequestBody(String requestBody);
@@ -47,4 +40,8 @@ public interface InfraActiveRequestsRepository
List<InfraActiveRequests> findByEndTimeLessThan(Date endTime, Pageable request);
List<InfraActiveRequests> findByStartTimeLessThanAndEndTime(Date startTime, Date endTime, Pageable request);
+
+ @Query(value = "SELECT * FROM infra_active_requests WHERE request_status = 'IN_PROGRESS' AND (request_scope = 'volumeGroup' OR request_scope = 'vfModule') AND start_time < (NOW() - INTERVAL 2 MINUTE)"
+ + " ORDER BY start_time DESC", nativeQuery = true)
+ List<InfraActiveRequests> getInProgressVolumeGroupsAndVfModules();
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java
index 5a8e2e2f6c..1c32e03c84 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java
@@ -47,10 +47,6 @@ public interface InfraActiveRequestsRepositoryCustom {
public InfraActiveRequests getRequestFromInfraActive(String requestId, String requestType);
- public InfraActiveRequests checkDuplicateByVnfName(String vnfName, String action, String requestType);
-
- public InfraActiveRequests checkDuplicateByVnfId(String vnfId, String action, String requestType);
-
public InfraActiveRequests checkVnfIdStatus(String operationalEnvironmentId);
List<InfraActiveRequests> getInfraActiveRequests(final Map<String, String[]> filters, final long startTime,
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
index 13ca33c2cf..bba0ad4696 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
@@ -24,11 +24,9 @@ package org.onap.so.db.request.data.repository;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -67,7 +65,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
protected static final String SOURCE = "source";
protected static final String START_TIME = "startTime";
protected static final String END_TIME = "endTime";
- protected static final String REQUEST_TYPE = "requestType";
protected static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
protected static final String SERVICE_INSTANCE_NAME = "serviceInstanceName";
protected static final String VNF_INSTANCE_NAME = "vnfName";
@@ -88,12 +85,11 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
protected static final String SERVICE_VERSION = "serviceVersion";
protected static final String REQUEST_ID = "requestId";
protected static final String REQUESTOR_ID = "requestorId";
- protected static final String ACTION = "action";
protected static final String OPENV = "operationalEnvironment";
private static final List<String> VALID_COLUMNS =
- Arrays.asList(REQUEST_ID, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, ACTION, REQUEST_STATUS,
- VFMODULE_INSTANCE_ID, VNF_INSTANCE_ID, NETWORK_INSTANCE_ID, VOLUME_GROUP_INSTANCE_ID);
+ Arrays.asList(REQUEST_ID, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUEST_STATUS, VFMODULE_INSTANCE_ID,
+ VNF_INSTANCE_ID, NETWORK_INSTANCE_ID, VOLUME_GROUP_INSTANCE_ID);
/*
@@ -114,17 +110,13 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
private List<InfraActiveRequests> executeInfraQuery(final CriteriaQuery<InfraActiveRequests> crit,
final List<Predicate> predicates, final Order order) {
- final long startTime = System.currentTimeMillis();
logger.debug("Execute query on infra active request table");
- List<InfraActiveRequests> results = new ArrayList<InfraActiveRequests>();
-
final CriteriaBuilder cb = entityManager.getCriteriaBuilder();
crit.where(cb.and(predicates.toArray(new Predicate[0])));
crit.orderBy(order);
- results = entityManager.createQuery(crit).getResultList();
- return results;
+ return entityManager.createQuery(crit).getResultList();
}
/*
@@ -134,12 +126,10 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
*/
@Override
public InfraActiveRequests getRequestFromInfraActive(final String requestId) {
- final long startTime = System.currentTimeMillis();
logger.debug("Get request {} from InfraActiveRequests DB", requestId);
InfraActiveRequests ar = null;
- final Query query = entityManager
- .createQuery("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId");
+ final Query query = entityManager.createQuery("from InfraActiveRequests where requestId = :requestId");
query.setParameter(REQUEST_ID, requestId);
ar = this.getSingleResult(query);
return ar;
@@ -255,6 +245,8 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
mapKey = "serviceInstanceName";
} else if ("vnfInstanceId".equalsIgnoreCase(mapKey)) {
mapKey = "vnfId";
+ } else if ("pnfId".equalsIgnoreCase(mapKey)) {
+ mapKey = "pnfId";
} else if ("vnfInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "vnfName";
} else if ("vfModuleInstanceId".equalsIgnoreCase(mapKey)) {
@@ -274,7 +266,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
} else if (mapKey.equalsIgnoreCase("configurationInstanceName")) {
mapKey = "configurationName";
} else if ("lcpCloudRegionId".equalsIgnoreCase(mapKey)) {
- mapKey = "aicCloudRegion";
+ mapKey = "cloudRegion";
} else if ("tenantId".equalsIgnoreCase(mapKey)) {
mapKey = "tenantId";
} else if ("modelType".equalsIgnoreCase(mapKey)) {
@@ -393,12 +385,8 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
final CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
final Root<InfraActiveRequests> candidateRoot = crit.from(InfraActiveRequests.class);
final Predicate isEqual = cb.equal(candidateRoot.get(queryAttributeName), queryValue);
- final Predicate equalRequestType = cb.equal(candidateRoot.get(REQUEST_TYPE), requestType);
- final Predicate isNull = cb.isNull(candidateRoot.get(REQUEST_TYPE));
- final Predicate orClause = cb.or(equalRequestType, isNull);
final Order orderDesc = cb.desc(candidateRoot.get(START_TIME));
final Order orderAsc = cb.asc(candidateRoot.get(SOURCE));
- crit.where(cb.and(isEqual, orClause)).orderBy(orderDesc, orderAsc);
final List<InfraActiveRequests> arList = entityManager.createQuery(crit).getResultList();
if (arList != null && !arList.isEmpty()) {
@@ -419,79 +407,17 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
*/
@Override
public InfraActiveRequests getRequestFromInfraActive(final String requestId, final String requestType) {
- final long startTime = System.currentTimeMillis();
logger.debug("Get infra request from DB with id {}", requestId);
InfraActiveRequests ar = null;
- final Query query = entityManager.createQuery(
- "from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType");
+ final Query query = entityManager
+ .createQuery("from InfraActiveRequests where requestId = :requestId and requestType = :requestType");
query.setParameter(REQUEST_ID, requestId);
- query.setParameter(REQUEST_TYPE, requestType);
ar = this.getSingleResult(query);
return ar;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkDuplicateByVnfName(java.lang. String,
- * java.lang.String, java.lang.String)
- */
- @Override
- public InfraActiveRequests checkDuplicateByVnfName(final String vnfName, final String action,
- final String requestType) {
-
- final long startTime = System.currentTimeMillis();
- logger.debug("Get infra request from DB for VNF {} and action {} and requestType {}", vnfName, action,
- requestType);
-
- InfraActiveRequests ar = null;
-
- final Query query = entityManager.createQuery(
- "from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
- query.setParameter("vnfName", vnfName);
- query.setParameter("action", action);
- query.setParameter(REQUEST_TYPE, requestType);
- @SuppressWarnings("unchecked")
- final List<InfraActiveRequests> results = query.getResultList();
- if (!results.isEmpty()) {
- ar = results.get(0);
- }
-
- return ar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkDuplicateByVnfId(java.lang. String,
- * java.lang.String, java.lang.String)
- */
- @Override
- public InfraActiveRequests checkDuplicateByVnfId(final String vnfId, final String action,
- final String requestType) {
-
- final long startTime = System.currentTimeMillis();
- logger.debug("Get list of infra requests from DB for VNF {} and action {}", vnfId, action);
-
- InfraActiveRequests ar = null;
-
- final Query query = entityManager.createQuery(
- "from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
- query.setParameter("vnfId", vnfId);
- query.setParameter("action", action);
- query.setParameter(REQUEST_TYPE, requestType);
- @SuppressWarnings("unchecked")
- final List<InfraActiveRequests> results = query.getResultList();
- if (!results.isEmpty()) {
- ar = results.get(0);
- }
-
- return ar;
- }
-
/*
* (non-Javadoc)
*
@@ -499,7 +425,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
*/
@Override
public InfraActiveRequests checkVnfIdStatus(final String operationalEnvironmentId) {
- final long startTime = System.currentTimeMillis();
logger.debug("Get Infra request from DB for OperationalEnvironmentId {}", operationalEnvironmentId);
InfraActiveRequests ar = null;
@@ -509,10 +434,9 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
final Root<InfraActiveRequests> candidateRoot = crit.from(InfraActiveRequests.class);
final Predicate operationalEnvEq = cb.equal(candidateRoot.get("operationalEnvId"), operationalEnvironmentId);
final Predicate requestStatusNotEq = cb.notEqual(candidateRoot.get(REQUEST_STATUS), "COMPLETE");
- final Predicate actionEq = cb.equal(candidateRoot.get("action"), "create");
final Order startTimeOrder = cb.desc(candidateRoot.get("startTime"));
crit.select(candidateRoot);
- crit.where(cb.and(operationalEnvEq, requestStatusNotEq, actionEq));
+ crit.where(cb.and(operationalEnvEq, requestStatusNotEq));
crit.orderBy(startTimeOrder);
final TypedQuery<InfraActiveRequests> query = entityManager.createQuery(crit);
final List<InfraActiveRequests> results = query.getResultList();
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 708171366d..cb02b7c491 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
@@ -39,6 +39,9 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr
List<RequestProcessingData> findBySoRequestIdOrderByGroupingIdDesc(@Param("SO_REQUEST_ID") String soRequestId);
+ RequestProcessingData[] findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc(
+ @Param("SO_REQUEST_ID") String soRequestId, @Param("IS_INTERNAL_DATA") Boolean isDataInternal);
+
List<RequestProcessingData> findByGroupingIdAndNameAndTag(@Param("GROUPING_ID") String groupingId,
@Param("NAME") String name, @Param("TAG") String tag);
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
index ca30604e06..3df30c0f49 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
-import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.ACTION;
import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.REQUEST_ID;
import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.SERVICE_INSTANCE_ID;
import java.util.Collections;
@@ -142,59 +141,6 @@ public class InfraActiveRequestsRepositoryImplTest {
assertEquals(SERVICE_INSTANCE_ID_VALUE, actualRequests.get(0).getServiceInstanceId());
}
-
- @Test
- public void test_GetInfraActiveRequestsData_withNotEqualAction() {
- final Map<String, String[]> values = new HashMap<>();
- values.put(ACTION, new String[] {QueryOperationType.NEQ.name(), "createInstance"});
- final List<InfraActiveRequests> actualRequests =
- objUnderTest.getInfraActiveRequests(values, START_TIME_IN_MILISEC, END_TIME_IN_MILISEC, null);
- assertFalse(actualRequests.isEmpty());
- for (final InfraActiveRequests actualActiveRequests : actualRequests) {
- assertNotEquals("createInstance", actualActiveRequests.getAction());
- }
- }
-
-
- @Test
- public void test_GetInfraActiveRequestsData_withNotEqualToServiceInstanceNameAndServiceInstanceIdNul() {
- final Map<String, String[]> values = new HashMap<>();
- values.put(ACTION, new String[] {QueryOperationType.NEQ.name(), "createInstance"});
- values.put(SERVICE_INSTANCE_ID, new String[] {QueryOperationType.EQ.name(), SERVICE_INSTANCE_ID_VALUE});
-
- final List<InfraActiveRequests> actualRequests =
- objUnderTest.getInfraActiveRequests(values, START_TIME_IN_MILISEC, END_TIME_IN_MILISEC, null);
- assertFalse(actualRequests.isEmpty());
- for (final InfraActiveRequests actualActiveRequests : actualRequests) {
- assertNotEquals("createInstance", actualActiveRequests.getAction());
- assertEquals(SERVICE_INSTANCE_ID_VALUE, actualActiveRequests.getServiceInstanceId());
- }
- }
-
- @Test
- public void test_GetInfraActiveRequestsData_withStartEndDateTimeNotEqualAction() {
- final Map<String, String[]> values = new HashMap<>();
- values.put(ACTION, new String[] {QueryOperationType.NEQ.name(), "createInstance"});
- final List<InfraActiveRequests> actualRequests =
- objUnderTest.getInfraActiveRequests(values, START_TIME_IN_MILISEC, END_TIME_IN_MILISEC, null);
- assertFalse(actualRequests.isEmpty());
- for (final InfraActiveRequests actualActiveRequests : actualRequests) {
- assertNotEquals("createInstance", actualActiveRequests.getAction());
- }
- }
-
- @Test
- public void test_GetInfraActiveRequestsData_withLimitNotEqualAction() {
- final Map<String, String[]> values = new HashMap<>();
- values.put(ACTION, new String[] {QueryOperationType.NEQ.name(), "createInstance"});
- final List<InfraActiveRequests> actualRequests =
- objUnderTest.getInfraActiveRequests(values, START_TIME_IN_MILISEC, END_TIME_IN_MILISEC, MAX_LIMIT);
- assertFalse(actualRequests.isEmpty());
- for (final InfraActiveRequests actualActiveRequests : actualRequests) {
- assertNotEquals("createInstance", actualActiveRequests.getAction());
- }
- }
-
@Test
public void test_GetInfraActiveRequestsData_withNullFilters() {
final List<InfraActiveRequests> actualRequests =
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql
index 43571e42fc..209a341b74 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/afterMigrate.sql
@@ -4,13 +4,13 @@ insert into operation_status(service_id, operation_id, service_name, user_id, re
('serviceid', 'operationid', 'servicename', 'userid', 'result', 'operationcontent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10');
-insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+insert into infra_active_requests(request_id, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, tenant_id, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values
+('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00164b9e-784d-48a8-8973-bbad6ef818ed', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
insert into watchdog_distributionid_status(distribution_id, distribution_id_status, lock_version, create_time, modify_time) values
('1533c4bd-a3e3-493f-a16d-28c20614415e', '', 0, '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
index 192e6d55b6..d2b3a71cad 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
@@ -29,10 +29,14 @@ create table IF NOT EXISTS OPERATION_STATUS (
);
-INSERT INTO PUBLIC.OPERATION_STATUS(SERVICE_ID, OPERATION_ID, OPERATION_TYPE, USER_ID, RESULT, OPERATION_CONTENT, PROGRESS, REASON, OPERATE_AT, FINISHED_AT) VALUES
-('serviceId', 'operationId', 'operationType', 'userId', 'result', 'operationContent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10');
+INSERT INTO PUBLIC.OPERATION_STATUS (SERVICE_ID, OPERATION_ID, OPERATION_TYPE, USER_ID, RESULT, OPERATION_CONTENT, PROGRESS, REASON, OPERATE_AT, FINISHED_AT)
+SELECT * FROM (SELECT 'serviceId', 'operationId', 'operationType', 'userId', 'result', 'operationContent', 'progress', 'reason', '2016-11-24 13:19:1' AS OPERATE_AT, '2016-11-24 13:19:10' AS FINISHED_AT) AS tmp
+WHERE NOT EXISTS (
+ SELECT SERVICE_ID, OPERATION_ID FROM OPERATION_STATUS WHERE
+ SERVICE_ID = 'serviceId' and OPERATION_ID = 'operationId'
+) LIMIT 1;
- create table RESOURCE_OPERATION_STATUS (
+ create table IF NOT EXISTS RESOURCE_OPERATION_STATUS (
SERVICE_ID varchar(255) not null,
OPERATION_ID varchar(255) not null,
RESOURCE_TEMPLATE_UUID varchar(255) not null,
@@ -46,10 +50,10 @@ INSERT INTO PUBLIC.OPERATION_STATUS(SERVICE_ID, OPERATION_ID, OPERATION_TYPE, US
primary key (SERVICE_ID,OPERATION_ID,RESOURCE_TEMPLATE_UUID)
);
+DROP TABLE PUBLIC.INFRA_ACTIVE_REQUESTS IF EXISTS;
+
CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS(
REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
- CLIENT_REQUEST_ID VARCHAR SELECTIVITY 6,
- ACTION VARCHAR SELECTIVITY 1,
REQUEST_STATUS VARCHAR SELECTIVITY 1,
STATUS_MESSAGE longtext SELECTIVITY 36,
ROLLBACK_STATUS_MESSAGE longtext SELECTIVITY 36,
@@ -60,26 +64,23 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS(
END_TIME VARCHAR,
SOURCE VARCHAR SELECTIVITY 2,
VNF_ID VARCHAR SELECTIVITY 15,
+ PNF_ID VARCHAR SELECTIVITY 15,
VNF_NAME VARCHAR SELECTIVITY 11,
VNF_TYPE VARCHAR SELECTIVITY 5,
SERVICE_TYPE VARCHAR SELECTIVITY 1,
- AIC_NODE_CLLI VARCHAR SELECTIVITY 1,
TENANT_ID VARCHAR SELECTIVITY 2,
- PROV_STATUS VARCHAR SELECTIVITY 1,
VNF_PARAMS VARCHAR SELECTIVITY 1,
VNF_OUTPUTS VARCHAR SELECTIVITY 3,
REQUEST_BODY VARCHAR SELECTIVITY 79,
RESPONSE_BODY VARCHAR SELECTIVITY 7,
LAST_MODIFIED_BY VARCHAR SELECTIVITY 2,
MODIFY_TIME VARCHAR,
- REQUEST_TYPE VARCHAR SELECTIVITY 1,
VOLUME_GROUP_ID VARCHAR SELECTIVITY 2,
VOLUME_GROUP_NAME VARCHAR SELECTIVITY 3,
VF_MODULE_ID VARCHAR SELECTIVITY 5,
VF_MODULE_NAME VARCHAR SELECTIVITY 8,
VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3,
- AAI_SERVICE_ID VARCHAR SELECTIVITY 1,
- AIC_CLOUD_REGION VARCHAR SELECTIVITY 1,
+ CLOUD_REGION VARCHAR SELECTIVITY 1,
CALLBACK_URL VARCHAR SELECTIVITY 1,
CORRELATOR VARCHAR SELECTIVITY 1,
NETWORK_ID VARCHAR SELECTIVITY 2,
@@ -102,26 +103,30 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS(
ROLLBACK_EXT_SYSTEM_ERROR_SOURCE VARCHAR SELECTIVITY 1
);
-INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, STRINGDECODE('<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'md5621', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, START_TIME, END_TIME, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME ) VALUES
-('a5294d37-21db-4e3a-ae04-57412adcb4ac', null, 'createInstance', 'COMPLETE', '2019-01-01 12:45:00', '2019-01-01 12:50:00', 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_1'),
-('9383dc81-7a6c-4673-8082-650d50a82a1a', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 12:55:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_2'),
-('a1abeab2-f8ef-43ab-b76c-9c3c2cb9980f', null, 'activateInstance', 'FAILED', '2019-01-01 13:00:00', '2019-01-01 14:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_3'),
-('81b8e152-ee89-49f4-b82b-08b0dcae27cd', null, 'createInstance', 'COMPLETE', '2019-01-01 14:10:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_1'),
-('0c28cad2-ff79-4dfa-a04a-9e44996fd7f7', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 13:30:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_2'),
-('d0d995a7-549b-4e7e-9101-2bab17ec24ea', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 11:15:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_3');
+INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00032ab7-3fb3-42e5-965d-8ea592502017', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}', null, 'APIH', null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, STRINGDECODE('<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', null, null, null, 'MODULENAME1', 'moduleModelName', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+
+
+INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES
+('00164b9e-784d-48a8-8973-bbad6ef818ed', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'md5621', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
+
+INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, START_TIME, END_TIME, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME ) VALUES
+('a5294d37-21db-4e3a-ae04-57412adcb4ac', 'COMPLETE', '2019-01-01 12:45:00', '2019-01-01 12:50:00', 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_1'),
+('9383dc81-7a6c-4673-8082-650d50a82a1a', 'IN_PROGRESS', '2019-01-01 12:55:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_2'),
+('a1abeab2-f8ef-43ab-b76c-9c3c2cb9980f', 'FAILED', '2019-01-01 13:00:00', '2019-01-01 14:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_3'),
+('81b8e152-ee89-49f4-b82b-08b0dcae27cd', 'COMPLETE', '2019-01-01 14:10:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_1'),
+('0c28cad2-ff79-4dfa-a04a-9e44996fd7f7', 'IN_PROGRESS', '2019-01-01 13:30:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_2'),
+('d0d995a7-549b-4e7e-9101-2bab17ec24ea', 'IN_PROGRESS', '2019-01-01 11:15:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_3');
+
+
+DROP TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS IF EXISTS;
CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS(
REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
- CLIENT_REQUEST_ID VARCHAR SELECTIVITY 6,
- ACTION VARCHAR SELECTIVITY 1,
REQUEST_STATUS VARCHAR SELECTIVITY 1,
STATUS_MESSAGE longtext SELECTIVITY 36,
ROLLBACK_STATUS_MESSAGE longtext SELECTIVITY 36,
@@ -135,23 +140,19 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS(
VNF_NAME VARCHAR SELECTIVITY 11,
VNF_TYPE VARCHAR SELECTIVITY 5,
SERVICE_TYPE VARCHAR SELECTIVITY 1,
- AIC_NODE_CLLI VARCHAR SELECTIVITY 1,
TENANT_ID VARCHAR SELECTIVITY 2,
- PROV_STATUS VARCHAR SELECTIVITY 1,
VNF_PARAMS VARCHAR SELECTIVITY 1,
VNF_OUTPUTS VARCHAR SELECTIVITY 3,
REQUEST_BODY VARCHAR SELECTIVITY 79,
RESPONSE_BODY VARCHAR SELECTIVITY 7,
LAST_MODIFIED_BY VARCHAR SELECTIVITY 2,
MODIFY_TIME VARCHAR,
- REQUEST_TYPE VARCHAR SELECTIVITY 1,
VOLUME_GROUP_ID VARCHAR SELECTIVITY 2,
VOLUME_GROUP_NAME VARCHAR SELECTIVITY 3,
VF_MODULE_ID VARCHAR SELECTIVITY 5,
VF_MODULE_NAME VARCHAR SELECTIVITY 8,
VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3,
- AAI_SERVICE_ID VARCHAR SELECTIVITY 1,
- AIC_CLOUD_REGION VARCHAR SELECTIVITY 1,
+ CLOUD_REGION VARCHAR SELECTIVITY 1,
CALLBACK_URL VARCHAR SELECTIVITY 1,
CORRELATOR VARCHAR SELECTIVITY 1,
NETWORK_ID VARCHAR SELECTIVITY 2,
@@ -182,6 +183,9 @@ CONSTRAINT fk_cloud_api_req_infra_requests
FOREIGN KEY (SO_REQUEST_ID)
REFERENCES infra_active_requests (REQUEST_ID));
+
+DROP TABLE PUBLIC.SITE_STATUS IF EXISTS;
+
CREATE CACHED TABLE PUBLIC.SITE_STATUS(
SITE_NAME VARCHAR NOT NULL,
STATUS VARCHAR,
@@ -196,6 +200,8 @@ INSERT INTO PUBLIC.SITE_STATUS(SITE_NAME, STATUS, CREATION_TIMESTAMP) VALUES
('test name4', '1', '2017-11-30 15:48:09'),
('test name update', '0', null);
+DROP TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS IF EXISTS;
+
CREATE CACHED TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(
DISTRIBUTION_ID VARCHAR NOT NULL,
DISTRIBUTION_ID_STATUS VARCHAR,
@@ -210,6 +216,9 @@ INSERT INTO PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(DISTRIBUTION_ID, DISTRIBUTION_
('55429711-809b-4a3b-9ee5-5120d46d9de0', '', 0, '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', 0, '2017-11-30 15:54:39', '2017-11-30 15:54:39');
+DROP TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS IF EXISTS;
+
+
CREATE CACHED TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS(
DISTRIBUTION_ID VARCHAR NOT NULL,
COMPONENT_NAME VARCHAR NOT NULL,
@@ -224,6 +233,8 @@ INSERT INTO PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS(DISTRIBUTION_ID, C
('55429711-809b-4a3b-9ee5-5120d46d9de0', 'MSO', 'COMPONENT_DONE_ERROR', '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:54:39', '2017-11-30 15:54:39');
+DROP TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP IF EXISTS;
+
CREATE CACHED TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP(
DISTRIBUTION_ID VARCHAR NOT NULL,
SERVICE_MODEL_VERSION_ID VARCHAR NOT NULL,
diff --git a/mso-api-handlers/mso-requests-db/pom.xml b/mso-api-handlers/mso-requests-db/pom.xml
index 651f35fd5c..031f86282a 100644
--- a/mso-api-handlers/mso-requests-db/pom.xml
+++ b/mso-api-handlers/mso-requests-db/pom.xml
@@ -31,6 +31,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<packaging>jar</packaging>
<build>
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java
index 2cf442406e..8c4d0718b1 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java
@@ -35,7 +35,6 @@ public class ArchivedInfraRequests extends InfraRequests {
public ArchivedInfraRequests(String requestId, String action) {
setRequestId(requestId);
- setAction(action);
}
public ArchivedInfraRequests(String requestId) {
@@ -61,22 +60,19 @@ public class ArchivedInfraRequests extends InfraRequests {
@Override
public String toString() {
- return new ToStringBuilder(this).append("requestId", getRequestId())
- .append("clientRequestId", getClientRequestId()).append("action", getAction())
- .append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
- .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
- .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
- .append("vnfType", getVnfType()).append("serviceType", getServiceType())
- .append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
- .append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
- .append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
- .append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
- .append("modifyTime", getModifyTime()).append("requestType", getRequestType())
+ return new ToStringBuilder(this).append("requestId", getRequestId()).append("requestStatus", getRequestStatus())
+ .append("statusMessage", getStatusMessage()).append("progress", getProgress())
+ .append("startTime", getStartTime()).append("endTime", getEndTime()).append("source", getSource())
+ .append("vnfId", getVnfId()).append("vnfName", getVnfName()).append("vnfType", getVnfType())
+ .append("serviceType", getServiceType()).append("tenantId", getTenantId())
+ .append("vnfParams", getVnfParams()).append("vnfOutputs", getVnfOutputs())
+ .append("requestBody", getRequestBody()).append("responseBody", getResponseBody())
+ .append("lastModifiedBy", getLastModifiedBy()).append("modifyTime", getModifyTime())
.append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
.append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
- .append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
- .append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
- .append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
+ .append("vfModuleModelName", getVfModuleModelName()).append("cloudRegion", getCloudRegion())
+ .append("callBackUrl", getCallBackUrl()).append("correlator", getCorrelator())
+ .append("serviceInstanceId", getServiceInstanceId())
.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
.append("networkName", getNetworkName()).append("networkType", getNetworkType())
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java
index d0a4aa2c5f..5848f3b3d9 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java
@@ -23,8 +23,10 @@ package org.onap.so.db.request.beans;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Table;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
/**
* InfraActiveRequests generated by hbm2java
@@ -32,6 +34,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name = "infra_active_requests")
+@JsonInclude(Include.NON_NULL)
public class InfraActiveRequests extends InfraRequests {
private static final long serialVersionUID = -6818265918910035170L;
@@ -40,7 +43,6 @@ public class InfraActiveRequests extends InfraRequests {
public InfraActiveRequests(final String requestId, final String action) {
setRequestId(requestId);
- setAction(action);
}
public InfraActiveRequests(final String requestId) {
@@ -66,22 +68,19 @@ public class InfraActiveRequests extends InfraRequests {
@Override
public String toString() {
- return new ToStringBuilder(this).append("requestId", getRequestId())
- .append("clientRequestId", getClientRequestId()).append("action", getAction())
- .append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
- .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
- .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
- .append("vnfType", getVnfType()).append("serviceType", getServiceType())
- .append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
- .append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
- .append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
- .append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
- .append("modifyTime", getModifyTime()).append("requestType", getRequestType())
+ return new ToStringBuilder(this).append("requestId", getRequestId()).append("requestStatus", getRequestStatus())
+ .append("statusMessage", getStatusMessage()).append("progress", getProgress())
+ .append("startTime", getStartTime()).append("endTime", getEndTime()).append("source", getSource())
+ .append("vnfId", getVnfId()).append("vnfName", getVnfName()).append("vnfType", getVnfType())
+ .append("pnfId", getPnfId()).append("serviceType", getServiceType()).append("tenantId", getTenantId())
+ .append("vnfParams", getVnfParams()).append("vnfOutputs", getVnfOutputs())
+ .append("requestBody", getRequestBody()).append("responseBody", getResponseBody())
+ .append("lastModifiedBy", getLastModifiedBy()).append("modifyTime", getModifyTime())
.append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
.append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
- .append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
- .append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
- .append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
+ .append("vfModuleModelName", getVfModuleModelName()).append("CloudRegion", getCloudRegion())
+ .append("callBackUrl", getCallBackUrl()).append("correlator", getCorrelator())
+ .append("serviceInstanceId", getServiceInstanceId())
.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
.append("networkName", getNetworkName()).append("networkType", getNetworkType())
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
index 05845dd058..8f798a207c 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
@@ -53,10 +53,6 @@ public abstract class InfraRequests implements java.io.Serializable {
@Id
@Column(name = "REQUEST_ID", length = 45)
private String requestId;
- @Column(name = "CLIENT_REQUEST_ID", length = 45, unique = true)
- private String clientRequestId;
- @Column(name = "ACTION", length = 45)
- private String action;
@Column(name = "REQUEST_STATUS", length = 20)
private String requestStatus;
@Column(name = "STATUS_MESSAGE", length = 2000)
@@ -78,18 +74,16 @@ public abstract class InfraRequests implements java.io.Serializable {
private String source;
@Column(name = "VNF_ID", length = 45)
private String vnfId;
+ @Column(name = "PNF_ID", length = 45)
+ private String pnfId;
@Column(name = "VNF_NAME", length = 80)
private String vnfName;
@Column(name = "VNF_TYPE", length = 200)
private String vnfType;
@Column(name = "SERVICE_TYPE", length = 45)
private String serviceType;
- @Column(name = "AIC_NODE_CLLI", length = 11)
- private String aicNodeClli;
@Column(name = "TENANT_ID", length = 45)
private String tenantId;
- @Column(name = "PROV_STATUS", length = 20)
- private String provStatus;
@Column(name = "VNF_PARAMS")
private String vnfParams;
@Column(name = "VNF_OUTPUTS")
@@ -103,8 +97,6 @@ public abstract class InfraRequests implements java.io.Serializable {
@Column(name = "MODIFY_TIME")
@Temporal(TemporalType.TIMESTAMP)
private Date modifyTime;
- @Column(name = "REQUEST_TYPE", length = 20)
- private String requestType;
@Column(name = "VOLUME_GROUP_ID", length = 45)
private String volumeGroupId;
@Column(name = "VOLUME_GROUP_NAME", length = 45)
@@ -115,10 +107,8 @@ public abstract class InfraRequests implements java.io.Serializable {
private String vfModuleName;
@Column(name = "VF_MODULE_MODEL_NAME", length = 200)
private String vfModuleModelName;
- @Column(name = "AAI_SERVICE_ID", length = 50)
- private String aaiServiceId;
- @Column(name = "AIC_CLOUD_REGION", length = 11)
- private String aicCloudRegion;
+ @Column(name = "CLOUD_REGION", length = 11)
+ private String cloudRegion;
@Column(name = "CALLBACK_URL", length = 200)
private String callBackUrl;
@Column(name = "CORRELATOR", length = 80)
@@ -177,22 +167,6 @@ public abstract class InfraRequests implements java.io.Serializable {
this.requestId = requestId;
}
- public String getClientRequestId() {
- return clientRequestId;
- }
-
- public void setClientRequestId(String clientRequestId) {
- this.clientRequestId = clientRequestId;
- }
-
- public String getAction() {
- return this.action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
public String getRequestStatus() {
return this.requestStatus;
}
@@ -275,6 +249,14 @@ public abstract class InfraRequests implements java.io.Serializable {
this.vnfId = vnfId;
}
+ public String getPnfId() {
+ return this.pnfId;
+ }
+
+ public void setPnfId(String pnfId) {
+ this.pnfId = pnfId;
+ }
+
public String getVnfName() {
return this.vnfName;
}
@@ -299,14 +281,6 @@ public abstract class InfraRequests implements java.io.Serializable {
this.serviceType = serviceType;
}
- public String getAicNodeClli() {
- return this.aicNodeClli;
- }
-
- public void setAicNodeClli(String aicNodeClli) {
- this.aicNodeClli = aicNodeClli;
- }
-
public String getTenantId() {
return this.tenantId;
}
@@ -315,14 +289,6 @@ public abstract class InfraRequests implements java.io.Serializable {
this.tenantId = tenantId;
}
- public String getProvStatus() {
- return this.provStatus;
- }
-
- public void setProvStatus(String provStatus) {
- this.provStatus = provStatus;
- }
-
public String getVnfParams() {
return this.vnfParams;
}
@@ -367,14 +333,6 @@ public abstract class InfraRequests implements java.io.Serializable {
return this.modifyTime;
}
- public String getRequestType() {
- return this.requestType;
- }
-
- public void setRequestType(String requestType) {
- this.requestType = requestType;
- }
-
public String getVolumeGroupId() {
return this.volumeGroupId;
}
@@ -415,20 +373,12 @@ public abstract class InfraRequests implements java.io.Serializable {
this.vfModuleModelName = vfModuleModelName;
}
- public String getAaiServiceId() {
- return this.aaiServiceId;
- }
-
- public void setAaiServiceId(String aaiServiceId) {
- this.aaiServiceId = aaiServiceId;
- }
-
- public String getAicCloudRegion() {
- return this.aicCloudRegion;
+ public String getCloudRegion() {
+ return this.cloudRegion;
}
- public void setAicCloudRegion(String aicCloudRegion) {
- this.aicCloudRegion = aicCloudRegion;
+ public void setCloudRegion(String cloudRegion) {
+ this.cloudRegion = cloudRegion;
}
public String getCallBackUrl() {
@@ -637,24 +587,20 @@ public abstract class InfraRequests implements java.io.Serializable {
@Override
public String toString() {
- return new ToStringBuilder(this).append("requestId", getRequestId())
- .append("clientRequestId", getClientRequestId()).append("action", getAction())
- .append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
- .append("rollbackStatusMessage", getRollbackStatusMessage()).append("flowStatus", getFlowStatus())
- .append("retryStatusMessage", getRetryStatusMessage()).append("progress", getProgress())
- .append("startTime", getStartTime()).append("endTime", getEndTime()).append("source", getSource())
- .append("vnfId", getVnfId()).append("vnfName", getVnfName()).append("vnfType", getVnfType())
- .append("serviceType", getServiceType()).append("aicNodeClli", getAicNodeClli())
- .append("tenantId", getTenantId()).append("provStatus", getProvStatus())
- .append("vnfParams", getVnfParams()).append("vnfOutputs", getVnfOutputs())
- .append("requestBody", getRequestBody()).append("responseBody", getResponseBody())
- .append("lastModifiedBy", getLastModifiedBy()).append("modifyTime", getModifyTime())
- .append("requestType", getRequestType()).append("volumeGroupId", getVolumeGroupId())
+ return new ToStringBuilder(this).append("requestId", getRequestId()).append("requestStatus", getRequestStatus())
+ .append("statusMessage", getStatusMessage()).append("rollbackStatusMessage", getRollbackStatusMessage())
+ .append("flowStatus", getFlowStatus()).append("retryStatusMessage", getRetryStatusMessage())
+ .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
+ .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
+ .append("pnfId", getPnfId()).append("vnfType", getVnfType()).append("serviceType", getServiceType())
+ .append("tenantId", getTenantId()).append("vnfParams", getVnfParams())
+ .append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
+ .append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
+ .append("modifyTime", getModifyTime()).append("volumeGroupId", getVolumeGroupId())
.append("volumeGroupName", getVolumeGroupName()).append("vfModuleId", getVfModuleId())
.append("vfModuleName", getVfModuleName()).append("vfModuleModelName", getVfModuleModelName())
- .append("aaiServiceId", getAaiServiceId()).append("aicCloudRegion", getAicCloudRegion())
- .append("callBackUrl", getCallBackUrl()).append("correlator", getCorrelator())
- .append("serviceInstanceId", getServiceInstanceId())
+ .append("cloudRegion", getCloudRegion()).append("callBackUrl", getCallBackUrl())
+ .append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
.append("networkName", getNetworkName()).append("networkType", getNetworkType())
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/RequestProcessingData.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/RequestProcessingData.java
index 3c81555b99..e386789c7f 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/RequestProcessingData.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/RequestProcessingData.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -42,7 +42,7 @@ import com.openpojo.business.annotation.BusinessKey;
* persist the request identifiers created when MSO POSTs a request to PINC <br>
* <p>
* </p>
- *
+ *
* @author
* @version
*/
@@ -54,7 +54,7 @@ import com.openpojo.business.annotation.BusinessKey;
public class RequestProcessingData implements Serializable {
/**
- *
+ *
*/
private static final long serialVersionUID = -3497593687393936143L;
@@ -87,7 +87,7 @@ public class RequestProcessingData implements Serializable {
private Date created = null;
@Column(name = "IS_DATA_INTERNAL")
- private Boolean isDataInternal = true;
+ private Boolean isDataInternal = false;
@Override
public boolean equals(final Object other) {
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 9be92ad93a..334eb73da4 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
@@ -22,6 +22,7 @@ package org.onap.so.db.request.client;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -32,6 +33,7 @@ import javax.annotation.PostConstruct;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.HttpStatus;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
import org.onap.so.db.request.beans.ArchivedInfraRequests;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.beans.OperationStatus;
@@ -44,7 +46,7 @@ import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
import org.onap.so.db.request.beans.WatchdogDistributionStatus;
import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup;
import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
-import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
@@ -69,6 +71,7 @@ public class RequestsDbClient {
private static final String SERVICE_ID = "SERVICE_ID";
private static final String OPERATION_ID = "OPERATION_ID";
private static final String SO_REQUEST_ID = "SO_REQUEST_ID";
+ private static final String IS_INTERNAL_DATA = "IS_INTERNAL_DATA";
private static final String NAME = "NAME";
private static final String GROUPING_ID = "GROUPING_ID";
private static final String REQUEST_ID = "REQUEST_ID";
@@ -82,7 +85,7 @@ public class RequestsDbClient {
protected String endpoint;
@Value("${mso.adapters.requestDb.auth:#{null}}")
- private String msoAdaptersAuth;
+ protected String msoAdaptersAuth;
private String getOrchestrationFilterURI = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive/";
private static final String OPERATION_STATUS_SEARCH = "/operationStatus/search";
@@ -114,6 +117,8 @@ public class RequestsDbClient {
private String getInfraActiveRequests = "/infraActiveRequests/v1/getInfraActiveRequests";
+ private String getInProgressVolumeGroupsAndVfModules = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules";
+
private static final String findBySoRequestIdAndGroupIdAndName =
"/requestProcessingData/search/findOneBySoRequestIdAndGroupingIdAndName";
@@ -122,6 +127,9 @@ public class RequestsDbClient {
private static final String findBySoRequestIdOrderByGroupingIdDesc =
"/requestProcessingData/search/findBySoRequestIdOrderByGroupingIdDesc";
+ private static final String findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc =
+ "/requestProcessingData/search/findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc";
+
private static final String findByGroupingIdAndNameAndTag =
"/requestProcessingData/search/findByGroupingIdAndNameAndTag";
@@ -150,14 +158,19 @@ public class RequestsDbClient {
findOneByRequestId = endpoint + findOneByRequestId;
}
- private ClientFactory getClientFactory() {
- URI baseUri = UriBuilder.fromUri(endpoint).build();
+ protected String getEndpoint() {
+ return endpoint;
+ }
+
+ protected ClientFactory getClientFactory() {
+ URI baseUri = UriBuilder.fromUri(getEndpoint()).build();
ClientHttpRequestFactory factory =
new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory());
return Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory)
.setRestTemplateConfigurer(restTemplate -> {
- restTemplate.getInterceptors().add((new SpringClientFilter()));
+ restTemplate.getInterceptors().add((new SOSpringClientFilter()));
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
restTemplate.getInterceptors().add((request, body, execution) -> {
@@ -183,6 +196,15 @@ public class RequestsDbClient {
}
}
+ public List<InfraActiveRequests> getInProgressVolumeGroupsAndVfModules() {
+ HttpHeaders headers = getHttpHeaders();
+ URI uri = getUri(endpoint + getInProgressVolumeGroupsAndVfModules);
+ HttpEntity<Map<String, List<String>>> entity = new HttpEntity<>(headers);
+ return restTemplate
+ .exchange(uri, HttpMethod.GET, entity, new ParameterizedTypeReference<List<InfraActiveRequests>>() {})
+ .getBody();
+ }
+
public InfraActiveRequests getInfraActiveRequestbyRequestId(String requestId) {
try {
HttpEntity<?> entity = getHttpEntity();
@@ -341,6 +363,49 @@ public class RequestsDbClient {
restTemplate.put(uri, entity);
}
+ public void patchInfraActiveRequests(InfraActiveRequests request) {
+ HttpHeaders headers = getHttpHeaders();
+ URI uri = getUri(infraActiveRequestURI + request.getRequestId());
+ HttpEntity<InfraActiveRequests> entity = new HttpEntity<>(request, headers);
+ restTemplate.exchange(uri, HttpMethod.PATCH, new HttpEntity<InfraActiveRequests>(request, headers),
+ String.class);
+ }
+
+ public InfraActiveRequests getInfraActiveRequests(String requestId, String basicAuth, String host) {
+ RestTemplate template = new RestTemplate();
+ HttpHeaders headers = new HttpHeaders();
+ headers.set(HttpHeaders.AUTHORIZATION, basicAuth);
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
+ headers.set(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
+ URI uri = getUri(host + "/infraActiveRequests/" + requestId);
+ try {
+ InfraActiveRequests infraActiveRequests = template
+ .exchange(uri, HttpMethod.GET, new HttpEntity<>(headers), InfraActiveRequests.class).getBody();
+ if (infraActiveRequests != null) {
+ infraActiveRequests.setRequestId(requestId);
+ }
+ return infraActiveRequests;
+ } catch (HttpClientErrorException e) {
+ if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) {
+ return null;
+ }
+ throw e;
+ }
+ }
+
+ public void updateInfraActiveRequests(InfraActiveRequests request, String basicAuth, String host) {
+ RestTemplate template = new RestTemplate();
+ template.getInterceptors().add(new SOSpringClientFilter());
+ template.getInterceptors().add(new SpringClientPayloadFilter());
+ HttpHeaders headers = new HttpHeaders();
+ headers.set(HttpHeaders.AUTHORIZATION, basicAuth);
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
+ headers.set(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
+ URI uri = getUri(host + "/infraActiveRequests/" + request.getRequestId());
+ HttpEntity<InfraActiveRequests> entity = new HttpEntity<>(request, headers);
+ template.put(uri, entity);
+ }
+
protected URI getUri(String uri) {
return URI.create(uri);
}
@@ -365,6 +430,18 @@ public class RequestsDbClient {
.queryParam(SO_REQUEST_ID, soRequestId).build().toString()));
}
+ public List<RequestProcessingData> getExternalRequestProcessingDataBySoRequestId(String soRequestId) {
+ URI uri = getUri(UriBuilder.fromUri(getEndpoint() + findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc)
+ .queryParam(SO_REQUEST_ID, soRequestId).queryParam(IS_INTERNAL_DATA, false).build().toString());
+ ResponseEntity<RequestProcessingData[]> array =
+ restTemplate.exchange(uri, HttpMethod.GET, getHttpEntity(), RequestProcessingData[].class);
+ if (array != null) {
+ return Arrays.asList(array.getBody());
+ } else {
+ return null;
+ }
+ }
+
public RequestProcessingData getRequestProcessingDataBySoRequestIdAndNameAndGrouping(String soRequestId,
String name, String groupingId) {
return getClientFactory().create(RequestProcessingData.class)
@@ -403,6 +480,7 @@ public class RequestsDbClient {
rpd.setSoRequestId(requestId);
rpd.setValue(flowExecutionPath);
rpd.setTag(BPMN_EXECUTION_DATA_TAG);
+ rpd.setIsDataInternal(true);
HttpEntity<RequestProcessingData> entity = new HttpEntity<>(rpd, headers);
restTemplate.postForLocation(uri, entity);
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java
index e4464450ea..21dea7577e 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java
@@ -65,9 +65,6 @@ public class RequestsDBHelper {
request.setProgress(100L);
request.setLastModifiedBy("APIH");
request.setOperationalEnvId(operationalEnvironmentId);
- if (request.getAction() == null) {
- request.setRequestAction(UNKNOWN);
- }
if (request.getRequestScope() == null) {
request.setRequestScope(UNKNOWN);
}
@@ -100,9 +97,6 @@ public class RequestsDBHelper {
request.setProgress(100L);
request.setLastModifiedBy("APIH");
request.setOperationalEnvId(operationalEnvironmentId);
- if (request.getAction() == null) {
- request.setRequestAction(UNKNOWN);
- }
if (request.getRequestScope() == null) {
request.setRequestScope(UNKNOWN);
}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
index fdbc04acb4..0ad8d1458e 100644
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
@@ -4,20 +4,35 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.times;
import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
+import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
+import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
+import uk.co.blackpepper.bowman.ClientFactory;
+import uk.co.blackpepper.bowman.Configuration;
@RunWith(MockitoJUnitRunner.class)
public class RequestDbClientTest {
-
+ @Spy
@InjectMocks
protected RequestsDbClient requestsDbClient;
@@ -32,4 +47,26 @@ public class RequestDbClientTest {
requestsDbClient.updateRequestProcessingData(requestProcessingData);
Mockito.verify(restTemplate, times(1)).put(eq(uri), isA(HttpEntity.class));
}
+
+ @Test
+ public void updateInfraActiveRequestsTest() {
+ InfraActiveRequests request = new InfraActiveRequests();
+ request.setRequestId("1");
+ URI uri = URI.create("/infraActiveRequests/1");
+ requestsDbClient.patchInfraActiveRequests(request);
+ Mockito.verify(restTemplate, times(1)).exchange(eq(uri), eq(HttpMethod.PATCH), isA(HttpEntity.class),
+ eq(String.class));
+ }
+
+ @Test
+ public void testGetRequestProcessingDataBySoRequestIdAndIsInternalData() {
+ Mockito.doReturn("host").when(requestsDbClient).getEndpoint();
+ requestsDbClient.getExternalRequestProcessingDataBySoRequestId("12345");
+ URI uri = URI.create(UriBuilder
+ .fromUri("host/requestProcessingData/search/findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc")
+ .queryParam("SO_REQUEST_ID", "12345").queryParam("IS_INTERNAL_DATA", false).build().toString());
+ Mockito.verify(restTemplate, times(1)).exchange(eq(uri), eq(HttpMethod.GET), isA(HttpEntity.class),
+ eq(RequestProcessingData[].class));
+ }
+
}
diff --git a/mso-catalog-db/pom.xml b/mso-catalog-db/pom.xml
index 08e9719f50..6a4a6774e6 100644
--- a/mso-catalog-db/pom.xml
+++ b/mso-catalog-db/pom.xml
@@ -102,5 +102,10 @@
<artifactId>asm-xml</artifactId>
<version>6.1</version>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
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 053bf745e1..deaa2a3221 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
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -120,6 +120,11 @@ public class CloudSite {
@Temporal(TemporalType.TIMESTAMP)
private Date updated;
+ @JsonProperty("support_fabric")
+ @BusinessKey
+ @Column(name = "SUPPORT_FABRIC")
+ private Boolean supportFabric = true;
+
@Transient
private URI uri;
@@ -142,6 +147,7 @@ public class CloudSite {
this.platform = site.getPlatform();
this.regionId = site.getRegionId();
this.identityServiceId = site.getIdentityServiceId();
+ this.supportFabric = site.getSupportFabric();
}
@@ -247,6 +253,14 @@ public class CloudSite {
this.identityService = identity;
}
+ public Boolean getSupportFabric() {
+ return supportFabric;
+ }
+
+ public void setSupportFabric(Boolean supportFabric) {
+ this.supportFabric = supportFabric;
+ }
+
@Deprecated
public void setIdentityServiceId(String identityServiceId) {
this.identityServiceId = identityServiceId;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
index 425e0b8bbc..ac0d09b13b 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
@IdClass(ControllerSelectionReferenceId.class)
@Entity
-@Table(name = "CONTROLLER_SELECTION_REFERENCE")
+@Table(name = "controller_selection_reference")
public class ControllerSelectionReference implements Serializable {
private static final long serialVersionUID = -608098800737567188L;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java
index 93e2992d3f..9691eff5f5 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java
@@ -22,6 +22,7 @@ package org.onap.so.db.catalog.beans;
public enum OrchestrationStatus {
ACTIVE("Active", "active"),
+ ACTIVATED("Activated", "activated"),
ASSIGNED("Assigned", "assigned"),
CREATED("Created", "created"),
INVENTORIED("Inventoried", "inventoried"),
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 fabbc5007f..db0e0abd3c 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
@@ -83,6 +83,9 @@ public class PnfResourceCustomization implements Serializable {
@Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
private Boolean skipPostInstConf;
+ @Column(name = "CONTROLLER_ACTOR")
+ private String controllerActor;
+
@Override
public String toString() {
return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
@@ -90,7 +93,7 @@ public class PnfResourceCustomization implements Serializable {
.append("nfFunction", nfFunction).append("nfType", nfType).append("nfRole", nfRole)
.append("nfNamingCode", nfNamingCode).append("multiStageDesign", multiStageDesign)
.append("pnfResources", pnfResources).append("blueprintName", blueprintName)
- .append("blueprintVersion", blueprintVersion).toString();
+ .append("blueprintVersion", blueprintVersion).append("controllerActor", controllerActor).toString();
}
@Override
@@ -222,4 +225,11 @@ public class PnfResourceCustomization implements Serializable {
this.skipPostInstConf = skipPostInstConf;
}
+ public String getControllerActor() {
+ return controllerActor;
+ }
+
+ public void setControllerActor(String controllerActor) {
+ this.controllerActor = controllerActor;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java
new file mode 100644
index 0000000000..6e48938f19
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java
@@ -0,0 +1,91 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import com.openpojo.business.annotation.BusinessKey;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "pnf_resource_to_workflow")
+public class PnfResourceWorkflow implements Serializable {
+
+ private static final long serialVersionUID = 4897166645148426088L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "PNF_RESOURCE_MODEL_UUID")
+ private String pnfResourceModelUUID;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID", updatable = false, insertable = false)
+ private PnfResource pnfResource;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "WORKFLOW_ID")
+ private Workflow workflow;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("pnfResourceModelUUID", pnfResourceModelUUID).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof PnfResourceWorkflow)) {
+ return false;
+ }
+ PnfResourceWorkflow castOther = (PnfResourceWorkflow) other;
+ return new EqualsBuilder().append(pnfResourceModelUUID, castOther.pnfResourceModelUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(pnfResourceModelUUID).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getPnfResourceModelUUID() {
+ return pnfResourceModelUUID;
+ }
+
+ public void setPnfResourceModelUUID(String pnfResourceModelUUID) {
+ this.pnfResourceModelUUID = pnfResourceModelUUID;
+ }
+
+ @LinkedResource
+ public PnfResource getPnfResource() {
+ return pnfResource;
+ }
+
+ public void setPnfResource(PnfResource pnfResource) {
+ this.pnfResource = pnfResource;
+ }
+
+ @LinkedResource
+ public Workflow getWorkflow() {
+ return workflow;
+ }
+
+ public void setWorkflow(Workflow workflow) {
+ this.workflow = workflow;
+ }
+}
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 e591552ebf..ab40cefb4e 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
@@ -142,6 +142,18 @@ public class Service implements Serializable {
@Column(name = "ONAP_GENERATED_NAMING")
private Boolean onapGeneratedNaming;
+ @Column(name = "CDS_BLUEPRINT_NAME")
+ private String blueprintName;
+
+ @Column(name = "CDS_BLUEPRINT_VERSION")
+ private String blueprintVersion;
+
+ @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
+ private Boolean skipPostInstConf;
+
+ @Column(name = "CONTROLLER_ACTOR")
+ private String controllerActor;
+
@Override
public String toString() {
return new ToStringBuilder(this).append("modelName", modelName).append("description", description)
@@ -399,4 +411,35 @@ public class Service implements Serializable {
this.onapGeneratedNaming = onapGeneratedNaming;
}
+ public String getBlueprintName() {
+ return blueprintName;
+ }
+
+ public void setBlueprintName(String blueprintName) {
+ this.blueprintName = blueprintName;
+ }
+
+ public String getBlueprintVersion() {
+ return blueprintVersion;
+ }
+
+ public void setBlueprintVersion(String blueprintVersion) {
+ this.blueprintVersion = blueprintVersion;
+ }
+
+ public Boolean isSkipPostInstConf() {
+ return skipPostInstConf;
+ }
+
+ public void setSkipPostInstConf(Boolean skipPostInstConf) {
+ this.skipPostInstConf = skipPostInstConf;
+ }
+
+ public String getControllerActor() {
+ return controllerActor;
+ }
+
+ public void setControllerActor(String controllerActor) {
+ this.controllerActor = controllerActor;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
index 5a241afc3a..9e98041cf8 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
@@ -25,7 +25,8 @@ import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -46,6 +47,7 @@ public class ServiceRecipe implements Serializable, Recipe {
@Id
@Column(name = "id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
@@ -116,6 +118,7 @@ public class ServiceRecipe implements Serializable, Recipe {
super();
}
+ @Override
public Integer getId() {
return id;
}
@@ -136,6 +139,7 @@ public class ServiceRecipe implements Serializable, Recipe {
this.serviceModelUUID = serviceModelUUID;
}
+ @Override
public String getAction() {
return action;
}
@@ -144,6 +148,7 @@ public class ServiceRecipe implements Serializable, Recipe {
this.action = action;
}
+ @Override
public String getDescription() {
return description;
}
@@ -152,6 +157,7 @@ public class ServiceRecipe implements Serializable, Recipe {
this.description = description;
}
+ @Override
public String getOrchestrationUri() {
return orchestrationUri;
}
@@ -160,6 +166,7 @@ public class ServiceRecipe implements Serializable, Recipe {
this.orchestrationUri = orchestrationUri;
}
+ @Override
public String getParamXsd() {
return paramXsd;
}
@@ -168,6 +175,7 @@ public class ServiceRecipe implements Serializable, Recipe {
this.paramXsd = paramXsd;
}
+ @Override
public Integer getRecipeTimeout() {
return recipeTimeout;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
index c2cf2d7cf6..9ec61ff05f 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
@@ -17,7 +17,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import com.openpojo.business.annotation.BusinessKey;
@Entity
-@Table(name = "USER_PARAMETERS")
+@Table(name = "user_parameters")
public class UserParameters implements Serializable {
private static final long serialVersionUID = -5036895978102778877L;
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 29f8bcece5..3420682900 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
@@ -100,6 +100,9 @@ public class VfModuleCustomization implements Serializable {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization")
private Set<CvnfcCustomization> cvnfcCustomization;
+ @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
+ private Boolean skipPostInstConf;
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof VfModuleCustomization)) {
@@ -239,4 +242,12 @@ public class VfModuleCustomization implements Serializable {
public void setCvnfcCustomization(Set<CvnfcCustomization> cvnfcCustomization) {
this.cvnfcCustomization = cvnfcCustomization;
}
+
+ public Boolean isSkipPostInstConf() {
+ return skipPostInstConf;
+ }
+
+ public void setSkipPostInstConf(Boolean skipPostInstConf) {
+ this.skipPostInstConf = skipPostInstConf;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java
index 58e7c6c61c..89121bc7e1 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java
@@ -23,6 +23,8 @@ package org.onap.so.db.catalog.beans;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.commons.lang3.builder.EqualsBuilder;
@@ -38,6 +40,7 @@ public class VnfComponentsRecipe implements Serializable, Recipe {
@Id
@Column(name = "id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
@@ -92,6 +95,7 @@ public class VnfComponentsRecipe implements Serializable, Recipe {
.toHashCode();
}
+ @Override
public Integer getId() {
return id;
}
@@ -100,6 +104,7 @@ public class VnfComponentsRecipe implements Serializable, Recipe {
this.id = id;
}
+ @Override
public String getAction() {
return action;
}
@@ -108,6 +113,7 @@ public class VnfComponentsRecipe implements Serializable, Recipe {
this.action = action;
}
+ @Override
public String getDescription() {
return description;
}
@@ -132,6 +138,7 @@ public class VnfComponentsRecipe implements Serializable, Recipe {
this.vnfType = vnfType;
}
+ @Override
public String getParamXsd() {
return paramXsd;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java
index 8bf45b52c7..ef3d8761c1 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java
@@ -24,6 +24,8 @@ import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.Table;
@@ -42,6 +44,7 @@ public class VnfRecipe implements Serializable, Recipe {
@Id
@Column(name = "id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
@@ -117,6 +120,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.nfRole = nfRole;
}
+ @Override
public String getParamXsd() {
return paramXsd;
}
@@ -133,6 +137,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.vfModuleId = vfModuleId;
}
+ @Override
public Integer getId() {
return id;
}
@@ -141,6 +146,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.id = id;
}
+ @Override
public String getAction() {
return action;
}
@@ -149,6 +155,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.action = action;
}
+ @Override
public String getDescription() {
return description;
}
@@ -157,6 +164,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.description = description;
}
+ @Override
public String getOrchestrationUri() {
return orchestrationUri;
}
@@ -165,6 +173,7 @@ public class VnfRecipe implements Serializable, Recipe {
this.orchestrationUri = orchestrationUri;
}
+ @Override
public Integer getRecipeTimeout() {
return recipeTimeout;
}
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 36c9251d59..094a1f0bf3 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
@@ -23,9 +23,7 @@ package org.onap.so.db.catalog.beans;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -34,7 +32,6 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PrePersist;
@@ -124,6 +121,12 @@ public class VnfResourceCustomization implements Serializable {
@Column(name = "VNFCINSTANCEGROUP_ORDER")
private String vnfcInstanceGroupOrder;
+ @Column(name = "NF_DATA_VALID")
+ private Boolean nfDataValid;
+
+ @Column(name = "CONTROLLER_ACTOR")
+ private String controllerActor;
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof VnfResourceCustomization)) {
@@ -152,7 +155,8 @@ public class VnfResourceCustomization implements Serializable {
.append("multiStageDesign", multiStageDesign).append("vnfResources", vnfResources)
.append("vfModuleCustomizations", vfModuleCustomizations)
.append("vnfcInstanceGroupOrder", vnfcInstanceGroupOrder)
- .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString();
+ .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations)
+ .append("controllerActor", controllerActor).toString();
}
@PrePersist
@@ -336,4 +340,20 @@ public class VnfResourceCustomization implements Serializable {
public void setVnfcInstanceGroupOrder(String vnfcInstanceGroupOrder) {
this.vnfcInstanceGroupOrder = vnfcInstanceGroupOrder;
}
+
+ public Boolean getNfDataValid() {
+ return nfDataValid;
+ }
+
+ public void setNfDataValid(Boolean nfDataValid) {
+ this.nfDataValid = nfDataValid;
+ }
+
+ public String getControllerActor() {
+ return controllerActor;
+ }
+
+ public void setControllerActor(String controllerActor) {
+ this.controllerActor = controllerActor;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
index 6bd0713085..fc1c753e85 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
@@ -74,6 +74,9 @@ public class Workflow implements Serializable {
private List<VnfResourceWorkflow> vnfResourceWorkflow;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "workflow")
+ private List<PnfResourceWorkflow> pnfResourceWorkflow;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "workflow")
private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence;
@PrePersist
@@ -191,6 +194,15 @@ public class Workflow implements Serializable {
}
@LinkedResource
+ public List<PnfResourceWorkflow> getPnfResourceWorkflow() {
+ return pnfResourceWorkflow;
+ }
+
+ public void setPnfResourceWorkflow(List<PnfResourceWorkflow> pnfResourceWorkflow) {
+ this.pnfResourceWorkflow = pnfResourceWorkflow;
+ }
+
+ @LinkedResource
public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() {
return workflowActivitySpecSequence;
}
@@ -207,6 +219,7 @@ public class Workflow implements Serializable {
.append("resourceTarget", resourceTarget).append("source", source)
.append("timeoutMinutes", timeoutMinutes).append("artifactChecksum", artifactChecksum)
.append("created", created).append("vnfResourceWorkflow", vnfResourceWorkflow)
+ .append("pnfResourceWorkflow", pnfResourceWorkflow)
.append("WorkflowActivitySpecSequence", workflowActivitySpecSequence).toString();
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
index b74ade1e1f..91b74d4d6a 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
@@ -34,7 +34,6 @@ import javax.persistence.Table;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.onap.so.db.catalog.beans.BuildingBlockDetail;
import com.openpojo.business.annotation.BusinessKey;
import uk.co.blackpepper.bowman.annotation.LinkedResource;
@@ -65,6 +64,14 @@ public class OrchestrationFlow implements Serializable {
@Column(name = "FLOW_VERSION")
private Double flowVersion;
+ @BusinessKey
+ @Column(name = "ACTION")
+ private String bpmnAction;
+
+ @BusinessKey
+ @Column(name = "SCOPE")
+ private String bpmnScope;
+
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "NB_REQ_REF_LOOKUP_ID")
private NorthBoundRequest northBoundRequest;
@@ -73,7 +80,8 @@ public class OrchestrationFlow implements Serializable {
public String toString() {
return new ToStringBuilder(this).append("id", id).append("action", action)
.append("sequenceNumber", sequenceNumber).append("flowName", flowName)
- .append("flowVersion", flowVersion).toString();
+ .append("flowVersion", flowVersion).append("bpmnAction", bpmnAction).append("bpmnScope", bpmnScope)
+ .toString();
}
@Override
@@ -83,13 +91,14 @@ public class OrchestrationFlow implements Serializable {
}
OrchestrationFlow castOther = (OrchestrationFlow) other;
return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber)
- .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals();
+ .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion)
+ .append(bpmnAction, castOther.bpmnAction).append(bpmnScope, castOther.bpmnScope).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion)
- .toHashCode();
+ .append(bpmnAction).append(bpmnScope).toHashCode();
}
public String getAction() {
@@ -132,6 +141,22 @@ public class OrchestrationFlow implements Serializable {
this.id = id;
}
+ public String getBpmnAction() {
+ return bpmnAction;
+ }
+
+ public void setBpmnAction(String bpmnAction) {
+ this.bpmnAction = bpmnAction;
+ }
+
+ public String getBpmnScope() {
+ return bpmnScope;
+ }
+
+ public void setBpmnScope(String bpmnScope) {
+ this.bpmnScope = bpmnScope;
+ }
+
@LinkedResource
public NorthBoundRequest getNorthBoundRequest() {
return northBoundRequest;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index a959f2f5a1..7f5907e9bf 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -27,7 +27,11 @@ import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.persistence.EntityNotFoundException;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
+import org.apache.http.HttpStatus;
+import org.onap.logging.filter.base.Constants;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
import org.onap.so.db.catalog.beans.BuildingBlockDetail;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.CloudifyManager;
@@ -61,19 +65,23 @@ import org.onap.so.db.catalog.beans.Workflow;
import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
-import org.onap.so.logger.LogConstants;
-import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
import org.springframework.http.client.BufferingClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
+import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
+import com.google.common.base.Strings;
import uk.co.blackpepper.bowman.Client;
import uk.co.blackpepper.bowman.ClientFactory;
import uk.co.blackpepper.bowman.Configuration;
@@ -116,37 +124,38 @@ public class CatalogDbClient {
private static final String SEARCH = "/search";
private static final String URI_SEPARATOR = "/";
- private static final String SERVICE_MODEL_UUID = "serviceModelUUID";
- private static final String SERVICE_NAME = "serviceName";
- private static final String MODEL_UUID = "modelUUID";
- private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUUID";
- private static final String ACTION = "action";
- private static final String MODEL_NAME = "modelName";
- private static final String MODEL_VERSION = "modelVersion";
- private static final String MODEL_INVARIANT_UUID = "modelInvariantUUID";
- private static final String VNF_RESOURCE_MODEL_UUID = "vnfResourceModelUUID";
- private static final String NF_ROLE = "nfRole";
- private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUID";
- private static final String VNF_COMPONENT_TYPE = "vnfComponentType";
- private static final String BUILDING_BLOCK_NAME = "buildingBlockName";
- private static final String RESOURCE_TYPE = "resourceType";
- private static final String ORCHESTRATION_STATUS = "orchestrationStatus";
- private static final String TARGET_ACTION = "targetAction";
- private static final String REQUEST_SCOPE = "requestScope";
- private static final String IS_ALACARTE = "isALaCarte";
- private static final String CLOUD_OWNER = "cloudOwner";
- private static final String FLOW_NAME = "flowName";
- private static final String ERROR_MESSAGE = "errorMessage";
- private static final String SERVICE_ROLE = "serviceRole";
- private static final String SERVICE_TYPE = "serviceType";
- private static final String VNF_TYPE = "vnfType";
- private static final String ERROR_CODE = "errorCode";
- private static final String WORK_STEP = "workStep";
- private static final String CLLI = "clli";
- private static final String CLOUD_VERSION = "cloudVersion";
- private static final String HOMING_INSTANCE = "/homingInstance";
- private static final String ARTIFACT_UUID = "artifactUUID";
- private static final String SOURCE = "source";
+ protected static final String SERVICE_MODEL_UUID = "serviceModelUUID";
+ protected static final String SERVICE_NAME = "serviceName";
+ protected static final String MODEL_UUID = "modelUUID";
+ protected static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUUID";
+ protected static final String ACTION = "action";
+ protected static final String MODEL_NAME = "modelName";
+ protected static final String MODEL_VERSION = "modelVersion";
+ protected static final String MODEL_INVARIANT_UUID = "modelInvariantUUID";
+ protected static final String VNF_RESOURCE_MODEL_UUID = "vnfResourceModelUUID";
+ protected static final String PNF_RESOURCE_MODEL_UUID = "pnfResourceModelUUID";
+ protected static final String NF_ROLE = "nfRole";
+ protected static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUID";
+ protected static final String VNF_COMPONENT_TYPE = "vnfComponentType";
+ protected static final String BUILDING_BLOCK_NAME = "buildingBlockName";
+ protected static final String RESOURCE_TYPE = "resourceType";
+ protected static final String ORCHESTRATION_STATUS = "orchestrationStatus";
+ protected static final String TARGET_ACTION = "targetAction";
+ protected static final String REQUEST_SCOPE = "requestScope";
+ protected static final String IS_ALACARTE = "isALaCarte";
+ protected static final String CLOUD_OWNER = "cloudOwner";
+ protected static final String FLOW_NAME = "flowName";
+ protected static final String ERROR_MESSAGE = "errorMessage";
+ protected static final String SERVICE_ROLE = "serviceRole";
+ protected static final String SERVICE_TYPE = "serviceType";
+ protected static final String VNF_TYPE = "vnfType";
+ protected static final String ERROR_CODE = "errorCode";
+ protected static final String WORK_STEP = "workStep";
+ protected static final String CLLI = "clli";
+ protected static final String CLOUD_VERSION = "cloudVersion";
+ protected static final String HOMING_INSTANCE = "/homingInstance";
+ protected static final String ARTIFACT_UUID = "artifactUUID";
+ protected static final String SOURCE = "source";
private static final String TARGET_ENTITY = "SO:CatalogDB";
private static final String ASTERISK = "*";
@@ -193,6 +202,7 @@ public class CatalogDbClient {
private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid";
private String findWorkflowByArtifactUUID = "/findByArtifactUUID";
private String findWorkflowByModelUUID = "/findWorkflowByModelUUID";
+ private String findWorkflowByPnfModelUUID = "/findWorkflowByPnfModelUUID";
private String findWorkflowBySource = "/findBySource";
private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid";
@@ -330,6 +340,7 @@ public class CatalogDbClient {
findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID;
findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID;
+ findWorkflowByPnfModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByPnfModelUUID;
findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource;
findVnfResourceCustomizationByModelUuid =
@@ -359,12 +370,13 @@ public class CatalogDbClient {
ClientFactory clientFactory =
Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> {
- restTemplate.getInterceptors().add((new SpringClientFilter()));
+ restTemplate.getInterceptors().add((new SOSpringClientFilter()));
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
restTemplate.getInterceptors().add((request, body, execution) -> {
request.getHeaders().add(HttpHeaders.AUTHORIZATION, msoAdaptersAuth);
- request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY);
+ request.getHeaders().add(Constants.HttpHeaders.TARGET_ENTITY_HEADER, TARGET_ENTITY);
return execution.execute(request, body);
});
}).build().buildClientFactory();
@@ -408,12 +420,13 @@ public class CatalogDbClient {
ClientFactory clientFactory = Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory)
.setRestTemplateConfigurer(restTemplate -> {
- restTemplate.getInterceptors().add((new SpringClientFilter()));
+ restTemplate.getInterceptors().add((new SOSpringClientFilter()));
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
restTemplate.getInterceptors().add((request, body, execution) -> {
request.getHeaders().add(HttpHeaders.AUTHORIZATION, auth);
- request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY);
+ request.getHeaders().add(Constants.HttpHeaders.TARGET_ENTITY_HEADER, TARGET_ENTITY);
return execution.execute(request, body);
});
}).build().buildClientFactory();
@@ -755,6 +768,12 @@ public class CatalogDbClient {
this.postSingleResource(cloudSiteClient, cloudSite);
}
+ public List<CloudSite> getCloudSites() {
+ return this.getMultipleResources(cloudSiteClient,
+ UriBuilder.fromUri(endpoint + CLOUD_SITE).queryParam("size", "1000").build());
+ }
+
+
public CloudSite getCloudSiteByClliAndAicVersion(String clli, String cloudVersion) {
return this.getSingleResource(cloudSiteClient, getUri(UriBuilder.fromUri(findByClliAndCloudVersion)
.queryParam(CLLI, clli).queryParam(CLOUD_VERSION, cloudVersion).build().toString()));
@@ -801,7 +820,7 @@ public class CatalogDbClient {
return client.get(uri);
}
- private <T> List<T> getMultipleResources(Client<T> client, URI uri) {
+ protected <T> List<T> getMultipleResources(Client<T> client, URI uri) {
Iterable<T> iterator = client.getAll(uri);
List<T> list = new ArrayList<>();
Iterator<T> it = iterator.iterator();
@@ -888,6 +907,90 @@ public class CatalogDbClient {
"Unable to find CvnfcConfigurationCustomization ModelCustomizationUUID:" + cvnfcCustomizationUuid);
}
+ public org.onap.so.rest.catalog.beans.Service getServiceModelInformation(String serviceModelUUID, String depth) {
+ if (Strings.isNullOrEmpty(serviceModelUUID)) {
+ throw new EntityNotFoundException("Service Model UUID passed as Null or Empty String");
+ }
+ try {
+ HttpEntity<?> entity = getHttpEntity();
+ return restTemplate.exchange(
+ UriComponentsBuilder.fromUriString(endpoint + "/ecomp/mso/catalog/v1/services/" + serviceModelUUID)
+ .queryParam("depth", depth).build().encode().toString(),
+ HttpMethod.GET, entity, org.onap.so.rest.catalog.beans.Service.class).getBody();
+ } catch (HttpClientErrorException e) {
+ logger.warn("Entity Not found in DLP", e);
+ if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) {
+ throw new EntityNotFoundException("Unable to find Service with ServiceModelUUID:" + serviceModelUUID);
+ }
+ throw e;
+ }
+ }
+
+ public List<org.onap.so.rest.catalog.beans.Service> getServices() {
+ try {
+ HttpEntity<?> entity = getHttpEntity();
+ return restTemplate
+ .exchange(
+ UriComponentsBuilder.fromUriString(endpoint + "/ecomp/mso/catalog/v1/services").build()
+ .encode().toString(),
+ HttpMethod.GET, entity,
+ new ParameterizedTypeReference<List<org.onap.so.rest.catalog.beans.Service>>() {})
+ .getBody();
+ } catch (HttpClientErrorException e) {
+ logger.error("Error Calling catalog database", e);
+ throw e;
+ }
+ }
+
+ public org.onap.so.rest.catalog.beans.Vnf getVnfModelInformation(String serviceModelUUID,
+ String vnfCustomizationUUID, String depth) {
+ if (Strings.isNullOrEmpty(serviceModelUUID)) {
+ throw new EntityNotFoundException("Service Model UUID passed as Null or Empty String");
+ }
+ if (Strings.isNullOrEmpty(vnfCustomizationUUID)) {
+ throw new EntityNotFoundException("Vnf Customization UUID passed as Null or Empty String");
+ }
+ try {
+ HttpEntity<?> entity = getHttpEntity();
+ return restTemplate
+ .exchange(
+ UriComponentsBuilder
+ .fromUriString(endpoint + "/ecomp/mso/catalog/v1/services/" + serviceModelUUID
+ + "/vnfs/" + vnfCustomizationUUID)
+ .queryParam("depth", depth).build().encode().toString(),
+ HttpMethod.GET, entity, org.onap.so.rest.catalog.beans.Vnf.class)
+ .getBody();
+ } catch (HttpClientErrorException e) {
+ if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) {
+ throw new EntityNotFoundException(
+ "Unable to find Vnf with Vnf Customization UUID:" + vnfCustomizationUUID);
+ }
+ throw e;
+ }
+ }
+
+ public void updateVnf(String serviceModelUUID, org.onap.so.rest.catalog.beans.Vnf vnf) {
+ if (vnf == null) {
+ throw new EntityNotFoundException("Vnf passed as null");
+ }
+ try {
+ HttpHeaders headers = getHttpHeaders();
+ HttpEntity<org.onap.so.rest.catalog.beans.Vnf> entity = new HttpEntity<>(vnf, headers);
+
+ restTemplate.exchange(
+ UriComponentsBuilder.fromUriString(endpoint + "/ecomp/mso/catalog/v1/services/" + serviceModelUUID
+ + "/vnfs/" + vnf.getModelCustomizationId()).build().encode().toString(),
+ HttpMethod.PUT, entity, org.onap.so.rest.catalog.beans.Vnf.class).getBody();
+ } catch (HttpClientErrorException e) {
+ if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) {
+ throw new EntityNotFoundException(
+ "Unable to find Vnf with Vnf Customization UUID:" + vnf.getModelCustomizationId());
+ }
+ throw e;
+ }
+ }
+
+
public Workflow findWorkflowByArtifactUUID(String artifactUUID) {
return this.getSingleResource(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByArtifactUUID)
.queryParam(ARTIFACT_UUID, artifactUUID).build().toString()));
@@ -898,6 +1001,11 @@ public class CatalogDbClient {
.queryParam(VNF_RESOURCE_MODEL_UUID, vnfResourceModelUUID).build().toString()));
}
+ public List<Workflow> findWorkflowByPnfModelUUID(String pnfResourceModelUUID) {
+ return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByPnfModelUUID)
+ .queryParam(PNF_RESOURCE_MODEL_UUID, pnfResourceModelUUID).build().toString()));
+ }
+
public List<Workflow> findWorkflowBySource(String source) {
return this.getMultipleResources(workflowClient,
getUri(UriBuilder.fromUri(findWorkflowBySource).queryParam(SOURCE, source).build().toString()));
@@ -910,4 +1018,18 @@ public class CatalogDbClient {
public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}
+
+ private HttpHeaders getHttpHeaders() {
+ HttpHeaders headers = new HttpHeaders();
+ headers.set(HttpHeaders.AUTHORIZATION, msoAdaptersAuth);
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
+ headers.set(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
+ headers.set(Constants.HttpHeaders.TARGET_ENTITY_HEADER, TARGET_ENTITY);
+ return headers;
+ }
+
+ private HttpEntity<?> getHttpEntity() {
+ HttpHeaders headers = getHttpHeaders();
+ return new HttpEntity<>(headers);
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java
index eaeb4292fb..42d107c1ff 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java
@@ -23,9 +23,10 @@ package org.onap.so.db.catalog.data.repository;
import org.onap.so.db.catalog.beans.NetworkResource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.stereotype.Repository;
-@Repository
+@RepositoryRestResource(collectionResourceRel = "networkResource", path = "networkResource")
public interface NetworkResourceRepository extends JpaRepository<NetworkResource, String> {
/**
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java
index 898911fd1c..d49d5e864d 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java
@@ -25,7 +25,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource(collectionResourceRel = "serviceRecipe", path = "serviceRecipe")
-public interface ServiceRecipeRepository extends JpaRepository<ServiceRecipe, Long> {
+public interface ServiceRecipeRepository extends JpaRepository<ServiceRecipe, Integer> {
ServiceRecipe findByActionAndServiceModelUUID(String action, String serviceModelUUID);
ServiceRecipe findByAction(String action);
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
index 8bcc60c8be..f1b399325e 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
@@ -39,10 +39,23 @@ public interface WorkflowRepository extends JpaRepository<Workflow, Integer> {
* This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide Workflow based on
* model UUID without projection.
*
- * @param vnfResourceModelUUIDmodel UUID
+ * @param vnfResourceModelUUID UUID
* @return List of Workflow
*/
@Query(value = "select b.* from vnf_resource_to_workflow a join workflow b where a.WORKFLOW_ID = b.ID and a.VNF_RESOURCE_MODEL_UUID = ?1",
nativeQuery = true)
List<Workflow> findWorkflowByModelUUID(String vnfResourceModelUUID);
+
+ /**
+ * Used to fetch the @{link Workflow} by the Pnf Model UUID.
+ *
+ * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide Workflow based on
+ * pnf model UUID without projection.
+ *
+ * @param pnfResourceModelUUID UUID
+ * @return List of Workflow
+ */
+ @Query(value = "select b.* from pnf_resource_to_workflow a join workflow b where a.WORKFLOW_ID = b.ID and a.PNF_RESOURCE_MODEL_UUID = ?1",
+ nativeQuery = true)
+ List<Workflow> findWorkflowByPnfModelUUID(String pnfResourceModelUUID);
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Cvnfc.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Cvnfc.java
new file mode 100644
index 0000000000..e22f366ddf
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Cvnfc.java
@@ -0,0 +1,136 @@
+/*-
+ * ============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.rest.catalog.beans;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@JsonInclude(Include.NON_DEFAULT)
+public class Cvnfc {
+
+ private String modelCustomizationId;
+ private String modelInstanceName;
+ private String modelVersionId;
+ private String modelInvariantId;
+ private String modelVersion;
+ private String modelName;
+ private String description;
+ private String nfcFunction;
+ private String nfcNamingCode;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
+ private Date created;
+
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId = modelCustomizationId;
+ }
+
+ public String getModelInstanceName() {
+ return modelInstanceName;
+ }
+
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getNfcFunction() {
+ return nfcFunction;
+ }
+
+ public void setNfcFunction(String nfcFunction) {
+ this.nfcFunction = nfcFunction;
+ }
+
+ public String getNfcNamingCode() {
+ return nfcNamingCode;
+ }
+
+ public void setNfcNamingCode(String nfcNamingCode) {
+ this.nfcNamingCode = nfcNamingCode;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("modelCustomizationId", modelCustomizationId)
+ .append("modelInstanceName", modelInstanceName).append("modelVersionId", modelVersionId)
+ .append("modelInvariantId", modelInvariantId).append("modelVersion", modelVersion)
+ .append("modelName", modelName).append("description", description).append("nfcFunction", nfcFunction)
+ .append("nfcNamingCode", nfcNamingCode).append("created", created).toString();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java
index 1620058e1e..11089046fd 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -40,6 +41,7 @@ public class Service implements Serializable {
private String modelInvariantId;
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
private Date created;
private String modelVersion;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java
index 8e18f94faf..f2a2c77aca 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java
@@ -20,9 +20,11 @@
package org.onap.so.rest.catalog.beans;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.onap.so.db.catalog.beans.HeatEnvironment;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -37,6 +39,7 @@ public class VfModule {
private String description;
private Boolean isBase;
private HeatTemplate heatTemplate;
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
private Date created;
private List<HeatFile> heatFile;
@@ -50,9 +53,7 @@ public class VfModule {
private HeatEnvironment heatEnv;
private Boolean isVolumeGroup;
-
- // Add in cvnfcCustomization
-
+ private List<Cvnfc> vnfc = new ArrayList<>();
public String getModelName() {
@@ -191,6 +192,12 @@ public class VfModule {
this.isVolumeGroup = isVolumeGroup;
}
+ public List<Cvnfc> getVnfc() {
+ return vnfc;
+ }
+ public void setVnfc(List<Cvnfc> vnfc) {
+ this.vnfc = vnfc;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java
index 40d701c3c5..febf69baf1 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java
@@ -47,12 +47,14 @@ public class Vnf implements Serializable {
private String nfFunction;
private String nfRole;
private String nfNamingCode;
+ private String nfType;
private String multiStageDesign;
private String orchestrationMode;
private String cloudVersionMin;
private String cloudVersionMax;
private String category;
private String subCategory;
+ private Boolean nfDataValid;
private List<VfModule> vfModule = new ArrayList<>();
public List<VfModule> getVfModule() {
@@ -215,4 +217,21 @@ public class Vnf implements Serializable {
public void setMultiStageDesign(String multiStepDesign) {
this.multiStageDesign = multiStepDesign;
}
+
+ public String getNfType() {
+ return nfType;
+ }
+
+ public void setNfType(String nfType) {
+ this.nfType = nfType;
+ }
+
+ public Boolean getNfDataValid() {
+ return nfDataValid;
+ }
+
+ public void setNfDataValid(Boolean nfDataValid) {
+ this.nfDataValid = nfDataValid;
+ }
+
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index b82c17dc84..66fc0f5dc5 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -19,26 +19,33 @@
*/
package org.onap.so.db.catalog.client;
+
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
import java.util.ArrayList;
+import java.util.List;
import javax.persistence.EntityNotFoundException;
-import org.junit.Before;
+import javax.ws.rs.core.UriBuilder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.db.catalog.beans.CvnfcCustomization;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.beans.Workflow;
+import uk.co.blackpepper.bowman.Client;
+@RunWith(MockitoJUnitRunner.class)
public class CatalogDbClientTest {
+ @Spy
private CatalogDbClient catalogDbClient;
-
- @Before
- public void init() {
- catalogDbClient = new CatalogDbClient();
- }
-
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -171,4 +178,16 @@ public class CatalogDbClientTest {
assertTrue(aCvnfc.getModelCustomizationUUID().equals("a123"));
}
+ @Test
+ public final void testFindWorkflowByPnfModelUUID() throws Exception {
+ String pnfResourceModelUUID = "f2d1f2b2-88bb-49da-b716-36ae420ccbff";
+
+ doReturn(new ArrayList()).when(catalogDbClient).getMultipleResources(any(), any());
+ List<Workflow> results = catalogDbClient.findWorkflowByPnfModelUUID(pnfResourceModelUUID);
+ verify(catalogDbClient).getMultipleResources(any(Client.class),
+ eq(UriBuilder.fromUri("/findWorkflowByPnfModelUUID")
+ .queryParam(CatalogDbClient.PNF_RESOURCE_MODEL_UUID, pnfResourceModelUUID).build()));
+
+ }
+
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
index 612963d35b..8bf47e71d3 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
@@ -37,6 +37,7 @@ public class VnfcCustomizationRepositoryTest extends BaseTest {
private VnfcCustomizationRepository vnfcCustomizationRepository;
@Test
+ @Transactional
public void findAllTest() throws Exception {
List<VnfcCustomization> vnfcCustomizationList = vnfcCustomizationRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(vnfcCustomizationList));
diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql
index 13ab018a27..e5963c183f 100644
--- a/mso-catalog-db/src/test/resources/data.sql
+++ b/mso-catalog-db/src/test/resources/data.sql
@@ -683,7 +683,7 @@ INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `
INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `PROJECT_DOMAIN_NAME`, `USER_DOMAIN_NAME`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('MTN13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', NULL, NULL, 'admin', 'admin', 1, 'KEYSTONE', 'USERNAME_PASSWORD', 'MSO_USER', '2018-07-17 14:02:33', '2018-07-17 14:02:33');
-INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'mtn13', 'MTN13', '2.5', 'MDT13', 'mtn13', NULL, 'orchestrator', 'MSO_USER', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
+INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`, `SUPPORT_FABRIC`) VALUES ('mtn13', 'mtn13', 'MTN13', '2.5', 'MDT13', 'mtn13', NULL, 'orchestrator', 'MSO_USER', '2018-07-17 14:06:28', '2018-07-17 14:06:28', 1);
INSERT INTO `controller_selection_reference` (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES
('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'ConfigScaleOut'),
@@ -768,10 +768,15 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m
insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
+insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
+('b2fd5627-55e4-4f4f-8064-9e6f443e9152','DummyPnfWorkflow','Dummy Pnf Workflow','DummyPnfWorkflow',1.0,'Dummy Pnf Workflow to test custom Pnf workflow',null,'pnf','native');
insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
('ff2ae348-214a-11e7-93ae-92361f002671', '1');
+Insert into pnf_resource_to_workflow (`PNF_RESOURCE_MODEL_UUID`,`WORKFLOW_ID`) values
+("ff2ae348-214a-11e7-93ae-92361f002680", 2);
+
insert into activity_spec(name, description, version) values
('testActivity1', 'Test Activity 1', 1);
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 7cd13a3780..9037e431d4 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -120,6 +120,7 @@ CREATE TABLE `cloud_sites` (
`LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
`CREATION_TIMESTAMP` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`UPDATE_TIMESTAMP` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ `SUPPORT_FABRIC` bit(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`ID`),
KEY `FK_cloud_sites_identity_services` (`IDENTITY_SERVICE_ID`),
CONSTRAINT `FK_cloud_sites_identity_services` FOREIGN KEY (`IDENTITY_SERVICE_ID`) REFERENCES `identity_services` (`ID`)
@@ -735,6 +736,8 @@ CREATE TABLE `orchestration_flow_reference` (
`SEQ_NO` int(11) NOT NULL,
`FLOW_NAME` varchar(200) NOT NULL,
`FLOW_VERSION` double NOT NULL,
+ `SCOPE` varchar(200) DEFAULT NULL,
+ `ACTION` varchar(200) DEFAULT NULL,
`NB_REQ_REF_LOOKUP_ID` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_orchestration_flow_reference` (`COMPOSITE_ACTION`,`FLOW_NAME`,`SEQ_NO`,`NB_REQ_REF_LOOKUP_ID`),
@@ -806,6 +809,10 @@ CREATE TABLE `service` (
`OVERALL_DISTRIBUTION_STATUS` varchar(45),
`ONAP_GENERATED_NAMING` TINYINT(1) DEFAULT NULL,
`NAMING_POLICY` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -960,6 +967,7 @@ CREATE TABLE `vf_module_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VF_MODULE_MODEL_UUID` varchar(200) NOT NULL,
`VNF_RESOURCE_CUSTOMIZATION_ID` int(13) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`ID`),
KEY `fk_vf_module_customization__vf_module1_idx` (`VF_MODULE_MODEL_UUID`),
KEY `fk_vf_module_customization__heat_env__heat_environment1_idx` (`HEAT_ENVIRONMENT_ARTIFACT_UUID`),
@@ -1109,7 +1117,9 @@ CREATE TABLE `vnf_resource_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_MODEL_UUID` varchar(200) NOT NULL,
+ `NF_DATA_VALID` tinyint(1) DEFAULT '0',
`VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`),
KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`),
@@ -1191,6 +1201,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
`CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
`CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
`SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
+ `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -1232,6 +1243,18 @@ CREATE TABLE IF NOT EXISTS `vnf_resource_to_workflow` (
CONSTRAINT `fk_vnf_resource_to_workflow__workflow1` FOREIGN KEY (`WORKFLOW_ID`) REFERENCES `workflow` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE TABLE IF NOT EXISTS `pnf_resource_to_workflow` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `PNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
+ `WORKFLOW_ID` int(11) NOT NULL,
+ PRIMARY KEY (`ID`),
+ UNIQUE KEY `UK_pnf_resource_to_workflow` (`PNF_RESOURCE_MODEL_UUID`,`WORKFLOW_ID`),
+ KEY `fk_pnf_resource_to_workflow__workflow1_idx` (`WORKFLOW_ID`),
+ KEY `fk_pnf_resource_to_workflow__pnf_res_mod_uuid_idx` (`PNF_RESOURCE_MODEL_UUID`),
+ CONSTRAINT `fk_pnf_resource_to_workflow__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_pnf_resource_to_workflow__workflow1` FOREIGN KEY (`WORKFLOW_ID`) REFERENCES `workflow` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
CREATE TABLE IF NOT EXISTS `activity_spec` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`NAME` VARCHAR(200) NOT NULL,
diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
index 611e2d293d..5d09ffb0d6 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -64,7 +64,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.28.0</version>
+ <version>0.31.0</version>
<configuration>
<verbose>true</verbose>
@@ -231,6 +231,31 @@
</assembly>
</build>
</image>
+ <image>
+ <name>${docker.image.prefix}/so-appc-orchestrator</name>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFileDir>docker-files</dockerFileDir>
+ <dockerFile>Dockerfile.so-app</dockerFile>
+ <tags>
+ <tag>${project.version}</tag>
+ <tag>${project.version}-${maven.build.timestamp}</tag>
+ <tag>${project.docker.latesttag.version}</tag>
+ </tags>
+ <assembly>
+ <inline>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>org.onap.so.adapters:so-appc-orchestrator</include>
+ </includes>
+ <outputFileNameMapping>app.jar</outputFileNameMapping>
+ </dependencySet>
+ </dependencySets>
+ </inline>
+ </assembly>
+ </build>
+ </image>
<image>
<name>${docker.image.prefix}/sdc-controller</name>
<build>
@@ -332,7 +357,7 @@
</build>
</image>
<image>
- <name>${docker.image.prefix}/vnfm-simulator</name>
+ <name>${docker.image.prefix}/so-simulator</name>
<build>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>
@@ -347,7 +372,7 @@
<dependencySets>
<dependencySet>
<includes>
- <include>org.onap.so.vnfm:vnfm-service</include>
+ <include>org.onap.so:so-simulator</include>
</includes>
<outputFileNameMapping>app.jar</outputFileNameMapping>
</dependencySet>
@@ -387,7 +412,7 @@
<goal>push</goal>
</goals>
<configuration>
- <image>${docker.image.prefix}/catalog-db-adapter,${docker.image.prefix}/request-db-adapter,${docker.image.prefix}/sdnc-adapter,${docker.image.prefix}/openstack-adapter,${docker.image.prefix}/vfc-adapter,${docker.image.prefix}/sdc-controller,${docker.image.prefix}/bpmn-infra,${docker.image.prefix}/api-handler-infra,${docker.image.prefix}/so-monitoring,${docker.image.prefix}/vnfm-simulator</image>
+ <image>${docker.image.prefix}/catalog-db-adapter,${docker.image.prefix}/request-db-adapter,${docker.image.prefix}/sdnc-adapter,${docker.image.prefix}/openstack-adapter,${docker.image.prefix}/vfc-adapter,${docker.image.prefix}/sdc-controller,${docker.image.prefix}/bpmn-infra,${docker.image.prefix}/api-handler-infra,${docker.image.prefix}/so-monitoring,${docker.image.prefix}/so-simulator</image>
</configuration>
</execution>
</executions>
@@ -455,9 +480,9 @@
<artifactId>so-monitoring-service</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.onap.so.vnfm</groupId>
- <artifactId>vnfm-service</artifactId>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>so-simulator</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-app b/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
index e8f02f12c6..90f0a6627d 100644
--- a/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
+++ b/packages/docker/src/main/docker/docker-files/Dockerfile.so-app
@@ -14,6 +14,7 @@ COPY configs/logging/logback-spring.xml /app
COPY scripts/start-app.sh /app
COPY scripts/wait-for.sh /app
COPY ca-certificates/onap-ca.crt /app/ca-certificates/onap-ca.crt
+COPY certs/* /app/
RUN chown -R so:so /app && chmod 700 /app/*.sh
diff --git a/packages/docker/src/main/docker/docker-files/certs/org.onap.so.jks b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.jks
new file mode 100644
index 0000000000..1e849afb5e
--- /dev/null
+++ b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.jks
Binary files differ
diff --git a/packages/docker/src/main/docker/docker-files/certs/org.onap.so.keyfile b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.keyfile
new file mode 100644
index 0000000000..9000ed29fb
--- /dev/null
+++ b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.keyfile
@@ -0,0 +1,27 @@
+xVdhDotWIx2RB3f8RxAFQb9mkHVVdIzv8eiij9cDjg_5ea5HWPS7OzLR5lv4NA0vStrAMfSAaS2e
+j4rzvrlserM9bTRco3JHb-i6ZGYMoTL6kuFJ9JMveSqg-fkwvrm7VcYQJBs1FIE3hRLNqiGJ34ud
+hDRp-cGUvNRLIImksKT2fmUyEawLLuE0Lo5aX46y0ibjIMe7clMxLHIS5-WggvkgIOPkVDcxqLT2
+OteGptqW1cjrm1ydbTkLYN6dd7ZmRsT3ULPYLEtPTlZ2vCh7bFBBvP_tjp2cZf4uSPM6EClYAikn
+dnTqivOfCZn25r0xeXuectoXbq12fws_jaCH05ZK1wJwAF_cQNfpvaiM457rE672YV3Ev4yhXCyM
+1jVL2P9Chl1sSBkZujCftvaj1rlippP9P_eohcLv84mtApEyV49rBFRMtkX9ZVdPyb8shFSoXJxk
+M6DentRzY1g37mVJ1B1YMKPNQj95nOD4gLvjbUZ7dATuroENsG7oUWkfaV6dokfTmh504ZbyeqGh
+xa7yfr3326fMQBhQMpsyqD2o_Obe5wN57p-vb469w65pUmK7iJDa0Fgxaxy8XNNnw6gCurbbsvyU
+nB8UdfhTvL5mJew_tKUvtq_KH9ajnA8giSxuFd9KM6YHJWiFMXIROEQT7hKjTJka1ghERBjcH_pY
+hbKtHdvbrS7T2hGwY_MQEUXYQBirtjaEwAvI960hXQt1K-MC8PNLRYtdLKE2Aq3amMt7ZKtrHSeN
+33I1MjXc3wRUeOi5A6qImge1Q_Wmn1SURAn9KbEv9eoMUbQUkN1z2iyw4x94BZpBk5GjDypKKOyg
+guec0UY3y9wqm5gGW7XvT3v1lZqo5180VgK49iFgA4IhWZ7dnDFQmq6IHTr1pM4kuvJ9dka9saIh
+9xCk_KINPp5_dqJ2Lhak2IeRg_Zm3belm1jvYGCyRRqfoi9WGrDh3LLZeK8MHrrfzLI4Toy_n6DG
+UNXPrXqrZPREfW2lhYLRfrivOBYWPq9JidQXn1UctSmWdNoMH7XuikBpAwmlInNA_5j9J-L-gf9D
+cw2zoby3_wvcm5vxndnocEdhqVVdo7uMmXasQqphuyJP8rgCJf_I1v0Qe5F-JXsj6xDvarOUPOTj
+Z93a64EO0KI0OznolRyBqHpIXffbGh7e1EpAE0LMESKJC3Mjmsgz1ld3s7WfdeDK-IxUEHJLHlhY
+IjBlY6q3OJDrgvPLkwoWPbI48tmRUJX1BCafvDU6W8crl4VQKhL_l5ANAX5oaKwh-0ZJAZ15tna5
+6fjWcWrtQSdNQxj0jXV7uEcBtRtyPyOk2uw4HJDBLQyyOglUUxcQZJFCFp2fCHmNyttmUJQ5U9cu
+yw9lKhsyBJ5TB4psbp64_0EalITeAGrpuH1I1N2m1O5ZY8pmrpPtA1Mb5rQ4IJqiVbZgHTcvSiN5
+Z2SilurhI1vq4_aN_UZJQvEnw9U5WU3ysphsQk8RZKbFH4W9GDtmEGbAkRkTy17KrDIuMpe--XJF
+SQHUd4tzxbiYVYHKdF6Ce1kfQ-DEFXEf7RddwuKbc7tw2pSjy1MVH4HSRoTOQQpewZRTfG-4d3MX
+B99-QgufEk1OBkfemuDhdnPty5qkOLUEG_uQKPpD0QDVf-t4OxZqk_8G_dCJcXbmY4VT3V7pdN_I
+qp2xP98wGcIPuLGlEB8px94jKdUolkqeV_UTmmkTGz-szLzgK_YhnnVJn8VeyNsPTwAFUlqiPTyT
+n_7rCb_6nNKlriadaHu6IuJWehv03ZR9jS0P1Y3YLM286deCLFu93lN3nY4yf-SEguASdHJNCBFJ
+RQViYm8Tfuim5F0KQGafheGcdZxTvBFihnDduQWNBR_bDB9zfD6OtvvkseyyWHt3gHkJm5QeCjWK
+RzRvbjLpUnA31cJeEXmnmhB5qMAvjn8yORKcotn3u4MXdHEk-s8vR_SKykS6IcaYE1xxbowtg-UG
+d1iaky1NFYa2VZ4pGx9lD93GDTDynmOSfzVeVsxhTu_5rAanpDkUYVuxOzajmRh55I8a6dRk \ No newline at end of file
diff --git a/packages/docker/src/main/docker/docker-files/certs/org.onap.so.trust.jks b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.trust.jks
new file mode 100644
index 0000000000..71c6e776a3
--- /dev/null
+++ b/packages/docker/src/main/docker/docker-files/certs/org.onap.so.trust.jks
Binary files differ
diff --git a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
index 89482fdcda..dd14091daf 100644
--- a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
+++ b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml
@@ -1,45 +1,52 @@
-<!-- ============LICENSE_START=======================================================
- ECOMP MSO ================================================================================
- 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========================================================= -->
-
+<!--
+ ============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=========================================================
+-->
<configuration scan="true" debug="false">
- <contextListener class="org.onap.so.logger.LoggerStartupListener" />
- <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+ <contextListener class="org.onap.so.logger.LoggerStartupListener" />
+ <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+
+ <property name="queueSize" value="256" />
+ <property name="maxFileSize" value="200MB" />
+ <property name="maxHistory" value="30" />
+ <property name="totalSizeCap" value="10GB" />
- <property name="queueSize" value="256" />
- <property name="maxFileSize" value="200MB" />
- <property name="maxHistory" value="30" />
- <property name="totalSizeCap" value="10GB" />
+ <!-- log file names -->
+ <property name="errorLogName" value="error" />
+ <property name="metricsLogName" value="metrics" />
+ <property name="auditLogName" value="audit" />
+ <property name="debugLogName" value="debug" />
- <!-- log file names -->
- <property name="errorLogName" value="error" />
- <property name="metricsLogName" value="metrics" />
- <property name="auditLogName" value="audit" />
- <property name="debugLogName" value="debug" />
-
- <property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}"/>
+ <property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}" />
- <property name="errorPattern"
- value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" />
+ <property name="errorPattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode:-500}|%X{ErrorDesc}|%msg%n" />
- <property name="debugPattern"
- value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}| %logger{50} - %msg%n" />
+ <property name="debugPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%logger{50} - %msg%n" />
- <property name="auditPattern"
- value="%X{EntryTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||||||%msg%n" />
+ <property name="auditPattern"
+ value="%X{EntryTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||%marker|%mdc|||%msg%n" />
- <property name="metricPattern"
- value="%X{InvokeTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|||||%msg%n" />
+ <property name="metricPattern"
+ value="%X{InvokeTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|%marker|%mdc|||%msg%n" />
- <property name="defaultPattern"
- value="%nopexception%logger
+ <property name="defaultPattern"
+ value="%nopexception%logger
\t%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}
\t%level
\t%replace(%replace(%message){'\t','\\\\t'}){'\n','\\\\n'}
@@ -49,151 +56,141 @@
\t%thread
\t%n" />
- <appender name="Audit"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
- <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
- <marker>EXIT</marker>
- </evaluator>
- <onMismatch>DENY</onMismatch>
- <onMatch>ACCEPT</onMatch>
- </filter>
- <file>${logs_dir:-.}/${auditLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${logs_dir:-.}/${auditLogName}.%d{yyyy-MM-dd}.%i.log.zip
- </fileNamePattern>
- <maxFileSize>${maxFileSize}</maxFileSize>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${auditPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncAudit" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="Audit" />
- </appender>
-
- <appender name="Metric"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
- <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
- <marker>INVOKE_RETURN</marker>
- </evaluator>
- <onMismatch>DENY</onMismatch>
- <onMatch>ACCEPT</onMatch>
- </filter>
- <file>${logs_dir:-.}/${metricsLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${logs_dir:-.}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log.zip
- </fileNamePattern>
- <maxFileSize>${maxFileSize}</maxFileSize>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${metricPattern}</pattern>
- </encoder>
- </appender>
-
-
- <appender name="asyncMetric" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="Metric" />
- </appender>
-
- <appender name="Error"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <level>ERROR</level>
- <onMatch>ACCEPT</onMatch>
- <onMismatch>DENY</onMismatch>
- </filter>
- <file>${logs_dir:-.}/${errorLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${logs_dir:-.}/${errorLogName}.%d{yyyy-MM-dd}.%i.log.zip
- </fileNamePattern>
- <maxFileSize>${maxFileSize}</maxFileSize>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${errorPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncError" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="Error" />
- </appender>
-
- <appender name="Debug"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
- <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
- <marker>INVOKE</marker>
- <marker>INVOKE_RETURN</marker>
- <marker>ENTRY</marker>
- <marker>EXIT</marker>
- </evaluator>
- <onMismatch>ACCEPT</onMismatch>
- <onMatch>DENY</onMatch>
- </filter>
- <file>${logs_dir:-.}/${debugLogName}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${logs_dir:-.}/${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip
- </fileNamePattern>
- <maxFileSize>${maxFileSize}</maxFileSize>
- <maxHistory>${maxHistory}</maxHistory>
- <totalSizeCap>${totalSizeCap}</totalSizeCap>
- </rollingPolicy>
- <encoder>
- <pattern>${debugPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>256</queueSize>
- <appender-ref ref="Debug" />
- <includeCallerData>true</includeCallerData>
- </appender>
-
- <!-- Spring related loggers -->
- <logger name="org.springframework" level="WARN" />
- <logger
- name="org.springframework.security.authentication.dao.DaoAuthenticationProvider"
- level="DEBUG" />
-
- <!-- Camunda related loggers -->
- <logger name="org.camunda.bpm.engine.jobexecutor.level" level="WARN" />
- <logger
- name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level"
- level="WARN" />
-
- <logger name="org.apache.wire" level="DEBUG" />
- <logger name="org.onap" level="DEBUG" />
- <logger name="com.att.ecomp" level="DEBUG" />
- <logger name="org.apache.cxf.interceptor" level="DEBUG" />
-
- <logger name="AUDIT" level="INFO" additivity="false">
- <appender-ref ref="asyncAudit" />
- </logger>
-
- <logger name="METRIC" level="INFO" additivity="false">
- <appender-ref ref="asyncMetric" />
- </logger>
-
- <root level="WARN">
- <appender-ref ref="asyncDebug" />
- <appender-ref ref="asyncError" />
- <appender-ref ref="asyncAudit" />
- <appender-ref ref="asyncMetric" />
- </root>
+ <appender name="Audit" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>EXIT</marker>
+ </evaluator>
+ <onMismatch>DENY</onMismatch>
+ <onMatch>ACCEPT</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${auditLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${auditLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${auditPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncAudit" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Audit" />
+ </appender>
+
+ <appender name="Metric" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>INVOKE-RETURN</marker>
+ </evaluator>
+ <onMismatch>DENY</onMismatch>
+ <onMatch>ACCEPT</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${metricsLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${metricPattern}</pattern>
+ </encoder>
+ </appender>
+
+
+ <appender name="asyncMetric" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Metric" />
+ </appender>
+
+ <appender name="Error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <file>${logs_dir:-.}/${errorLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${errorLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${errorPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Error" />
+ </appender>
+
+ <appender name="Debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
+ <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+ <marker>INVOKE</marker>
+ <marker>INVOKE-RETURN</marker>
+ <marker>ENTRY</marker>
+ <marker>EXIT</marker>
+ </evaluator>
+ <onMismatch>ACCEPT</onMismatch>
+ <onMatch>DENY</onMatch>
+ </filter>
+ <file>${logs_dir:-.}/${debugLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logs_dir:-.}/${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Debug" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+ <!-- Spring related loggers -->
+ <logger name="org.springframework" level="WARN" />
+ <logger name="org.springframework.security.authentication.dao.DaoAuthenticationProvider" level="DEBUG" />
+
+ <!-- Camunda related loggers -->
+ <logger name="org.camunda.bpm.engine.jobexecutor.level" level="WARN" />
+ <logger name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level" level="WARN" />
+
+ <logger name="org.apache.wire" level="DEBUG" />
+ <logger name="org.onap" level="DEBUG" />
+ <logger name="com.att.ecomp" level="DEBUG" />
+ <logger name="org.apache.cxf.interceptor" level="DEBUG" />
+ <logger name="com.att.commons" level="DEBUG" />
+ <logger name="org.reflections" level="ERROR" />
+
+ <logger name="AUDIT" level="INFO" additivity="false">
+ <appender-ref ref="asyncAudit" />
+ </logger>
+
+ <logger name="METRIC" level="INFO" additivity="false">
+ <appender-ref ref="asyncMetric" />
+ </logger>
+
+ <root level="WARN">
+ <appender-ref ref="asyncDebug" />
+ <appender-ref ref="asyncError" />
+ <appender-ref ref="asyncAudit" />
+ <appender-ref ref="asyncMetric" />
+ </root>
</configuration> \ No newline at end of file
diff --git a/packages/docker/src/main/docker/docker-files/scripts/start-app.sh b/packages/docker/src/main/docker/docker-files/scripts/start-app.sh
index cb2f35b87f..cea680c682 100644
--- a/packages/docker/src/main/docker/docker-files/scripts/start-app.sh
+++ b/packages/docker/src/main/docker/docker-files/scripts/start-app.sh
@@ -52,10 +52,6 @@ if [ ${APP} = "so-monitoring" ]; then
ln -s ${LOG_PATH} MONITORING
fi
-if [ ${APP} = "vnfm-simulator" ]; then
- ln -s ${LOG_PATH} SIMULATOR
-fi
-
if [ ${APP} = "openstack-adapter" ]; then
export DISABLE_SNI="-Djsse.enableSNIExtension=false"
fi
@@ -81,7 +77,11 @@ if [ ! -z "${TRUSTSTORE}" ]; then
jksargs="$jksargs -Djavax.net.ssl.trustStorePassword=${TRUSTSTORE_PASSWORD}"
fi
-jvmargs="${JVM_ARGS} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.additional-location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
+if [ -z "${ACTIVE_PROFILE}" ]; then
+ export ACTIVE_PROFILE="basic"
+fi
+
+jvmargs="${JVM_ARGS} -Dspring.profiles.active=${ACTIVE_PROFILE} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.additional-location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
echo "JVM Arguments: ${jvmargs}"
diff --git a/pom.xml b/pom.xml
index d5cd1f4a0b..9e27d8cf23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
<relativePath />
</parent>
<groupId>org.onap.so</groupId>
@@ -32,8 +32,8 @@
<module>cloudify-client</module>
<module>cxf-logging</module>
<module>so-monitoring</module>
- <module>vnfm-simulator</module>
<module>packages</module>
+ <module>so-simulator</module>
</modules>
<properties>
<project.mso.base.folder>.</project.mso.base.folder>
@@ -49,7 +49,7 @@
<sonar.cpd.exclusions>**/*</sonar.cpd.exclusions>
<jacoco.version>0.7.5.201505241946</jacoco.version>
<org.apache.maven.user-settings />
- <openstack.version>1.5.0-SNAPSHOT</openstack.version>
+ <openstack.version>1.5.1</openstack.version>
<maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
<originalClassifier>original</originalClassifier>
<docker.skip>true</docker.skip>
@@ -58,7 +58,7 @@
<docker.buildArg.project_version>${project.version}</docker.buildArg.project_version>
<docker.buildArg.artifact_id>${project.artifactId}</docker.buildArg.artifact_id>
<docker.buildArg.docker_repository>${dockerPullRepo}</docker.buildArg.docker_repository>
- <enforcer.skip>true</enforcer.skip>
+ <enforcer.skip>false</enforcer.skip>
<nexusproxy>https://nexus.onap.org</nexusproxy>
<releaseNexusPath>content/repositories/releases/</releaseNexusPath>
<snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
@@ -497,6 +497,42 @@
</dependency>
</dependencies>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ <executions>
+ <execution>
+ <id>enforce-property</id>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>enforce-no-snapshots</id>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>enforce-banned-dependencies</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>org.powermock</exclude>
+ </excludes>
+ <searchTransitive>false</searchTransitive>
+ </bannedDependencies>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -593,21 +629,13 @@
<version>3.0.2</version>
<executions>
<execution>
- <id>tests</id>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- <execution>
<id>original</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
+ <skip>true</skip>
<classifier>${originalClassifier}</classifier>
<includes>
<include>**</include>
@@ -636,6 +664,21 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.onap.logging-analytics</groupId>
+ <artifactId>logging-slf4j</artifactId>
+ <version>1.6.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.logging-analytics</groupId>
+ <artifactId>logging-filter-base</artifactId>
+ <version>1.6.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.logging-analytics</groupId>
+ <artifactId>logging-filter-spring</artifactId>
+ <version>1.6.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
@@ -837,12 +880,12 @@
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
- <version>0.18.2</version>
+ <version>4.0.0</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
- <version>0.18.2</version>
+ <version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
diff --git a/so-monitoring/readme.md b/so-monitoring/readme.md
deleted file mode 100644
index d4b876c763..0000000000
--- a/so-monitoring/readme.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# SO Monitoring
-
-----
-
-## Introduction
-
-SO Monitoring provides multiple useful features:
-* Search/Filtering Menu
-* A graphical user interface
-* Workflow pathing
-* Subflow navigation
-* Access to the workflow variables
-
-## Compiling / Running
-
-Compiling is simple: `mvn clean install`
-Compilation may fail if your code is not formatted properly.
-
-## Components
-
-### so-monitoring-handler
-
-
-### so-monitoring-service
-
-Backend API for so-monitoring. Requires basic auth to access it.
-
-Default credentials:
-- with role GUI-Client: gui/password1$
-
-Note that these default users should be changed for production.
-
-### so-monitoring-ui
-
-UI for so-monitoring has a separate README.md - so-monitoring/so-monitoring-ui/src/main/frontend/README.md
diff --git a/so-monitoring/so-monitoring-service/pom.xml b/so-monitoring/so-monitoring-service/pom.xml
index f5448aaf5c..762e3a5ee6 100644
--- a/so-monitoring/so-monitoring-service/pom.xml
+++ b/so-monitoring/so-monitoring-service/pom.xml
@@ -37,15 +37,10 @@
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@@ -64,10 +59,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </dependency>
</dependencies>
<build>
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
index 7c5a8965b7..aff4fecfdc 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
@@ -22,11 +22,12 @@ package org.onap.so.monitoring.rest.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
/**
* @author waqas.ikram@ericsson.com
*/
-@SpringBootApplication(scanBasePackages = {"org.onap"})
+@SpringBootApplication(scanBasePackages = {"org.onap"}, exclude = SecurityAutoConfiguration.class)
public class SoMonitoringApplication {
public static void main(String[] args) {
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
index d48d18dad0..5a5a4143fa 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
@@ -19,6 +19,7 @@
*/
package org.onap.so.monitoring.rest.api;
+import com.google.common.base.Optional;
import java.util.List;
import java.util.Map;
import javax.ws.rs.GET;
@@ -39,12 +40,12 @@ import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
import org.onap.so.monitoring.model.SoInfraRequest;
import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider;
import org.onap.so.rest.exceptions.InvalidRestRequestException;
+import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.google.common.base.Optional;
/**
* @author waqas.ikram@ericsson.com
@@ -82,10 +83,10 @@ public class SoMonitoringController {
return Response.status(Status.OK).entity(processInstanceId.get()).build();
}
- LOGGER.error("Unable to find process instance id for : " + requestId);
+ LOGGER.error("Unable to find process instance id for : {} ", requestId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find process instance id for : " + requestId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -111,10 +112,10 @@ public class SoMonitoringController {
return Response.status(Status.OK).entity(processInstanceDetail.get()).build();
}
- LOGGER.error("Unable to find process instance id for : " + processInstanceId);
+ LOGGER.error("Unable to find process instance id for : {}", processInstanceId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find process instance id for : " + processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -140,10 +141,10 @@ public class SoMonitoringController {
final ProcessDefinitionDetail definitionDetail = response.get();
return Response.status(Status.OK).entity(definitionDetail).build();
}
- LOGGER.error("Unable to find process definition xml for processDefinitionId: " + processDefinitionId);
+ LOGGER.error("Unable to find process definition xml for processDefinitionId: {}", processDefinitionId);
return Response.status(Status.NO_CONTENT).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message =
"Unable to find process definition xml for processDefinitionId: {}" + processDefinitionId;
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -166,7 +167,7 @@ public class SoMonitoringController {
final List<ActivityInstanceDetail> activityInstanceDetails =
camundaProcessDataServiceProvider.getActivityInstance(processInstanceId);
return Response.status(Status.OK).entity(activityInstanceDetails).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to find activity instance for processInstanceId: " + processInstanceId;
LOGGER.error(message);
return Response.status(Status.BAD_REQUEST).entity(message).build();
@@ -189,7 +190,7 @@ public class SoMonitoringController {
final List<ProcessInstanceVariableDetail> processInstanceVariable =
camundaProcessDataServiceProvider.getProcessInstanceVariable(processInstanceId);
return Response.status(Status.OK).entity(processInstanceVariable).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message =
"Unable to find process instance variables for processInstanceId: " + processInstanceId;
LOGGER.error(message);
@@ -214,10 +215,10 @@ public class SoMonitoringController {
try {
final List<SoInfraRequest> requests =
databaseServiceProvider.getSoInfraRequest(filters, startTime, endTime, maxResult);
- LOGGER.info("result size: " + requests.size());
+ LOGGER.info("result size: {}", requests.size());
return Response.status(Status.OK).entity(requests).build();
- } catch (final InvalidRestRequestException extensions) {
+ } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
+ ", to: " + endTime + ", maxResult: " + maxResult;
LOGGER.error(message);
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
deleted file mode 100644
index 3959631f94..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.monitoring.rest.api;
-
-import java.security.Principal;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class UserController {
-
- @RequestMapping("/user")
- public Principal user(Principal user) {
- return user;
- }
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
index 2b53ed8953..cadd60b0d9 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
@@ -2,9 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -23,15 +21,16 @@ package org.onap.so.monitoring.rest.api;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @author waqas.ikram@ericsson.com
*/
@Configuration
-public class WebApplicationConfig implements WebMvcConfigurer {
+public class WebApplicationConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
+ super.addViewControllers(registry);
registry.addViewController("/details/**").setViewName("forward:/");
}
}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
deleted file mode 100644
index 298f52bd35..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.monitoring.rest.api;
-
-import org.onap.so.security.WebSecurityConfig;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-
-@EnableWebSecurity
-@Configuration("att-security-config")
-@Order(2)
-public class WebSecurityConfigImpl extends WebSecurityConfig {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers("/actuator", "/actuator/*", "/login", "/", "/index.html", "/*.js",
- "/*.js.map", "/favicon.png").permitAll().anyRequest().authenticated().and().httpBasic();
- }
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
index 417febebf6..dbccb76979 100644
--- a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
+++ b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
@@ -19,9 +19,3 @@ mso:
spring:
main:
allow-bean-definition-overriding: true
- security:
- usercredentials:
- -
- username: gui
- password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
- role: GUI-Client
diff --git a/so-monitoring/so-monitoring-ui/pom.xml b/so-monitoring/so-monitoring-ui/pom.xml
index a5f1a6c18e..c362a83a9b 100644
--- a/so-monitoring/so-monitoring-ui/pom.xml
+++ b/so-monitoring/so-monitoring-ui/pom.xml
@@ -28,7 +28,9 @@
</parent>
<artifactId>so-monitoring-ui</artifactId>
-
+ <properties>
+ <yarn.proxy>false</yarn.proxy>
+ </properties>
<build>
<plugins>
<plugin>
@@ -66,7 +68,7 @@
<goal>yarn</goal>
</goals>
<configuration>
- <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
+ <yarnInheritsProxyConfigFromMaven>${yarn.proxy}</yarnInheritsProxyConfigFromMaven>
<arguments>build</arguments>
</configuration>
</execution>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
index 65731cdc5d..329de0f833 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
@@ -6,15 +6,6 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
-FYI: You may need to change environments.ts to hit to your backend: not so-monitoring:30224 but localhost:8088
-
-### Logging in
-
-Backend API for so-monitoring. Requires basic auth to access it.
-
-Default credentials:
-- with role GUI-Client: gui/password1$
-
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
index 03e77fc2d9..428998dc62 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -26,25 +24,17 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { DetailsComponent } from './details/details.component';
-import {AuthGuard} from "./auth.guard";
-import {LoginComponent} from "./login/login.component";
const routes: Routes = [
{
// Route to home page
path: '',
- component: HomeComponent,
- canActivate: [AuthGuard]
+ component: HomeComponent
},
{
// Route to page to show individual process based on ID
path: 'details/:id',
component: DetailsComponent
- },
- {
- // Route to login page
- path: 'login',
- component: LoginComponent
}
];
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
index 71294bfffe..75be395879 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -19,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { BrowserModule } from '@angular/platform-browser';
@@ -30,18 +28,15 @@ import { AppComponent } from './app.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { HomeComponent } from './home/home.component';
-import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
+import { HttpClientModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DetailsComponent } from './details/details.component';
import { ToastrNotificationService } from './toastr-notification-service.service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { MatFormFieldModule, MatInputModule, MatTableModule, MatTabsModule, MatSelectModule, MatNativeDateModule, MatDatepickerModule, MatCardModule, MatPaginatorModule, MatSortModule } from '@angular/material';
+import { MatFormFieldModule, MatInputModule, MatTableModule, MatTabsModule, MatSelectModule, MatNativeDateModule, MatDatepickerModule, MatCardModule, MatPaginatorModule, MatSortModule, MatIconModule } from '@angular/material';
import { NgxSpinnerModule } from 'ngx-spinner';
import { RouterModule, Routes } from '@angular/router';
import { APP_BASE_HREF } from '@angular/common';
-import { LoginComponent } from './login/login.component';
-import {BasicAuthInterceptor} from "./basic-auth.interceptor";
-import {ErrorInterceptor} from "./error.interceptor";
@NgModule({
declarations: [
@@ -49,8 +44,7 @@ import {ErrorInterceptor} from "./error.interceptor";
SidebarComponent,
TopbarComponent,
HomeComponent,
- DetailsComponent,
- LoginComponent
+ DetailsComponent
],
imports: [
BrowserModule,
@@ -70,16 +64,14 @@ import {ErrorInterceptor} from "./error.interceptor";
RouterModule,
MatPaginatorModule,
MatSortModule,
+ MatIconModule,
RouterModule.forRoot([]),
ReactiveFormsModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
- providers: [
- { provide: HTTP_INTERCEPTORS, useClass: BasicAuthInterceptor, multi: true },
- { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
- ToastrNotificationService],
+ providers: [ToastrNotificationService],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
deleted file mode 100644
index f437a21710..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from '@angular/router';
-import { Observable } from 'rxjs';
-
-@Injectable({
- providedIn: 'root'
-})
-export class AuthGuard implements CanActivate {
-
- constructor(private router:Router) { }
-
- canActivate(
- next: ActivatedRouteSnapshot,
- state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
- if (localStorage.getItem('authdata')) {
- // logged in
- return true;
- }
-
- // not logged in
- this.router.navigate(['/login'], { queryParams: {returnUrl: state.url}});
- return false;
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
deleted file mode 100644
index d7610eed0d..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import {Injectable} from '@angular/core';
-import {HttpClient} from "@angular/common/http";
-import {environment} from "../environments/environment";
-
-@Injectable({
- providedIn: 'root'
-})
-export class AuthenticationService {
-
- constructor(private http: HttpClient) {
- }
-
- login(username: string, password: string) {
- // remove old data from storage
- localStorage.removeItem('authdata');
- // add to local storage
- var authdata = window.btoa(username + ':' + password);
- localStorage.setItem('authdata', authdata);
-
- // make request
- return this.http.get(environment.authBackendURL);
- }
-
- logout() {
- // remove from local storage
- localStorage.removeItem('authdata');
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
deleted file mode 100644
index 4990d05ecb..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
-import { Observable } from 'rxjs';
-
-@Injectable()
-export class BasicAuthInterceptor implements HttpInterceptor {
- intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
- //add authorization header with basic auth credentials if available
- let auth = localStorage.getItem('authdata');
- if (auth) {
- const authReq = request.clone({
- headers: request.headers.set('Authorization', 'Basic Z3VpOnBhc3N3b3JkMSQ=')
- });
-
- // send cloned request with header to the next handler.
- return next.handle(authReq);
- }
-
- return next.handle(request);
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
index 8dfae3da1e..b391672728 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
@@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
*/
import { Injectable } from '@angular/core';
-import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
+import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { BpmnInfraRequest } from './model/bpmnInfraRequest.model';
import { catchError } from 'rxjs/operators';
import { Observable } from 'rxjs';
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
index a98095ca00..8ad955f38e 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
@@ -17,12 +17,23 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
-->
<div class="completeForm">
<div class="topCanvas">
- <section class="canvas" id="canvas"></section>
+ <div class="navigation">
+ <button class="zoomButton" mat-icon-button title="zoom in" (click)="zoomIn()">
+ <mat-icon>zoom_in</mat-icon>
+ </button>
+ <button class="zoomButton" mat-icon-button title="zoom out" (click)="zoomOut()">
+ <mat-icon>zoom_out</mat-icon>
+ </button>
+ <button class="zoomButton" mat-icon-button title="reset zoom" (click)="resetZoom()">
+ <mat-icon>all_out</mat-icon>
+ </button>
+ </div>
+ <div #canvas class="canvas" id="canvas"></div>
<mat-card class="besideCanvas" id="besideCanvas">
<mat-card-title>Process Information</mat-card-title>
<br />
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
index 2789723964..b96fe4ace2 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.scss
@@ -17,23 +17,39 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
#canvas {
background: white;
padding: 0;
- margin: 0;
+ margin-left: -43px;
width: 70%;
height: 470px;
margin-top: 0;
- box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
+ box-shadow: 0 8px 10px 1px rgba(0,0,0,.2);
+}
+
+.navigation {
+ background: #e6e6e6;
+ width: 40px;
+ box-shadow: -5px 8px 10px 1px rgba(0,0,0,.2);
+ height: 470px;
+ border: 1px;
+ border-color: black;
+ position: relative;
+}
+
+.zoomButton {
+ padding-top: 8px;
+ background: none;
+ border: none;
}
#besideCanvas {
background: white;
padding-left: 20px;
margin: 0;
- width: 28%;
+ width: 25%;
height: 470px;
margin-top: 0;
box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
index 7106a87937..a42fa3f5a6 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { Component, OnInit } from '@angular/core';
@@ -34,6 +34,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { VariableInstance } from '../model/variableInstance.model';
import { ToastrNotificationService } from '../toastr-notification-service.service';
import { NgxSpinnerService } from 'ngx-spinner';
+import { ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-details',
@@ -43,6 +44,9 @@ import { NgxSpinnerService } from 'ngx-spinner';
})
export class DetailsComponent implements OnInit {
+
+ @ViewChild("canvas") elementReference: ElementRef;
+
bpmnViewer: any;
processInstanceID: string;
@@ -82,7 +86,8 @@ export class DetailsComponent implements OnInit {
async (data: ProcessDefinitionDetail) => {
this.processDefinition = data;
console.log(data);
- await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance, this.router);
+ await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance,
+ this.router, this.spinner, this.popup);
}, error => {
console.log(error);
this.popup.error("Unable to get process definition for id: " + procDefId + " Error code:" + error.status);
@@ -104,30 +109,53 @@ export class DetailsComponent implements OnInit {
});
}
- displayCamundaflow(bpmnXml, activities: ActivityInstance[], r: Router) {
- this.spinner.show();
+ displayCamundaflow(bpmnXml, activities: ActivityInstance[], router: Router,
+ spinner: NgxSpinnerService, popup: ToastrNotificationService) {
+ spinner.show();
this.bpmnViewer.importXML(bpmnXml, (error) => {
if (error) {
console.error('Unable to load BPMN flow ', error);
- this.popup.error('Unable to load BPMN flow ');
- this.spinner.hide();
+ popup.error('Unable to load BPMN flow ');
+ spinner.hide();
} else {
- this.spinner.hide();
- var canvas = this.bpmnViewer.get('canvas');
+ spinner.hide();
+ let canvas = this.bpmnViewer.get('canvas');
var eventBus = this.bpmnViewer.get('eventBus');
- eventBus.on('element.click', function(e) {
+ var elementRegistry = this.bpmnViewer.get('elementRegistry');
+ var overlays = this.bpmnViewer.get('overlays');
- activities.forEach(a => {
- if (a.activityId == e.element.id && a.calledProcessInstanceId !== null) {
- console.log("will drill down to : " + a.calledProcessInstanceId);
- r.navigate(['/details/' + a.calledProcessInstanceId]);
- this.spinner.show();
- }
- });
+ activities.forEach(a => {
+ if (a.calledProcessInstanceId !== null) {
+ var element = elementRegistry.get(a.activityId);
+ let newNode = document.createElement('div');
+ newNode.className = 'highlight-overlay';
+ newNode.id = element.id;
+ newNode.style.width = element.width + "px";
+ newNode.style.height = element.height + "px";
+ newNode.style.cursor = "pointer";
+
+ overlays.add(a.activityId, {
+ position: {
+ top: -5,
+ left: -5
+ },
+ html: newNode
+ });
+
+ newNode.addEventListener('click', function(e) {
+ console.log("clicked on: " + e.srcElement.id)
+ activities.forEach(a => {
+ if (a.activityId == e.srcElement.id && a.calledProcessInstanceId !== null) {
+ console.log("will drill down to : " + a.calledProcessInstanceId);
+ router.navigate(['/details/' + a.calledProcessInstanceId]);
+ }
+ });
+ });
+ }
});
// zoom to fit full viewport
- canvas.zoom('fit-viewport');
+ canvas.zoom('fit-viewport', 'auto');
activities.forEach(a => {
canvas.addMarker(a.activityId, 'highlight');
});
@@ -135,6 +163,26 @@ export class DetailsComponent implements OnInit {
});
}
+ zoomIn() {
+ this.bpmnViewer.get('zoomScroll').zoom(1, {
+ x: this.elementReference.nativeElement.offsetWidth / 2,
+ y: this.elementReference.nativeElement.offsetHeight / 2
+ });
+ }
+
+ zoomOut() {
+ this.bpmnViewer.get('zoomScroll').zoom(-1, {
+ x: this.elementReference.nativeElement.offsetWidth / 2,
+ y: this.elementReference.nativeElement.offsetHeight / 2
+ });
+ }
+ resetZoom() {
+ let canvas = this.bpmnViewer.get('canvas');
+ canvas.resized();
+ canvas.zoom('fit-viewport', 'auto');
+
+ }
+
getVarInst(procInstId: string) {
this.data.getVariableInstance(procInstId).subscribe(
(data: VariableInstance[]) => {
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
deleted file mode 100644
index afe792c80f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Injectable } from '@angular/core';
-import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
-import { Observable, throwError } from 'rxjs';
-import { catchError } from 'rxjs/operators';
-import {AuthenticationService} from "./authentication.service";
-
-@Injectable()
-export class ErrorInterceptor implements HttpInterceptor {
- constructor(private authenticationService: AuthenticationService) {}
-
- intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
- return next.handle(request).pipe(catchError(err => {
- if (err.status === 401) {
- // auto logout if 401 response returned from api
- this.authenticationService.logout();
- location.reload(true);
- }
-
- const error = err.error.message || err.statusText;
- return throwError(error);
- }))
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
index 16d274f16a..b22fa6ee9c 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/http-error-handler.service.ts
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+@authors: ronan.kenny@est.tech, waqas.ikram@est.tech
*/
import { Injectable } from '@angular/core';
@@ -44,9 +44,9 @@ export class HttpErrorHandlerService {
this.popup.error("Internal Service Error occured for operation: " + operation + " please check backend service log. status code: " + error.status);
}
console.error(
- 'Backend returned code ${error.status}, ' +
- 'body was: ${error.error}');
- return throwError(error.error || "Internal Service Error occured for operation: " + operation + " please check backend service log. status code: " + error.status);
+ 'Backend returned status code: ', error.status + ' from URL ' + url);
+ return throwError(error.error || "Internal Service Error occured for operation: " +
+ operation + ". Please check backend service log. Status code: " + error.status);
};
}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
deleted file mode 100644
index 107e1da04a..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
-============LICENSE_START=======================================================
-Copyright (C) 2019 Samsung. 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: k.kazak@samsung.com
--->
-<h2>Login</h2>
-<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
- <div class="form-group">
- <label for="username">Username</label>
- <input type="text" formControlName="username" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.username.errors }" />
- <div *ngIf="submitted && f.username.errors" class="invalid-feedback">
- <div *ngIf="f.username.errors.required">Username is required</div>
- </div>
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" formControlName="password" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.password.errors }" />
- <div *ngIf="submitted && f.password.errors" class="invalid-feedback">
- <div *ngIf="f.password.errors.required">Password is required</div>
- </div>
- </div>
- <div class="form-group">
- <button [disabled]="loading" class="btn btn-primary">Login</button>
- <img *ngIf="loading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==" />
- </div>
- <div *ngIf="error" class="alert alert-danger">{{error}}</div>
-</form>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
deleted file mode 100644
index 8cf379d04f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import {async, ComponentFixture, inject, TestBed} from '@angular/core/testing';
-
-import {LoginComponent} from './login.component';
-import {AuthenticationService} from "../authentication.service";
-import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-import {RouterTestingModule} from "@angular/router/testing";
-import {ActivatedRoute, Router, RouterModule} from "@angular/router";
-
-describe('LoginComponent', () => {
- // Create SPY Object for Jasmine tests to mock DataService
- let spyDataService: jasmine.SpyObj<AuthenticationService>;
- let component: LoginComponent;
- let fixture: ComponentFixture<LoginComponent>;
- let router: Router;
-
- beforeEach(async(() => {
- spyDataService = jasmine.createSpyObj('AuthenticationService', ['login', 'logout']);
-
- TestBed.configureTestingModule({
- providers: [LoginComponent,
- {provide: AuthenticationService, useValue: spyDataService},
- {provide: ActivatedRoute, useValue: { snapshot: {queryParams: { returnUrl: 'test'}}}}
- ],
- imports: [RouterTestingModule, ReactiveFormsModule, FormsModule, RouterModule.forRoot([])],
- declarations: [LoginComponent],
- schemas: [
- CUSTOM_ELEMENTS_SCHEMA
- ]
- });
-
- fixture = TestBed.createComponent(LoginComponent);
- component = fixture.componentInstance;
- router = TestBed.get(Router);
- }));
-
-
- it('should create', inject([LoginComponent],
- (component: LoginComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should logout and route to test directory', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.returnUrl).toBe('test');
- }));
-
- it('should logout and route to root directory', inject([LoginComponent],
- (component: LoginComponent) => {
- router.initialNavigation();
- component.ngOnInit();
- expect(component.returnUrl).toBe('test');
- }));
-
- it('should submit without success', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.loginForm.valid).toBe(false);
- component.onSubmit();
- expect(component.submitted).toBe(true);
- }));
-
- it('should submit without success', inject([LoginComponent],
- (component: LoginComponent) => {
- component.ngOnInit();
- expect(component.loginForm.valid).toBe(false);
- spyDataService.login.and.returnValue(Promise.resolve());
-
- let compiled = fixture.debugElement.nativeElement;
- let username = compiled.querySelector('input[type="text"]');
- let password = compiled.querySelector('input[type="password"]');
-
- fixture.detectChanges();
-
- // Change value
- username.value = 'test';
- password.value = 'password';
-
- // dispatch input event
- dispatchEvent(new Event('input'));
-
- component.onSubmit();
- expect(component.submitted).toBe(true);
- }));
-});
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
deleted file mode 100644
index 4a3f4e6b0f..0000000000
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- ============LICENSE_START=======================================================
- Copyright (C) 2019 Samsung. 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.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
-
- @authors: k.kazak@samsung.com
- **/
-
-import { Component, OnInit } from '@angular/core';
-import {FormBuilder, FormGroup, Validators, ReactiveFormsModule} from "@angular/forms";
-import {ActivatedRoute, Router} from "@angular/router";
-import {AuthenticationService} from "../authentication.service";
-import {first} from "rxjs/internal/operators";
-
-@Component({
- selector: 'app-login',
- templateUrl: './login.component.html',
- styleUrls: []
-})
-export class LoginComponent implements OnInit {
-
- loginForm: FormGroup;
- loading = false;
- submitted = false;
- returnUrl: string;
- error = '';
-
- constructor(private formBuilder: FormBuilder,
- private route: ActivatedRoute,
- private router: Router,
- private authenticationService: AuthenticationService) { }
-
- ngOnInit() {
- this.loginForm = this.formBuilder.group({
- username: ['', Validators.required],
- password: ['', Validators.required]
- });
-
- // logout
- this.authenticationService.logout();
-
- this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
- }
-
- // convenience getter for easy access to form fields
- get f() { return this.loginForm.controls; }
-
- onSubmit() {
- this.submitted = true;
-
- // stop here if form is invalid
- if (this.loginForm.invalid) {
- return;
- }
-
- this.loading = true;
- this.authenticationService.login(this.f.username.value, this.f.password.value)
- .subscribe(
- next => {
- this.router.navigate([this.returnUrl]);
- },
- error => {
- this.error = error;
- this.loading = false;
- });
- }
-}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
index 1c623518c7..e8b54d7ae3 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
@@ -1,34 +1,29 @@
-<!--
-============LICENSE_START=======================================================
- Copyright (C) 2018 Ericsson. 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
--->
-
-<nav>
- <ul>
- <li>
- <a routerLink="/">Home</a>
- </li>
- <li>
- <a routerLink="/login">Logout</a>
- </li>
- </ul>
-</nav>
+<!--
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. 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.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+-->
+
+<nav>
+ <ul>
+ <li>
+ <a routerLink="/">Home</a>
+ </li>
+ </ul>
+</nav>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
index 484a156fa9..f0c63fe582 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
@@ -2,8 +2,6 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -26,6 +24,5 @@ SPDX-License-Identifier: Apache-2.0
export const environment = {
production: false,
- soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/',
- authBackendURL: 'http://so-monitoring:30224/user'
+ soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/'
};
diff --git a/so-simulator/.gitignore b/so-simulator/.gitignore
new file mode 100644
index 0000000000..f22dbba7d7
--- /dev/null
+++ b/so-simulator/.gitignore
@@ -0,0 +1,22 @@
+target
+**/.settings
+**/.classpath
+**/.project
+**/.buildpath
+**/.factorypath
+**/.springBeans
+.idea
+.checkstyle
+.DS_Store
+.*~
+*.iml
+**/logs/
+**/debug-logs/
+*.class
+*.swp
+*.log
+*.tmp
+**/bin/
+/tattletale/
+/.metadata/
+
diff --git a/so-simulator/README.md b/so-simulator/README.md
new file mode 100644
index 0000000000..e059a97956
--- /dev/null
+++ b/so-simulator/README.md
@@ -0,0 +1,62 @@
+SO Citrus REST Simulator ![Logo][1]
+================
+
+This is a standalone simulator application for REST messaging.
+
+Clients are able to access the simulator endpoints and the simulator responds with predefined response
+messages according to its scenarios. The simulator response logic is very powerful and enables us to simulate
+any kind of server interface.
+
+Read the simulator [user manual](https://citrusframework.org/citrus-simulator/) for more information.
+
+Message processing
+---------
+
+First of all the simulator identifies the simulator scenario based on a mapping key that is extracted from the incoming request. Based
+on that operation key the respective simulator scenario is executed.
+
+There are multiple ways to identify the simulator scenario from incoming request messages:
+
+* Message-Type: Each request message type (XML root QName) results in a separate simulator scenario
+* REST request mappings: Identifies the scenario based on Http method and resource path on server
+* SOAP Action: Each SOAP action value defines a simulator scenario
+* Message Header: Any SOAP or Http message header value specifies a new simulator scenario
+* XPath payload: An XPath expression is evaluated on the message payload to identify the scenario
+
+Once the simulator scenario is identified the respective test logic builder is executed. The Citrus test logic provides
+proper response messages as a result to the calling client. The response messages can hold dynamic values and the
+simulator is able to perform complex response generating logic. The test logic is built in Java classes that use the Citrus test
+DSL for defining the simulator scenario steps.
+
+Quick start
+---------
+
+You can build the simulator application locally with Maven:
+
+```
+mvn clean install
+```
+
+This will compile and package all resources for you. Also some prepared Citrus integration tests are executed during the build.
+After the successful build you are able to run the simulator with:
+
+```
+mvn spring-boot:run
+```
+
+Open your browser and point to [http://localhost:8080](http://localhost:8080). You will see the simulator user interface with all available scenarios and
+latest activities.
+
+You can execute the Citrus integration tests now in order to get some interaction with the simulator. Open the Maven project in your favorite IDE and
+run the tests with TestNG plugins. You should see the tests calling operations on the simulator in order to receive proper responses. The simulator user interface should track those
+interactions accordingly.
+
+Information
+---------
+
+Read the [user manual](https://citrusframework.org/citrus-simulator/) for detailed instructions and features.
+For more information on Citrus see [citrusframework.org][2], including a complete [reference manual][3].
+
+ [1]: https://citrusframework.org/img/brand-logo.png "Citrus"
+ [2]: https://citrusframework.org
+ [3]: https://citrusframework.org/reference/html/
diff --git a/so-simulator/pom.xml b/so-simulator/pom.xml
new file mode 100644
index 0000000000..49e02e3d68
--- /dev/null
+++ b/so-simulator/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.onap.so</groupId>
+ <artifactId>so</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>so-simulator</artifactId>
+ <groupId>org.onap.so</groupId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <citrus.simulator.version>1.1.0</citrus.simulator.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+ <!-- Citrus Simulator -->
+ <dependency>
+ <groupId>com.consol.citrus</groupId>
+ <artifactId>citrus-simulator-starter</artifactId>
+ <version>${citrus.simulator.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.consol.citrus</groupId>
+ <artifactId>citrus-simulator-ui</artifactId>
+ <version>${citrus.simulator.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.consol.citrus</groupId>
+ <artifactId>citrus-ws</artifactId>
+ <version>2.7.8</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${springboot.version}</version>
+ <configuration>
+ <mainClass>org.onap.so.simulator.Simulator</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>fabric8-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>start</id>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/so-simulator/src/main/docker/Dockerfile b/so-simulator/src/main/docker/Dockerfile
new file mode 100644
index 0000000000..8fa8dc75e9
--- /dev/null
+++ b/so-simulator/src/main/docker/Dockerfile
@@ -0,0 +1,24 @@
+FROM docker.io/openjdk:8-jdk-alpine
+
+#Create User so
+RUN addgroup -g 1000 so && adduser -S -u 1000 -G so so
+
+ARG project_version=1.1.0-SNAPSHOT
+ARG artifact_id
+ARG docker_repository
+ENV docker_repository $docker_repository
+ENV project_version $project_version
+ENV artifact_id $artifact_id
+
+ENV no_proxy localhost
+
+VOLUME /tmp
+WORKDIR /app
+
+ADD /maven/${artifact_id}-${project_version}.jar /app/app.jar
+RUN chown -R so:so /app
+
+USER so
+
+
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app/app.jar"] \ No newline at end of file
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntity.java b/so-simulator/src/main/java/org/onap/so/simulator/AAIPropertiesImpl.java
index 3a3ec91d2f..a0c0007927 100644
--- a/common/src/main/java/org/onap/so/utils/TargetEntity.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/AAIPropertiesImpl.java
@@ -18,42 +18,43 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.utils;
-
-import java.util.EnumSet;
-
-public enum TargetEntity implements TargetEntities {
- OPENSTACK_ADAPTER,
- BPMN,
- GRM,
- AAI,
- DMAAP,
- POLICY,
- CATALOG_DB,
- REQUEST_DB,
- VNF_ADAPTER,
- SDNC_ADAPTER,
- SNIRO,
- SDC,
- EXTERNAL,
- MULTICLOUD,
- OOF,
- SDNC,
- SO,
- UNKNOWN,
- OPENSTACK;
-
- private static final String PREFIX = "SO";
-
- public static EnumSet<TargetEntity> getSOInternalComponents() {
- return EnumSet.of(OPENSTACK_ADAPTER, BPMN, CATALOG_DB, REQUEST_DB, VNF_ADAPTER, SDNC_ADAPTER);
+package org.onap.so.simulator;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.onap.so.client.aai.AAIVersion;
+
+
+public class AAIPropertiesImpl implements org.onap.so.client.aai.AAIProperties {
+
+ public static final String AAI_ENDPOINT = "aai.endpoint";
+
+
+ @Override
+ public URL getEndpoint() throws MalformedURLException {
+ return new URL("http://so-aai-resources-svc:9900");
+ }
+
+ @Override
+ public String getSystemName() {
+ return "SIMULATOR";
}
@Override
- public String toString() {
- if (getSOInternalComponents().contains(this))
- return TargetEntity.PREFIX + "." + this.name();
- else
- return this.name();
+ public AAIVersion getDefaultVersion() {
+ return AAIVersion.LATEST;
}
+
+ @Override
+ public String getAuth() {
+ return null;
+ }
+
+ @Override
+ public String getKey() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/Simulator.java b/so-simulator/src/main/java/org/onap/so/simulator/Simulator.java
new file mode 100644
index 0000000000..a5489d19c0
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/Simulator.java
@@ -0,0 +1,47 @@
+
+package org.onap.so.simulator;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.http.HttpStatus;
+import org.springframework.ws.soap.SoapVersion;
+import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import com.consol.citrus.endpoint.EndpointAdapter;
+import com.consol.citrus.endpoint.adapter.StaticEndpointAdapter;
+import com.consol.citrus.http.message.HttpMessage;
+import com.consol.citrus.message.Message;
+import com.consol.citrus.simulator.http.SimulatorRestAdapter;
+import com.consol.citrus.simulator.http.SimulatorRestConfigurationProperties;
+
+
+@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
+public class Simulator extends SimulatorRestAdapter {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Simulator.class, args);
+ }
+
+ @Override
+ public String urlMapping(SimulatorRestConfigurationProperties simulatorRestConfiguration) {
+ return "/sim/**";
+ }
+
+ @Override
+ public EndpointAdapter fallbackEndpointAdapter() {
+ return new StaticEndpointAdapter() {
+ @Override
+ protected Message handleMessageInternal(Message message) {
+ return new HttpMessage().status(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ };
+ }
+
+ @Bean
+ public SaajSoapMessageFactory messageFactory() {
+ SaajSoapMessageFactory messageFactory = new SaajSoapMessageFactory();
+ messageFactory.setSoapVersion(SoapVersion.SOAP_12);
+ return messageFactory;
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java
new file mode 100644
index 0000000000..064556da00
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java
@@ -0,0 +1,34 @@
+package org.onap.so.simulator.actions.aai;
+
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.consol.citrus.actions.AbstractTestAction;
+import com.consol.citrus.context.TestContext;
+
+public class DeleteVServers extends AbstractTestAction {
+
+ private static final Logger logger = LoggerFactory.getLogger(DeleteVServers.class);
+
+ @Override
+ public void doExecute(TestContext context) {
+
+ try {
+ logger.info("Deleting Vservers in A&AI");
+ AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
+ String vserverId = context.getVariable("vServerId");
+ String cloudRegion = context.getVariable("cloudRegion");
+ String cloudOwner = context.getVariable("cloudOwner");
+ String tenantId = context.getVariable("tenantId");
+ AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion,
+ tenantId, vserverId);
+ aaiResourceClient.delete(vserverURI);
+ } catch (Exception e) {
+ logger.error("Error Deleting VServer in A&AI", e);
+ }
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
new file mode 100644
index 0000000000..075a5b7a6b
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
@@ -0,0 +1,42 @@
+package org.onap.so.simulator.actions.aai;
+
+import org.onap.aai.domain.yang.L3Network;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import com.consol.citrus.actions.AbstractTestAction;
+import com.consol.citrus.context.TestContext;
+
+
+public class ProcessNetwork extends AbstractTestAction {
+
+ @Override
+ public void doExecute(TestContext context) {
+
+ try {
+ int random = (int) (Math.random() * 50 + 1);
+
+ AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
+
+ if (context.getVariable("action").equals("assign")) {
+ String networkId = context.getVariable("generatedNetworkId");
+ AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId);
+ L3Network network = new L3Network();
+ network.setNetworkId(networkId);
+ network.setNetworkName(context.getVariable("networkName"));
+ network.setNetworkType(context.getVariable("networkType"));
+ network.setNetworkTechnology("SR_IOV");
+ network.setPhysicalNetworkName("PhysicalNetwork" + random);
+ aaiResourceClient.create(networkURI, network);
+ } else if (context.getVariable("action").equals("delete")) {
+ String networkId = context.getVariable("networkId");
+ AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId);
+ aaiResourceClient.delete(networkURI);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
new file mode 100644
index 0000000000..e061d2b79d
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -0,0 +1,64 @@
+package org.onap.so.simulator.actions.aai;
+
+import org.onap.aai.domain.yang.Vnfc;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.consol.citrus.actions.AbstractTestAction;
+import com.consol.citrus.context.TestContext;
+
+public class ProcessVnfc extends AbstractTestAction {
+
+ @Override
+ public void doExecute(TestContext context) {
+
+ final Logger logger = LoggerFactory.getLogger(ProcessVnfc.class);
+ try {
+ logger.debug("running ProcessVnfc scenario");
+ logger.debug("requestAction: " + context.getVariable("requestAction"));
+ logger.debug("serviceAction: " + context.getVariable("serviceAction"));
+ logger.debug("cloudOwner: " + context.getVariable("cloudOwner"));
+ logger.debug("cloundRegion: " + context.getVariable("cloudRegion"));
+ logger.debug("tenant: " + context.getVariable("tenant"));
+ logger.debug("vfModuleId: " + context.getVariable("vfModuleId"));
+ logger.debug("vnfId: " + context.getVariable("vnfId"));
+
+ AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
+
+ if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
+ && context.getVariable("serviceAction").equals("activate")) {
+
+ AAIResourceUri vnfcURI = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, "zauk51bfrwl09oam001");
+ Vnfc vnfc = new Vnfc();
+ vnfc.setVnfcName("zauk51bfrwl09oam001");
+ vnfc.setNfcNamingCode("oamfw");
+ vnfc.setNfcFunction("EPC-OAM-FIREWALL");
+ vnfc.setProvStatus("PREPROV");
+ vnfc.setOrchestrationStatus("Active");
+ vnfc.setInMaint(false);
+ vnfc.setIsClosedLoopDisabled(false);
+
+ vnfc.setModelInvariantId("b214d2e9-73d9-49d7-b7c4-a9ae7f06e244");
+ vnfc.setModelVersionId("9e314c37-2258-4572-a399-c0dd7d5f1aec");
+ vnfc.setModelCustomizationId("2bd95cd4-d7ff-4af0-985d-2adea0339921");
+
+ if (!aaiResourceClient.exists(vnfcURI))
+ aaiResourceClient.create(vnfcURI, vnfc);
+ AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE,
+ context.getVariable("vnfId"), context.getVariable("vfModuleId"));
+ AAIResourceUri pserverURI = AAIUriFactory.createResourceUri(AAIObjectType.PSERVER, "test");
+ AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER,
+ context.getVariable("cloudOwner"), context.getVariable("cloudRegion"),
+ context.getVariable("tenant"), "d29f3151-592d-4011-9356-ad047794e236");
+ aaiResourceClient.connect(vnfcURI, vserverURI);
+ aaiResourceClient.connect(vserverURI, pserverURI);
+ aaiResourceClient.connect(vfModuleURI, vnfcURI);
+ }
+ } catch (Exception e) {
+ logger.debug(e.getMessage());
+ }
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/DefaultScenario.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/DefaultScenario.java
new file mode 100644
index 0000000000..cb9c7873a9
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/DefaultScenario.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2006-2017 the original author or authors.
+ *
+ * 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.
+ */
+
+package org.onap.so.simulator.scenarios;
+
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioRunner;
+import org.springframework.http.HttpStatus;
+
+/**
+ * @author Christoph Deppisch
+ */
+@Scenario("Default")
+public class DefaultScenario extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioRunner scenario) {
+ scenario.http().receive((builder -> builder.get()));
+
+ scenario.http().send((builder -> builder.response(HttpStatus.BAD_REQUEST)));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
new file mode 100644
index 0000000000..eae5ef2135
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
@@ -0,0 +1,38 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import java.io.InputStream;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.client.aai.AAICommonObjectMapperProvider;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.springframework.core.io.ClassPathResource;
+import com.consol.citrus.actions.AbstractTestAction;
+import com.consol.citrus.context.TestContext;
+
+public class CreateAAInventory extends AbstractTestAction {
+
+ @Override
+ public void doExecute(TestContext context) {
+ try {
+ String stackName = context.getVariable("stackName");
+
+ if (stackName != null && stackName.equals("replace_module")) {
+ String vServerId = "92272b67-d23f-42ca-87fa-7b06a9ec81f3";
+ AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
+ AAICommonObjectMapperProvider aaiMapper = new AAICommonObjectMapperProvider();
+ InputStream vserverFile =
+ new ClassPathResource("openstack/gr_api/CreateAAIInventory.json").getInputStream();
+ Vserver vserver = aaiMapper.getMapper().readValue(vserverFile, Vserver.class);
+ AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, "cloudOwner",
+ "regionOne", "0422ffb57ba042c0800a29dc85ca70f8", vServerId);
+ aaiResourceClient.create(vserverURI, vserver);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java
new file mode 100644
index 0000000000..2c0c4aff09
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-CreateStack")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks", method = RequestMethod.POST)
+public class CreateStack extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().post().extractFromPayload("$.stack_name", "stackName");
+
+ scenario.action(new CreateAAInventory());
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Create.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java
new file mode 100644
index 0000000000..35e0571b14
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-CreateStackAudit")
+@RequestMapping(value = "/sim/mockPublicUrlThree/stacks", method = RequestMethod.POST)
+public class CreateStackAudit extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().post().extractFromPayload("$.stack_name", "stackName");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java
new file mode 100644
index 0000000000..25bb87c8bc
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java
@@ -0,0 +1,53 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-ModuleCreateDelete")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/dummy_id/stackId")
+public class ModuleCreateDelete extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "dummy_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionOne");
+ scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70f8");
+ scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Initial Get from Openstack Adapter prior to deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Final Get from Openstack Adapter after the deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDeleteAudit.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDeleteAudit.java
new file mode 100644
index 0000000000..1365fa04c8
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDeleteAudit.java
@@ -0,0 +1,52 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-ModuleCreateDeleteAudit")
+@RequestMapping(value = "/sim/mockPublicUrlThree/stacks/nc_dummy_id/stackId")
+public class ModuleCreateDeleteAudit extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "nc_dummy_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionThree");
+ scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70a3");
+ scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Initial Get from Openstack Adapter prior to deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Final Get from Openstack Adapter after the deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/NetworkCreateDeleteCloud.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/NetworkCreateDeleteCloud.java
new file mode 100644
index 0000000000..712f377f4e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/NetworkCreateDeleteCloud.java
@@ -0,0 +1,48 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-NetworkCreateDeleteCloud")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/network_dummy_id/stackId")
+public class NetworkCreateDeleteCloud extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "network_dummy_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionOne");
+ scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70f8");
+ scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Final Get from Openstack Adapter after the deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseStack.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseStack.java
new file mode 100644
index 0000000000..25bd563e1a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseStack.java
@@ -0,0 +1,35 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryBaseStackByName")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/base_module_id/*", method = RequestMethod.GET)
+public class QueryBaseStack extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "base_module_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionTwo");
+ scenario.variable("tenantId", "872f331350c54e59991a8de2cbffb40c");
+ scenario.variable("vServerId", "d29f3151-592d-4011-9356-ad047794e236");
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseVfModuleStackById.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseVfModuleStackById.java
new file mode 100644
index 0000000000..149794fb3c
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryBaseVfModuleStackById.java
@@ -0,0 +1,48 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryBaseVfModuleStackById")
+@RequestMapping(value = "/sim/v1/872f331350c54e59991a8de2cbffb40c/stacks/base_module_id/stackId")
+public class QueryBaseVfModuleStackById extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "base_module_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionTwo");
+ scenario.variable("tenantId", "872f331350c54e59991a8de2cbffb40c");
+ scenario.variable("vServerId", "d29f3151-592d-4011-9356-ad047794e236");
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Initial Get from Openstack Adapter prior to deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Poll Deletion of stack for status
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java
new file mode 100644
index 0000000000..5659f309d1
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Failure-ID-Name-Resources")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/failure_id/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameFailureId extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "failure_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
new file mode 100644
index 0000000000..4c3b4b628e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-ID-Name-Resources")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/replace_module/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplace extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
new file mode 100644
index 0000000000..5e4bb98926
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-Volume-ID-Name-Resources")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/replace_module_volume_id/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplaceVolume extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module_volume_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java
new file mode 100644
index 0000000000..8d36e567e4
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java
@@ -0,0 +1,23 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByName")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/*", method = RequestMethod.GET)
+public class QueryStack extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.NOT_FOUND);
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java
new file mode 100644
index 0000000000..2311c4c44e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java
@@ -0,0 +1,49 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Double-Failure-Stack-Endpoint")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/double_failure_id/stackId")
+public class QueryStackByIdDoubleFailure extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "double_failure_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionTwo");
+ scenario.variable("tenantId", "872f331350c54e59991a8de2cbffb40c");
+ scenario.variable("vServerId", "d29f3151-592d-4011-9356-ad047794e236");
+ scenario.variable("stack_failure_message", "The Flavor ID (nd.c6r16d20) could not be found.");
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json"));
+
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Poll Deletion of stack for status
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdFailure.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdFailure.java
new file mode 100644
index 0000000000..4d0d578831
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdFailure.java
@@ -0,0 +1,49 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Failure-Stack-Endpoint")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/failure_id/stackId")
+public class QueryStackByIdFailure extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "failure_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionTwo");
+ scenario.variable("tenantId", "872f331350c54e59991a8de2cbffb40c");
+ scenario.variable("vServerId", "d29f3151-592d-4011-9356-ad047794e236");
+ scenario.variable("stack_failure_message", "The Flavor ID (nd.c6r16d20) could not be found.");
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json"));
+
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Poll Deletion of stack for status
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java
new file mode 100644
index 0000000000..4001d1c972
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java
@@ -0,0 +1,38 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByID-NetworkMacro1")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_network1/*", method = RequestMethod.GET)
+public class QueryStackByIdNetworkMacro1 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "dummy_id");
+
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java
new file mode 100644
index 0000000000..55d697aa69
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java
@@ -0,0 +1,38 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByID-NetworkMacro2")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_network1/*", method = RequestMethod.GET)
+public class QueryStackByIdNetworkMacro2 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "dummy_id");
+
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModule.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModule.java
new file mode 100644
index 0000000000..c0302ad1eb
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModule.java
@@ -0,0 +1,51 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Replace-VF-Module-Get")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/replace_module/*")
+public class QueryStackByIdReplaceModule extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "replace_module");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionOne");
+ scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70f8");
+ scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Initial Get from Openstack Adapter prior to deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Final Get from Openstack Adapter after the deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java
new file mode 100644
index 0000000000..170c3105b3
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java
@@ -0,0 +1,51 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.onap.so.simulator.actions.aai.DeleteVServers;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Replace-VF-Module-Volume-Get")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/replace_module_volume_id/*")
+public class QueryStackByIdReplaceModuleVolume extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ // Get to see if stack exists
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "replace_module_volume_id");
+ scenario.variable("cloudOwner", "cloudOwner");
+ scenario.variable("cloudRegion", "regionOne");
+ scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70f8");
+ scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Initial Get from Openstack Adapter prior to deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ // Delete of the stack
+ scenario.http().receive().delete();
+ scenario.action(new DeleteVServers());
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ // Final Get from Openstack Adapter after the deletion of the stack
+ scenario.http().receive().get();
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java
new file mode 100644
index 0000000000..75b1ecac81
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java
@@ -0,0 +1,40 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-VolumeGroup-Interactions")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/VolumeGroup/*")
+public class QueryStackByIdVolumeGroup extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "VolumeGroup");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().delete();
+
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java
new file mode 100644
index 0000000000..b51a608e6d
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java
@@ -0,0 +1,24 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByName3")
+@RequestMapping(value = "/sim/mockPublicUrlThree/stacks/*", method = RequestMethod.GET)
+public class QueryStackByName extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.NOT_FOUND);
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
new file mode 100644
index 0000000000..9413fab7df
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Query-Stack-Resources-Macro1")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_1/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
new file mode 100644
index 0000000000..8708dac438
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Query-Stack-Resources-Macro2")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_2/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
new file mode 100644
index 0000000000..a30115a63a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Query-Stack-Resources-Macro3")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_3/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java
new file mode 100644
index 0000000000..ba6a1a1185
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java
@@ -0,0 +1,36 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByID-Macro1")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_1/*", method = RequestMethod.GET)
+public class QueryStackByIdMacro1 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "macro_module_1");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java
new file mode 100644
index 0000000000..efd420486d
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java
@@ -0,0 +1,37 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByID-Macro2")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_2/*", method = RequestMethod.GET)
+public class QueryStackByIdMacro2 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "macro_module_2");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java
new file mode 100644
index 0000000000..4d3ba8697a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java
@@ -0,0 +1,37 @@
+package org.onap.so.simulator.scenarios.openstack.macro;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-QueryStackByID-Macro3")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/macro_module_3/*", method = RequestMethod.GET)
+public class QueryStackByIdMacro3 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "correlationId");
+ scenario.echo("${correlationId}");
+ scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME,
+ "${correlationId}");
+
+ scenario.variable("stackName", "macro_module_3");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json"));
+
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/nova/NovaKeyPairDelete.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/nova/NovaKeyPairDelete.java
new file mode 100644
index 0000000000..32b29f2ab8
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/nova/NovaKeyPairDelete.java
@@ -0,0 +1,19 @@
+package org.onap.so.simulator.scenarios.openstack.nova;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Nova-Keypair-Delete")
+@RequestMapping(value = "/sim/mockPublicUrl/os-keypairs/*", method = RequestMethod.DELETE)
+public class NovaKeyPairDelete extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().delete();
+ scenario.http().send().response(HttpStatus.NO_CONTENT);
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCHAPort0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCHAPort0.java
new file mode 100644
index 0000000000..682ed9f03d
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCHAPort0.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCHAPort0")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCHAPort0 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCHAPort0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort0.java
new file mode 100644
index 0000000000..26b2e1305e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort0.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCManagementPort0")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/8d93f63e-e972-48c7-ad98-b2122da47315",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCManagementPort0 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCManagementPort0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort1.java
new file mode 100644
index 0000000000..7269e54554
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCManagementPort1.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCManagementPort1")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCManagementPort1 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCManagementPort1.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCRole1Port0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCRole1Port0.java
new file mode 100644
index 0000000000..f7e677b158
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCRole1Port0.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCRole1Port0")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCRole1Port0 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCRole1Port0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCService1Port0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCService1Port0.java
new file mode 100644
index 0000000000..0e5c7fd2b6
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCService1Port0.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCservice1Port0")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/27391d94-33af-474a-927d-d409249e8fd3",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCService1Port0 extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCTservice1Port0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCTrusted.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCTrusted.java
new file mode 100644
index 0000000000..29f1df3e01
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryNeutronNetworkSSCTrusted.java
@@ -0,0 +1,28 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryNeutronNetworkSSCTrusted")
+@RequestMapping(value = "/sim/mockPublicUrl/v2.0/ports/d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ method = RequestMethod.GET)
+public class QueryNeutronNetworkSSCTrusted extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/GetNeutronNetworkSSCTrustedPort.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsRole1Sub1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsRole1Sub1.java
new file mode 100644
index 0000000000..d9331e7e1a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsRole1Sub1.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Resource-Details-Role1-Sub0")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources",
+ method = RequestMethod.GET)
+public class QueryResourceDetailsRole1Sub1 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Role1SubInterface1Resources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub0.java
new file mode 100644
index 0000000000..9c42e489ee
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub0.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Resource-Details-service1-Sub0")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb/resources",
+ method = RequestMethod.GET)
+public class QueryResourceDetailsService1Sub0 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface0Resources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub1.java
new file mode 100644
index 0000000000..691879cfc8
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub1.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Resource-Details-service1-Sub1")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a/resources",
+ method = RequestMethod.GET)
+public class QueryResourceDetailsService1Sub1 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface1Resources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub2.java
new file mode 100644
index 0000000000..33b450a08c
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourceDetailsService1Sub2.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Resource-Details-service1-Sub2")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c/resources",
+ method = RequestMethod.GET)
+public class QueryResourceDetailsService1Sub2 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface2Resources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
new file mode 100644
index 0000000000..6dbd898154
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
@@ -0,0 +1,27 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Query-Base-Stack-Resources")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/base_module_id/resources", method = RequestMethod.GET)
+public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByStackName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByStackName.java
new file mode 100644
index 0000000000..aff4d924e2
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByStackName.java
@@ -0,0 +1,27 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Openstack-Query-Stack-Resources")
+@RequestMapping(value = "/sim/mockPublicUrl/stacks/dummy_id/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackName extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "dummy_id");
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/GetStackResources.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryRole1StackResources.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryRole1StackResources.java
new file mode 100644
index 0000000000..5372d2ad78
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryRole1StackResources.java
@@ -0,0 +1,27 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryRole1StackResources-tsbc0005vm002ssc001")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources",
+ method = RequestMethod.GET)
+public class QueryRole1StackResources extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/StackResourcesRole1ResourceGroup.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryService1StackResources.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryService1StackResources.java
new file mode 100644
index 0000000000..60a5ad8964
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryService1StackResources.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("QueryService1StackResources-tsbc0005vm002ssc001")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources",
+ method = RequestMethod.GET)
+public class QueryService1StackResources extends AbstractSimulatorScenario {
+
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/StackResourcesservice1ResourceGroup.json"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsRole1Sub0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsRole1Sub0.java
new file mode 100644
index 0000000000..068bc26072
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsRole1Sub0.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Stack-Details-Role1-Sub0")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ method = RequestMethod.GET)
+public class QueryStackDetailsRole1Sub0 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/Role1SubInterface0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub0.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub0.java
new file mode 100644
index 0000000000..22fb263d5b
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub0.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Stack-Details-service1-Sub0")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ method = RequestMethod.GET)
+public class QueryStackDetailsService1Sub0 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface0.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub1.java
new file mode 100644
index 0000000000..16688ffae8
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub1.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Stack-Details-service1-Sub1")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
+ method = RequestMethod.GET)
+public class QueryStackDetailsService1Sub1 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface1.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub2.java
new file mode 100644
index 0000000000..53bf966421
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryStackDetailsService1Sub2.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack.resources;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Stack-Details-service1-Sub2")
+@RequestMapping(
+ value = "/sim/mockPublicUrl/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c",
+ method = RequestMethod.GET)
+public class QueryStackDetailsService1Sub2 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("openstack/gr_api/service1SubInterface2.json"));
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/AssignVFModule.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/AssignVFModule.java
new file mode 100644
index 0000000000..e089f33aa3
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/AssignVFModule.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.sdnc;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-VNFAPI-AssignVFModule")
+@RequestMapping(value = "/sim/restconf/operations/VNF-API:vnf-topology-operation", method = RequestMethod.POST)
+public class AssignVFModule extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().post();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("sdnc/vnf-api/AssignResponseSuccess.xml"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/QueryVFModule.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/QueryVFModule.java
new file mode 100644
index 0000000000..24bb671a06
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/QueryVFModule.java
@@ -0,0 +1,24 @@
+
+package org.onap.so.simulator.scenarios.sdnc;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-VNFAPI-QueryVFModule")
+@RequestMapping(value = "/sim/restconf/config/VNF-API:vnfs/vnf-list/*", method = RequestMethod.GET)
+public class QueryVFModule extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK)
+ .payload(new ClassPathResource("sdnc/vnf-api/QueryResponseSuccess.xml"));
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/HealthCheck.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/HealthCheck.java
new file mode 100644
index 0000000000..e7af44d261
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/HealthCheck.java
@@ -0,0 +1,24 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Health-Check-SDNC")
+@RequestMapping(value = "/sim/restconf/operations/SLI-API:healthcheck", method = RequestMethod.POST)
+public class HealthCheck extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().post();
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/HealthCheck.json"));
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
new file mode 100644
index 0000000000..c1ba812513
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
@@ -0,0 +1,29 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import com.consol.citrus.actions.AbstractTestAction;
+import com.consol.citrus.context.TestContext;
+
+public class ProcessSDNCAssignService extends AbstractTestAction {
+
+
+ @Override
+ public void doExecute(TestContext context) {
+ try {
+ String serviceName = context.getVariable("serviceName");
+ String action = context.getVariable("action");
+ if (("Robot_SI_For_Service_Failure".equals(serviceName) && "assign".equals(action))
+ || ("Robot_SI_For_Service_Rollback_Failure".equals(serviceName))) {
+ context.setVariable("responseMessage", "SDNC is throwing errors");
+ context.setVariable("responseCode", "500");
+ } else {
+ context.setVariable("responseMessage", "Success");
+ context.setVariable("responseCode", "200");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java
new file mode 100644
index 0000000000..4e6b15158c
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java
@@ -0,0 +1,31 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-QueryVFModule")
+@RequestMapping(
+ value = "/sim/restconf/config/GENERIC-RESOURCE-API:services/service/*/service-data/vnfs/vnf/*/vnf-data/vf-modules/vf-module/dummy_id/vf-module-data/vf-module-topology/",
+ method = RequestMethod.GET)
+public class QueryVFModuleGR extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+ int random = (int) (Math.random() * 50 + 1);
+
+ scenario.variable("vfModuleName", "vfModuleName" + random);
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNC_Query_VfModule.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro1.java
new file mode 100644
index 0000000000..6a6fbf191c
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro1.java
@@ -0,0 +1,31 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-QueryVFModule-Macro1")
+@RequestMapping(
+ value = "/sim/restconf/config/GENERIC-RESOURCE-API:services/service/*/service-data/vnfs/vnf/*/vnf-data/vf-modules/vf-module/macro_module_1/vf-module-data/vf-module-topology/",
+ method = RequestMethod.GET)
+public class QueryVFModuleGR_Macro1 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+
+ scenario.variable("vfModuleName", "macro_module_1");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNC_Query_VfModule.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro2.java
new file mode 100644
index 0000000000..a63aa0f94f
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro2.java
@@ -0,0 +1,30 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-QueryVFModule-Macro2")
+@RequestMapping(
+ value = "/sim/restconf/config/GENERIC-RESOURCE-API:services/service/*/service-data/vnfs/vnf/*/vnf-data/vf-modules/vf-module/macro_module_2/vf-module-data/vf-module-topology/",
+ method = RequestMethod.GET)
+public class QueryVFModuleGR_Macro2 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("vfModuleName", "macro_module_2");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNC_Query_VfModule.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro3.java
new file mode 100644
index 0000000000..0d4fb2adf3
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR_Macro3.java
@@ -0,0 +1,30 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-QueryVFModule-Macro3")
+@RequestMapping(
+ value = "/sim/restconf/config/GENERIC-RESOURCE-API:services/service/*/service-data/vnfs/vnf/*/vnf-data/vf-modules/vf-module/macro_module_3/vf-module-data/vf-module-topology/",
+ method = RequestMethod.GET)
+public class QueryVFModuleGR_Macro3 extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("vfModuleName", "macro_module_3");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNC_Query_VfModule.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVNF.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVNF.java
new file mode 100644
index 0000000000..a891ea73e2
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVNF.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-QueryVnf")
+@RequestMapping(
+ value = "/sim/restconf/config/GENERIC-RESOURCE-API:services/service/*/service-data/vnfs/vnf/*/vnf-data/vnf-topology/",
+ method = RequestMethod.GET)
+public class QueryVNF extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNC_Query_Vnf.json"));
+ }
+
+
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ServiceInstance.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ServiceInstance.java
new file mode 100644
index 0000000000..4dd57d2b39
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ServiceInstance.java
@@ -0,0 +1,35 @@
+package org.onap.so.simulator.scenarios.sdnc.grapi;
+
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("SDNC-GRAPI-ServiceInstance")
+@RequestMapping(value = "/sim/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation/",
+ method = RequestMethod.POST)
+public class ServiceInstance extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().post().extractFromPayload("$.input.service-information.service-id", "serviceId")
+ .extractFromPayload("$.input.service-request-input.service-instance-name", "serviceName")
+ .extractFromPayload("$.input.sdnc-request-header.svc-action", "action");
+
+ scenario.createVariable("finalIndicator", "Y");
+ scenario.createVariable("responseCode", "200");
+ scenario.createVariable("responseMessage", "success");
+ scenario.action(new ProcessSDNCAssignService());
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("sdnc/gr-api/SDNCSuccess.json"));
+
+
+ }
+
+
+}
diff --git a/so-simulator/src/main/resources/META-INF/citrus-simulator-context.xml b/so-simulator/src/main/resources/META-INF/citrus-simulator-context.xml
new file mode 100644
index 0000000000..9e9311f6f3
--- /dev/null
+++ b/so-simulator/src/main/resources/META-INF/citrus-simulator-context.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:citrus="http://www.citrusframework.org/schema/config"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+
+ http://www.citrusframework.org/schema/config http://www.citrusframework.org/schema/config/citrus-config.xsd">
+
+
+
+ <citrus:global-variables>
+ <citrus:variable name="simulator.name" value="Citrus REST Simulator"/>
+ </citrus:global-variables>
+
+
+
+</beans>
diff --git a/so-simulator/src/main/resources/META-INF/services/org.onap.so.client.RestProperties b/so-simulator/src/main/resources/META-INF/services/org.onap.so.client.RestProperties
new file mode 100644
index 0000000000..9f1dcba23b
--- /dev/null
+++ b/so-simulator/src/main/resources/META-INF/services/org.onap.so.client.RestProperties
@@ -0,0 +1 @@
+org.onap.so.simulator.AAIPropertiesImpl \ No newline at end of file
diff --git a/so-simulator/src/main/resources/application.properties b/so-simulator/src/main/resources/application.properties
new file mode 100644
index 0000000000..e2ab7af9c0
--- /dev/null
+++ b/so-simulator/src/main/resources/application.properties
@@ -0,0 +1,28 @@
+server.port: 10000
+
+info.simulator.name=REST Simulator
+logging.file=debug.log
+logging.level.com.consol.citrus=DEBUG
+logging.level.org.onap.so=DEBUG
+logging.level.org.reflections.Reflections=ERROR
+
+# Enable Http REST support
+citrus.simulator.rest.enabled=true
+citrus.simulator.ws.enabled=true
+citrus.simulator.ws.servlet.mapping=/services/ws/*
+
+# Default timeout setting
+citrus.simulator.default.timeout=300000
+citrus.simulator.defaultTimeout=300000
+# Default message template path
+citrus.simulator.templatePath=templates
+
+# Default scenario name
+citrus.simulator.defaultScenario=Default
+
+# Should Citrus validate incoming messages on syntax and semantics
+citrus.simulator.templateValidation=true
+
+#Actuator
+management.endpoints.web.basePath=/manage
+management.endpoints.web.exposure.include=info, health
diff --git a/so-simulator/src/main/resources/logback-spring.xml b/so-simulator/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000000..2fcb7121dd
--- /dev/null
+++ b/so-simulator/src/main/resources/logback-spring.xml
@@ -0,0 +1,58 @@
+<configuration scan="true" debug="false">
+ <include resource="org/springframework/boot/logging/logback/base.xml" />
+
+ <property name="queueSize" value="256" />
+ <property name="maxFileSize" value="20MB" />
+ <property name="maxHistory" value="30" />
+ <property name="totalSizeCap" value="20MB" />
+
+ <!-- log file names -->
+ <property name="debugLogName" value="debug" />
+
+ <property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}"/>
+
+ <property name="debugPattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%thread|%X{RequestID}| %logger{50} - %msg%n" />
+
+ <appender name="Debug"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>/app/logs/${debugLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip
+ </fileNamePattern>
+ <maxFileSize>${maxFileSize}</maxFileSize>
+ <maxHistory>${maxHistory}</maxHistory>
+ <totalSizeCap>${totalSizeCap}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Debug" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+ <!-- Sim Logs go here-->
+ <logger name="com.consol.citrus" level="DEBUG" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+
+ <logger name="com.consol.citrus.simulator.http.HttpRequestAnnotationMatcher" level="WARN" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+ <logger name="org.onap.so" level="DEBUG" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+
+ <root level="INFO">
+ <appender-ref ref="asyncDebug" />
+ </root>
+
+</configuration> \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/CreateAAIInventory.json b/so-simulator/src/main/resources/openstack/gr_api/CreateAAIInventory.json
new file mode 100644
index 0000000000..6a541c50f1
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/CreateAAIInventory.json
@@ -0,0 +1,170 @@
+{
+ "vserver-id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "vserver-name": "tsbc0005vm002",
+ "vserver-name2": "tsbc0005vm002",
+ "vserver-selflink": "https://test.com:8774/v2/0422ffb57ba042c0800a29dc85ca70f8/servers/92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_mgmt_port_1",
+ "selflink": "https://test.com:9696/v2.0/ports/07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "interface-id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "macaddr": "02:07:f5:b1:4c:14",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_OAMP_NSD_TSBC0_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "1.2.2.2",
+ "l3-interface-ipv4-prefix-length": 28,
+ "is-floating": false,
+ "neutron-network-id": "cae2ade2-9f44-40fa-b124-18b101ff9aa0",
+ "neutron-subnet-id": "1f954922-6e9c-4a64-9d78-62e869ba8c77"
+ }
+ ]
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_role1_port_0",
+ "selflink": "https://test.com:9696/v2.0/ports/0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "interface-id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "macaddr": "02:05:94:a2:f2:7e",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR-UNTR-Role1-PARNT_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_role1_81",
+ "interface-id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc",
+ "macaddr": "02:05:94:a2:f2:7e",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_UNTR_VSE_Role10_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "172.26.0.36",
+ "l3-interface-ipv4-prefix-length": 27,
+ "is-floating": false,
+ "neutron-network-id": "49bd2c8c-808d-4783-a1c5-5d9ae0c6a9fa",
+ "neutron-subnet-id": "8d073a94-b1b9-493a-8fc1-cf92abcba466"
+ }
+ ]
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_service1_port_0",
+ "selflink": "https://test.com:9696/v2.0/ports/27391d94-33af-474a-927d-d409249e8fd3",
+ "interface-id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "macaddr": "02:27:39:1d:94:33",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR-UNTR-CUS-PARNT_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l-interfaces": {
+ "l-interface": [
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_101",
+ "interface-id": "d54dfd09-75c6-4e04-b204-909455b8f933",
+ "macaddr": "02:27:39:1d:94:33",
+ "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_006",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_103",
+ "interface-id": "f7a998c0-8939-4b07-bf4a-0862e9c325e1",
+ "macaddr": "02:27:39:1d:94:33",
+ "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_008",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1_102",
+ "interface-id": "621c1fea-60b8-44ee-aede-c01b8b1aaa70",
+ "macaddr": "02:27:39:1d:94:33",
+ "network-name": "GRP-27529-T-IST-05E_int_SUB-INTERFACE_net_007",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "172.26.0.5",
+ "l3-interface-ipv4-prefix-length": 27,
+ "is-floating": false,
+ "neutron-network-id": "7acdc0c3-eff2-4ecb-8722-a3451711027c",
+ "neutron-subnet-id": "4c4cc70a-7f31-41a6-a50f-5390d80fd127"
+ }
+ ]
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_int_ha_port_0",
+ "selflink": "https://test.com:9696/v2.0/ports/00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "interface-id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "macaddr": "02:00:bb:84:07:65",
+ "network-name": "tsbc0005v_int_ha_net",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "172.26.1.27",
+ "l3-interface-ipv4-prefix-length": 26,
+ "is-floating": false,
+ "neutron-network-id": "de0a1ec5-8685-4de5-999c-a791bd48c9d8",
+ "neutron-subnet-id": "1151932c-935d-4cdc-b134-f58bebed9bf1"
+ }
+ ]
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_mgmt_port_0",
+ "selflink": "https://test.com:9696/v2.0/ports/8d93f63e-e972-48c7-ad98-b2122da47315",
+ "interface-id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "macaddr": "02:8d:93:f6:3e:e9",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_OAMP_NSD_TSBC0_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "1.8.2.2",
+ "l3-interface-ipv4-prefix-length": 28,
+ "is-floating": false,
+ "neutron-network-id": "cae2ade2-9f44-40fa-b124-18b101ff9aa0",
+ "neutron-subnet-id": "1f954922-6e9c-4a64-9d78-62e869ba8c77"
+ }
+ ]
+ },
+ {
+ "interface-name": "tsbc0005v_tsbc0005vm002_trusted_port",
+ "selflink": "https://test.com:9696/v2.0/ports/d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "interface-id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "macaddr": "02:d2:f5:1f:82:0e",
+ "network-name": "GRP-27529-T-IST-05E-dyh3b_TIPFR_TRST_VIF_TSBC0_net_1",
+ "is-port-mirrored": false,
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "1.6.2.1",
+ "l3-interface-ipv4-prefix-length": 28,
+ "is-floating": false,
+ "neutron-network-id": "4f35d575-a4f2-4020-8322-3eb138e7f258",
+ "neutron-subnet-id": "d476da9d-bf9b-49e1-aec9-fee99b863f30"
+ }
+ ]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork1.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork1.json
new file mode 100644
index 0000000000..5c23c4594a
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork1.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "e80bec21-4b4b-42b0-ae17-20e736b8a82a",
+ "security_groups": [],
+ "device_id": "d29f3151-592d-4011-9356-ad047794e236",
+ "name": "ssc_1_int_ha_port_0",
+ "admin_state_up": true,
+ "network_id": "b7ebec8e-d572-4dbf-ab4c-fc140b1e699a",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json
new file mode 100644
index 0000000000..725c896b8d
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetwork2.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "e80bec21-4b4b-42b0-ae17-20e736b8a82b",
+ "security_groups": [],
+ "device_id": "d29f3151-592d-4011-9356-ad047794e236",
+ "name": "ssc_1_mgmt_port_0",
+ "admin_state_up": true,
+ "network_id": "b7ebec8e-d572-4dbf-ab4c-fc140b1e699a",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "normal",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCHAPort0.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCHAPort0.json
new file mode 100644
index 0000000000..b775baeee4
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCHAPort0.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_int_ha_port_0",
+ "admin_state_up": true,
+ "network_id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort0.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort0.json
new file mode 100644
index 0000000000..f451d44351
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort0.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_mgmt_port_0",
+ "admin_state_up": true,
+ "network_id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort1.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort1.json
new file mode 100644
index 0000000000..bdb12be613
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCManagementPort1.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_mgmt_port_1",
+ "admin_state_up": true,
+ "network_id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCRole1Port0.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCRole1Port0.json
new file mode 100644
index 0000000000..e576ab7639
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCRole1Port0.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_role1_port_0",
+ "admin_state_up": true,
+ "network_id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTrustedPort.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTrustedPort.json
new file mode 100644
index 0000000000..b16f70611d
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTrustedPort.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_trusted_port",
+ "admin_state_up": true,
+ "network_id": "b7ebec8e-d572-4dbf-ab4c-fc140b1e699a",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTservice1Port0.json b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTservice1Port0.json
new file mode 100644
index 0000000000..2fbfc58902
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNeutronNetworkSSCTservice1Port0.json
@@ -0,0 +1,52 @@
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "auk51r07c002",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-11T19:12:50Z",
+ "device_owner": "compute:auk51b-kvm-az01",
+ "revision_number": 10,
+ "port_security_enabled": false,
+ "binding:profile": {
+ "public_vlans": [
+ ""
+ ],
+ "pf_pci_slot": "0000:5e:01.0",
+ "fabric_config": true,
+ "vlan_filter": [
+ "181"
+ ],
+ "private_vlans": [
+ "181"
+ ],
+ "physical_network": "sriovnet1",
+ "pci_slot": "0000:5e:05.6",
+ "pci_vendor_info": "8086:154c"
+ },
+ "fixed_ips": [
+ {
+ "subnet_id": "2849cc67-a616-4384-9ffc-eadfb1df2a44",
+ "ip_address": "1.2.1.3"
+ }
+ ],
+ "id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "security_groups": [],
+ "device_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "name": "tsbc0005v_tsbc0005vm002_service1_port_0",
+ "admin_state_up": true,
+ "network_id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "binding:vif_details": {
+ "port_filter": false,
+ "vlan": "181"
+ },
+ "binding:vnic_type": "direct",
+ "binding:vif_type": "hw_veb",
+ "mac_address": "fa:16:3e:0c:29:94",
+ "project_id": "872f331350c54e59991a8de2cbffb40c",
+ "created_at": "2019-02-11T19:11:39Z"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetNovaServer.json b/so-simulator/src/main/resources/openstack/gr_api/GetNovaServer.json
new file mode 100644
index 0000000000..622bf8e3ef
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetNovaServer.json
@@ -0,0 +1,75 @@
+{
+ "server": {
+ "OS-EXT-STS:task_state": null,
+ "addresses": {
+ },
+ "links": [
+ {
+ "href": "https://test.com/v2.1/872f331350c54e59991a8de2cbffb40c/servers/d29f3151-592d-4011-9356-ad047794e236",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com/872f331350c54e59991a8de2cbffb40c/servers/d29f3151-592d-4011-9356-ad047794e236",
+ "rel": "bookmark"
+ }
+ ],
+ "image": {
+ "id": "d46a5dfb-bf63-49db-b9eb-c7519bf46017",
+ "links": [
+ {
+ "href": "https://test.com/872f331350c54e59991a8de2cbffb40c/images/d46a5dfb-bf63-49db-b9eb-c7519bf46017",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "OS-EXT-STS:vm_state": "active",
+ "OS-EXT-SRV-ATTR:instance_name": "instance-00000183",
+ "OS-SRV-USG:launched_at": "2019-02-11T19:12:51.000000",
+ "flavor": {
+ "id": "10259b47-bf17-4343-b885-32a68b1c4ba8",
+ "links": [
+ {
+ "href": "https://test.com/872f331350c54e59991a8de2cbffb40c/flavors/10259b47-bf17-4343-b885-32a68b1c4ba8",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "id": "d29f3151-592d-4011-9356-ad047794e236",
+ "security_groups": [
+ {
+ "name": "zauk51bcgwy09_oam_security_group"
+ }
+ ],
+ "user_id": "3344345757302c88cf9f4ac7e9805c7073af90bce2e4c186ff1806fe867610b5",
+ "OS-DCF:diskConfig": "MANUAL",
+ "accessIPv4": "",
+ "accessIPv6": "",
+ "progress": 0,
+ "OS-EXT-STS:power_state": 1,
+ "OS-EXT-AZ:availability_zone": "auk51b-kvm-az01",
+ "metadata": {
+ "stack-root-id": "",
+ "vf_module_id": "26dd34cf-6b9b-485d-90e9-6101ff917516",
+ "vnf_id": "921662e3-eac6-446d-9573-ac377827c74f",
+ "workload_context": "Production",
+ "stack-name": "zauk51bcgwy01_base11",
+ "environment_context": "General_Revenue-Bearing",
+ "vf_module_name": "zauk51bcgwy01_base11",
+ "vnf_name": "zauk51bcgwy09",
+ "stack-root-name": "",
+ "stack-id": "0009693a-2fb1-4e91-80b8-70cc0a4e3f0f"
+ },
+ "status": "ACTIVE",
+ "updated": "2019-02-11T19:12:46Z",
+ "hostId": "50197c55fc934e7b3947e17db762f0839320f94983df774d84991ad2",
+ "OS-EXT-SRV-ATTR:host": "test",
+ "OS-SRV-USG:terminated_at": null,
+ "key_name": null,
+ "OS-EXT-SRV-ATTR:hypervisor_hostname": "test.com",
+ "name": "zauk51bfrwl09oam001",
+ "created": "2019-02-11T19:11:58Z",
+ "tenant_id": "872f331350c54e59991a8de2cbffb40c",
+ "os-extended-volumes:volumes_attached": [],
+ "config_drive": "True"
+ }
+}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetStackResources.json b/so-simulator/src/main/resources/openstack/gr_api/GetStackResources.json
new file mode 100644
index 0000000000..b50645b62f
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetStackResources.json
@@ -0,0 +1,206 @@
+{
+ "resources": [
+ {
+ "resource_name": "ssc_1_trusted_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_trusted_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_trusted_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_service1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_service1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_service1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_1_subint_service1_port_0_subinterfaces",
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_subint_role1_port_0_subinterfaces",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_role1_port_0_subinterfaces",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "ssc_1_subint_role1_port_0_subinterfaces",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "resource_type": "OS::Heat::ResourceGroup"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_role1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_role1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_role1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_1_subint_role1_port_0_subinterfaces",
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_int_ha_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_int_ha_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_int_ha_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_server_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_server_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_server_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "resource_type": "OS::Nova::Server"
+ },
+ {
+ "resource_name": "ssc_1_subint_service1_port_0_subinterfaces",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_service1_port_0_subinterfaces",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "ssc_1_subint_service1_port_0_subinterfaces",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "31d0647a-6043-49a4-81b6-ccab29380672",
+ "resource_type": "OS::Heat::ResourceGroup"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesKeyPairFailure.json b/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesKeyPairFailure.json
new file mode 100644
index 0000000000..650fb6b11d
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesKeyPairFailure.json
@@ -0,0 +1,230 @@
+{
+ "resources": [
+ {
+ "resource_name": "ssc_1_trusted_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_trusted_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_trusted_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_service1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_service1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_service1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_1_subint_service1_port_0_subinterfaces",
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_subint_role1_port_0_subinterfaces",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_role1_port_0_subinterfaces",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "ssc_1_subint_role1_port_0_subinterfaces",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "resource_type": "OS::Heat::ResourceGroup"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_role1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_role1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_role1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_1_subint_role1_port_0_subinterfaces",
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_int_ha_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_int_ha_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_int_ha_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_server_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_server_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_server_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "resource_type": "OS::Nova::Server"
+ },
+ {
+ "resource_name": "ssc_1_subint_service1_port_0_subinterfaces",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_service1_port_0_subinterfaces",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "ssc_1_subint_service1_port_0_subinterfaces",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "31d0647a-6043-49a4-81b6-ccab29380672",
+ "resource_type": "OS::Heat::ResourceGroup"
+ },
+ {
+ "resource_name": "ssc_1_subint_service1_port_0_subinterfaces",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_service1_port_0_subinterfaces",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "kepair_name",
+ "resource_status": "CREATE_FAILED",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": null,
+ "resource_type": "OS::Nova::KeyPair"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesMacro.json b/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesMacro.json
new file mode 100644
index 0000000000..ae317deab2
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/GetStackResourcesMacro.json
@@ -0,0 +1,157 @@
+{
+ "resources": [
+ {
+ "resource_name": "ssc_1_trusted_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_trusted_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_trusted_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "d2f51f82-0ec2-4581-bd1a-d2a82073e52b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_service1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_service1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_service1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_1_subint_service1_port_0_subinterfaces",
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "27391d94-33af-474a-927d-d409249e8fd3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "07f5b14c-147a-4d14-8c94-a9e94dbc097b",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_mgmt_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_mgmt_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "8d93f63e-e972-48c7-ad98-b2122da47315",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_role1_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_role1_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_role1_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_1_int_ha_port_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_int_ha_port_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_1_int_ha_port_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "00bb8407-650e-48b5-b919-33b88d6f8fe3",
+ "resource_type": "OS::Neutron::Port"
+ },
+ {
+ "resource_name": "ssc_server_1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_server_1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_server_1",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:15Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "92272b67-d23f-42ca-87fa-7b06a9ec81f3",
+ "resource_type": "OS::Nova::Server"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface0.json b/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface0.json
new file mode 100644
index 0000000000..98639d0b8b
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface0.json
@@ -0,0 +1,41 @@
+{
+ "stack": {
+ "parent": "447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "disable_rollback": true,
+ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "self"
+ }
+ ],
+ "stack_status_reason": "Stack CREATE completed successfully",
+ "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y",
+ "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1",
+ "stack_owner": "m08699",
+ "creation_time": "2019-01-23T19:34:56Z",
+ "capabilities": [],
+ "notification_topics": [],
+ "updated_time": null,
+ "timeout_mins": 120,
+ "stack_status": "CREATE_COMPLETE",
+ "parameters": {
+ "OS::project_id": "0422ffb57ba042c0800a29dc85ca70f8",
+ "port_interface": "0594a2f2-7ea4-42eb-abc2-48ea49677fca",
+ "OS::stack_id": "f711be16-2654-4a09-b89d-0511fda20e81",
+ "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y",
+ "vip_v6_address": "2001:1890:1001:4a32::3",
+ "network_id": "8be20e92-68d6-4aec-ae66-0fc0fc933546",
+ "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untruste_role1",
+ "counter": "0",
+ "mac_address": "02:05:94:a2:f2:7e",
+ "vip_address": "1.2.1.9",
+ "vlan_tag": "81",
+ "ip_address": "1.2.1.9",
+ "ip_v6_address": "2001:1890:1001:4a32::4"
+ },
+ "id": "f711be16-2654-4a09-b89d-0511fda20e81",
+ "outputs": [],
+ "template_description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface1Resources.json b/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface1Resources.json
new file mode 100644
index 0000000000..a8e27655d1
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Role1SubInterface1Resources.json
@@ -0,0 +1,70 @@
+{
+ "resources": [
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [
+ "ssc_subint_role1_vmi_0_v6_ip_0",
+ "ssc_subint_role1_vmi_0_ip_0"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc",
+ "resource_type": "OS::ContrailV2::VirtualMachineInterface"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_v6_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/SampleRequest.json b/so-simulator/src/main/resources/openstack/gr_api/SampleRequest.json
new file mode 100644
index 0000000000..27bf79e0de
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/SampleRequest.json
@@ -0,0 +1 @@
+{type: string, description: Unique name for this VF instance}f5_ssh_key: {type: string, description: SSH public key}f5_int_ha_net_prefix_v4: {type: string, description: IPv4 subnet prefixfor internal HA network} f5_int_ha_net_prefix_len_v4: type: number description: Prefix length of subnet associated withinternal HA network constraints: - range: {min: 0, max: 31} description: int_ha_net_plen must be between 0 and 31\nresources:f5_secgroup: type: OS::Neutron::SecurityGroup properties: description: Security Group for BIGIP networks name: str_replace: template: $VNF_NAME_f5_secgroup_0 params: $VNF_NAME: {get_param: vnf_name} rules: - {direction: egress, remote_ip_prefix: 0.0.0.0/0, protocol: tcp,ethertype: IPv4, port_range_max: 65535, port_range_min: 1} - {direction: egress, remote_ip_prefix: 0.0.0.0/0, protocol: udp,ethertype: IPv4, port_range_max: 65535, port_range_min: 1} - {direction: egress, remote_ip_prefix: 0.0.0.0/0, protocol: icmp,ethertype: IPv4} - {direction: egress, remote_ip_prefix: '::/0',protocol: icmp, ethertype: IPv6} - {direction: egress,remote_ip_prefix: '::/0', protocol: tcp, ethertype: IPv6, port_range_max: 65535, port_range_min: 1} - {direction: egress,remote_ip_prefix: '::/0', protocol: udp, ethertype: IPv6, port_range_max: 65535, port_range_min: 1} - {direction: ingress,remote_ip_prefix: 0.0.0.0/0, protocol: tcp, ethertype: IPv4, port_range_max: 65535, port_range_min: 1} - {direction: ingress,remote_ip_prefix: 0.0.0.0/0, protocol: udp, ethertype: IPv4, port_range_max: 65535, port_range_min: 1} - {direction: ingress,remote_ip_prefix: 0.0.0.0/0, protocol: icmp, ethertype: IPv4} -{direction: ingress, remote_ip_prefix: '::/0', protocol: icmp,ethertype: IPv6} - {direction: ingress, remote_ip_prefix: '::/0',protocol: tcp, ethertype: IPv6, port_range_max: 65535,port_range_min: 1} - {direction: ingress, remote_ip_prefix:'::/0', protocol: udp, ethertype: IPv6, port_range_max: 65535,port_range_min: 1} f5_keypair: type: OS::Nova::KeyPair properties: name: str_replace: template:$VNF_NAME_f5_key_pair_0 params: $VNF_NAME:{get_param: vnf_name} public_key: {get_param: f5_ssh_key} save_private_key: false f5_server_group: type:OS::Nova::ServerGroup properties: name: str_replace: template: $VNF_NAME_f5_server_group_0 params: $VNF_NAME: {get_param: vnf_name} policies:[anti-affinity] f5_internal_ha_ipam_net_0: type:OS::ContrailV2::NetworkIpam properties: name: str_replace: template: $VF_NAME_f5_int_ha_ipam_net_0 params: $VF_NAME: {get_param: vnf_name}f5_internal_ha_net_0: type: OS::ContrailV2::VirtualNetwork depends_on: [f5_internal_ha_ipam_net_0] properties: name: str_replace: template: $VF_NAME_f5_int_ha_net_0 params: $VF_NAME: {get_param: vnf_name} virtual_network_properties: {virtual_network_properties_rpf: enable} is_shared: false flood_unknown_unicast: true network_ipam_refs: - {get_resource: f5_internal_ha_ipam_net_0} network_ipam_refs_data: -network_ipam_refs_data_ipam_subnets: -network_ipam_refs_data_ipam_subnets_subnet: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: {get_param:f5_int_ha_net_prefix_v4} network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: {get_param:f5_int_ha_net_prefix_len_v4} network_ipam_refs_data_ipam_subnets_enable_dhcp: false\noutputs:f5_server_group: description: BIGIP F5 Server group value:{get_resource: f5_server_group} f5_keypair: description: SSHkeypair for deployment value: {get_resource: f5_keypair}f5_sec_groups: description: List of security groups to use for allnetwork interfaces value: {get_resource: f5_secgroup}f5_int_ha_net_id: description: HA internal network for deployment value: {get_resource:f5_internal_ha_net_0}\n","stack_name":"dummy_id","parameters":{"vnf_name":"SO-DEV-VNF-vSAMP12_14-1806HF1-Aug18-GR_API-2XXX-9002"},"timeout_mins":120,"environment":"parameters: f5_int_ha_net_prefix_len_v4: 24f5_int_ha_net_prefix_v4: \"172.26.0.0\" f5_ssh_key: vnf_name:\n","disable_rollback":true} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/StackResourcesRole1ResourceGroup.json b/so-simulator/src/main/resources/openstack/gr_api/StackResourcesRole1ResourceGroup.json
new file mode 100644
index 0000000000..0c68fd4524
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/StackResourcesRole1ResourceGroup.json
@@ -0,0 +1,29 @@
+{
+ "resources": [
+ {
+ "parent_resource": "ssc_1_subint_role1_port_0_subinterfaces",
+ "resource_name": "0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources/0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "0",
+ "resource_status_reason": "state changed",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status": "CREATE_COMPLETE",
+ "physical_resource_id": "f711be16-2654-4a09-b89d-0511fda20e81",
+ "resource_type": "vlan_subinterface_ssc_role1.yaml"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/StackResourcesservice1ResourceGroup.json b/so-simulator/src/main/resources/openstack/gr_api/StackResourcesservice1ResourceGroup.json
new file mode 100644
index 0000000000..ce929e6753
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/StackResourcesservice1ResourceGroup.json
@@ -0,0 +1,79 @@
+{
+ "resources": [
+ {
+ "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces",
+ "resource_name": "1",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/1",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "1",
+ "resource_status_reason": "state changed",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status": "CREATE_COMPLETE",
+ "physical_resource_id": "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
+ "resource_type": "vlan_subinterface_ssc_service1.yaml"
+ },
+ {
+ "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces",
+ "resource_name": "0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "0",
+ "resource_status_reason": "state changed",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status": "CREATE_COMPLETE",
+ "physical_resource_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "resource_type": "vlan_subinterface_ssc_service1.yaml"
+ },
+ {
+ "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces",
+ "resource_name": "2",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/2",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672",
+ "rel": "stack"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c",
+ "rel": "nested"
+ }
+ ],
+ "logical_resource_id": "2",
+ "resource_status_reason": "state changed",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status": "CREATE_COMPLETE",
+ "physical_resource_id": "bd0fc728-cbde-4301-a581-db56f494675c",
+ "resource_type": "vlan_subinterface_ssc_service1.yaml"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_Create.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_Create.json
new file mode 100644
index 0000000000..47d1063c5e
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_Create.json
@@ -0,0 +1,11 @@
+{
+ "stack": {
+ "id": "stackId",
+ "links": [
+ {
+ "href": "https://test.com/v1/e2a6af59d1cb43b2874e943bbbf8470a/stacks/zauk51bmcir02_base/20f2cad7-4626-476a-9279-4bd81ca62e4b",
+ "rel": "self"
+ }
+ ]
+ }
+}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_Created.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_Created.json
new file mode 100644
index 0000000000..6bbaf3e06e
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_Created.json
@@ -0,0 +1,17 @@
+{
+ "stack": {
+ "description": null,
+ "links": null,
+ "stack_status_reason": null,
+ "stack_name": "${stackName}",
+ "updated_time": null,
+ "creation_time": null,
+ "stack_status": "CREATE_COMPLETE",
+ "id": "stackId",
+ "files": null,
+ "outputs": null,
+ "parameters": {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_Deleted.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_Deleted.json
new file mode 100644
index 0000000000..ede10c99cc
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_Deleted.json
@@ -0,0 +1,17 @@
+{
+ "stack": {
+ "description": null,
+ "links": null,
+ "stack_status_reason": "Stack DELETE completed successfully",
+ "stack_name": "${stackName}",
+ "updated_time": null,
+ "creation_time": null,
+ "stack_status": "DELETE_COMPLETE",
+ "id": "stackId",
+ "files": null,
+ "outputs": null,
+ "parameters": {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_Failure.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_Failure.json
new file mode 100644
index 0000000000..12bdbef9f8
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_Failure.json
@@ -0,0 +1,17 @@
+{
+ "stack": {
+ "description": null,
+ "links": null,
+ "stack_status_reason": "${stack_failure_message}",
+ "stack_name": "${stackName}",
+ "updated_time": null,
+ "creation_time": null,
+ "stack_status": "CREATE_FAILED",
+ "id": "stackId",
+ "files": null,
+ "outputs": null,
+ "parameters": {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_In_Progress.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_In_Progress.json
new file mode 100644
index 0000000000..e17323e1ed
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_In_Progress.json
@@ -0,0 +1,17 @@
+{
+ "stack": {
+ "description": null,
+ "links": null,
+ "stack_status_reason": null,
+ "stack_name": "${stackName}",
+ "updated_time": null,
+ "creation_time": null,
+ "stack_status": "CREATE_IN_PROGRESS",
+ "id": "stackId",
+ "files": null,
+ "outputs": null,
+ "parameters": {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Stack_KeyPair_Failure.json b/so-simulator/src/main/resources/openstack/gr_api/Stack_KeyPair_Failure.json
new file mode 100644
index 0000000000..f75669d1a5
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Stack_KeyPair_Failure.json
@@ -0,0 +1,44 @@
+{
+ "stack": {
+ "capabilities": [],
+ "creation_time": "2019-04-22T19:36:00Z",
+ "description": "BroadWorks NFM Template with Data and OAMP Interfaces - Version 13DEC2017",
+ "disable_rollback": true,
+ "id": "stackId",
+ "links": [
+ ],
+ "notification_topics": [],
+ "outputs": [],
+ "parameters": {
+ "HostnameWithDomain": "test.com",
+ "OS::project_id": "efb9b00711a64eb087e3cca9767f7909",
+ "OS::stack_id": "8a2470c3-5fc0-479a-8849-5f38f5eeed35",
+ "OS::stack_name": "hst3bbfnm0011v_base",
+ "availability_zone_0": "hst3b-kvm-az01",
+ "bfnm_cinder_volume_id_0": "0659b195-1bf9-4def-8d15-fffee392131f",
+ "bfnm_cinder_volume_id_1": "c193ef62-128c-4bd5-9d7d-af7e91af36c0",
+ "bfnm_flavor_name": "nd.c4r8d0",
+ "bfnm_key_name": "hst3bbfnm0011vm001",
+ "bfnm_names": "hst3bbfnm0011vm001",
+ "bfnm_nsdnet_ips": "1.3.1.7",
+ "bfnm_nsdnet_net_security_group": "default",
+ "ifcfg-eth0_content_0": "DEVICE=\"eth0\" NEWLINE\nBOOTPROTO=static NEWLINE\nONBOOT=yes NEWLINE\nTYPE=\"Ethernet\" NEWLINE\nIPADDR=135.63.139.74 NEWLINE\nNETMASK=255.255.255.0 NEWLINE\nGATEWAY=135.63.139.65 NEWLINE\nIPV6INIT=no NEWLINE\nIPV6_AUTOCONF=no NEWLINE\nMTU=1450",
+ "mech_id": "m04137",
+ "nsdnet_net_id": "53f5c3f5-ae22-48b3-a476-c48d9fe46a75",
+ "ntp_servers": "server 135.190.235.222 iburst NEWLINE \nserver 135.191.235.222 iburst NEWLINE \nserver 135.193.235.222 iburst NEWLINE \noptions timeout:1 attempts:2",
+ "resolv_conf_content": "search test.com NEWLINE nameserver 135.190.235.222 NEWLINE nameserver 135.193.235.222 NEWLINE nameserver 135.191.235.222 NEWLINE options timeout:1 attempts:2",
+ "vf_module_id": "d117fdf9-bcba-4c92-b3da-af538615b63d",
+ "vnf_id": "8faf7e17-de35-4d9e-a731-1e463e94261a",
+ "vnf_name": "hst3bbfnm"
+ },
+ "parent": null,
+ "stack_name": "${stackName}",
+ "stack_owner": "m95682",
+ "stack_status": "CREATE_FAILED",
+ "stack_status_reason": "Resource CREATE failed: Conflict: resources.bfnm_my_keypair: Key pair 'hst3bbfnm0011vm001' already exists. (HTTP 409) (Request-ID: req-941b0af6-63ae-4d6a-afbc-90b728bacf82)",
+ "stack_user_project_id": "2399d381718342edaff3d7daae2f2003",
+ "template_description": "BroadWorks NFM Template with Data and OAMP Interfaces - Version 13DEC2017",
+ "timeout_mins": 120,
+ "updated_time": null
+ }
+}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/Sync_Stack_Failure.json b/so-simulator/src/main/resources/openstack/gr_api/Sync_Stack_Failure.json
new file mode 100644
index 0000000000..121da48a4a
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/Sync_Stack_Failure.json
@@ -0,0 +1,10 @@
+{
+ "explanation": "The resource could not be found.",
+ "code": 404,
+ "error": {
+ "message": "The Stack (Stability_Tools-27525-T-01-DPA2a_test_net_0) could not be found.",
+ "traceback": "Traceback (most recent call last):\n\n File \"/usr/lib/python2.7/dist-packages/heat/common/context.py\", line 300, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/usr/lib/python2.7/dist-packages/heat/engine/service.py\", line 422, in identify_stack\n raise exception.StackNotFound(stack_name=stack_name)\n\nStackNotFound: The Stack (Stability_Tools-27525-T-01-DPA2a_test_net_0) could not be found.\n",
+ "type": "StackNotFound"
+ },
+ "title": "Not Found"
+}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0.json
new file mode 100644
index 0000000000..776a731cf6
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0.json
@@ -0,0 +1,41 @@
+{
+ "stack": {
+ "parent": "31d0647a-6043-49a4-81b6-ccab29380672",
+ "disable_rollback": true,
+ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
+ "rel": "self"
+ }
+ ],
+ "stack_status_reason": "Stack CREATE completed successfully",
+ "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m",
+ "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1",
+ "stack_owner": "m08699",
+ "creation_time": "2019-01-23T19:34:57Z",
+ "capabilities": [],
+ "notification_topics": [],
+ "updated_time": null,
+ "timeout_mins": 120,
+ "stack_status": "CREATE_COMPLETE",
+ "parameters": {
+ "OS::project_id": "0422ffb57ba042c0800a29dc85ca70f8",
+ "port_interface": "27391d94-33af-474a-927d-d409249e8fd3",
+ "OS::stack_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m",
+ "vip_v6_address": "2001:1890:e005:1403::",
+ "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1",
+ "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1",
+ "counter": "0",
+ "mac_address": "02:27:39:1d:94:33",
+ "vip_address": "1.1.1.8",
+ "vlan_tag": "101,102,103",
+ "ip_address": "1.1.1.5",
+ "ip_v6_address": "2001:1890:e005:1402:8000::"
+ },
+ "id": "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
+ "outputs": [],
+ "template_description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0Resources.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0Resources.json
new file mode 100644
index 0000000000..f98854ae2b
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface0Resources.json
@@ -0,0 +1,72 @@
+
+
+{
+ "resources": [
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [
+ "ssc_subint_role1_vmi_0_v6_ip_0",
+ "ssc_subint_role1_vmi_0_ip_0"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "d54dfd09-75c6-4e04-b204-909455b8f933",
+ "resource_type": "OS::ContrailV2::VirtualMachineInterface"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_v6_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1.json
new file mode 100644
index 0000000000..995a9d9c49
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1.json
@@ -0,0 +1,43 @@
+
+
+{
+ "stack": {
+ "parent": "31d0647a-6043-49a4-81b6-ccab29380672",
+ "disable_rollback": true,
+ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "rel": "self"
+ }
+ ],
+ "stack_status_reason": "Stack CREATE completed successfully",
+ "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m",
+ "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1",
+ "stack_owner": "m08699",
+ "creation_time": "2019-01-23T19:34:57Z",
+ "capabilities": [],
+ "notification_topics": [],
+ "updated_time": null,
+ "timeout_mins": 120,
+ "stack_status": "CREATE_COMPLETE",
+ "parameters": {
+ "OS::project_id": "0422ffb57ba042c0800a29dc85ca70f8",
+ "port_interface": "27391d94-33af-474a-927d-d409249e8fd3",
+ "OS::stack_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m",
+ "vip_v6_address": "2001:1890:e005:1403::",
+ "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1",
+ "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1",
+ "counter": "1",
+ "mac_address": "02:27:39:1d:94:33",
+ "vip_address": "1.1.1.8",
+ "vlan_tag": "101,102,103",
+ "ip_address": "1.1.1.5",
+ "ip_v6_address": "2001:1890:e005:1402:8000::"
+ },
+ "id": "b7019dd0-2ee9-4447-bdef-ac25676b205a",
+ "outputs": [],
+ "template_description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1Resources.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1Resources.json
new file mode 100644
index 0000000000..59f9dadc12
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface1Resources.json
@@ -0,0 +1,72 @@
+
+
+{
+ "resources": [
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [
+ "ssc_subint_role1_vmi_0_v6_ip_0",
+ "ssc_subint_role1_vmi_0_ip_0"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "f7a998c0-8939-4b07-bf4a-0862e9c325e1",
+ "resource_type": "OS::ContrailV2::VirtualMachineInterface"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_v6_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2.json
new file mode 100644
index 0000000000..2f8c3f4528
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2.json
@@ -0,0 +1,41 @@
+{
+ "stack": {
+ "parent": "31d0647a-6043-49a4-81b6-ccab29380672",
+ "disable_rollback": true,
+ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbtsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675cc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c",
+ "rel": "self"
+ }
+ ],
+ "stack_status_reason": "Stack CREATE completed successfully",
+ "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv",
+ "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1",
+ "stack_owner": "m08699",
+ "creation_time": "2019-01-23T19:34:57Z",
+ "capabilities": [],
+ "notification_topics": [],
+ "updated_time": null,
+ "timeout_mins": 120,
+ "stack_status": "CREATE_COMPLETE",
+ "parameters": {
+ "OS::project_id": "0422ffb57ba042c0800a29dc85ca70f8",
+ "port_interface": "27391d94-33af-474a-927d-d409249e8fd3",
+ "OS::stack_id": "bd0fc728-cbde-4301-a581-db56f494675c",
+ "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv",
+ "vip_v6_address": "2001:1890:e005:1403::",
+ "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1",
+ "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1",
+ "counter": "2",
+ "mac_address": "02:27:39:1d:94:33",
+ "vip_address": "1.1.1.8",
+ "vlan_tag": "101,102,103",
+ "ip_address": "1.1.1.5",
+ "ip_v6_address": "2001:1890:e005:1402:8000::"
+ },
+ "id": "bd0fc728-cbde-4301-a581-db56f494675c",
+ "outputs": [],
+ "template_description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2Resources.json b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2Resources.json
new file mode 100644
index 0000000000..7b9d27dd07
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/service1SubInterface2Resources.json
@@ -0,0 +1,72 @@
+
+
+{
+ "resources": [
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [
+ "ssc_subint_role1_vmi_0_v6_ip_0",
+ "ssc_subint_role1_vmi_0_ip_0"
+ ],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "621c1fea-60b8-44ee-aede-c01b8b1aaa70",
+ "resource_type": "OS::ContrailV2::VirtualMachineInterface"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_v6_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_v6_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ },
+ {
+ "parent_resource": "0",
+ "resource_name": "ssc_subint_role1_vmi_0_ip_0",
+ "links": [
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_role1_vmi_0_ip_0",
+ "rel": "self"
+ },
+ {
+ "href": "https://test.com:8004/v1/0422ffb57ba042c0800a29dc85ca70f8/stacks/tsbc0005vm002ssc001-ssc_1_subint_role1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "ssc_subint_role1_vmi_0_ip_0",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-01-23T19:34:56Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506",
+ "resource_type": "OS::ContrailV2::InstanceIp"
+ }
+ ]
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/properties/aai-client.properties b/so-simulator/src/main/resources/properties/aai-client.properties
new file mode 100644
index 0000000000..9acf198888
--- /dev/null
+++ b/so-simulator/src/main/resources/properties/aai-client.properties
@@ -0,0 +1,3 @@
+aai.endpoint=http://localhost:8443
+system.name=SO-Simulator
+aai.auth=dGVzdDp0ZXN0dGVzdA== \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/HealthCheck.json b/so-simulator/src/main/resources/sdnc/HealthCheck.json
new file mode 100644
index 0000000000..730fba2649
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/HealthCheck.json
@@ -0,0 +1,7 @@
+{
+ "output": {
+ "ack-final-indicator": "Y",
+ "response-code": "200",
+ "response-message": "SDN-C is healthy"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/gr-api/AsyncRequest.xml b/so-simulator/src/main/resources/sdnc/gr-api/AsyncRequest.xml
new file mode 100644
index 0000000000..3bce5bc20d
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/gr-api/AsyncRequest.xml
@@ -0,0 +1,10 @@
+<input>
+ <service-information>
+ <service-type>useless-trash</service-type>
+ <service-instance-id>useless-trash</service-instance-id>
+ </service-information>
+ <svc-request-id>${responseCode}</svc-request-id>
+ <response-code>${responseCode}</response-code>
+ <response-message>${responseMessage}</response-message>
+ <ack-final-indicator>Y</ack-final-indicator>
+</input> \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/gr-api/Network_Assign_Success.json b/so-simulator/src/main/resources/sdnc/gr-api/Network_Assign_Success.json
new file mode 100644
index 0000000000..cd77c44c8e
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/gr-api/Network_Assign_Success.json
@@ -0,0 +1,20 @@
+{
+ "output": {
+ "response-code": "200",
+ "response-message": "Success in US746794 DG",
+ "ack-final-indicator": "Y",
+ "svc-request-id": "248783176134150",
+ "response-parameters": [
+ {
+ "sequence-number": 2,
+ "tag-value": "DEBES0MDABE0207URWX01",
+ "tag-name": "vnf-host-name"
+ },
+ {
+ "sequence-number": 1,
+ "tag-value": "911ce7a0-3852-4786-9f3b-41fa1adda63a",
+ "tag-name": "vnf-id"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/gr-api/SDNCFailure.json b/so-simulator/src/main/resources/sdnc/gr-api/SDNCFailure.json
new file mode 100644
index 0000000000..05b49b44df
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/gr-api/SDNCFailure.json
@@ -0,0 +1,8 @@
+{
+ "output": {
+ "svc-request-id": "service-request-id-902112066",
+ "response-code": "500",
+ "response-message": "Error updating selflink in generic-vnf in AAI",
+ "ack-final-indicator": "Y"
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/gr-api/SDNCSuccess.json b/so-simulator/src/main/resources/sdnc/gr-api/SDNCSuccess.json
new file mode 100644
index 0000000000..4c7360afab
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/gr-api/SDNCSuccess.json
@@ -0,0 +1,20 @@
+{
+ "output": {
+ "response-code": "${responseCode}",
+ "response-message": "${responseMessage}",
+ "ack-final-indicator": "${finalIndicator}",
+ "svc-request-id": "248783176134150",
+ "response-parameters": [
+ {
+ "sequence-number": 2,
+ "tag-value": "DEBES0MDABE0207URWX01",
+ "tag-name": "vnf-host-name"
+ },
+ {
+ "sequence-number": 1,
+ "tag-value": "911ce7a0-3852-4786-9f3b-41fa1adda63a",
+ "tag-name": "vnf-id"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/vnf-api/AssignResponseSuccess.xml b/so-simulator/src/main/resources/sdnc/vnf-api/AssignResponseSuccess.xml
new file mode 100644
index 0000000000..e43dfbff64
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/vnf-api/AssignResponseSuccess.xml
@@ -0,0 +1,13 @@
+ <output xmlns="com:att:sdnctl:vnf">
+ <vnf-information>
+ <vnf-id>123123123123</vnf-id>
+ </vnf-information>
+ <response-code>200</response-code>
+ <svc-request-id>123123123123</svc-request-id>
+ <ack-final-indicator>Y</ack-final-indicator>
+ <service-information>
+ <subscriber-name>dontcare</subscriber-name>
+ <service-instance-id>0</service-instance-id>
+ <service-type>SDN-MOBILITY</service-type>
+ </service-information>
+ </output> \ No newline at end of file
diff --git a/so-simulator/src/main/resources/sdnc/vnf-api/NetworkAssignResponse.xml b/so-simulator/src/main/resources/sdnc/vnf-api/NetworkAssignResponse.xml
new file mode 100644
index 0000000000..5b2d14275d
--- /dev/null
+++ b/so-simulator/src/main/resources/sdnc/vnf-api/NetworkAssignResponse.xml
@@ -0,0 +1,14 @@
+<output xmlns="org:onap:sdnctl:vnf">
+ <svc-request-id>${requestId}</svc-request-id>
+ <service-information>
+ <service-id>${serviceId}</service-id>
+ <service-type>${serviceType}</service-type>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
+ <subscriber-name>${subscriberName}</subscriber-name>
+ </service-information>
+ <response-code>200</response-code>
+ <network-information>
+ <network-id>${networkId}</network-id>
+ </network-information>
+ <ack-final-indicator>Y</ack-final-indicator>
+</output> \ No newline at end of file
diff --git a/so-simulator/src/test/resources/citrus-context.xml b/so-simulator/src/test/resources/citrus-context.xml
new file mode 100644
index 0000000000..f491dbcb7e
--- /dev/null
+++ b/so-simulator/src/test/resources/citrus-context.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:citrus="http://www.citrusframework.org/schema/config"
+ xmlns:citrus-http="http://www.citrusframework.org/schema/http/config"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+
+ http://www.citrusframework.org/schema/http/config http://www.citrusframework.org/schema/http/config/citrus-http-config.xsd
+ http://www.citrusframework.org/schema/config http://www.citrusframework.org/schema/config/citrus-config.xsd">
+
+ <citrus:schema-repository id="schemaRepository">
+ <citrus:locations>
+ <citrus:location path="classpath:xsd/HelloService.xsd"/>
+ </citrus:locations>
+ </citrus:schema-repository>
+
+ <!-- Test Http REST client -->
+ <citrus-http:client
+ id="simulatorClient"
+ request-url="http://localhost:8080/services/rest/simulator"
+ timeout="5000"/>
+
+</beans> \ No newline at end of file
diff --git a/so-simulator/src/test/resources/log4j.properties b/so-simulator/src/test/resources/log4j.properties
new file mode 100644
index 0000000000..bbf07d9f49
--- /dev/null
+++ b/so-simulator/src/test/resources/log4j.properties
@@ -0,0 +1,12 @@
+#
+# The logging properties used
+#
+log4j.rootLogger=INFO, out
+
+log4j.logger.com.consol.citrus=DEBUG
+log4j.logger.org.springframework=INFO
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5.5p %20.20c{2}| %m%n
diff --git a/version.properties b/version.properties
index 99af34261b..9eb3b93ac9 100644
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=1
minor=5
-patch=0
+patch=3
base_version=${major}.${minor}.${patch}
diff --git a/vnfm-simulator/README.md b/vnfm-simulator/README.md
deleted file mode 100644
index f03fc12c17..0000000000
--- a/vnfm-simulator/README.md
+++ /dev/null
@@ -1 +0,0 @@
-check
diff --git a/vnfm-simulator/packages/docker/pom.xml b/vnfm-simulator/packages/docker/pom.xml
deleted file mode 100644
index 5d67d57521..0000000000
--- a/vnfm-simulator/packages/docker/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<!-- ============LICENSE_START=======================================================
- Copyright (C) 2019 Nordix Foundation. ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. SPDX-License-Identifier:
- Apache-2.0 ============LICENSE_END========================================================= -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.onap.svnfm</groupId>
- <artifactId>packages</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <packaging>pom</packaging>
- <artifactId>docker</artifactId>
- <name>Docker Images</name>
- <description>Docker Images</description>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <svnfm.project.version>${project.version}</svnfm.project.version>
- <docker.skip>false</docker.skip>
- <docker.skip.build>false</docker.skip.build>
- <docker.skip.push>false</docker.skip.push>
- <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
- <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
- </properties>
-
- <build>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <plugins>
- <plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>
- println 'Project version: ' +
- project.properties['svnfm.project.version'];
- def versionArray;
- if
- (
- project.properties['svnfm.project.version'] != null ) {
- versionArray =
- project.properties['svnfm.project.version'].split('-');
- }
-
- if (
- project.properties['svnfm.project.version'].endsWith("-SNAPSHOT")
- )
- {
- project.properties['project.docker.latesttag.version']=versionArray[0]
- + "-SNAPSHOT-latest";
- } else {
- project.properties['project.docker.latesttag.version']=versionArray[0]
- + "-STAGING-latest";
- }
-
- println 'New tag for docker: ' +
- project.properties['project.docker.latesttag.version'];
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.19.1</version>
-
- <configuration>
- <verbose>true</verbose>
- <apiVersion>1.23</apiVersion>
- <pullRegistry>${docker.pull.registry}</pullRegistry>
- <pushRegistry>${docker.push.registry}</pushRegistry>
-
- <images>
- <image>
- <name>onap/svnfm/simulator</name>
- <build>
- <cleanup>try</cleanup>
- <dockerFile>Dockerfile</dockerFile>
- <tags>
- <tag>${project.version}</tag>
- <tag>${project.version}-${maven.build.timestamp}</tag>
- <tag>${project.docker.latesttag.version}</tag>
- </tags>
- <assembly>
- <inline>
- <dependencySets>
- <dependencySet>
- <includes>
- <include>org.onap.svnfm:simulator</include>
- </includes>
- <outputFileNameMapping>app.jar</outputFileNameMapping>
- </dependencySet>
- </dependencySets>
- </inline>
- </assembly>
- </build>
- </image>
- </images>
- </configuration>
-
- <executions>
- <execution>
- <id>clean-images</id>
- <phase>pre-clean</phase>
- <goals>
- <goal>remove</goal>
- </goals>
- <configuration>
- <removeAll>true</removeAll>
- </configuration>
- </execution>
-
- <execution>
- <id>generate-images</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
-
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
- <goals>
- <goal>build</goal>
- <goal>push</goal>
- </goals>
- <configuration>
- <image>onap/svnfm/simulator</image>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/vnfm-simulator/packages/docker/src/main/docker/Dockerfile b/vnfm-simulator/packages/docker/src/main/docker/Dockerfile
deleted file mode 100644
index 2ccc8035f3..0000000000
--- a/vnfm-simulator/packages/docker/src/main/docker/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-FROM openjdk:8-jdk-alpine
-
-ARG http_proxy
-ENV HTTP_PROXY=$http_proxy
-ENV http_proxy=$HTTP_PROXY
-ARG https_proxy
-ENV HTTPS_PROXY=$https_proxy
-ENV https_proxy=$HTTPS_PROXY
-
-RUN apk add --no-cache --update busybox-extras bash zip unzip curl wget openssh maven openjdk8 jq httpie py-pip
-
-RUN mkdir /app && mkdir /app/config && mkdir /app/certificates && mkdir /app/logs && mkdir /app/ca-certificates
-
-COPY maven/app.jar /app
-#COPY configs/logging/logback-spring.xml /app
-COPY start-app.sh /app
-#COPY ca-certificates/onap-ca.crt /app/ca-certificates/onap-ca.crt
-
-RUN chown -R svnfm:svnfm /app && chmod 700 /app/*.sh
-
-# Springboot configuration (required)
-VOLUME /app/config
-
-# Root certificates (optional)
-VOLUME /app/ca-certificates
-
-WORKDIR /app
-CMD ["/app/start-app.sh"] \ No newline at end of file
diff --git a/vnfm-simulator/packages/docker/src/main/docker/start-app.sh b/vnfm-simulator/packages/docker/src/main/docker/start-app.sh
deleted file mode 100644
index 36657f2ddc..0000000000
--- a/vnfm-simulator/packages/docker/src/main/docker/start-app.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/
-SVNFM_HOME=/opt/app/svnfm
-
-if [ "$#" -eq 1 ]; then
- CONFIG_FILE=$1
-else
- CONFIG_FILE=${CONFIG_FILE}
-fi
-
-if [ -z "$CONFIG_FILE" ]
- then
- CONFIG_FILE="/etc/defaultConfig.json"
-fi
-
-echo "SVNFM Config File path: $CONFIG_FILE"
-
-$JAVA_HOME/bin/java -cp "$SVNFM_HOME/etc:$SVNFM_HOME/lib/*"
-#-Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE"
diff --git a/vnfm-simulator/packages/pom.xml b/vnfm-simulator/packages/pom.xml
deleted file mode 100644
index a5ca8b2816..0000000000
--- a/vnfm-simulator/packages/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<!-- ============LICENSE_START=======================================================
- Copyright (C) 2019 Nordix Foundation. ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. SPDX-License-Identifier:
- Apache-2.0 ============LICENSE_END========================================================= -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.svnfm</groupId>
- <artifactId>simulator</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>packages</artifactId>
- <packaging>pom</packaging>
- <name>SVNFM Simulator Packages</name>
-
-
- <profiles>
- <!-- DO NOT CHANGE THE *ORDER* IN WHICH THESE PROFILES ARE DEFINED! -->
-
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- </profile>
-
- <!-- Those profile are exclusive, choose docker or with-integration-tests -->
- <profile>
- <id>docker</id>
- <modules>
- <module>docker</module>
- </modules>
- <properties>
- <!-- For this profile we probably don't want to skip the docker push
- (if deploy goal is specified) -->
- <docker.skip.push>false</docker.skip.push>
- </properties>
- </profile>
- </profiles>
-</project> \ No newline at end of file
diff --git a/vnfm-simulator/pom.xml b/vnfm-simulator/pom.xml
deleted file mode 100644
index 2f9f0cde28..0000000000
--- a/vnfm-simulator/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so</groupId>
- <artifactId>so</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.onap.so.vnfm</groupId>
- <artifactId>vnfm-simulator</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
-
- <properties>
- <springboot.version>2.0.5.RELEASE</springboot.version>
- <version.java.compiler>1.8</version.java.compiler>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${version.java.compiler}</source>
- <target>${version.java.compiler}</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <modules>
- <module>vnfm-api</module>
- <module>vnfm-service</module>
- </modules>
-</project> \ No newline at end of file
diff --git a/vnfm-simulator/vnfm-api/pom.xml b/vnfm-simulator/vnfm-api/pom.xml
deleted file mode 100644
index ee5ef03964..0000000000
--- a/vnfm-simulator/vnfm-api/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so.vnfm</groupId>
- <artifactId>vnfm-simulator</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <artifactId>vnfm-api</artifactId>
- <name>${project.artifactId}</name>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- <gson-fire-version>1.8.2</gson-fire-version>
- <retrofit-version>2.3.0</retrofit-version>
- <threetenbp-version>1.3.5</threetenbp-version>
- <rxjava-version>2.0.0-RC1</rxjava-version>
- <oltu-version>1.0.1</oltu-version>
- <swagger-core-version>1.5.15</swagger-core-version>
- <gson-version>2.8.5</gson-version>
- </properties>
- <description>VNFM Simulator adapter API</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-codegen-maven-plugin</artifactId>
- <version>2.3.1</version>
- <executions>
- <execution>
- <id>vnfmsimulator</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- <configuration>
- <inputSpec>${basedir}/src/main/resources/vnfm-sim-swagger.yaml</inputSpec>
- <language>java</language>
- <library>retrofit2</library>
- <output>${project.build.directory}/generated-sources/vnfmsimulator</output>
- <apiPackage>org.onap.vnfm.v1.api</apiPackage>
- <modelPackage>org.onap.vnfm.v1.model</modelPackage>
- <configOptions>
- <jackson>true</jackson>
- <sourceFolder>src/gen/java/main</sourceFolder>
- <withXml>true</withXml>
- <useRxJava2>true</useRxJava2>
- </configOptions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-annotations</artifactId>
- <version>${swagger-core-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-gson</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>retrofit</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-scalars</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.oltu.oauth2</groupId>
- <artifactId>org.apache.oltu.oauth2.client</artifactId>
- <version>${oltu-version}</version>
- </dependency>
- <dependency>
- <groupId>io.gsonfire</groupId>
- <artifactId>gson-fire</artifactId>
- <version>${gson-fire-version}</version>
- </dependency>
- <dependency>
- <groupId>org.threeten</groupId>
- <artifactId>threetenbp</artifactId>
- <version>${threetenbp-version}</version>
- </dependency>
- <dependency>
- <groupId>io.reactivex.rxjava2</groupId>
- <artifactId>rxjava</artifactId>
- <version>${rxjava-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>adapter-rxjava2</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson-version}</version>
- </dependency>
- </dependencies>
-</project> \ No newline at end of file
diff --git a/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.json b/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.json
deleted file mode 100644
index 2bc25a2d5b..0000000000
--- a/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.json
+++ /dev/null
@@ -1,8143 +0,0 @@
-{
- "swagger": "2.0",
- "info": {
- "version": "1.1.1",
- "title": "SOL003 - VNF Lifecycle Management interface",
- "description": "SOL003 - VNF Lifecycle Management interface definition\n\nIMPORTANT: Please note that this file might be not aligned to the current version of the ETSI Group Specification it refers to. In case of discrepancies the published ETSI Group Specification takes precedence.\n\nIn clause 4.3.2 of ETSI GS NFV-SOL 003 v2.4.1, an attribute-based filtering mechanism is defined. This mechanism is currently not included in the corresponding OpenAPI design for this GS version. Changes to the attribute-based filtering mechanism are being considered in v2.5.1 of this GS for inclusion in the corresponding future ETSI NFV OpenAPI design.\nPlease report bugs to https://forge.etsi.org/bugzilla/buglist.cgi?component=Nfv-Openapis&list_id=61&product=NFV&resolution=\n",
- "license": {
- "name": "ETSI Forge copyright notice",
- "url": "https://forge.etsi.org/etsi-forge-copyright-notice.txt"
- }
- },
- "externalDocs": {
- "description": "ETSI GS NFV-SOL 003 V2.4.1",
- "url": "http://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.04.01_60/gs_NFV-SOL003v020401p.pdf"
- },
- "basePath": "/vnflcm/v1",
- "schemes": ["https"],
- "consumes": ["application/json"],
- "produces": ["application/json"],
- "paths": {
- "/vnf_instances": {
- "post": {
- "description": "Create VNF Identifier\n\nThe POST method creates a new VNF instance resource.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "createVnfRequest",
- "description": "The VNF creation parameters",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": ["vnfdId"],
- "properties": {
- "vnfdId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfInstanceName": {
- "description": "Human-readable name of the VNF instance to be created.\n",
- "type": "string"
- },
- "vnfInstanceDescription": {
- "description": "Human-readable description of the VNF instance to be created.\n",
- "type": "string"
- }
- }
- }
- }, {
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }, {
- "name": "Content-Type",
- "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "201": {
- "description": "A VNF Instance identifier was created successfully",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "Location": {
- "description": "The resource URI of the created VNF instance",
- "type": "string",
- "format": "url"
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfdId", "vnfProvider", "vnfProductName", "vnfSoftwareVersion", "vnfdVersion", "vnfPkgId", "instantiationState"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfInstanceName": {
- "description": "Name of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfInstanceDescription": {
- "description": "Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfdId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfProvider": {
- "description": "Provider of the VNF and the VNFD. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfProductName": {
- "description": "Name to identify the VNF Product. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfSoftwareVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfdVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfPkgId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfConfigurableProperties": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "vimConnectionInfo": {
- "description": "Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.\n",
- "type": "array",
- "items": {
- "description": "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
- "type": "object",
- "required": ["id", "vimType"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimType": {
- "description": "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n",
- "type": "string"
- },
- "interfaceInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "accessInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extra": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "instantiationState": {
- "description": "The instantiation state of the VNF.\n",
- "type": "string",
- "enum": ["NOT_INSTANTIATED", "INSTANTIATED"]
- },
- "instantiatedVnfInfo": {
- "description": "Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.\n",
- "type": "object",
- "required": ["flavourId", "vnfState"],
- "properties": {
- "flavourId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfState": {
- "type": "string",
- "enum": ["STARTED", "STOPPED"]
- },
- "scaleStatus": {
- "description": "Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how \"big\" the VNF has been scaled w.r.t. that aspect.\n",
- "type": "array",
- "items": {
- "required": ["aspectId", "scaleLevel"],
- "type": "object",
- "properties": {
- "aspectId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "scaleLevel": {
- "description": "Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.\n",
- "type": "integer"
- }
- }
- }
- },
- "extCpInfo": {
- "description": "Information about the external CPs exposed by the VNF instance.\n",
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "extLinkPortId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "extVirtualLinkInfo": {
- "description": "Information about the external VLs the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "extLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.\n",
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "extManagedVirtualLinkInfo": {
- "description": "External virtual links the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "vnfLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "monitoringParameters": {
- "description": "Active monitoring parameters.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "value", "timeStamp"],
- "properties": {
- "id": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "name": {
- "description": "Human readable name of the monitoring parameter, as defined in the VNFD.\n",
- "type": "string"
- },
- "value": {
- "description": "Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the \"value\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.\n",
- "type": "object"
- },
- "timeStamp": {
- "description": "Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.\n",
- "type": "string"
- }
- }
- }
- },
- "localizationLanguage": {
- "description": "Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.\n",
- "type": "string"
- },
- "vnfcResourceInfo": {
- "description": "Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vduId", "computeResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vduId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "computeResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "storageResourceIds": {
- "description": "References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfcCpInfo": {
- "description": "CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfExtCpId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfLinkPortId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualLinkResourceInfo": {
- "description": "Information about the virtualised network resources used by the VLs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId", "networkResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfLinkPorts": {
- "description": "Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualStorageResourceInfo": {
- "description": "Information on the virtualised storage resource(s) used as storage for the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.\n",
- "type": "object",
- "required": ["id", "virtualStorageDescId", "storageResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "virtualStorageDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "storageResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extensions": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "indicators": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "instantiate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "terminate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scale": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scaleToLevel": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeFlavour": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "heal": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "operate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeExtConn": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nAnother request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "416": {
- "description": "Requested Range Not Satisfiable\nThis code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "422": {
- "description": "Unprocessable Entity\nIf the payload body of a request contains syntactically correct data (e.g. well-formed JSON) but the data cannot be processed (e.g. because it fails validation against a schema), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem. NOTE 2: This error response code is only applicable for methods that have a request body.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/vnf_instances/{vnfInstanceId}": {
- "parameters": [{
- "name": "vnfInstanceId",
- "description": "Identifier of the VNF instance. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the \"id\" attribute in the payload body of that response.\n",
- "in": "path",
- "type": "string",
- "required": true
- }
- ],
- "get": {
- "description": "Query VNF\n\nThe GET method retrieves information about a VNF instance by reading an individual VNF instance resource.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }, {
- "name": "Content-Type",
- "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "OK\nInformation about zero or more VNF instances was queried successfully. The response body shall contain representations of zero or more VNF instances.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfdId", "vnfProvider", "vnfProductName", "vnfSoftwareVersion", "vnfdVersion", "vnfPkgId", "instantiationState"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfInstanceName": {
- "description": "Name of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfInstanceDescription": {
- "description": "Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfdId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfProvider": {
- "description": "Provider of the VNF and the VNFD. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfProductName": {
- "description": "Name to identify the VNF Product. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfSoftwareVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfdVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfPkgId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfConfigurableProperties": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "vimConnectionInfo": {
- "description": "Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.\n",
- "type": "array",
- "items": {
- "description": "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
- "type": "object",
- "required": ["id", "vimType"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimType": {
- "description": "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n",
- "type": "string"
- },
- "interfaceInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "accessInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extra": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "instantiationState": {
- "description": "The instantiation state of the VNF.\n",
- "type": "string",
- "enum": ["NOT_INSTANTIATED", "INSTANTIATED"]
- },
- "instantiatedVnfInfo": {
- "description": "Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.\n",
- "type": "object",
- "required": ["flavourId", "vnfState"],
- "properties": {
- "flavourId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfState": {
- "type": "string",
- "enum": ["STARTED", "STOPPED"]
- },
- "scaleStatus": {
- "description": "Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how \"big\" the VNF has been scaled w.r.t. that aspect.\n",
- "type": "array",
- "items": {
- "required": ["aspectId", "scaleLevel"],
- "type": "object",
- "properties": {
- "aspectId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "scaleLevel": {
- "description": "Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.\n",
- "type": "integer"
- }
- }
- }
- },
- "extCpInfo": {
- "description": "Information about the external CPs exposed by the VNF instance.\n",
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "extLinkPortId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "extVirtualLinkInfo": {
- "description": "Information about the external VLs the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "extLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.\n",
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "extManagedVirtualLinkInfo": {
- "description": "External virtual links the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "vnfLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "monitoringParameters": {
- "description": "Active monitoring parameters.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "value", "timeStamp"],
- "properties": {
- "id": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "name": {
- "description": "Human readable name of the monitoring parameter, as defined in the VNFD.\n",
- "type": "string"
- },
- "value": {
- "description": "Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the \"value\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.\n",
- "type": "object"
- },
- "timeStamp": {
- "description": "Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.\n",
- "type": "string"
- }
- }
- }
- },
- "localizationLanguage": {
- "description": "Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.\n",
- "type": "string"
- },
- "vnfcResourceInfo": {
- "description": "Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vduId", "computeResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vduId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "computeResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "storageResourceIds": {
- "description": "References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfcCpInfo": {
- "description": "CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfExtCpId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfLinkPortId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualLinkResourceInfo": {
- "description": "Information about the virtualised network resources used by the VLs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId", "networkResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfLinkPorts": {
- "description": "Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualStorageResourceInfo": {
- "description": "Information on the virtualised storage resource(s) used as storage for the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.\n",
- "type": "object",
- "required": ["id", "virtualStorageDescId", "storageResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "virtualStorageDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "storageResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extensions": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "indicators": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "instantiate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "terminate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scale": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scaleToLevel": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeFlavour": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "heal": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "operate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeExtConn": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nAnother request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "416": {
- "description": "Requested Range Not Satisfiable\nThis code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- },
- "delete": {
- "description": "Delete VNF Identifier\n\nThis method deletes an individual VNF instance resource.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content\nThe VNF instance resource and the associated VNF identifier were deleted successfully. The response body shall be empty.\n",
- "headers": {
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- }
- },
- "400": {
- "description": "Bad Request\nIt fhe request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem. If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided. If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nThe operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute should convey more information about the error.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "412": {
- "description": "Precondition Failed\nA precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity. The response body should contain a ProblemDetails structure, in which the \"detail\" attribute should convey more information about the error.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/vnf_instances/{vnfInstanceId}/instantiate": {
- "parameters": [{
- "name": "vnfInstanceId",
- "description": "Identifier of the VNF instance. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the \"id\" attribute in the payload body of that response.\n",
- "in": "path",
- "type": "string",
- "required": true
- }
- ],
- "post": {
- "description": "Instantiate VNF\n\nThe POST method instantiates a VNF instance.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "InstantiateVnfRequest",
- "description": "Parameters for the VNF instantiation.",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": ["flavourId"],
- "properties": {
- "flavourId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "extVirtualLinks": {
- "description": "Information about external VLs to connect the VNF to.\n",
- "type": "array",
- "items": {
- "description": "This type represents an external VL.\n",
- "type": "object",
- "required": ["id", "resourceId", "extCps"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "extCps": {
- "description": "External CPs of the VNF to be connected to this external VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents configuration information for external CPs created from a CPD.\n",
- "type": "object",
- "required": ["cpdId"],
- "properties": {
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "cpConfig": {
- "description": "List of instance data that need to be configured on the CP instances created from the respective CPD.\n",
- "type": "array",
- "items": {
- "description": "This type represents an externally provided link port or network address information per instance of an external connection point. In case a link port is provided, the VNFM shall use that link port when connecting the external CP to the external VL. In a link port is not provided, the VNFM shall create a link port on the external VL, and use that link port to connect the external CP to the external VL.\n",
- "type": "object",
- "properties": {
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "linkPortId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "cpProtocolData": {
- "description": "Parameters for configuring the network protocols on the link port that connects the CP to a VL. The following conditions apply to the attributes \"linkPortId\" and \"cpProtocolData\": * The \"linkPortId\" and \"cpProtocolData\" attributes shall both be absent for the deletion of an existing external CP instance\n addressed by cpInstanceId. \n* At least one of these attributes shall be present for a to-be-created external CP instance or an existing external\n CP instance.\n* If the \"linkPortId\" attribute is absent, the VNFM shall create a link port.\n* If the \"cpProtocolData\" attribute is absent, the \"linkPortId\" attribute shall be provided referencing a pre-created link port,\n and the VNFM can use means outside the scope of the present\n document to obtain the pre-configured address information for the\n connection point from the resource representing the link port.\n* If both \"cpProtocolData\" and \"linkportId\" are provided, the API consumer shall ensure that the cpProtocolData can be used with the\n pre-created link port referenced by \"linkPortId\".\n",
- "type": "array",
- "items": {
- "description": "This type represents network protocol data.\n",
- "type": "object",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "Identifier of layer(s) and protocol(s). This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents network address data for IP over Ethernet.\n",
- "type": "object",
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "List of IP addresses to assign to the CP instance. Each entry represents IP address data for fixed or dynamic IP address assignment per subnet. If this attribute is not present, no IP address shall be assigned.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "fixedAddresses": {
- "description": "Fixed addresses to assign (from the subnet defined by \"subnetId\" if provided). Exactly one of \"fixedAddresses\", \"numDynamicAddresses\" or \"ipAddressRange\" shall be present.\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "numDynamicAddresses": {
- "description": "Number of dynamic addresses to assign (from the subnet defined by \"subnetId\" if provided). Exactly one of \"fixedAddresses\", \"numDynamicAddresses\" or \"ipAddressRange\" shall be present.\n",
- "type": "integer"
- },
- "addressRange": {
- "description": "An IP address range to be used, e.g. in case of egress connections. In case this attribute is present, IP addresses from the range will be used.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "extLinkPorts": {
- "description": "Externally provided link ports to be used to connect external connection points to this external VL. If this attribute is not present, the VNFM shall create the link ports on the external VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents an externally provided link port to be used to connect an external connection point to an external VL.\n",
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vimConnectionInfo": {
- "description": "Information about VIM connections to be used for managing the resources for the VNF instance, or refer to external / externally-managed virtual links. This attribute shall only be supported and may be present if VNF-related resource management in direct mode is applicable.\n",
- "type": "array",
- "items": {
- "description": "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
- "type": "object",
- "required": ["id", "vimType"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimType": {
- "description": "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n",
- "type": "string"
- },
- "interfaceInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "accessInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "additionalParams": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- }, {
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }, {
- "name": "Content-Type",
- "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "202": {
- "description": "Accepted\nThe request was accepted for processing, but the processing has not been completed. The response body shall be empty. The HTTP response shall include a \"Location\" HTTP header that contains the URI of the newly-created \"VNF LCM operation occurrence\" resource corresponding to the operation.\n",
- "headers": {
- "Location": {
- "description": "The resource URI of the created VNF instance",
- "type": "string",
- "format": "url"
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nThe operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute should convey more information about the error.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "416": {
- "description": "Requested Range Not Satisfiable\nThis code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/vnf_instances/{vnfInstanceId}/terminate": {
- "parameters": [{
- "name": "vnfInstanceId",
- "description": "The identifier of the VNF instance to be terminated. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the \"id\" attribute in the payload body of that response.\n",
- "in": "path",
- "type": "string",
- "required": true
- }
- ],
- "post": {
- "description": "Terminate VNF\n\nThe POST method terminates a VNF instance.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "TerminateVnfRequest",
- "description": "Parameters for the VNF termination.",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": ["terminationType"],
- "properties": {
- "terminationType": {
- "description": "Indicates whether forceful or graceful termination is requested. VNFM Adapter will only support FORCEFUL in Dublin.\n",
- "type": "string",
- "enum": ["FORCEFUL", "GRACEFUL"]
- }
- }
- }
- }, {
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }, {
- "name": "Content-Type",
- "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "202": {
- "description": "Accepted\nThe request was accepted for processing, but the processing has not been completed. On success, the HTTP response shall include a \"Location\" HTTP header that contains the URI of the newly-created \"VNF LCM operation occurrence\" resource corresponding to the operation.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "Location": {
- "description": "The resource URI of the created VNF instance",
- "type": "string",
- "format": "url"
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfdId", "vnfProvider", "vnfProductName", "vnfSoftwareVersion", "vnfdVersion", "vnfPkgId", "instantiationState"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfInstanceName": {
- "description": "Name of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfInstanceDescription": {
- "description": "Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.\n",
- "type": "string"
- },
- "vnfdId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfProvider": {
- "description": "Provider of the VNF and the VNFD. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfProductName": {
- "description": "Name to identify the VNF Product. The value is copied from the VNFD.\n",
- "type": "string"
- },
- "vnfSoftwareVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfdVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfPkgId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfConfigurableProperties": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "vimConnectionInfo": {
- "description": "Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.\n",
- "type": "array",
- "items": {
- "description": "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
- "type": "object",
- "required": ["id", "vimType"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimType": {
- "description": "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n",
- "type": "string"
- },
- "interfaceInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "accessInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extra": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "instantiationState": {
- "description": "The instantiation state of the VNF.\n",
- "type": "string",
- "enum": ["NOT_INSTANTIATED", "INSTANTIATED"]
- },
- "instantiatedVnfInfo": {
- "description": "Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.\n",
- "type": "object",
- "required": ["flavourId", "vnfState"],
- "properties": {
- "flavourId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfState": {
- "type": "string",
- "enum": ["STARTED", "STOPPED"]
- },
- "scaleStatus": {
- "description": "Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how \"big\" the VNF has been scaled w.r.t. that aspect.\n",
- "type": "array",
- "items": {
- "required": ["aspectId", "scaleLevel"],
- "type": "object",
- "properties": {
- "aspectId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "scaleLevel": {
- "description": "Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.\n",
- "type": "integer"
- }
- }
- }
- },
- "extCpInfo": {
- "description": "Information about the external CPs exposed by the VNF instance.\n",
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "extLinkPortId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "extVirtualLinkInfo": {
- "description": "Information about the external VLs the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "extLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.\n",
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "extManagedVirtualLinkInfo": {
- "description": "External virtual links the VNF instance is connected to.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "vnfLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "monitoringParameters": {
- "description": "Active monitoring parameters.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "value", "timeStamp"],
- "properties": {
- "id": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "name": {
- "description": "Human readable name of the monitoring parameter, as defined in the VNFD.\n",
- "type": "string"
- },
- "value": {
- "description": "Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the \"value\" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.\n",
- "type": "object"
- },
- "timeStamp": {
- "description": "Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.\n",
- "type": "string"
- }
- }
- }
- },
- "localizationLanguage": {
- "description": "Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.\n",
- "type": "string"
- },
- "vnfcResourceInfo": {
- "description": "Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vduId", "computeResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vduId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "computeResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "storageResourceIds": {
- "description": "References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfcCpInfo": {
- "description": "CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "cpdId"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpdId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "vnfExtCpId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "cpProtocolInfo": {
- "description": "Network protocol information for this CP.\n",
- "type": "array",
- "items": {
- "description": "This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.\n",
- "required": ["layerProtocol"],
- "properties": {
- "layerProtocol": {
- "description": "The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.\n",
- "type": "string",
- "enum": ["IP_OVER_ETHERNET"]
- },
- "ipOverEthernet": {
- "description": "This type represents information about a network address that has been assigned.\n",
- "type": "object",
- "required": ["macAddress"],
- "properties": {
- "macAddress": {
- "description": "A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.\n",
- "type": "string",
- "format": "MAC"
- },
- "ipAddresses": {
- "description": "Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["type"],
- "properties": {
- "type": {
- "description": "The type of the IP addresses. Permitted values: IPV4, IPV6.\n",
- "type": "string",
- "enum": ["IPV4", "IPV6"]
- },
- "addresses": {
- "description": "Fixed addresses assigned (from the subnet defined by \"subnetId\" if provided).\n",
- "type": "array",
- "items": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- },
- "isDynamic": {
- "description": "Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if \"addresses\" is present and shall be absent otherwise.\n",
- "type": "boolean"
- },
- "addressRange": {
- "description": "An IP address range used, e.g., in case of egress connections. Exactly one of \"addresses\" or \"addressRange\" shall be present.\n",
- "type": "object",
- "required": ["minAddress", "maxAddress"],
- "properties": {
- "minAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- },
- "maxAddress": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- },
- "subnetId": {
- "description": "An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.\n",
- "type": "string",
- "format": "IP"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfLinkPortId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualLinkResourceInfo": {
- "description": "Information about the virtualised network resources used by the VLs of the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.\n",
- "type": "object",
- "required": ["id", "vnfVirtualLinkDescId", "networkResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vnfVirtualLinkDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfLinkPorts": {
- "description": "Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "virtualStorageResourceInfo": {
- "description": "Information on the virtualised storage resource(s) used as storage for the VNF instance.\n",
- "type": "array",
- "items": {
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.\n",
- "type": "object",
- "required": ["id", "virtualStorageDescId", "storageResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "virtualStorageDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "storageResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "reservationId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extensions": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "indicators": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "instantiate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "terminate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scale": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "scaleToLevel": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeFlavour": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "heal": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "operate": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "changeExtConn": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nThe operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute should convey more information about the error.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/vnf_lcm_op_occs/{vnfLcmOpOccId}": {
- "parameters": [{
- "name": "vnfLcmOpOccId",
- "description": "Identifier of a VNF lifecycle management operation occurrence. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a PATCH or POST request triggering a VNF LCM operation. It can also be retrieved from the \"vnfLcmOpOccId\" attribute in the VnfLcmOperationOccurrenceNotification.\n",
- "in": "path",
- "required": true,
- "type": "string"
- }
- ],
- "get": {
- "description": "Get Operation Status\n\nThe client can use this method to retrieve status information about a VNF lifecycle management operation occurrence by reading an individual \"VNF LCM operation occurrence\" resource.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "OK\nInformation about an individual VNF instance was queried successfully. The response body shall contain status information about a VNF lifecycle management operation occurrence.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a VNF lifecycle management operation occurrence.\n",
- "type": "object",
- "required": ["id", "operationState", "stateEnteredTime", "startTime", "vnfInstanceId", "operation", "isAutomaticInvocation", "operationParams", "isCancelPending"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "operationState": {
- "description": "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
- "type": "string",
- "enum": ["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"]
- },
- "stateEnteredTime": {
- "description": "Date-time when the current state was entered.\n",
- "type": "string",
- "format": "date-time"
- },
- "startTime": {
- "description": "Date-time of the start of the operation.\n",
- "type": "string",
- "format": "date-time"
- },
- "vnfInstanceId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "grantId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "operation": {
- "description": "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation.\n",
- "type": "string",
- "enum": ["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"]
- },
- "isAutomaticInvocation": {
- "description": "Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM (i.e. ScaleVnf / ScaleVnfToLevel triggered by auto-scale, or HealVnf triggered by auto-heal). Set to false otherwise.\n",
- "type": "boolean"
- },
- "operationParams": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "isCancelPending": {
- "description": "If the VNF LCM operation occurrence is in \"STARTING\", \"PROCESSING\" or \"ROLLING_BACK\" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.\n",
- "type": "boolean"
- },
- "cancelMode": {
- "description": "Cancellation mode. GRACEFUL: If the VNF LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state, the VNFM shall not start any new resource management operation and shall wait for the ongoing resource management operations in the underlying system, typically the VIM, to finish execution or to time out. After that, the VNFM shall put the operation occurrence into the FAILED_TEMP state. If the VNF LCM operation occurrence is in \"STARTING\" state, the VNFM shall not start any resource management operation and shall wait for the granting request to finish execution or time out. After that, the VNFM shall put the operation occurrence into the ROLLED_BACK state. FORCEFUL: If the VNF LCM operation occurrence is in \"PROCESSING\" or \"ROLLING_BACK\" state, the VNFM shall not start any new resource management operation, shall cancel the ongoing resource management operations in the underlying system, typically the VIM, and shall wait for the cancellation to finish or to time out. After that, the VNFM shall put the operation occurrence into the FAILED_TEMP state. If the VNF LCM operation occurrence is in \"STARTING\" state, the VNFM shall not start any resource management operation and put the operation occurrence into the ROLLED_BACK state.\n",
- "type": "string",
- "enum": ["GRACEFUL", "FORCEFUL"]
- },
- "error": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- },
- "resourceChanges": {
- "description": "This attribute contains information about the cumulative changes to virtualised resources that were performed so far by the LCM operation since its start, if applicable.\n",
- "type": "object",
- "properties": {
- "affectedVnfcs": {
- "description": "Information about VNFC instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest \"result\" notification if it has not received it due to an error or a wrongly configured subscription filter.\n",
- "type": "array",
- "items": {
- "description": "This type provides information about added, deleted, modified and temporary VNFCs.\n",
- "type": "object",
- "required": ["id", "vduId", "changeType", "computeResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "vduId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "changeType": {
- "description": "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVnfc structure exists as long as the temporary resource exists.\n",
- "type": "string",
- "enum": ["ADDED", "REMOVED", "MODIFIED", "TEMPORARY"]
- },
- "computeResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "affectedVnfcCpIds": {
- "description": "Identifiers of CP(s) of the VNFC instance that were affected by the change. Shall be present for those affected CPs of the VNFC instance that are associated to an external CP of the VNF instance. May be present for further affected CPs of the VNFC instance.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- },
- "addedStorageResourceIds": {
- "description": "References to VirtualStorage resources that have been added. Each value refers to a VirtualStorageResourceInfo item in the VnfInstance that was added to the VNFC. It shall be provided if at least one storage resource was added to the VNFC.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- },
- "removedStorageResourceIds": {
- "description": "References to VirtualStorage resources that have been removed. The value contains the identifier of a VirtualStorageResourceInfo item that has been removed from the VNFC, and might no longer exist in the VnfInstance. It shall be provided if at least one storage resource was removed from the VNFC.\n",
- "type": "array",
- "items": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- },
- "affectedVirtualLinks": {
- "description": "Information about VL instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest \"result\" notification if it has not received it due to an error or a wrongly configured subscription filter.\n",
- "type": "array",
- "items": {
- "description": "This type provides information about added, deleted, modified and temporary VLs.\n",
- "type": "object",
- "required": ["id", "virtualLinkDescId", "changeType", "networkResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "virtualLinkDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "changeType": {
- "description": "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY * LINK_PORT_ADDED * LINK_PORT_REMOVED For a temporary resource, an AffectedVirtualLink structure exists as long as the temporary resource exists.\n",
- "type": "string",
- "enum": ["ADDED", "REMOVED", "MODIFIED", "TEMPORARY", "LINK_PORT_ADDED", "LINK_PORT_REMOVED"]
- },
- "networkResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "affectedVirtualStorages": {
- "description": "Information about virtualised storage instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest \"result\" notification if it has not received it due to an error or a wrongly configured subscription filter.\n",
- "type": "array",
- "items": {
- "description": "This type provides information about added, deleted, modified and temporary virtual storage resources.\n",
- "type": "object",
- "required": ["id", "virtualStorageDescId", "changeType", "storageResource"],
- "properties": {
- "id": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- },
- "virtualStorageDescId": {
- "description": "An identifier that is unique within a VNF descriptor.\n",
- "type": "string"
- },
- "changeType": {
- "description": "Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVirtualStorage structure exists as long as the temporary resource exists.\n",
- "type": "string",
- "enum": ["ADDED", "REMOVED", "MODIFIED", "TEMPORARY"]
- },
- "storageResource": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- }
- }
- },
- "changedInfo": {
- "description": "This type represents attribute modifications that were performed on an \"Individual VNF instance\" resource. The attributes that can be included consist of those requested to be modified explicitly in the \"VnfInfoModificationRequest\" data structure, and additional attributes of the \"VnfInstance\" data structure that were modified implicitly e.g. when modifying the referenced VNF package.\n",
- "type": "object",
- "properties": {
- "vnfInstanceName": {
- "description": "If present, this attribute signals modifications of the \"vnfInstanceName\" attribute in \"VnfInstance\".\n",
- "type": "string"
- },
- "vnfInstanceDescription": {
- "description": "If present, this attribute signals modifications of the \"vnfInstanceDescription\" attribute in \"VnfInstance\".\n",
- "type": "string"
- },
- "vnfConfigurableProperties": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "metadata": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extensions": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "vimConnectionInfo": {
- "description": "If present, this attribute signals modifications of certain entries in the \"vimConnectionInfo\" attribute array in \"VnfInstance\".\n",
- "type": "array",
- "items": {
- "description": "This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.\n",
- "type": "object",
- "required": ["id", "vimType"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vimType": {
- "description": "Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the \"interfaceInfo\" and \"accessInfo\" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.\n",
- "type": "string"
- },
- "interfaceInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "accessInfo": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- },
- "extra": {
- "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.\n",
- "type": "object"
- }
- }
- }
- },
- "vnfPkgId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfdId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "vnfProvider": {
- "description": "If present, this attribute signals modifications of the \"vnfProvider\" attribute in \"VnfInstance\". If present, this attribute (which depends on the value of the \"vnfPkgId\" attribute) was modified implicitly following a request to modify the \"vnfPkgId\" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the \"vnfPkgId” attribute.\n",
- "type": "string"
- },
- "vnfProductName": {
- "description": "If present, this attribute signals modifications of the \"vnfProductName\" attribute in \"VnfInstance\". If present, this attribute (which depends on the value of the \"vnfPkgId\" attribute) was modified implicitly following a request to modify the \"vnfPkgId\" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the \"vnfPkgId” attribute.\n",
- "type": "string"
- },
- "vnfSoftwareVersion": {
- "description": "A Version.\n",
- "type": "string"
- },
- "vnfdVersion": {
- "description": "A Version.\n",
- "type": "string"
- }
- }
- },
- "changedExtConnectivity": {
- "description": "Information about changed external connectivity, if applicable. This allows the NFVO to obtain the information contained in the latest \"result\" notification if it has not received it due to an error or a wrongly configured subscription filter.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "extLinkPorts": {
- "description": "Link ports of this VL.\n",
- "type": "array",
- "items": {
- "description": "This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.\n",
- "type": "object",
- "required": ["id", "resourceHandle"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceHandle": {
- "required": ["vimConnectionId", "resourceId"],
- "type": "object",
- "description": "This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.\n",
- "properties": {
- "vimConnectionId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceProviderId": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "resourceId": {
- "description": "An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.\n",
- "type": "string"
- },
- "vimLevelResourceType": {
- "description": "Type of the resource in the scope of the VIM or the resource provider.\n",
- "type": "string"
- }
- }
- },
- "cpInstanceId": {
- "description": "An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self", "vnfInstance"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "vnfInstance": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "grant": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "cancel": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "retry": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "rollback": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- },
- "fail": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "409": {
- "description": "Conflict\nAnother request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/subscriptions": {
- "post": {
- "description": "Subscribe\n\nThe POST method creates a new subscription. Creation of two subscription resources with the same callbackURI and the same filter can result in performance degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the same filter and callbackUri already exists (in which case it shall return the “201 Created” response code), or may decide to not create a duplicate subscription resource (in which case it shall return a “303 See Other” response code referencing the existing subscription resource with the same filter and callbackUri).\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "LccnSubscriptionRequest",
- "description": "Details of the subscription to be created.\n",
- "in": "body",
- "required": true,
- "schema": {
- "description": "This type represents a subscription request related to notifications about VNF lifecycle changes.\n",
- "type": "object",
- "required": ["callbackUri"],
- "properties": {
- "filter": {
- "description": "This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
- "type": "object",
- "properties": {
- "vnfInstanceSubscriptionFilter": {
- "description": "This type represents subscription filter criteria to match VNF instances.\n",
- "type": "object",
- "properties": {
- "vnfInstanceIds": {
- "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- }
- }
- },
- "notificationTypes": {
- "description": "Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["VnfLcmOperationOccurrenceNotification", "VnfIdentifierCreationNotification", "VnfIdentifierDeletionNotification"]
- }
- },
- "operationTypes": {
- "description": "Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation.\n",
- "type": "string",
- "enum": ["INSTANTIATE", "TERMINATE"]
- }
- },
- "operationStates": {
- "description": "Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
- "type": "string",
- "enum": ["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"]
- }
- }
- }
- },
- "callbackUri": {
- "description": "String formatted according to IETF RFC 3986.\n",
- "type": "string"
- },
- "authentication": {
- "type": "object",
- "required": ["authType"],
- "properties": {
- "authType": {
- "description": "Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification. Permitted values: * BASIC: In every HTTP request to the notification endpoint, use HTTP Basic authentication with the client credentials. \n* OAUTH2_CLIENT_CREDENTIALS: In every HTTP request to the notification endpoint, use an OAuth 2.0 Bearer token, obtained\n using the client credentials grant type.\n* TLS_CERT: Every HTTP request to the notification endpoint is sent over a mutually authenticated TLS session, i.e. not only the\n server is authenticated, but also the client is authenticated\n during the TLS tunnel setup.\n",
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["BASIC", "OAUTH2_CLIENT_CREDENTIALS", "TLS_CERT"]
- }
- },
- "paramsBasic": {
- "description": "Parameters for authentication/authorization using BASIC. Shall be present if authType is \"BASIC\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n",
- "type": "object",
- "properties": {
- "userName": {
- "description": "Username to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n",
- "type": "string"
- },
- "password": {
- "description": "Password to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n",
- "type": "string"
- }
- }
- },
- "paramsOauth2ClientCredentials": {
- "description": "Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS. Shall be present if authType is \"OAUTH2_CLIENT_CREDENTIALS\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n",
- "type": "object",
- "properties": {
- "clientId": {
- "description": "Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n",
- "type": "string"
- },
- "clientPassword": {
- "description": "Client password to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n",
- "type": "string"
- },
- "tokenEndpoint": {
- "description": "String formatted according to IETF RFC 3986.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }, {
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }, {
- "name": "Content-Type",
- "description": "The MIME type of the body of the request. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "201": {
- "description": "Created\nThe subscription was created successfully. The response body shall contain a representation of the created subscription resource. The HTTP response shall include a \"Location\" HTTP header that points to the created subscription resource.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "Location": {
- "description": "The resource URI of the created VNF instance",
- "type": "string",
- "format": "url"
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a subscription related to notifications about VNF lifecycle changes.\n",
- "type": "object",
- "required": ["id", "callbackUri", "_links"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "filter": {
- "description": "This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
- "type": "object",
- "properties": {
- "vnfInstanceSubscriptionFilter": {
- "description": "This type represents subscription filter criteria to match VNF instances.\n",
- "type": "object",
- "properties": {
- "vnfdIds": {
- "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfProductsFromProviders": {
- "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProvider"],
- "properties": {
- "vnfProvider": {
- "description": "Name of the VNF provider to match.\n",
- "type": "string"
- },
- "vnfProducts": {
- "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProductName"],
- "properties": {
- "vnfProductName": {
- "description": "Name of the VNF product to match.\n",
- "type": "string"
- },
- "versions": {
- "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfSoftwareVersion"],
- "properties": {
- "vnfSoftwareVersion": {
- "description": "A version.\n",
- "type": "string"
- },
- "vnfdVersions": {
- "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "description": "A version.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfInstanceIds": {
- "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfInstanceNames": {
- "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "notificationTypes": {
- "description": "Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["VnfLcmOperationOccurrenceNotification", "VnfIdentifierCreationNotification", "VnfIdentifierDeletionNotification"]
- }
- },
- "operationTypes": {
- "description": "Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation.\n",
- "type": "string",
- "enum": ["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"]
- }
- },
- "operationStates": {
- "description": "Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
- "type": "string",
- "enum": ["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"]
- }
- }
- }
- },
- "callbackUri": {
- "description": "String formatted according to IETF RFC 3986.\n",
- "type": "string"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "303": {
- "description": "See Other\nA subscription with the same callbackURI and the same filter already exists and the policy of the VNFM is to not create redundant subscriptions. The HTTP response shall include a \"Location\" HTTP header that contains the resource URI of the existing subscription resource. The response body shall be empty.\n",
- "headers": {
- "Location": {
- "description": "The resource URI of the created VNF instance",
- "type": "string",
- "format": "url"
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- },
- "get": {
- "description": "Query Subscription Information\n\nThe GET method queries the list of active subscriptions of the functional block that invokes the method. It can be used e.g. for resynchronization after error situations.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "OK\nThe list of subscriptions was queried successfully. The response body shall contain the representations of all active subscriptions of the functional block that invokes the method.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a subscription related to notifications about VNF lifecycle changes.\n",
- "type": "object",
- "required": ["id", "callbackUri", "_links"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "filter": {
- "description": "This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
- "type": "object",
- "properties": {
- "vnfInstanceSubscriptionFilter": {
- "description": "This type represents subscription filter criteria to match VNF instances.\n",
- "type": "object",
- "properties": {
- "vnfdIds": {
- "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfProductsFromProviders": {
- "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProvider"],
- "properties": {
- "vnfProvider": {
- "description": "Name of the VNF provider to match.\n",
- "type": "string"
- },
- "vnfProducts": {
- "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProductName"],
- "properties": {
- "vnfProductName": {
- "description": "Name of the VNF product to match.\n",
- "type": "string"
- },
- "versions": {
- "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfSoftwareVersion"],
- "properties": {
- "vnfSoftwareVersion": {
- "description": "A version.\n",
- "type": "string"
- },
- "vnfdVersions": {
- "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "description": "A version.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfInstanceIds": {
- "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfInstanceNames": {
- "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "notificationTypes": {
- "description": "Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["VnfLcmOperationOccurrenceNotification", "VnfIdentifierCreationNotification", "VnfIdentifierDeletionNotification"]
- }
- },
- "operationTypes": {
- "description": "Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation.\n",
- "type": "string",
- "enum": ["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"]
- }
- },
- "operationStates": {
- "description": "Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
- "type": "string",
- "enum": ["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"]
- }
- }
- }
- },
- "callbackUri": {
- "description": "String formatted according to IETF RFC 3986.\n",
- "type": "string"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nInvalid attribute-based filtering parameters. The response body shall contain a ProblemDetails structure, in which the \"detail\" attribute should convey more information about the error.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- },
- "/subscriptions/{subscriptionId}": {
- "parameters": [{
- "name": "subscriptionId",
- "description": "Identifier of this subscription. This identifier can be retrieved from the resource referenced by the \"Location\" HTTP header in the response to a POST request creating a new subscription resource. It can also be retrieved from the \"id\" attribute in the payload body of that response.\n",
- "in": "path",
- "type": "string",
- "required": true
- }
- ],
- "get": {
- "description": "Query Subscription Information\n\nThe GET method retrieves information about a subscription by reading an individual subscription resource.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Accept",
- "description": "Content-Types that are acceptable for the response. Reference: IETF RFC 7231\n",
- "in": "header",
- "required": true,
- "type": "string"
- }, {
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "OK\nThe operation has completed successfully. The response body shall contain a representation of the subscription resource.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "This type represents a subscription related to notifications about VNF lifecycle changes.\n",
- "type": "object",
- "required": ["id", "callbackUri", "_links"],
- "properties": {
- "id": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- },
- "filter": {
- "description": "This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n",
- "type": "object",
- "properties": {
- "vnfInstanceSubscriptionFilter": {
- "description": "This type represents subscription filter criteria to match VNF instances.\n",
- "type": "object",
- "properties": {
- "vnfdIds": {
- "description": "If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfProductsFromProviders": {
- "description": "If present, match VNF instances that belong to VNF products from certain providers. The attributes \"vnfdIds\" and \"vnfProductsFromProviders\" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProvider"],
- "properties": {
- "vnfProvider": {
- "description": "Name of the VNF provider to match.\n",
- "type": "string"
- },
- "vnfProducts": {
- "description": "If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfProductName"],
- "properties": {
- "vnfProductName": {
- "description": "Name of the VNF product to match.\n",
- "type": "string"
- },
- "versions": {
- "description": "If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "type": "object",
- "required": ["vnfSoftwareVersion"],
- "properties": {
- "vnfSoftwareVersion": {
- "description": "A version.\n",
- "type": "string"
- },
- "vnfdVersions": {
- "description": "If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.\n",
- "type": "array",
- "items": {
- "description": "A version.\n",
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "vnfInstanceIds": {
- "description": "If present, match VNF instances with an instance identifier listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "description": "An identifier with the intention of being globally unique.\n",
- "type": "string"
- }
- },
- "vnfInstanceNames": {
- "description": "If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes \"vnfInstanceIds\" and \"vnfInstanceNames\" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.\n",
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "notificationTypes": {
- "description": "Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n",
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["VnfLcmOperationOccurrenceNotification", "VnfIdentifierCreationNotification", "VnfIdentifierDeletionNotification"]
- }
- },
- "operationTypes": {
- "description": "Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ INSTANTIATE | Represents the \"Instantiate VNF\" LCM operation. SCALE | Represents the \"Scale VNF\" LCM operation. SCALE_TO_LEVEL | Represents the \"Scale VNF to Level\" LCM operation. CHANGE_FLAVOUR | Represents the \"Change VNF Flavour\" LCM operation. TERMINATE | Represents the \"Terminate VNF\" LCM operation. HEAL | Represents the \"Heal VNF\" LCM operation. OPERATE | Represents the \"Operate VNF\" LCM operation. CHANGE_EXT_CONN | Represents the \"Change external VNF connectivity\" LCM operation. MODIFY_INFO | Represents the \"Modify VNF Information\" LCM operation.\n",
- "type": "string",
- "enum": ["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"]
- }
- },
- "operationStates": {
- "description": "Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the \"notificationTypes\" attribute contains the value \"VnfLcmOperationOccurrenceNotification\", and shall be absent otherwise.\n",
- "type": "array",
- "items": {
- "description": "Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.\n",
- "type": "string",
- "enum": ["STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", "ROLLING_BACK", "ROLLED_BACK"]
- }
- }
- }
- },
- "callbackUri": {
- "description": "String formatted according to IETF RFC 3986.\n",
- "type": "string"
- },
- "_links": {
- "description": "Links to resources related to this resource.\n",
- "type": "object",
- "required": ["self"],
- "properties": {
- "self": {
- "description": "This type represents a link to a resource.\n",
- "type": "object",
- "required": ["href"],
- "properties": {
- "href": {
- "description": "URI of the referenced resource.\n",
- "type": "string",
- "format": "url"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- },
- "delete": {
- "description": "Terminate Subscription\n\nThe DELETE method terminates an individual subscription.\n",
- "tags": ["Sol003VnfLcm"],
- "parameters": [{
- "name": "Authorization",
- "description": "The authorization token for the request. Reference: IETF RFC 7235\n",
- "in": "header",
- "required": false,
- "type": "string"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content\nThe subscription resource was deleted successfully. The response body shall be empty.\n",
- "headers": {
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- }
- },
- "400": {
- "description": "Bad Request\nIf the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided, and should include in the \"detail\" attribute more information about the source of the problem.\n ---\n\nIf the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n ---\n\nIf there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond with this response code.The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized\nIf the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- },
- "WWW-Authenticate": {
- "description": "Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.\n",
- "type": "string",
- "maximum": 1,
- "minimum": 0
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "403": {
- "description": "Forbidden\nIf the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The \"ProblemDetails\" structure shall be provided. It should include in the \"detail\" attribute information about the source of the problem, and may indicate how to solve it.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "404": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "405": {
- "description": "Not Found\nIf the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The \"ProblemDetails\" structure may be provided, including in the \"detail\" attribute information about the source of the problem, e.g. a wrong resource URI variable.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "406": {
- "description": "Not Acceptable\nIf the \"Accept\" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The \"ProblemDetails\" structure may be omitted in that case.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "500": {
- "description": "Internal Server Error\nIf there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code (\"catch all error\"), the API producer shall respond withthis response code. The \"ProblemDetails\" structure shall be provided, and shall include in the \"detail\" attribute more information about the source of the problem.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- },
- "503": {
- "description": "Service Unavailable\nIf the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the \"Retry-After\" HTTP header and for the alternative to refuse the connection. The \"ProblemDetails\" structure may be omitted.\n",
- "headers": {
- "Content-Type": {
- "description": "The MIME type of the body of the response.",
- "type": "string",
- "maximum": 1,
- "minimum": 1
- }
- },
- "schema": {
- "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n",
- "type": "object",
- "required": ["status", "detail"],
- "properties": {
- "type": {
- "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n",
- "type": "string",
- "format": "URI"
- },
- "title": {
- "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n",
- "type": "string"
- },
- "status": {
- "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n",
- "type": "integer"
- },
- "detail": {
- "description": "A human-readable explanation specific to this occurrence of the problem.\n",
- "type": "string"
- },
- "instance": {
- "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n",
- "type": "string",
- "format": "URI"
- }
- }
- }
- }
- }
- }
- }
- }
-}
diff --git a/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.yaml b/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.yaml
deleted file mode 100644
index 71b7163a46..0000000000
--- a/vnfm-simulator/vnfm-api/src/main/resources/vnfm-sim-swagger.yaml
+++ /dev/null
@@ -1,8404 +0,0 @@
-swagger: '2.0'
-info:
- version: 1.1.1
- title: SOL003 - VNF Lifecycle Management interface
- description: |
- SOL003 - VNF Lifecycle Management interface definition
-
- IMPORTANT: Please note that this file might be not aligned to the current version of the ETSI Group Specification it refers to. In case of discrepancies the published ETSI Group Specification takes precedence.
-
- In clause 4.3.2 of ETSI GS NFV-SOL 003 v2.4.1, an attribute-based filtering mechanism is defined. This mechanism is currently not included in the corresponding OpenAPI design for this GS version. Changes to the attribute-based filtering mechanism are being considered in v2.5.1 of this GS for inclusion in the corresponding future ETSI NFV OpenAPI design.
- Please report bugs to https://forge.etsi.org/bugzilla/buglist.cgi?component=Nfv-Openapis&list_id=61&product=NFV&resolution=
- license:
- name: ETSI Forge copyright notice
- url: 'https://forge.etsi.org/etsi-forge-copyright-notice.txt'
-externalDocs:
- description: ETSI GS NFV-SOL 003 V2.4.1
- url: 'http://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.04.01_60/gs_NFV-SOL003v020401p.pdf'
-basePath: /vnflcm/v1
-schemes:
- - https
-consumes:
- - application/json
-produces:
- - application/json
-paths:
- /vnf_instances:
- post:
- description: |
- Create VNF Identifier
-
- The POST method creates a new VNF instance resource.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: createVnfRequest
- description: The VNF creation parameters
- in: body
- required: true
- schema:
- type: object
- required:
- - vnfdId
- properties:
- vnfdId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceName:
- description: |
- Human-readable name of the VNF instance to be created.
- type: string
- vnfInstanceDescription:
- description: |
- Human-readable description of the VNF instance to be created.
- type: string
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- - name: Content-Type
- description: |
- The MIME type of the body of the request. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- responses:
- '201':
- description: A VNF Instance identifier was created successfully
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- Location:
- description: The resource URI of the created VNF instance
- type: string
- format: url
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a VNF instance.
- type: object
- required:
- - id
- - vnfdId
- - vnfProvider
- - vnfProductName
- - vnfSoftwareVersion
- - vnfdVersion
- - vnfPkgId
- - instantiationState
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceName:
- description: |
- Name of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfInstanceDescription:
- description: |
- Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfdId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProvider:
- description: |
- Provider of the VNF and the VNFD. The value is copied from the VNFD.
- type: string
- vnfProductName:
- description: |
- Name to identify the VNF Product. The value is copied from the VNFD.
- type: string
- vnfSoftwareVersion:
- description: |
- A Version.
- type: string
- vnfdVersion:
- description: |
- A Version.
- type: string
- vnfPkgId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfConfigurableProperties:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- vimConnectionInfo:
- description: |
- Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.
- type: array
- items:
- description: |
- This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.
- type: object
- required:
- - id
- - vimType
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimType:
- description: |
- Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the "interfaceInfo" and "accessInfo" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.
- type: string
- interfaceInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- accessInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extra:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- instantiationState:
- description: |
- The instantiation state of the VNF.
- type: string
- enum:
- - NOT_INSTANTIATED
- - INSTANTIATED
- instantiatedVnfInfo:
- description: |
- Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.
- type: object
- required:
- - flavourId
- - vnfState
- properties:
- flavourId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfState:
- type: string
- enum:
- - STARTED
- - STOPPED
- scaleStatus:
- description: |
- Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how "big" the VNF has been scaled w.r.t. that aspect.
- type: array
- items:
- required:
- - aspectId
- - scaleLevel
- type: object
- properties:
- aspectId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- scaleLevel:
- description: |
- Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.
- type: integer
- extCpInfo:
- description: |
- Information about the external CPs exposed by the VNF instance.
- type: array
- minItems: 1
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- extLinkPortId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- extVirtualLinkInfo:
- description: |
- Information about the external VLs the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- extLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- description: |
- This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- extManagedVirtualLinkInfo:
- description: |
- External virtual links the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- vnfLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- monitoringParameters:
- description: |
- Active monitoring parameters.
- type: array
- items:
- type: object
- required:
- - id
- - value
- - timeStamp
- properties:
- id:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- name:
- description: |
- Human readable name of the monitoring parameter, as defined in the VNFD.
- type: string
- value:
- description: |
- Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the "value" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.
- type: object
- timeStamp:
- description: |
- Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.
- type: string
- localizationLanguage:
- description: |
- Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.
- type: string
- vnfcResourceInfo:
- description: |
- Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.
- type: object
- required:
- - id
- - vduId
- - computeResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vduId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- computeResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- storageResourceIds:
- description: |
- References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfcCpInfo:
- description: |
- CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfExtCpId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- vnfLinkPortId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualLinkResourceInfo:
- description: |
- Information about the virtualised network resources used by the VLs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- - networkResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfLinkPorts:
- description: |
- Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualStorageResourceInfo:
- description: |
- Information on the virtualised storage resource(s) used as storage for the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.
- type: object
- required:
- - id
- - virtualStorageDescId
- - storageResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- virtualStorageDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- storageResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extensions:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- indicators:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- instantiate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- terminate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scale:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scaleToLevel:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeFlavour:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- heal:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- operate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeExtConn:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- Another request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '416':
- description: |
- Requested Range Not Satisfiable
- This code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '422':
- description: |
- Unprocessable Entity
- If the payload body of a request contains syntactically correct data (e.g. well-formed JSON) but the data cannot be processed (e.g. because it fails validation against a schema), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem. NOTE 2: This error response code is only applicable for methods that have a request body.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '/vnf_instances/{vnfInstanceId}':
- parameters:
- - name: vnfInstanceId
- description: |
- Identifier of the VNF instance. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the "id" attribute in the payload body of that response.
- in: path
- type: string
- required: true
- get:
- description: |
- Query VNF
-
- The GET method retrieves information about a VNF instance by reading an individual VNF instance resource.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- - name: Content-Type
- description: |
- The MIME type of the body of the request. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- responses:
- '200':
- description: |
- OK
- Information about zero or more VNF instances was queried successfully. The response body shall contain representations of zero or more VNF instances.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a VNF instance.
- type: object
- required:
- - id
- - vnfdId
- - vnfProvider
- - vnfProductName
- - vnfSoftwareVersion
- - vnfdVersion
- - vnfPkgId
- - instantiationState
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceName:
- description: |
- Name of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfInstanceDescription:
- description: |
- Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfdId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProvider:
- description: |
- Provider of the VNF and the VNFD. The value is copied from the VNFD.
- type: string
- vnfProductName:
- description: |
- Name to identify the VNF Product. The value is copied from the VNFD.
- type: string
- vnfSoftwareVersion:
- description: |
- A Version.
- type: string
- vnfdVersion:
- description: |
- A Version.
- type: string
- vnfPkgId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfConfigurableProperties:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- vimConnectionInfo:
- description: |
- Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.
- type: array
- items:
- description: |
- This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.
- type: object
- required:
- - id
- - vimType
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimType:
- description: |
- Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the "interfaceInfo" and "accessInfo" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.
- type: string
- interfaceInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- accessInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extra:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- instantiationState:
- description: |
- The instantiation state of the VNF.
- type: string
- enum:
- - NOT_INSTANTIATED
- - INSTANTIATED
- instantiatedVnfInfo:
- description: |
- Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.
- type: object
- required:
- - flavourId
- - vnfState
- properties:
- flavourId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfState:
- type: string
- enum:
- - STARTED
- - STOPPED
- scaleStatus:
- description: |
- Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how "big" the VNF has been scaled w.r.t. that aspect.
- type: array
- items:
- required:
- - aspectId
- - scaleLevel
- type: object
- properties:
- aspectId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- scaleLevel:
- description: |
- Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.
- type: integer
- extCpInfo:
- description: |
- Information about the external CPs exposed by the VNF instance.
- type: array
- minItems: 1
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- extLinkPortId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- extVirtualLinkInfo:
- description: |
- Information about the external VLs the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- extLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- description: |
- This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- extManagedVirtualLinkInfo:
- description: |
- External virtual links the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- vnfLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- monitoringParameters:
- description: |
- Active monitoring parameters.
- type: array
- items:
- type: object
- required:
- - id
- - value
- - timeStamp
- properties:
- id:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- name:
- description: |
- Human readable name of the monitoring parameter, as defined in the VNFD.
- type: string
- value:
- description: |
- Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the "value" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.
- type: object
- timeStamp:
- description: |
- Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.
- type: string
- localizationLanguage:
- description: |
- Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.
- type: string
- vnfcResourceInfo:
- description: |
- Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.
- type: object
- required:
- - id
- - vduId
- - computeResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vduId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- computeResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- storageResourceIds:
- description: |
- References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfcCpInfo:
- description: |
- CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfExtCpId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- vnfLinkPortId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualLinkResourceInfo:
- description: |
- Information about the virtualised network resources used by the VLs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- - networkResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfLinkPorts:
- description: |
- Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualStorageResourceInfo:
- description: |
- Information on the virtualised storage resource(s) used as storage for the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.
- type: object
- required:
- - id
- - virtualStorageDescId
- - storageResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- virtualStorageDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- storageResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extensions:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- indicators:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- instantiate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- terminate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scale:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scaleToLevel:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeFlavour:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- heal:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- operate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeExtConn:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- Another request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '416':
- description: |
- Requested Range Not Satisfiable
- This code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- delete:
- description: |
- Delete VNF Identifier
-
- This method deletes an individual VNF instance resource.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- responses:
- '204':
- description: |
- No Content
- The VNF instance resource and the associated VNF identifier were deleted successfully. The response body shall be empty.
- headers:
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- '400':
- description: |
- Bad Request
- It fhe request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem. If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided. If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. The response body shall contain a ProblemDetails structure, in which the "detail" attribute should convey more information about the error.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '412':
- description: |
- Precondition Failed
- A precondition given in an HTTP request header is not fulfilled. Typically, this is due to an ETag mismatch, indicating that the resource was modified by another entity. The response body should contain a ProblemDetails structure, in which the "detail" attribute should convey more information about the error.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '/vnf_instances/{vnfInstanceId}/instantiate':
- parameters:
- - name: vnfInstanceId
- description: |
- Identifier of the VNF instance. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the "id" attribute in the payload body of that response.
- in: path
- type: string
- required: true
- post:
- description: |
- Instantiate VNF
-
- The POST method instantiates a VNF instance.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: InstantiateVnfRequest
- description: Parameters for the VNF instantiation.
- in: body
- required: true
- schema:
- type: object
- required:
- - flavourId
- properties:
- flavourId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- extVirtualLinks:
- description: |
- Information about external VLs to connect the VNF to.
- type: array
- items:
- description: |
- This type represents an external VL.
- type: object
- required:
- - id
- - resourceId
- - extCps
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- extCps:
- description: |
- External CPs of the VNF to be connected to this external VL.
- type: array
- items:
- description: |
- This type represents configuration information for external CPs created from a CPD.
- type: object
- required:
- - cpdId
- properties:
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- cpConfig:
- description: |
- List of instance data that need to be configured on the CP instances created from the respective CPD.
- type: array
- items:
- description: |
- This type represents an externally provided link port or network address information per instance of an external connection point. In case a link port is provided, the VNFM shall use that link port when connecting the external CP to the external VL. In a link port is not provided, the VNFM shall create a link port on the external VL, and use that link port to connect the external CP to the external VL.
- type: object
- properties:
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- linkPortId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- cpProtocolData:
- description: |
- Parameters for configuring the network protocols on the link port that connects the CP to a VL. The following conditions apply to the attributes "linkPortId" and "cpProtocolData": * The "linkPortId" and "cpProtocolData" attributes shall both be absent for the deletion of an existing external CP instance
- addressed by cpInstanceId.
- * At least one of these attributes shall be present for a to-be-created external CP instance or an existing external
- CP instance.
- * If the "linkPortId" attribute is absent, the VNFM shall create a link port.
- * If the "cpProtocolData" attribute is absent, the "linkPortId" attribute shall be provided referencing a pre-created link port,
- and the VNFM can use means outside the scope of the present
- document to obtain the pre-configured address information for the
- connection point from the resource representing the link port.
- * If both "cpProtocolData" and "linkportId" are provided, the API consumer shall ensure that the cpProtocolData can be used with the
- pre-created link port referenced by "linkPortId".
- type: array
- items:
- description: |
- This type represents network protocol data.
- type: object
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- Identifier of layer(s) and protocol(s). This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents network address data for IP over Ethernet.
- type: object
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- List of IP addresses to assign to the CP instance. Each entry represents IP address data for fixed or dynamic IP address assignment per subnet. If this attribute is not present, no IP address shall be assigned.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- fixedAddresses:
- description: |
- Fixed addresses to assign (from the subnet defined by "subnetId" if provided). Exactly one of "fixedAddresses", "numDynamicAddresses" or "ipAddressRange" shall be present.
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- numDynamicAddresses:
- description: |
- Number of dynamic addresses to assign (from the subnet defined by "subnetId" if provided). Exactly one of "fixedAddresses", "numDynamicAddresses" or "ipAddressRange" shall be present.
- type: integer
- addressRange:
- description: |
- An IP address range to be used, e.g. in case of egress connections. In case this attribute is present, IP addresses from the range will be used.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- extLinkPorts:
- description: |
- Externally provided link ports to be used to connect external connection points to this external VL. If this attribute is not present, the VNFM shall create the link ports on the external VL.
- type: array
- items:
- description: |
- This type represents an externally provided link port to be used to connect an external connection point to an external VL.
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- vimConnectionInfo:
- description: |
- Information about VIM connections to be used for managing the resources for the VNF instance, or refer to external / externally-managed virtual links. This attribute shall only be supported and may be present if VNF-related resource management in direct mode is applicable.
- type: array
- items:
- description: |
- This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.
- type: object
- required:
- - id
- - vimType
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimType:
- description: |
- Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the "interfaceInfo" and "accessInfo" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.
- type: string
- interfaceInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- accessInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- additionalParams:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- - name: Content-Type
- description: |
- The MIME type of the body of the request. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- responses:
- '202':
- description: |
- Accepted
- The request was accepted for processing, but the processing has not been completed. The response body shall be empty. The HTTP response shall include a "Location" HTTP header that contains the URI of the newly-created "VNF LCM operation occurrence" resource corresponding to the operation.
- headers:
- Location:
- description: The resource URI of the created VNF instance
- type: string
- format: url
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in INSTANTIATED state. The response body shall contain a ProblemDetails structure, in which the "detail" attribute should convey more information about the error.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '416':
- description: |
- Requested Range Not Satisfiable
- This code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '/vnf_instances/{vnfInstanceId}/terminate':
- parameters:
- - name: vnfInstanceId
- description: |
- The identifier of the VNF instance to be terminated. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request creating a new VNF instance resource. It can also be retrieved from the "id" attribute in the payload body of that response.
- in: path
- type: string
- required: true
- post:
- description: |
- Terminate VNF
-
- The POST method terminates a VNF instance.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: TerminateVnfRequest
- description: Parameters for the VNF termination.
- in: body
- required: true
- schema:
- type: object
- required:
- - terminationType
- properties:
- terminationType:
- description: |
- Indicates whether forceful or graceful termination is requested. VNFM Adapter will only support FORCEFUL in Dublin.
- type: string
- enum:
- - FORCEFUL
- - GRACEFUL
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- - name: Content-Type
- description: |
- The MIME type of the body of the request. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- responses:
- '202':
- description: |
- Accepted
- The request was accepted for processing, but the processing has not been completed. On success, the HTTP response shall include a "Location" HTTP header that contains the URI of the newly-created "VNF LCM operation occurrence" resource corresponding to the operation.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- Location:
- description: The resource URI of the created VNF instance
- type: string
- format: url
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a VNF instance.
- type: object
- required:
- - id
- - vnfdId
- - vnfProvider
- - vnfProductName
- - vnfSoftwareVersion
- - vnfdVersion
- - vnfPkgId
- - instantiationState
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceName:
- description: |
- Name of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfInstanceDescription:
- description: |
- Human-readable description of the VNF instance. This attribute can be modified with the PATCH method.
- type: string
- vnfdId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProvider:
- description: |
- Provider of the VNF and the VNFD. The value is copied from the VNFD.
- type: string
- vnfProductName:
- description: |
- Name to identify the VNF Product. The value is copied from the VNFD.
- type: string
- vnfSoftwareVersion:
- description: |
- A Version.
- type: string
- vnfdVersion:
- description: |
- A Version.
- type: string
- vnfPkgId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfConfigurableProperties:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- vimConnectionInfo:
- description: |
- Information about VIM connections to be used for managing the resources for the VNF instance. This attribute shall only be supported and present if VNF-related resource management in direct mode is applicable. This attribute can be modified with the PATCH method.
- type: array
- items:
- description: |
- This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.
- type: object
- required:
- - id
- - vimType
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimType:
- description: |
- Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the "interfaceInfo" and "accessInfo" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.
- type: string
- interfaceInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- accessInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extra:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- instantiationState:
- description: |
- The instantiation state of the VNF.
- type: string
- enum:
- - NOT_INSTANTIATED
- - INSTANTIATED
- instantiatedVnfInfo:
- description: |
- Information specific to an instantiated VNF instance. This attribute shall be present if the instantiateState attribute value is INSTANTIATED.
- type: object
- required:
- - flavourId
- - vnfState
- properties:
- flavourId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfState:
- type: string
- enum:
- - STARTED
- - STOPPED
- scaleStatus:
- description: |
- Scale status of the VNF, one entry per aspect. Represents for every scaling aspect how "big" the VNF has been scaled w.r.t. that aspect.
- type: array
- items:
- required:
- - aspectId
- - scaleLevel
- type: object
- properties:
- aspectId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- scaleLevel:
- description: |
- Indicates the scale level. The minimum value shall be 0 and the maximum value shall be <= maxScaleLevel as described in the VNFD.
- type: integer
- extCpInfo:
- description: |
- Information about the external CPs exposed by the VNF instance.
- type: array
- minItems: 1
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- extLinkPortId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- extVirtualLinkInfo:
- description: |
- Information about the external VLs the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- extLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- description: |
- This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- extManagedVirtualLinkInfo:
- description: |
- External virtual links the VNF instance is connected to.
- type: array
- items:
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- vnfLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- monitoringParameters:
- description: |
- Active monitoring parameters.
- type: array
- items:
- type: object
- required:
- - id
- - value
- - timeStamp
- properties:
- id:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- name:
- description: |
- Human readable name of the monitoring parameter, as defined in the VNFD.
- type: string
- value:
- description: |
- Value of the monitoring parameter known to the VNFM (e.g. obtained for autoscaling purposes). The type of the "value" attribute (i.e. scalar, structure (Object in JSON), or array (of scalars, arrays or structures/Objects)) is assumed to be defined in an external measurement specification.
- type: object
- timeStamp:
- description: |
- Represents the point in time when the measurement has been performed, as known to the VNFM. Should be formatted according to ETF RFC 3339.
- type: string
- localizationLanguage:
- description: |
- Information about localization language of the VNF (includes e.g. strings in the VNFD). The localization languages supported by a VNF can be declared in the VNFD, and localization language selection can take place at instantiation time. The value shall comply with the format defined in IETF RFC 5646.
- type: string
- vnfcResourceInfo:
- description: |
- Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information on virtualised compute and storage resources used by a VNFC in a VNF instance.
- type: object
- required:
- - id
- - vduId
- - computeResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vduId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- computeResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- storageResourceIds:
- description: |
- References to the VirtualStorage resources. The value refers to a VirtualStorageResourceInfo item in the VnfInstance.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfcCpInfo:
- description: |
- CPs of the VNFC instance. Shall be present when that particular CP of the VNFC instance is associated to an external CP of the VNF instance. May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - cpdId
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpdId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- vnfExtCpId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- cpProtocolInfo:
- description: |
- Network protocol information for this CP.
- type: array
- items:
- description: |
- This type describes the protocol layer(s) that a CP uses together with protocol-related information, like addresses.
- required:
- - layerProtocol
- properties:
- layerProtocol:
- description: |
- The identifier of layer(s) and protocol(s) associated to the network address information. Permitted values: IP_OVER_ETHERNET This attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.
- type: string
- enum:
- - IP_OVER_ETHERNET
- ipOverEthernet:
- description: |
- This type represents information about a network address that has been assigned.
- type: object
- required:
- - macAddress
- properties:
- macAddress:
- description: |
- A MAC address. Representation: string that consists of groups of two hexadecimal digits, separated by hyphens or colons.
- type: string
- format: MAC
- ipAddresses:
- description: |
- Addresses assigned to the CP instance. Each entry represents IP addresses assigned by fixed or dynamic IP address assignment per subnet.
- type: array
- items:
- type: object
- required:
- - type
- properties:
- type:
- description: |
- The type of the IP addresses. Permitted values: IPV4, IPV6.
- type: string
- enum:
- - IPV4
- - IPV6
- addresses:
- description: |
- Fixed addresses assigned (from the subnet defined by "subnetId" if provided).
- type: array
- items:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- isDynamic:
- description: |
- Indicates whether this set of addresses was assigned dynamically (true) or based on address information provided as input from the API consumer (false). Shall be present if "addresses" is present and shall be absent otherwise.
- type: boolean
- addressRange:
- description: |
- An IP address range used, e.g., in case of egress connections. Exactly one of "addresses" or "addressRange" shall be present.
- type: object
- required:
- - minAddress
- - maxAddress
- properties:
- minAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- maxAddress:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- subnetId:
- description: |
- An IPV4 or IPV6 address. Representation: In case of an IPV4 address, string that consists of four decimal integers separated by dots, each integer ranging from 0 to 255. In case of an IPV6 address, string that consists of groups of zero to four hexadecimal digits, separated by colons.
- type: string
- format: IP
- vnfLinkPortId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualLinkResourceInfo:
- description: |
- Information about the virtualised network resources used by the VLs of the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by an internal VL instance in a VNF instance.
- type: object
- required:
- - id
- - vnfVirtualLinkDescId
- - networkResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vnfVirtualLinkDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfLinkPorts:
- description: |
- Links ports of this VL. Shall be present when the linkPort is used for external connectivity by the VNF (refer to VnfLinkPortInfo). May be present otherwise.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- virtualStorageResourceInfo:
- description: |
- Information on the virtualised storage resource(s) used as storage for the VNF instance.
- type: array
- items:
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance.
- type: object
- required:
- - id
- - virtualStorageDescId
- - storageResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- virtualStorageDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- storageResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- reservationId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extensions:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- indicators:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- instantiate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- terminate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scale:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- scaleToLevel:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeFlavour:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- heal:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- operate:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- changeExtConn:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. Typically, this is due to the fact that the VNF instance resource is in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. The response body shall contain a ProblemDetails structure, in which the "detail" attribute should convey more information about the error.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '/vnf_lcm_op_occs/{vnfLcmOpOccId}':
- parameters:
- - name: vnfLcmOpOccId
- description: |
- Identifier of a VNF lifecycle management operation occurrence. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a PATCH or POST request triggering a VNF LCM operation. It can also be retrieved from the "vnfLcmOpOccId" attribute in the VnfLcmOperationOccurrenceNotification.
- in: path
- required: true
- type: string
- get:
- description: |
- Get Operation Status
-
- The client can use this method to retrieve status information about a VNF lifecycle management operation occurrence by reading an individual "VNF LCM operation occurrence" resource.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- responses:
- '200':
- description: |
- OK
- Information about an individual VNF instance was queried successfully. The response body shall contain status information about a VNF lifecycle management operation occurrence.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a VNF lifecycle management operation occurrence.
- type: object
- required:
- - id
- - operationState
- - stateEnteredTime
- - startTime
- - vnfInstanceId
- - operation
- - isAutomaticInvocation
- - operationParams
- - isCancelPending
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- operationState:
- description: |
- Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.
- type: string
- enum:
- - STARTING
- - PROCESSING
- - COMPLETED
- - FAILED_TEMP
- - FAILED
- - ROLLING_BACK
- - ROLLED_BACK
- stateEnteredTime:
- description: |
- Date-time when the current state was entered.
- type: string
- format: date-time
- startTime:
- description: |
- Date-time of the start of the operation.
- type: string
- format: date-time
- vnfInstanceId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- grantId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- operation:
- description: |
- Value | Description ------|------------ INSTANTIATE | Represents the "Instantiate VNF" LCM operation. SCALE | Represents the "Scale VNF" LCM operation. SCALE_TO_LEVEL | Represents the "Scale VNF to Level" LCM operation. CHANGE_FLAVOUR | Represents the "Change VNF Flavour" LCM operation. TERMINATE | Represents the "Terminate VNF" LCM operation. HEAL | Represents the "Heal VNF" LCM operation. OPERATE | Represents the "Operate VNF" LCM operation. CHANGE_EXT_CONN | Represents the "Change external VNF connectivity" LCM operation. MODIFY_INFO | Represents the "Modify VNF Information" LCM operation.
- type: string
- enum:
- - INSTANTIATE
- - SCALE
- - SCALE_TO_LEVEL
- - CHANGE_FLAVOUR
- - TERMINATE
- - HEAL
- - OPERATE
- - CHANGE_EXT_CONN
- - MODIFY_INFO
- isAutomaticInvocation:
- description: |
- Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM (i.e. ScaleVnf / ScaleVnfToLevel triggered by auto-scale, or HealVnf triggered by auto-heal). Set to false otherwise.
- type: boolean
- operationParams:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- isCancelPending:
- description: |
- If the VNF LCM operation occurrence is in "STARTING", "PROCESSING" or "ROLLING_BACK" state and the operation is being cancelled, this attribute shall be set to true. Otherwise, it shall be set to false.
- type: boolean
- cancelMode:
- description: |
- Cancellation mode. GRACEFUL: If the VNF LCM operation occurrence is in "PROCESSING" or "ROLLING_BACK" state, the VNFM shall not start any new resource management operation and shall wait for the ongoing resource management operations in the underlying system, typically the VIM, to finish execution or to time out. After that, the VNFM shall put the operation occurrence into the FAILED_TEMP state. If the VNF LCM operation occurrence is in "STARTING" state, the VNFM shall not start any resource management operation and shall wait for the granting request to finish execution or time out. After that, the VNFM shall put the operation occurrence into the ROLLED_BACK state. FORCEFUL: If the VNF LCM operation occurrence is in "PROCESSING" or "ROLLING_BACK" state, the VNFM shall not start any new resource management operation, shall cancel the ongoing resource management operations in the underlying system, typically the VIM, and shall wait for the cancellation to finish or to time out. After that, the VNFM shall put the operation occurrence into the FAILED_TEMP state. If the VNF LCM operation occurrence is in "STARTING" state, the VNFM shall not start any resource management operation and put the operation occurrence into the ROLLED_BACK state.
- type: string
- enum:
- - GRACEFUL
- - FORCEFUL
- error:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- resourceChanges:
- description: |
- This attribute contains information about the cumulative changes to virtualised resources that were performed so far by the LCM operation since its start, if applicable.
- type: object
- properties:
- affectedVnfcs:
- description: |
- Information about VNFC instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest "result" notification if it has not received it due to an error or a wrongly configured subscription filter.
- type: array
- items:
- description: |
- This type provides information about added, deleted, modified and temporary VNFCs.
- type: object
- required:
- - id
- - vduId
- - changeType
- - computeResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- vduId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- changeType:
- description: |
- Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVnfc structure exists as long as the temporary resource exists.
- type: string
- enum:
- - ADDED
- - REMOVED
- - MODIFIED
- - TEMPORARY
- computeResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- affectedVnfcCpIds:
- description: |
- Identifiers of CP(s) of the VNFC instance that were affected by the change. Shall be present for those affected CPs of the VNFC instance that are associated to an external CP of the VNF instance. May be present for further affected CPs of the VNFC instance.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- addedStorageResourceIds:
- description: |
- References to VirtualStorage resources that have been added. Each value refers to a VirtualStorageResourceInfo item in the VnfInstance that was added to the VNFC. It shall be provided if at least one storage resource was added to the VNFC.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- removedStorageResourceIds:
- description: |
- References to VirtualStorage resources that have been removed. The value contains the identifier of a VirtualStorageResourceInfo item that has been removed from the VNFC, and might no longer exist in the VnfInstance. It shall be provided if at least one storage resource was removed from the VNFC.
- type: array
- items:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- affectedVirtualLinks:
- description: |
- Information about VL instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest "result" notification if it has not received it due to an error or a wrongly configured subscription filter.
- type: array
- items:
- description: |
- This type provides information about added, deleted, modified and temporary VLs.
- type: object
- required:
- - id
- - virtualLinkDescId
- - changeType
- - networkResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- virtualLinkDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- changeType:
- description: |
- Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY * LINK_PORT_ADDED * LINK_PORT_REMOVED For a temporary resource, an AffectedVirtualLink structure exists as long as the temporary resource exists.
- type: string
- enum:
- - ADDED
- - REMOVED
- - MODIFIED
- - TEMPORARY
- - LINK_PORT_ADDED
- - LINK_PORT_REMOVED
- networkResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- affectedVirtualStorages:
- description: |
- Information about virtualised storage instances that were affected during the lifecycle operation. This allows the NFVO to obtain the information contained in the latest "result" notification if it has not received it due to an error or a wrongly configured subscription filter.
- type: array
- items:
- description: |
- This type provides information about added, deleted, modified and temporary virtual storage resources.
- type: object
- required:
- - id
- - virtualStorageDescId
- - changeType
- - storageResource
- properties:
- id:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- virtualStorageDescId:
- description: |
- An identifier that is unique within a VNF descriptor.
- type: string
- changeType:
- description: |
- Signals the type of change. Permitted values: * ADDED * REMOVED * MODIFIED * TEMPORARY For a temporary resource, an AffectedVirtualStorage structure exists as long as the temporary resource exists.
- type: string
- enum:
- - ADDED
- - REMOVED
- - MODIFIED
- - TEMPORARY
- storageResource:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- changedInfo:
- description: |
- This type represents attribute modifications that were performed on an "Individual VNF instance" resource. The attributes that can be included consist of those requested to be modified explicitly in the "VnfInfoModificationRequest" data structure, and additional attributes of the "VnfInstance" data structure that were modified implicitly e.g. when modifying the referenced VNF package.
- type: object
- properties:
- vnfInstanceName:
- description: |
- If present, this attribute signals modifications of the "vnfInstanceName" attribute in "VnfInstance".
- type: string
- vnfInstanceDescription:
- description: |
- If present, this attribute signals modifications of the "vnfInstanceDescription" attribute in "VnfInstance".
- type: string
- vnfConfigurableProperties:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- metadata:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extensions:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- vimConnectionInfo:
- description: |
- If present, this attribute signals modifications of certain entries in the "vimConnectionInfo" attribute array in "VnfInstance".
- type: array
- items:
- description: |
- This type represents parameters to connect to a VIM for managing the resources of a VNF instance. This structure is used to convey VIM-related parameters over the Or-Vnfm interface. Additional parameters for a VIM may be configured into the VNFM by means outside the scope of the present document, and bound to the identifier of that VIM.
- type: object
- required:
- - id
- - vimType
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vimType:
- description: |
- Discriminator for the different types of the VIM information. The value of this attribute determines the structure of the "interfaceInfo" and "accessInfo" attributes, based on the type of the VIM. The set of permitted values is expected to change over time as new types or versions of VIMs become available. The ETSI NFV registry of VIM-related information provides access to information about VimConnectionInfo definitions for various VIM types. The structure of the registry is defined in Annex C of SOL003.
- type: string
- interfaceInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- accessInfo:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- extra:
- description: |
- This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key- value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 7159.
- type: object
- vnfPkgId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfdId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProvider:
- description: |
- If present, this attribute signals modifications of the "vnfProvider" attribute in "VnfInstance". If present, this attribute (which depends on the value of the "vnfPkgId" attribute) was modified implicitly following a request to modify the "vnfPkgId" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the "vnfPkgId” attribute.
- type: string
- vnfProductName:
- description: |
- If present, this attribute signals modifications of the "vnfProductName" attribute in "VnfInstance". If present, this attribute (which depends on the value of the "vnfPkgId" attribute) was modified implicitly following a request to modify the "vnfPkgId" attribute, by copying the value of this attribute from the VNFD in the VNF Package identified by the "vnfPkgId” attribute.
- type: string
- vnfSoftwareVersion:
- description: |
- A Version.
- type: string
- vnfdVersion:
- description: |
- A Version.
- type: string
- changedExtConnectivity:
- description: |
- Information about changed external connectivity, if applicable. This allows the NFVO to obtain the information contained in the latest "result" notification if it has not received it due to an error or a wrongly configured subscription filter.
- type: array
- items:
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- extLinkPorts:
- description: |
- Link ports of this VL.
- type: array
- items:
- description: |
- This type represents information about a link port of an external VL, i.e. a port providing connectivity for the VNF to an NS VL.
- type: object
- required:
- - id
- - resourceHandle
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceHandle:
- required:
- - vimConnectionId
- - resourceId
- type: object
- description: |
- This type represents the information that allows addressing a virtualised resource that is used by a VNF instance. Information about the resource is available from the VIM.
- properties:
- vimConnectionId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceProviderId:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- resourceId:
- description: |
- An identifier maintained by the VIM or other resource provider. It is expected to be unique within the VIM instance.
- type: string
- vimLevelResourceType:
- description: |
- Type of the resource in the scope of the VIM or the resource provider.
- type: string
- cpInstanceId:
- description: |
- An identifier that is unique for the respective type within a VNF instance, but may not be globally unique.
- type: string
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- - vnfInstance
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- vnfInstance:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- grant:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- cancel:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- retry:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- rollback:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- fail:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '409':
- description: |
- Conflict
- Another request is in progress that prohibits the fulfilment of the current request, or the current resource state is inconsistent with the request.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- /subscriptions:
- post:
- description: |
- Subscribe
-
- The POST method creates a new subscription. Creation of two subscription resources with the same callbackURI and the same filter can result in performance degradation and will provide duplicates of notifications to the NFVO, and might make sense only in very rare use cases. Consequently, the VNFM may either allow creating a subscription resource if another subscription resource with the same filter and callbackUri already exists (in which case it shall return the “201 Created” response code), or may decide to not create a duplicate subscription resource (in which case it shall return a “303 See Other” response code referencing the existing subscription resource with the same filter and callbackUri).
- tags:
- - Sol003VnfLcm
- parameters:
- - name: LccnSubscriptionRequest
- description: |
- Details of the subscription to be created.
- in: body
- required: true
- schema:
- description: |
- This type represents a subscription request related to notifications about VNF lifecycle changes.
- type: object
- required:
- - callbackUri
- properties:
- filter:
- description: |
- This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical "and" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical "or" between the values of one filter attribute).
- type: object
- properties:
- vnfInstanceSubscriptionFilter:
- description: |
- This type represents subscription filter criteria to match VNF instances.
- type: object
- properties:
- vnfInstanceIds:
- description: |
- If present, match VNF instances with an instance identifier listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- notificationTypes:
- description: |
- Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the "notificationTypes" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.
- type: array
- items:
- type: string
- enum:
- - VnfLcmOperationOccurrenceNotification
- - VnfIdentifierCreationNotification
- - VnfIdentifierDeletionNotification
- operationTypes:
- description: |
- Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ INSTANTIATE | Represents the "Instantiate VNF" LCM operation. SCALE | Represents the "Scale VNF" LCM operation. SCALE_TO_LEVEL | Represents the "Scale VNF to Level" LCM operation. CHANGE_FLAVOUR | Represents the "Change VNF Flavour" LCM operation. TERMINATE | Represents the "Terminate VNF" LCM operation. HEAL | Represents the "Heal VNF" LCM operation. OPERATE | Represents the "Operate VNF" LCM operation. CHANGE_EXT_CONN | Represents the "Change external VNF connectivity" LCM operation. MODIFY_INFO | Represents the "Modify VNF Information" LCM operation.
- type: string
- enum:
- - INSTANTIATE
- - TERMINATE
- operationStates:
- description: |
- Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.
- type: string
- enum:
- - STARTING
- - PROCESSING
- - COMPLETED
- - FAILED_TEMP
- - FAILED
- - ROLLING_BACK
- - ROLLED_BACK
- callbackUri:
- description: |
- String formatted according to IETF RFC 3986.
- type: string
- authentication:
- type: object
- required:
- - authType
- properties:
- authType:
- description: |
- Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification. Permitted values: * BASIC: In every HTTP request to the notification endpoint, use HTTP Basic authentication with the client credentials.
- * OAUTH2_CLIENT_CREDENTIALS: In every HTTP request to the notification endpoint, use an OAuth 2.0 Bearer token, obtained
- using the client credentials grant type.
- * TLS_CERT: Every HTTP request to the notification endpoint is sent over a mutually authenticated TLS session, i.e. not only the
- server is authenticated, but also the client is authenticated
- during the TLS tunnel setup.
- type: array
- items:
- type: string
- enum:
- - BASIC
- - OAUTH2_CLIENT_CREDENTIALS
- - TLS_CERT
- paramsBasic:
- description: |
- Parameters for authentication/authorization using BASIC. Shall be present if authType is "BASIC" and the contained information has not been provisioned out of band. Shall be absent otherwise.
- type: object
- properties:
- userName:
- description: |
- Username to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.
- type: string
- password:
- description: |
- Password to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.
- type: string
- paramsOauth2ClientCredentials:
- description: |
- Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS. Shall be present if authType is "OAUTH2_CLIENT_CREDENTIALS" and the contained information has not been provisioned out of band. Shall be absent otherwise.
- type: object
- properties:
- clientId:
- description: |
- Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.
- type: string
- clientPassword:
- description: |
- Client password to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.
- type: string
- tokenEndpoint:
- description: |
- String formatted according to IETF RFC 3986.
- type: string
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- - name: Content-Type
- description: |
- The MIME type of the body of the request. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- responses:
- '201':
- description: |
- Created
- The subscription was created successfully. The response body shall contain a representation of the created subscription resource. The HTTP response shall include a "Location" HTTP header that points to the created subscription resource.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- Location:
- description: The resource URI of the created VNF instance
- type: string
- format: url
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a subscription related to notifications about VNF lifecycle changes.
- type: object
- required:
- - id
- - callbackUri
- - _links
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- filter:
- description: |
- This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical "and" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical "or" between the values of one filter attribute).
- type: object
- properties:
- vnfInstanceSubscriptionFilter:
- description: |
- This type represents subscription filter criteria to match VNF instances.
- type: object
- properties:
- vnfdIds:
- description: |
- If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProductsFromProviders:
- description: |
- If present, match VNF instances that belong to VNF products from certain providers. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: object
- required:
- - vnfProvider
- properties:
- vnfProvider:
- description: |
- Name of the VNF provider to match.
- type: string
- vnfProducts:
- description: |
- If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfProductName
- properties:
- vnfProductName:
- description: |
- Name of the VNF product to match.
- type: string
- versions:
- description: |
- If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfSoftwareVersion
- properties:
- vnfSoftwareVersion:
- description: |
- A version.
- type: string
- vnfdVersions:
- description: |
- If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.
- type: array
- items:
- description: |
- A version.
- type: string
- vnfInstanceIds:
- description: |
- If present, match VNF instances with an instance identifier listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceNames:
- description: |
- If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: string
- notificationTypes:
- description: |
- Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the "notificationTypes" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.
- type: array
- items:
- type: string
- enum:
- - VnfLcmOperationOccurrenceNotification
- - VnfIdentifierCreationNotification
- - VnfIdentifierDeletionNotification
- operationTypes:
- description: |
- Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ INSTANTIATE | Represents the "Instantiate VNF" LCM operation. SCALE | Represents the "Scale VNF" LCM operation. SCALE_TO_LEVEL | Represents the "Scale VNF to Level" LCM operation. CHANGE_FLAVOUR | Represents the "Change VNF Flavour" LCM operation. TERMINATE | Represents the "Terminate VNF" LCM operation. HEAL | Represents the "Heal VNF" LCM operation. OPERATE | Represents the "Operate VNF" LCM operation. CHANGE_EXT_CONN | Represents the "Change external VNF connectivity" LCM operation. MODIFY_INFO | Represents the "Modify VNF Information" LCM operation.
- type: string
- enum:
- - INSTANTIATE
- - SCALE
- - SCALE_TO_LEVEL
- - CHANGE_FLAVOUR
- - TERMINATE
- - HEAL
- - OPERATE
- - CHANGE_EXT_CONN
- - MODIFY_INFO
- operationStates:
- description: |
- Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.
- type: string
- enum:
- - STARTING
- - PROCESSING
- - COMPLETED
- - FAILED_TEMP
- - FAILED
- - ROLLING_BACK
- - ROLLED_BACK
- callbackUri:
- description: |
- String formatted according to IETF RFC 3986.
- type: string
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '303':
- description: |
- See Other
- A subscription with the same callbackURI and the same filter already exists and the policy of the VNFM is to not create redundant subscriptions. The HTTP response shall include a "Location" HTTP header that contains the resource URI of the existing subscription resource. The response body shall be empty.
- headers:
- Location:
- description: The resource URI of the created VNF instance
- type: string
- format: url
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- get:
- description: |
- Query Subscription Information
-
- The GET method queries the list of active subscriptions of the functional block that invokes the method. It can be used e.g. for resynchronization after error situations.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- responses:
- '200':
- description: |
- OK
- The list of subscriptions was queried successfully. The response body shall contain the representations of all active subscriptions of the functional block that invokes the method.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a subscription related to notifications about VNF lifecycle changes.
- type: object
- required:
- - id
- - callbackUri
- - _links
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- filter:
- description: |
- This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical "and" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical "or" between the values of one filter attribute).
- type: object
- properties:
- vnfInstanceSubscriptionFilter:
- description: |
- This type represents subscription filter criteria to match VNF instances.
- type: object
- properties:
- vnfdIds:
- description: |
- If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProductsFromProviders:
- description: |
- If present, match VNF instances that belong to VNF products from certain providers. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: object
- required:
- - vnfProvider
- properties:
- vnfProvider:
- description: |
- Name of the VNF provider to match.
- type: string
- vnfProducts:
- description: |
- If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfProductName
- properties:
- vnfProductName:
- description: |
- Name of the VNF product to match.
- type: string
- versions:
- description: |
- If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfSoftwareVersion
- properties:
- vnfSoftwareVersion:
- description: |
- A version.
- type: string
- vnfdVersions:
- description: |
- If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.
- type: array
- items:
- description: |
- A version.
- type: string
- vnfInstanceIds:
- description: |
- If present, match VNF instances with an instance identifier listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceNames:
- description: |
- If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: string
- notificationTypes:
- description: |
- Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the "notificationTypes" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.
- type: array
- items:
- type: string
- enum:
- - VnfLcmOperationOccurrenceNotification
- - VnfIdentifierCreationNotification
- - VnfIdentifierDeletionNotification
- operationTypes:
- description: |
- Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ INSTANTIATE | Represents the "Instantiate VNF" LCM operation. SCALE | Represents the "Scale VNF" LCM operation. SCALE_TO_LEVEL | Represents the "Scale VNF to Level" LCM operation. CHANGE_FLAVOUR | Represents the "Change VNF Flavour" LCM operation. TERMINATE | Represents the "Terminate VNF" LCM operation. HEAL | Represents the "Heal VNF" LCM operation. OPERATE | Represents the "Operate VNF" LCM operation. CHANGE_EXT_CONN | Represents the "Change external VNF connectivity" LCM operation. MODIFY_INFO | Represents the "Modify VNF Information" LCM operation.
- type: string
- enum:
- - INSTANTIATE
- - SCALE
- - SCALE_TO_LEVEL
- - CHANGE_FLAVOUR
- - TERMINATE
- - HEAL
- - OPERATE
- - CHANGE_EXT_CONN
- - MODIFY_INFO
- operationStates:
- description: |
- Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.
- type: string
- enum:
- - STARTING
- - PROCESSING
- - COMPLETED
- - FAILED_TEMP
- - FAILED
- - ROLLING_BACK
- - ROLLED_BACK
- callbackUri:
- description: |
- String formatted according to IETF RFC 3986.
- type: string
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- Invalid attribute-based filtering parameters. The response body shall contain a ProblemDetails structure, in which the "detail" attribute should convey more information about the error.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '/subscriptions/{subscriptionId}':
- parameters:
- - name: subscriptionId
- description: |
- Identifier of this subscription. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request creating a new subscription resource. It can also be retrieved from the "id" attribute in the payload body of that response.
- in: path
- type: string
- required: true
- get:
- description: |
- Query Subscription Information
-
- The GET method retrieves information about a subscription by reading an individual subscription resource.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Accept
- description: |
- Content-Types that are acceptable for the response. Reference: IETF RFC 7231
- in: header
- required: true
- type: string
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- responses:
- '200':
- description: |
- OK
- The operation has completed successfully. The response body shall contain a representation of the subscription resource.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- This type represents a subscription related to notifications about VNF lifecycle changes.
- type: object
- required:
- - id
- - callbackUri
- - _links
- properties:
- id:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- filter:
- description: |
- This type represents a subscription filter related to notifications about VNF lifecycle changes. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical "and" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical "or" between the values of one filter attribute).
- type: object
- properties:
- vnfInstanceSubscriptionFilter:
- description: |
- This type represents subscription filter criteria to match VNF instances.
- type: object
- properties:
- vnfdIds:
- description: |
- If present, match VNF instances that were created based on a VNFD identified by one of the vnfdId values listed in this attribute. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfProductsFromProviders:
- description: |
- If present, match VNF instances that belong to VNF products from certain providers. The attributes "vnfdIds" and "vnfProductsFromProviders" are alternatives to reference to VNF instances that are based on certain VNFDs in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: object
- required:
- - vnfProvider
- properties:
- vnfProvider:
- description: |
- Name of the VNF provider to match.
- type: string
- vnfProducts:
- description: |
- If present, match VNF instances that belong to VNF products with certain product names, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfProductName
- properties:
- vnfProductName:
- description: |
- Name of the VNF product to match.
- type: string
- versions:
- description: |
- If present, match VNF instances that belong to VNF products with certain versions and a certain product name, from one particular provider.
- type: array
- items:
- type: object
- required:
- - vnfSoftwareVersion
- properties:
- vnfSoftwareVersion:
- description: |
- A version.
- type: string
- vnfdVersions:
- description: |
- If present, match VNF instances that belong to VNF products with certain VNFD versions, a certain software version and a certain product name, from one particular provider.
- type: array
- items:
- description: |
- A version.
- type: string
- vnfInstanceIds:
- description: |
- If present, match VNF instances with an instance identifier listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- description: |
- An identifier with the intention of being globally unique.
- type: string
- vnfInstanceNames:
- description: |
- If present, match VNF instances with a VNF Instance Name listed in this attribute. The attributes "vnfInstanceIds" and "vnfInstanceNames" are alternatives to reference to particular VNF Instances in a filter. They should not be used both in the same filter instance, but one alternative should be chosen.
- type: array
- items:
- type: string
- notificationTypes:
- description: |
- Match particular notification types. Permitted values: * VnfLcmOperationOccurrenceNotification * VnfIdentifierCreationNotification * VnfIdentifierDeletionNotification The permitted values of the "notificationTypes" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.
- type: array
- items:
- type: string
- enum:
- - VnfLcmOperationOccurrenceNotification
- - VnfIdentifierCreationNotification
- - VnfIdentifierDeletionNotification
- operationTypes:
- description: |
- Match particular VNF lifecycle operation types for the notification of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ INSTANTIATE | Represents the "Instantiate VNF" LCM operation. SCALE | Represents the "Scale VNF" LCM operation. SCALE_TO_LEVEL | Represents the "Scale VNF to Level" LCM operation. CHANGE_FLAVOUR | Represents the "Change VNF Flavour" LCM operation. TERMINATE | Represents the "Terminate VNF" LCM operation. HEAL | Represents the "Heal VNF" LCM operation. OPERATE | Represents the "Operate VNF" LCM operation. CHANGE_EXT_CONN | Represents the "Change external VNF connectivity" LCM operation. MODIFY_INFO | Represents the "Modify VNF Information" LCM operation.
- type: string
- enum:
- - INSTANTIATE
- - SCALE
- - SCALE_TO_LEVEL
- - CHANGE_FLAVOUR
- - TERMINATE
- - HEAL
- - OPERATE
- - CHANGE_EXT_CONN
- - MODIFY_INFO
- operationStates:
- description: |
- Match particular LCM operation state values as reported in notifications of type VnfLcmOperationOccurrenceNotification. May be present if the "notificationTypes" attribute contains the value "VnfLcmOperationOccurrenceNotification", and shall be absent otherwise.
- type: array
- items:
- description: |
- Value | Description ------|------------ STARTING | The LCM operation is starting. PROCESSING | The LCM operation is currently in execution. COMPLETED | he LCM operation has been completed successfully. FAILED_TEMP | The LCM operation has failed and execution has stopped, but the execution of the operation is not considered to be closed. FAILED | The LCM operation has failed and it cannot be retried or rolled back, as it is determined that such action won't succeed. ROLLING_BACK | The LCM operation is currently being rolled back. ROLLED_BACK | The LCM operation has been successfully rolled back, i.e. The state of the VNF prior to the original operation invocation has been restored as closely as possible.
- type: string
- enum:
- - STARTING
- - PROCESSING
- - COMPLETED
- - FAILED_TEMP
- - FAILED
- - ROLLING_BACK
- - ROLLED_BACK
- callbackUri:
- description: |
- String formatted according to IETF RFC 3986.
- type: string
- _links:
- description: |
- Links to resources related to this resource.
- type: object
- required:
- - self
- properties:
- self:
- description: |
- This type represents a link to a resource.
- type: object
- required:
- - href
- properties:
- href:
- description: |
- URI of the referenced resource.
- type: string
- format: url
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- delete:
- description: |
- Terminate Subscription
-
- The DELETE method terminates an individual subscription.
- tags:
- - Sol003VnfLcm
- parameters:
- - name: Authorization
- description: |
- The authorization token for the request. Reference: IETF RFC 7235
- in: header
- required: false
- type: string
- responses:
- '204':
- description: |
- No Content
- The subscription resource was deleted successfully. The response body shall be empty.
- headers:
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- '400':
- description: |
- Bad Request
- If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem.
- ---
-
- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- ---
-
- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '401':
- description: |
- Unauthorized
- If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- WWW-Authenticate:
- description: |
- Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.
- type: string
- maximum: 1
- minimum: 0
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '403':
- description: |
- Forbidden
- If the API consumer is not allowed to perform a particular request to a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided. It should include in the "detail" attribute information about the source of the problem, and may indicate how to solve it.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '404':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. Specifically in case of this task resource, the reason can also be that the task is not supported for the VNF LCM operation occurrence represented by the parent resource, and that the task resource consequently does not exist. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the sourceof the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '405':
- description: |
- Not Found
- If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '406':
- description: |
- Not Acceptable
- If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '500':
- description: |
- Internal Server Error
- If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
- '503':
- description: |
- Service Unavailable
- If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.
- headers:
- Content-Type:
- description: The MIME type of the body of the response.
- type: string
- maximum: 1
- minimum: 1
- schema:
- description: |
- The definition of the general "ProblemDetails" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the "status" and "detail" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the "ProblemDetails" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].
- type: object
- required:
- - status
- - detail
- properties:
- type:
- description: |
- A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be "about:blank".
- type: string
- format: URI
- title:
- description: |
- A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than "about:blank", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).
- type: string
- status:
- description: |
- The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
- type: integer
- detail:
- description: |
- A human-readable explanation specific to this occurrence of the problem.
- type: string
- instance:
- description: |
- A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.
- type: string
- format: URI
-
diff --git a/vnfm-simulator/vnfm-service/pom.xml b/vnfm-simulator/vnfm-service/pom.xml
deleted file mode 100644
index 1e3244bae4..0000000000
--- a/vnfm-simulator/vnfm-service/pom.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so.vnfm</groupId>
- <artifactId>vnfm-simulator</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <artifactId>vnfm-service</artifactId>
- <name>${project.artifactId}</name>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <java.version>1.8</java.version>
- <okhttp-version>2.7.5</okhttp-version>
- <gson-version>2.8.1</gson-version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.onap.so.adapters</groupId>
- <artifactId>mso-vnfm-adapter-ext-clients</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-devtools</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.security.oauth</groupId>
- <artifactId>spring-security-oauth2</artifactId>
- <version>2.3.6.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jaxrs</artifactId>
- <version>1.5.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.directory.studio</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger-ui</artifactId>
- <version>2.6.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger2</artifactId>
- <version>2.6.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.9.8</version>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.9.3</version>
- </dependency>
- <dependency>
- <groupId>org.modelmapper</groupId>
- <artifactId>modelmapper</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okio</groupId>
- <artifactId>okio</artifactId>
- <version>1.13.0</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson-version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.so</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${springboot.version}</version>
- <configuration>
- <mainClass>org.onap.svnfm.simulator.config.SvnfmApplication</mainClass>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <excludes>
- <exclude>**/*.p12</exclude>
- <exclude>**/*.jks</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>**/*.p12</include>
- <include>**/*.jks</include>
- </includes>
- </resource>
- </resources>
- </build>
-</project>
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
deleted file mode 100644
index a1abb05f07..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.onap.svnfm.simulator.config;
-
-import java.util.Arrays;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-import org.springframework.cache.concurrent.ConcurrentMapCache;
-import org.springframework.cache.support.SimpleCacheManager;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ApplicationConfig implements ApplicationRunner {
-
- private static final String PORT = "local.server.port";
-
- @Value("${server.dns.name:so-vnfm-simulator.onap}")
- private String serverDnsName;
-
- @Value("${server.request.grant.auth:oauth}")
- private String grantAuth;
-
- @Autowired
- private Environment environment;
-
- private String baseUrl;
-
- @Override
- public void run(final ApplicationArguments args) throws Exception {
- baseUrl = "https://" + serverDnsName + ":" + environment.getProperty(PORT);
- }
-
- public String getBaseUrl() {
- return baseUrl;
- }
-
- public String getGrantAuth() {
- return grantAuth;
- }
-
- @Bean
- public CacheManager cacheManager() {
- final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE);
- final SimpleCacheManager manager = new SimpleCacheManager();
- manager.setCaches(Arrays.asList(inlineResponse201));
- return manager;
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java
deleted file mode 100644
index 723ae906e6..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.config;
-
-import org.onap.svnfm.simulator.controller.SvnfmController;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-
-/**
- * The spring boot application for the VNF LCM.
- * <p>
- * The VNFM receives requests through its REST API {@link SvnfmController}
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author ronan.kenny@est.tech
- */
-@SpringBootApplication(scanBasePackages = {"org.onap"})
-@EnableJpaRepositories("org.onap.svnfm.simulator")
-@EntityScan("org.onap.svnfm.simulator.model")
-@EnableCaching
-public class SvnfmApplication {
- public static void main(final String[] args) {
- SpringApplication.run(SvnfmApplication.class, args);
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/constants/Constant.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/constants/Constant.java
deleted file mode 100644
index 98f47bf455..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/constants/Constant.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.constants;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author ronan.kenny@est.tech
- */
-public class Constant {
-
- public static final String BASE_URL = "/vnflcm/v1";
- public static final String VNF_PROVIDER = "XYZ";
- public static final String VNF_PROVIDER_NAME = "vCPE";
- public static final String VNF_SOFTWARE_VERSION = "1.24";
- public static final String VNFD_VERSION = "onapvcpe01_cxp9025898_4r85d01";
- public static final String VNF_NOT_INSTANTIATED = "NOT_INSTANTIATED";
- public static final String VNF_CONFIG_PROPERTIES =
- "{\"isAutoScaleEnabled\": \"true\",\"isAutoHealingEnabled\": \"true\"}";
- public static final String IN_LINE_RESPONSE_201_CACHE = "inlineResponse201";
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
deleted file mode 100644
index 2140b57488..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.controller;
-
-import java.util.UUID;
-import javax.ws.rs.core.MediaType;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.repository.VnfmCacheRepository;
-import org.onap.svnfm.simulator.services.SvnfmService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@RestController
-@RequestMapping(path = Constant.BASE_URL, produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
-public class SvnfmController {
-
- @Autowired
- private SvnfmService svnfmService;
-
- @Autowired
- private VnfmCacheRepository vnfmCacheRepository;
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SvnfmController.class);
-
- /**
- * To create the Vnf and stores the response in cache
- *
- * @param CreateVnfRequest
- * @return InlineResponse201
- */
- @PostMapping(value = "/vnf_instances")
- public ResponseEntity<InlineResponse201> createVnf(@RequestBody final CreateVnfRequest createVNFRequest) {
- LOGGER.info("Start createVnf {}", createVNFRequest);
- final String id = UUID.randomUUID().toString();
- final HttpHeaders headers = new HttpHeaders();
- headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- final ResponseEntity<InlineResponse201> responseEntity =
- new ResponseEntity<>(vnfmCacheRepository.createVnf(createVNFRequest, id), headers, HttpStatus.CREATED);
- LOGGER.info("Finished create {}", responseEntity);
- return responseEntity;
- }
-
- /**
- * Get the vnf by id from cache
- *
- * @param vnfId
- * @return InlineResponse201
- */
- @GetMapping(value = "/vnf_instances/{vnfInstanceId}")
- @ResponseStatus(code = HttpStatus.OK)
- public InlineResponse201 getVnf(@PathVariable("vnfInstanceId") final String vnfId) {
- LOGGER.info("Start getVnf------");
- return vnfmCacheRepository.getVnf(vnfId);
- }
-
- /**
- * To instantiate the vnf and returns the operation id
- *
- * @param vnfId
- * @throws InterruptedException
- */
- @PostMapping(value = "/vnf_instances/{vnfInstanceId}/instantiate")
- public ResponseEntity<Void> instantiateVnf(@PathVariable("vnfInstanceId") final String vnfId) {
- LOGGER.info("Start instantiateVNFRequest for vnf id {} ", vnfId);
-
- final HttpHeaders headers = new HttpHeaders();
- headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- headers.add(HttpHeaders.LOCATION, svnfmService.instantiateVnf(vnfId));
- return new ResponseEntity<>(headers, HttpStatus.ACCEPTED);
- }
-
- /**
- * To delete the vnf by id
- *
- * @param vnfId
- * @return InlineResponse201
- */
- @DeleteMapping(value = "/vnf_instances/{vnfInstanceId}")
- @ResponseStatus(code = HttpStatus.OK)
- public ResponseEntity<Void> deleteVnf(@PathVariable("vnfInstanceId") final String vnfId) {
- LOGGER.info("Start deleting Vnf------");
- vnfmCacheRepository.deleteVnf(vnfId);
- final HttpHeaders headers = new HttpHeaders();
- headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- return new ResponseEntity<>(headers, HttpStatus.NO_CONTENT);
- }
-
- /**
- * To terminate the vnf by id
- *
- * @param vnfId
- * @throws InterruptedException
- */
- @PostMapping(value = "/vnf_instances/{vnfInstanceId}/terminate")
- public ResponseEntity<Object> terminateVnf(@PathVariable("vnfInstanceId") final String vnfId) {
- LOGGER.info("Start terminateVNFRequest {}", vnfId);
- final HttpHeaders headers = new HttpHeaders();
- headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- headers.add(HttpHeaders.LOCATION, svnfmService.terminateVnf(vnfId));
- return new ResponseEntity<>(headers, HttpStatus.ACCEPTED);
- }
-
-
- /**
- * To get the status of the operation by id
- *
- * @param operationId
- * @return response entity
- * @throws InterruptedException
- */
- @GetMapping(value = "/vnf_lcm_op_occs/{vnfLcmOpOccId}")
- public ResponseEntity<InlineResponse200> getOperationStatus(
- @PathVariable("vnfLcmOpOccId") final String operationId) {
- LOGGER.info("Start getOperationStatus");
- final HttpHeaders headers = new HttpHeaders();
- headers.add("Content-Type", MediaType.APPLICATION_JSON);
- return new ResponseEntity<>(svnfmService.getOperationStatus(operationId), headers, HttpStatus.OK);
- }
-
- @PostMapping(value = "/subscriptions")
- public ResponseEntity<InlineResponse2001> subscribeForNotifications(
- @RequestBody final LccnSubscriptionRequest lccnSubscriptionRequest) {
- LOGGER.info("Subscription request received: {}", lccnSubscriptionRequest);
- svnfmService.registerSubscription(lccnSubscriptionRequest);
- final InlineResponse2001 response = new InlineResponse2001();
-
- final HttpHeaders headers = new HttpHeaders();
- headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- return new ResponseEntity<>(response, headers, HttpStatus.CREATED);
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfInstance.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfInstance.java
deleted file mode 100644
index 6af860c8f8..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfInstance.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@Entity
-@Table(name = "VNF_INSTANCE")
-public class VnfInstance {
- @Id
- @Column(name = "id", nullable = false)
- private String id;
- private String vnfInstanceName;
- private String vnfInstanceDescription;
- private String vnfdId;
- private String vnfProvider;
- private String vnfProductName;
- private String vnfSoftwareVersion;
- private String vnfdVersion;
- private String vnfPkgId;
- private String vnfConfigurableProperties;
- private String vimConnectionInfo;
- private String vnfInstantiationState;
- private String instantiatedVnfInfo;
- private String metadata;
- private String extensions;
- private String links;
-
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- public String getVnfInstanceName() {
- return vnfInstanceName;
- }
-
- public void setVnfInstanceName(final String vnfInstanceName) {
- this.vnfInstanceName = vnfInstanceName;
- }
-
- public String getVnfInstanceDescription() {
- return vnfInstanceDescription;
- }
-
- public void setVnfInstanceDescription(final String vnfInstanceDescription) {
- this.vnfInstanceDescription = vnfInstanceDescription;
- }
-
- public String getVnfdId() {
- return vnfdId;
- }
-
- public void setVnfdId(final String vnfdId) {
- this.vnfdId = vnfdId;
- }
-
- public String getVnfProvider() {
- return vnfProvider;
- }
-
- public void setVnfProvider(final String vnfProvider) {
- this.vnfProvider = vnfProvider;
- }
-
- public String getVnfProductName() {
- return vnfProductName;
- }
-
- public void setVnfProductName(final String vnfProductName) {
- this.vnfProductName = vnfProductName;
- }
-
- public String getVnfSoftwareVersion() {
- return vnfSoftwareVersion;
- }
-
- public void setVnfSoftwareVersion(final String vnfSoftwareVersion) {
- this.vnfSoftwareVersion = vnfSoftwareVersion;
- }
-
- public String getVnfdVersion() {
- return vnfdVersion;
- }
-
- public void setVnfdVersion(final String vnfdVersion) {
- this.vnfdVersion = vnfdVersion;
- }
-
- public String getVnfPkgId() {
- return vnfPkgId;
- }
-
- public void setVnfPkgId(final String vnfPkgId) {
- this.vnfPkgId = vnfPkgId;
- }
-
- public String getVnfConfigurableProperties() {
- return vnfConfigurableProperties;
- }
-
- public void setVnfConfigurableProperties(final String vnfConfigurableProperties) {
- this.vnfConfigurableProperties = vnfConfigurableProperties;
- }
-
- public String getVimConnectionInfo() {
- return vimConnectionInfo;
- }
-
- public void setVimConnectionInfo(final String vimConnectionInfo) {
- this.vimConnectionInfo = vimConnectionInfo;
- }
-
- public String getInstantiationState() {
- return vnfInstantiationState;
- }
-
- public void setVnfInstantiationState(final String vnfInstantiationState) {
- this.vnfInstantiationState = vnfInstantiationState;
- }
-
- public String getVnfInstantiationState() {
- return instantiatedVnfInfo;
- }
-
- public void setInstantiatedVnfInfo(final String instantiatedVnfInfo) {
- this.instantiatedVnfInfo = instantiatedVnfInfo;
- }
-
- public String getMetadata() {
- return metadata;
- }
-
- public void setMetadata(final String metadata) {
- this.metadata = metadata;
- }
-
- public String getExtensions() {
- return extensions;
- }
-
- public void setExtensions(final String extensions) {
- this.extensions = extensions;
- }
-
- public String getLinks() {
- return links;
- }
-
- public void setLinks(final String links) {
- this.links = links;
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfOperation.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfOperation.java
deleted file mode 100644
index c37f433668..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/VnfOperation.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.svnfm.simulator.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@Entity
-@Table(name = "VNF_OPERATION")
-public class VnfOperation {
- @Id
- @Column(name = "operationId", nullable = false)
- private String id;
- private String vnfInstanceId;
-
- @Enumerated(EnumType.STRING)
- private InlineResponse200.OperationEnum operation;
-
- @Enumerated(EnumType.STRING)
- private InlineResponse200.OperationStateEnum operationState;
-
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- public String getVnfInstanceId() {
- return vnfInstanceId;
- }
-
- public void setVnfInstanceId(final String vnfInstanceId) {
- this.vnfInstanceId = vnfInstanceId;
- }
-
- public InlineResponse200.OperationEnum getOperation() {
- return operation;
- }
-
- public void setOperation(final InlineResponse200.OperationEnum operation) {
- this.operation = operation;
- }
-
- public InlineResponse200.OperationStateEnum getOperationState() {
- return operationState;
- }
-
- public void setOperationState(final InlineResponse200.OperationStateEnum operationState) {
- this.operationState = operationState;
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/Vnfds.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/Vnfds.java
deleted file mode 100644
index ea171f0fce..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/model/Vnfds.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.onap.svnfm.simulator.model;
-
-import java.util.List;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-@ConfigurationProperties(prefix = "vnfds")
-@Component
-public class Vnfds {
-
- private List<Vnfd> vnfdList;
-
- public static class Vnfd {
-
- private String vnfdId;
- private List<Vnfc> vnfclist;
-
-
- public String getVnfdId() {
- return vnfdId;
- }
-
- public void setVnfdId(final String vnfdId) {
- this.vnfdId = vnfdId;
- }
-
- public List<Vnfc> getVnfcList() {
- return vnfclist;
- }
-
- public void setVnfcList(final List<Vnfc> vnfclist) {
- this.vnfclist = vnfclist;
- }
- }
-
-
- public static class Vnfc {
-
- private String vnfcId;
- private String type;
- private String vduId;
- private String resourceTemplateId;
- private String grantResourceId;
-
- public String getVnfcId() {
- return vnfcId;
- }
-
- public void setVnfcId(final String vnfcId) {
- this.vnfcId = vnfcId;
- }
-
- public String getVduId() {
- return vduId;
- }
-
- public void setVduId(final String vduId) {
- this.vduId = vduId;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public String getResourceTemplateId() {
- return resourceTemplateId;
- }
-
- public void setResourceTemplateId(final String resourceTemplateId) {
- this.resourceTemplateId = resourceTemplateId;
- }
-
- public String getGrantResourceId() {
- return grantResourceId;
- }
-
- public void setGrantResourceId(final String grantResourceId) {
- this.grantResourceId = grantResourceId;
- }
-
- }
-
-
- public List<Vnfd> getVnfdList() {
- return vnfdList;
- }
-
-
- public void setVnfdList(final List<Vnfd> vnfdList) {
- this.vnfdList = vnfdList;
- }
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java
deleted file mode 100644
index 9a3cd95bec..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/notifications/VnfInstantiationNotification.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.notifications;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-public class VnfInstantiationNotification implements Runnable {
-
- private static final Logger logger = LoggerFactory.getLogger(VnfInstantiationNotification.class);
-
- @Override
- public void run() {
- try {
- Thread.sleep(10000);
- } catch (final InterruptedException e) {
- logger.error("Error occured while simulating instantiation ", e);
- Thread.currentThread().interrupt();
- }
- logger.info("Instantiation process finished");
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/AuthorizationServerConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/AuthorizationServerConfig.java
deleted file mode 100644
index 5d2c310635..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/AuthorizationServerConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.onap.svnfm.simulator.oauth;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
-
-@Configuration
-@EnableAuthorizationServer
-@Profile("oauth-authentication")
-/**
- * Configures the authorization server for oauth token based authentication when the spring profile
- * "oauth-authentication" is active
- */
-public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
-
- private static final int ONE_DAY = 60 * 60 * 24;
-
- @Override
- public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
- clients.inMemory().withClient("vnfmadapter")
- .secret("$2a$10$dHzTlqSBcm8hdO52LBvnX./zNTvUzzJy.lZrc4bCBL5gkln0wX6T6")
- .authorizedGrantTypes("client_credentials").scopes("write").accessTokenValiditySeconds(ONE_DAY)
- .refreshTokenValiditySeconds(ONE_DAY);
- }
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2AccessTokenAdapter.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2AccessTokenAdapter.java
deleted file mode 100644
index 7bccffa2e0..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/oauth/OAuth2AccessTokenAdapter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.onap.svnfm.simulator.oauth;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import java.lang.reflect.Type;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-
-public class OAuth2AccessTokenAdapter implements JsonSerializer<OAuth2AccessToken> {
-
- @Override
- public JsonElement serialize(final OAuth2AccessToken src, final Type typeOfSrc,
- final JsonSerializationContext context) {
- final JsonObject obj = new JsonObject();
- obj.addProperty(OAuth2AccessToken.ACCESS_TOKEN, src.getValue());
- obj.addProperty(OAuth2AccessToken.TOKEN_TYPE, src.getTokenType());
- if (src.getRefreshToken() != null) {
- obj.addProperty(OAuth2AccessToken.REFRESH_TOKEN, src.getRefreshToken().getValue());
- }
- obj.addProperty(OAuth2AccessToken.EXPIRES_IN, src.getExpiresIn());
- final JsonArray scopeObj = new JsonArray();
- for (final String scope : src.getScope()) {
- scopeObj.add(scope);
- }
- obj.add(OAuth2AccessToken.SCOPE, scopeObj);
-
- return obj;
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmCacheRepository.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmCacheRepository.java
deleted file mode 100644
index fbdbf744d0..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/repository/VnfmCacheRepository.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.repository;
-
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.services.SvnfmService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Repository;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@Repository
-public class VnfmCacheRepository {
-
- @Autowired
- private SvnfmService svnfmService;
-
- @Cacheable(value = Constant.IN_LINE_RESPONSE_201_CACHE, key = "#id")
- public InlineResponse201 createVnf(final CreateVnfRequest createVnfRequest, final String id) {
- return svnfmService.createVnf(createVnfRequest, id);
- }
-
-
-
- public InlineResponse201 getVnf(final String id) {
- return svnfmService.getVnf(id);
- }
-
- /**
- * @param vnfId
- * @return
- */
- @CacheEvict(value = Constant.IN_LINE_RESPONSE_201_CACHE, key = "#id")
- public void deleteVnf(final String id) {}
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/InstantiateOperationProgressor.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/InstantiateOperationProgressor.java
deleted file mode 100644
index 020fa0390d..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/InstantiateOperationProgressor.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.onap.svnfm.simulator.services;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.modelmapper.ModelMapper;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources.TypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201AddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201VimConnections;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoResourceHandle;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoVnfcResourceInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.onap.svnfm.simulator.model.Vnfds;
-import org.onap.svnfm.simulator.model.Vnfds.Vnfc;
-import org.onap.svnfm.simulator.model.Vnfds.Vnfd;
-import org.onap.svnfm.simulator.repository.VnfOperationRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InstantiateOperationProgressor extends OperationProgressor {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(InstantiateOperationProgressor.class);
-
- public InstantiateOperationProgressor(final VnfOperation operation, final SvnfmService svnfmService,
- final VnfOperationRepository vnfOperationRepository, final ApplicationConfig applicationConfig,
- final Vnfds vnfds, final SubscriptionService subscriptionService) {
- super(operation, svnfmService, vnfOperationRepository, applicationConfig, vnfds, subscriptionService);
- }
-
- @Override
- protected List<GrantsAddResources> getAddResources(final String vnfdId) {
- final List<GrantsAddResources> resources = new ArrayList<>();
-
- for (final Vnfd vnfd : vnfds.getVnfdList()) {
- if (vnfd.getVnfdId().equals(vnfdId)) {
- for (final Vnfc vnfc : vnfd.getVnfcList()) {
- final GrantsAddResources addResource = new GrantsAddResources();
- vnfc.setGrantResourceId(UUID.randomUUID().toString());
- addResource.setId(vnfc.getGrantResourceId());
- addResource.setType(TypeEnum.fromValue(vnfc.getType()));
- addResource.setResourceTemplateId(vnfc.getResourceTemplateId());
- addResource.setVduId(vnfc.getVduId());
- resources.add(addResource);
- }
- }
- }
- return resources;
- }
-
- @Override
- protected List<GrantsAddResources> getRemoveResources(final String vnfdId) {
- return Collections.emptyList();
- }
-
- @Override
- protected List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> handleGrantResponse(
- final InlineResponse201 grantResponse) {
- final InlineResponse201InstantiatedVnfInfo instantiatedVnfInfo = createInstantiatedVnfInfo(grantResponse);
- svnfmService.updateVnf(InstantiationStateEnum.INSTANTIATED, instantiatedVnfInfo, operation.getVnfInstanceId(),
- getVimConnections(grantResponse));
- return instantiatedVnfInfo.getVnfcResourceInfo();
- }
-
- private InlineResponse201InstantiatedVnfInfo createInstantiatedVnfInfo(final InlineResponse201 grantResponse) {
- final InlineResponse201InstantiatedVnfInfo instantiatedVnfInfo = new InlineResponse201InstantiatedVnfInfo();
-
- final Map<String, String> mapOfGrantResourceIdToVimConnectionId = new HashMap<>();
- for (final InlineResponse201AddResources addResource : grantResponse.getAddResources()) {
- mapOfGrantResourceIdToVimConnectionId.put(addResource.getResourceDefinitionId(),
- addResource.getVimConnectionId());
- }
- LOGGER.info("VIM connections in grant response: {}", mapOfGrantResourceIdToVimConnectionId);
-
- for (final Vnfd vnfd : vnfds.getVnfdList()) {
- if (vnfd.getVnfdId().equals(svnfmService.getVnf(operation.getVnfInstanceId()).getVnfdId())) {
- for (final Vnfc vnfc : vnfd.getVnfcList()) {
- final InlineResponse201InstantiatedVnfInfoVnfcResourceInfo vnfcResourceInfoItem =
- new InlineResponse201InstantiatedVnfInfoVnfcResourceInfo();
- vnfcResourceInfoItem.setId(vnfc.getVnfcId());
- vnfcResourceInfoItem.setVduId(vnfc.getVduId());
- final InlineResponse201InstantiatedVnfInfoResourceHandle computeResource =
- new InlineResponse201InstantiatedVnfInfoResourceHandle();
- computeResource.setResourceId(UUID.randomUUID().toString());
- LOGGER.info("Checking for VIM connection id for : {}", vnfc.getGrantResourceId());
- computeResource
- .setVimConnectionId(mapOfGrantResourceIdToVimConnectionId.get(vnfc.getGrantResourceId()));
-
- computeResource.setVimLevelResourceType("OS::Nova::Server");
- vnfcResourceInfoItem.setComputeResource(computeResource);
- instantiatedVnfInfo.addVnfcResourceInfoItem(vnfcResourceInfoItem);
- }
- }
- }
-
- return instantiatedVnfInfo;
- }
-
-
- private List<InlineResponse201VimConnectionInfo> getVimConnections(final InlineResponse201 grantResponse) {
- final List<InlineResponse201VimConnectionInfo> vimConnectionInfo = new ArrayList<>();
- for (final InlineResponse201VimConnections vimConnection : grantResponse.getVimConnections()) {
- final ModelMapper modelMapper = new ModelMapper();
- vimConnectionInfo.add(modelMapper.map(vimConnection, InlineResponse201VimConnectionInfo.class));
- }
- return vimConnectionInfo;
- }
-
- @Override
- protected ChangeTypeEnum getVnfcChangeType() {
- return ChangeTypeEnum.ADDED;
- }
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/OperationProgressor.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/OperationProgressor.java
deleted file mode 100644
index 6e9478bdeb..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/OperationProgressor.java
+++ /dev/null
@@ -1,348 +0,0 @@
-package org.onap.svnfm.simulator.services;
-
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.codec.binary.Base64;
-import org.modelmapper.ModelMapper;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.ApiResponse;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsLinks;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsLinksVnfLcmOpOcc;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.ApiClient;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.ApiException;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.api.DefaultApi;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.NotificationStatusEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.NotificationTypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoVnfcResourceInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.onap.svnfm.simulator.model.Vnfds;
-import org.onap.svnfm.simulator.repository.VnfOperationRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-public abstract class OperationProgressor implements Runnable {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(OperationProgressor.class);
- private static final String CERTIFICATE_TO_TRUST = "so-vnfm-adapter.crt.pem";
-
- private Resource keyStoreResource = new ClassPathResource("so-vnfm-simulator.p12");
- private String keyStorePassword = "7Em3&j4.19xYiMelhD5?xbQ.";
-
- protected final VnfOperation operation;
- protected final SvnfmService svnfmService;
- private final VnfOperationRepository vnfOperationRepository;
- private final ApplicationConfig applicationConfig;
- protected final Vnfds vnfds;
- private final SubscriptionService subscriptionService;
- private final DefaultApi notificationClient;
- private final org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.api.DefaultApi grantClient;
-
- public OperationProgressor(final VnfOperation operation, final SvnfmService svnfmService,
- final VnfOperationRepository vnfOperationRepository, final ApplicationConfig applicationConfig,
- final Vnfds vnfds, final SubscriptionService subscriptionService) {
- this.operation = operation;
- this.svnfmService = svnfmService;
- this.vnfOperationRepository = vnfOperationRepository;
- this.applicationConfig = applicationConfig;
- this.vnfds = vnfds;
- this.subscriptionService = subscriptionService;
-
- final ApiClient apiClient = new ApiClient();
- String callBackUrl = subscriptionService.getSubscriptions().iterator().next().getCallbackUri();
- callBackUrl = callBackUrl.substring(0, callBackUrl.indexOf("/lcn/"));
- apiClient.setBasePath(callBackUrl);
- apiClient.setKeyManagers(getKeyManagers());
- apiClient.setSslCaCert(getCertificateToTrust());
- notificationClient = new DefaultApi(apiClient);
-
- final org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.ApiClient grantApiClient =
- new org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.ApiClient();
- grantApiClient.setBasePath(callBackUrl);
- grantApiClient.setKeyManagers(getKeyManagers());
- grantApiClient.setSslCaCert(getCertificateToTrust());
- grantClient = new org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.api.DefaultApi(grantApiClient);
- }
-
- private InputStream getCertificateToTrust() {
- try {
- return new ClassPathResource(CERTIFICATE_TO_TRUST).getInputStream();
- } catch (final IOException exception) {
- LOGGER.error("Error reading certificate to trust, https calls to VNFM adapter will fail", exception);
- return null;
- }
- }
-
- private KeyManager[] getKeyManagers() {
- KeyStore keystore;
- try {
- keystore = KeyStore.getInstance("pkcs12");
- keystore.load(keyStoreResource.getInputStream(), keyStorePassword.toCharArray());
- KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
- keyManagerFactory.init(keystore, keyStorePassword.toCharArray());
- return keyManagerFactory.getKeyManagers();
- } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException
- | UnrecoverableKeyException exception) {
- LOGGER.error("Error reading certificate, https calls using two way TLS to VNFM adapter will fail",
- exception);
- return new KeyManager[0];
- }
- }
-
- @Override
- public void run() {
- try {
- final VnfLcmOperationOccurrenceNotification notificationOfStarting =
- buildNotification(NotificationStatusEnum.START, OperationStateEnum.STARTING);
- sendNotification(notificationOfStarting);
-
- sleep(2000);
- setState(InlineResponse200.OperationStateEnum.PROCESSING);
- final VnfLcmOperationOccurrenceNotification notificationOfProcessing =
- buildNotification(NotificationStatusEnum.START, OperationStateEnum.PROCESSING);
- sendNotification(notificationOfProcessing);
-
-
- final GrantRequest grantRequest = buildGrantRequest();
- final InlineResponse201 grantResponse = sendGrantRequest(grantRequest);
- final List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> vnfcs = handleGrantResponse(grantResponse);
-
- svnfmService.getVnf(operation.getVnfInstanceId()).getInstantiatedVnfInfo();
-
- sleep(10000);
- setState(InlineResponse200.OperationStateEnum.COMPLETED);
- final VnfLcmOperationOccurrenceNotification notificationOfCompleted =
- buildNotification(NotificationStatusEnum.RESULT, OperationStateEnum.COMPLETED);
- notificationOfCompleted.setAffectedVnfcs(getVnfcs(vnfcs));
-
- sendNotification(notificationOfCompleted);
- } catch (final Exception exception) {
- LOGGER.error("Error in OperationProgressor ", exception);
- }
-
- }
-
- private void sleep(final long milliSeconds) {
- try {
- Thread.sleep(milliSeconds);
- } catch (final InterruptedException e) {
- operation.setOperationState(InlineResponse200.OperationStateEnum.FAILED);
- // Restore interrupted state
- Thread.currentThread().interrupt();
- }
- }
-
- private void setState(final InlineResponse200.OperationStateEnum state) {
- LOGGER.info("Setting state to {} for operation {}", state, operation.getId());
- operation.setOperationState(state);
- vnfOperationRepository.save(operation);
- }
-
- private VnfLcmOperationOccurrenceNotification buildNotification(final NotificationStatusEnum status,
- final OperationStateEnum operationState) {
- final VnfLcmOperationOccurrenceNotification notification = new VnfLcmOperationOccurrenceNotification();
- notification.setId(UUID.randomUUID().toString());
- notification.setNotificationType(NotificationTypeEnum.VNFLCMOPERATIONOCCURRENCENOTIFICATION);
- notification.setNotificationStatus(status);
- notification.setOperationState(operationState);
- notification.setOperation(OperationEnum.fromValue(operation.getOperation().toString()));
- notification.setVnfInstanceId(operation.getVnfInstanceId());
- notification.setVnfLcmOpOccId(operation.getId());
-
- final LcnVnfLcmOperationOccurrenceNotificationLinks links = new LcnVnfLcmOperationOccurrenceNotificationLinks();
- final LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance vnfInstanceLink =
- new LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance();
- vnfInstanceLink.setHref(getVnfLink());
- links.setVnfInstance(vnfInstanceLink);
-
-
- final LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance operationLink =
- new LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance();
- operationLink.setHref(getOperationLink());
- links.setVnfLcmOpOcc(operationLink);
-
- notification.setLinks(links);
-
- return notification;
- }
-
- private List<LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs> getVnfcs(
- final List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> instantiatedVnfcs) {
- final List<LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs> vnfcs = new ArrayList<>();
- if (instantiatedVnfcs != null) {
- for (final InlineResponse201InstantiatedVnfInfoVnfcResourceInfo instantiatedVnfc : instantiatedVnfcs) {
- LOGGER.info("VNFC TO BE CONVERTED: {}", instantiatedVnfc);
- final ModelMapper mapper = new ModelMapper();
- final LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs vnfc =
- mapper.map(instantiatedVnfc, LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.class);
- LOGGER.info("VNFC FROM CONVERSION: {}", vnfc);
- vnfc.setChangeType(getVnfcChangeType());
- vnfcs.add(vnfc);
- }
- }
- return vnfcs;
- }
-
- private void sendNotification(final VnfLcmOperationOccurrenceNotification notification) {
- LOGGER.info("Sending notification: {}", notification);
- try {
- final SubscriptionsAuthenticationParamsBasic subscriptionAuthentication =
- subscriptionService.getSubscriptions().iterator().next().getAuthentication().getParamsBasic();
- final String auth =
- subscriptionAuthentication.getUserName() + ":" + subscriptionAuthentication.getPassword();
- final byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1));
- String authHeader = "Basic " + new String(encodedAuth);
-
- notificationClient.lcnVnfLcmOperationOccurrenceNotificationPostWithHttpInfo(notification,
- MediaType.APPLICATION_JSON, authHeader);
- } catch (final ApiException exception) {
- LOGGER.error("Error sending notification: " + notification, exception);
- LOGGER.error("Response code: {}, body: {}, basePath: {}", exception.getCode(), exception.getResponseBody(),
- notificationClient.getApiClient().getBasePath());
-
- }
- }
-
-
- public GrantRequest buildGrantRequest() {
- final GrantRequest grantRequest = new GrantRequest();
- grantRequest.setVnfInstanceId(operation.getVnfInstanceId());
- final String vnfdId = svnfmService.getVnf(operation.getVnfInstanceId()).getVnfdId();
- grantRequest.setVnfdId(vnfdId);
- grantRequest.setAddResources(getAddResources(vnfdId));
- grantRequest.setRemoveResources(getRemoveResources(vnfdId));
- grantRequest.setVnfLcmOpOccId(operation.getId());
- grantRequest
- .setOperation(org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantRequest.OperationEnum
- .fromValue(operation.getOperation().getValue()));
- grantRequest.setIsAutomaticInvocation(false);
-
- final GrantsLinksVnfLcmOpOcc vnfInstanceLink = new GrantsLinksVnfLcmOpOcc();
- vnfInstanceLink.setHref(getVnfLink());
- final GrantsLinksVnfLcmOpOcc operationInstanceLink = new GrantsLinksVnfLcmOpOcc();
- operationInstanceLink.setHref(getOperationLink());
- final GrantsLinks links = new GrantsLinks();
- links.setVnfInstance(vnfInstanceLink);
- links.setVnfLcmOpOcc(operationInstanceLink);
- grantRequest.setLinks(links);
- return grantRequest;
- }
-
- protected abstract List<GrantsAddResources> getAddResources(final String vnfdId);
-
- protected abstract List<GrantsAddResources> getRemoveResources(final String vnfdId);
-
- protected abstract List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> handleGrantResponse(
- InlineResponse201 grantResponse);
-
- protected abstract ChangeTypeEnum getVnfcChangeType();
-
- private InlineResponse201 sendGrantRequest(final GrantRequest grantRequest) {
- LOGGER.info("Sending grant request: {}", grantRequest);
- try {
-
- final SubscriptionsAuthenticationParamsOauth2ClientCredentials subscriptionAuthentication =
- subscriptionService.getSubscriptions().iterator().next().getAuthentication()
- .getParamsOauth2ClientCredentials();
-
- final String authHeader = applicationConfig.getGrantAuth().equals("oauth")
- ? "Bearer " + getToken(notificationClient.getApiClient(), subscriptionAuthentication)
- : null;
-
- final ApiResponse<InlineResponse201> response = grantClient.grantsPostWithHttpInfo(grantRequest,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, authHeader);
- LOGGER.info("Grant Response: {}", response);
- return response.getData();
- } catch (final org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.ApiException exception) {
- LOGGER.error("Error sending notification: " + grantRequest, exception);
- return null;
- }
- }
-
- private String getVnfLink() {
- return getLinkBaseUrl() + "/vnf_instances/" + operation.getVnfInstanceId();
- }
-
- private String getOperationLink() {
- return getLinkBaseUrl() + "/vnf_lcm_op_occs/" + operation.getId();
- }
-
- private String getLinkBaseUrl() {
- return applicationConfig.getBaseUrl() + "/vnflcm/v1";
- }
-
- private String getToken(final ApiClient apiClient,
- final SubscriptionsAuthenticationParamsOauth2ClientCredentials oauthClientCredentials) {
- final String basePath = apiClient.getBasePath().substring(0, apiClient.getBasePath().indexOf("/so/"));
- final String tokenUrl = basePath + "/oauth/token?grant_type=client_credentials";
-
- try {
- URL url = new URL(tokenUrl);
- HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
- connection.setRequestMethod("POST");
- final String authorizationHeader = getAuthorizationHeader(oauthClientCredentials);
- connection.addRequestProperty("Authorization", authorizationHeader);
-
- connection.connect();
-
- return getResponse(connection).get("access_token").getAsString();
-
- } catch (IOException exception) {
- LOGGER.error("Error getting token", exception);
- return null;
- }
- }
-
- private String getAuthorizationHeader(
- final SubscriptionsAuthenticationParamsOauth2ClientCredentials oauthClientCredentials) {
- final String auth = oauthClientCredentials.getClientId() + ":" + oauthClientCredentials.getClientPassword();
- final byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8));
- return "Basic " + new String(encodedAuth);
- }
-
- private JsonObject getResponse(HttpsURLConnection connection) throws IOException {
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String line, data = "";
- while ((line = in.readLine()) != null) {
- data += line;
- }
- in.close();
- connection.getInputStream().close();
-
- JsonObject jsonObject = new JsonParser().parse(data).getAsJsonObject();
- return jsonObject;
- }
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SubscriptionService.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SubscriptionService.java
deleted file mode 100644
index 6a2340bdf6..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SubscriptionService.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.onap.svnfm.simulator.services;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
-import org.springframework.stereotype.Service;
-
-@Service
-public class SubscriptionService {
-
- Collection<LccnSubscriptionRequest> subscriptions = new ArrayList<>();
-
- public void registerSubscription(final LccnSubscriptionRequest subscription) {
- subscriptions.add(subscription);
- }
-
- public Collection<LccnSubscriptionRequest> getSubscriptions() {
- return Collections.unmodifiableCollection(subscriptions);
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SvnfmService.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SvnfmService.java
deleted file mode 100644
index 95043d35ed..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/SvnfmService.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.services;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.UUID;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.modelmapper.ModelMapper;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.model.VnfInstance;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.onap.svnfm.simulator.model.Vnfds;
-import org.onap.svnfm.simulator.notifications.VnfInstantiationNotification;
-import org.onap.svnfm.simulator.notifications.VnfmAdapterCreationNotification;
-import org.onap.svnfm.simulator.repository.VnfOperationRepository;
-import org.onap.svnfm.simulator.repository.VnfmRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-import org.springframework.cache.annotation.CachePut;
-import org.springframework.cache.support.SimpleValueWrapper;
-import org.springframework.stereotype.Service;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@Service
-public class SvnfmService {
-
- private VnfmRepository vnfmRepository;
- private VnfOperationRepository vnfOperationRepository;
- private VnfmHelper vnfmHelper;
- private ApplicationConfig applicationConfig;
- private CacheManager cacheManager;
- private Vnfds vnfds;
- private SubscriptionService subscriptionService;
-
- private final ExecutorService executor = Executors.newCachedThreadPool();
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SvnfmService.class);
-
- @Autowired
- public SvnfmService(VnfmRepository vnfmRepository, VnfOperationRepository vnfOperationRepository,
- VnfmHelper vnfmHelper, ApplicationConfig applicationConfig, CacheManager cacheManager, Vnfds vnfds,
- SubscriptionService subscriptionService) {
- this.vnfmRepository = vnfmRepository;
- this.vnfOperationRepository = vnfOperationRepository;
- this.vnfmHelper = vnfmHelper;
- this.applicationConfig = applicationConfig;
- this.cacheManager = cacheManager;
- this.vnfds = vnfds;
- this.subscriptionService = subscriptionService;
- }
-
- public InlineResponse201 createVnf(final CreateVnfRequest createVNFRequest, final String id) {
- InlineResponse201 inlineResponse201 = null;
- try {
- final VnfInstance vnfInstance = vnfmHelper.createVnfInstance(createVNFRequest, id);
- vnfmRepository.save(vnfInstance);
- final Thread creationNotification = new Thread(new VnfmAdapterCreationNotification());
- creationNotification.start();
- inlineResponse201 = vnfmHelper.getInlineResponse201(vnfInstance);
- LOGGER.debug("Response from Create VNF {}", inlineResponse201);
- } catch (IllegalAccessException | InvocationTargetException e) {
- LOGGER.error("Failed in Create Vnf", e);
- }
- return inlineResponse201;
- }
-
- @CachePut(value = Constant.IN_LINE_RESPONSE_201_CACHE, key = "#id")
- public void updateVnf(final InstantiationStateEnum instantiationState,
- final InlineResponse201InstantiatedVnfInfo instantiatedVnfInfo, final String id,
- final List<InlineResponse201VimConnectionInfo> vimConnectionInfo) {
- final InlineResponse201 vnf = getVnf(id);
- vnf.setInstantiatedVnfInfo(instantiatedVnfInfo);
- vnf.setInstantiationState(instantiationState);
- vnf.setVimConnectionInfo(vimConnectionInfo);
- }
-
- public String instantiateVnf(final String vnfId) {
- final VnfOperation vnfOperation = buildVnfOperation(InlineResponse200.OperationEnum.INSTANTIATE, vnfId);
- vnfOperationRepository.save(vnfOperation);
- executor.submit(new InstantiateOperationProgressor(vnfOperation, this, vnfOperationRepository,
- applicationConfig, vnfds, subscriptionService));
- return vnfOperation.getId();
- }
-
- private VnfOperation buildVnfOperation(final InlineResponse200.OperationEnum operation, final String vnfId) {
- final VnfOperation vnfOperation = new VnfOperation();
- vnfOperation.setId(UUID.randomUUID().toString());
- vnfOperation.setOperation(operation);
- vnfOperation.setOperationState(InlineResponse200.OperationStateEnum.STARTING);
- vnfOperation.setVnfInstanceId(vnfId);
- return vnfOperation;
- }
-
- public InlineResponse200 getOperationStatus(final String operationId) {
- LOGGER.info("Getting operation status with id: {}", operationId);
- final Thread instantiationNotification = new Thread(new VnfInstantiationNotification());
- instantiationNotification.start();
- for (final VnfOperation operation : vnfOperationRepository.findAll()) {
- LOGGER.info("Operation found: {}", operation);
- if (operation.getId().equals(operationId)) {
- final ModelMapper modelMapper = new ModelMapper();
- return modelMapper.map(operation, InlineResponse200.class);
- }
- }
- return null;
- }
-
- public InlineResponse201 getVnf(final String vnfId) {
- final Cache ca = cacheManager.getCache(Constant.IN_LINE_RESPONSE_201_CACHE);
- if (ca == null)
- return null;
- final SimpleValueWrapper wrapper = (SimpleValueWrapper) ca.get(vnfId);
- if (wrapper == null)
- return null;
- final InlineResponse201 inlineResponse201 = (InlineResponse201) wrapper.get();
- if (inlineResponse201 != null) {
- LOGGER.info("Cache Read Successful");
- return inlineResponse201;
- }
- return null;
- }
-
- public String terminateVnf(final String vnfId) {
- final VnfOperation vnfOperation = buildVnfOperation(InlineResponse200.OperationEnum.TERMINATE, vnfId);
- vnfOperationRepository.save(vnfOperation);
- executor.submit(new TerminateOperationProgressor(vnfOperation, this, vnfOperationRepository, applicationConfig,
- vnfds, subscriptionService));
- return vnfOperation.getId();
- }
-
- public void registerSubscription(final LccnSubscriptionRequest subscription) {
- subscriptionService.registerSubscription(subscription);
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/TerminateOperationProgressor.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/TerminateOperationProgressor.java
deleted file mode 100644
index c829be9a4f..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/TerminateOperationProgressor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.onap.svnfm.simulator.services;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources.TypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsResource;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoResourceHandle;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoVnfcResourceInfo;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.onap.svnfm.simulator.model.Vnfds;
-import org.onap.svnfm.simulator.repository.VnfOperationRepository;
-
-public class TerminateOperationProgressor extends OperationProgressor {
-
- public TerminateOperationProgressor(final VnfOperation operation, final SvnfmService svnfmService,
- final VnfOperationRepository vnfOperationRepository, final ApplicationConfig applicationConfig,
- final Vnfds vnfds, final SubscriptionService subscriptionService) {
- super(operation, svnfmService, vnfOperationRepository, applicationConfig, vnfds, subscriptionService);
- }
-
- @Override
- protected List<GrantsAddResources> getAddResources(final String vnfdId) {
- return Collections.emptyList();
- }
-
- @Override
- protected List<GrantsAddResources> getRemoveResources(final String vnfdId) {
- final List<GrantsAddResources> resources = new ArrayList<>();
-
- final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201 vnf =
- svnfmService.getVnf(operation.getVnfInstanceId());
- for (final InlineResponse201InstantiatedVnfInfoVnfcResourceInfo vnfc : vnf.getInstantiatedVnfInfo()
- .getVnfcResourceInfo()) {
- final GrantsAddResources addResource = new GrantsAddResources();
- addResource.setId(UUID.randomUUID().toString());
- addResource.setType(TypeEnum.COMPUTE);
- addResource.setVduId(vnfc.getVduId());
- final GrantsResource resource = new GrantsResource();
-
- final InlineResponse201InstantiatedVnfInfoResourceHandle computeResource = vnfc.getComputeResource();
- resource.setResourceId(computeResource.getResourceId());
- resource.setVimConnectionId(computeResource.getVimConnectionId());
- resource.setVimLevelResourceType(computeResource.getVimLevelResourceType());
- addResource.setResource(resource);
- resources.add(addResource);
-
- }
- return resources;
- }
-
- @Override
- protected List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> handleGrantResponse(
- final InlineResponse201 grantResponse) {
- final List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> vnfcs =
- svnfmService.getVnf(operation.getVnfInstanceId()).getInstantiatedVnfInfo().getVnfcResourceInfo();
- svnfmService.updateVnf(InstantiationStateEnum.NOT_INSTANTIATED, null, operation.getVnfInstanceId(), null);
- return vnfcs;
- }
-
- @Override
- protected ChangeTypeEnum getVnfcChangeType() {
- return ChangeTypeEnum.REMOVED;
- }
-
-
-
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java
deleted file mode 100644
index 8f1e299fec..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.services;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.commons.beanutils.BeanUtils;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.model.VnfInstance;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- *
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
- * @author Ronan Kenny (ronan.kenny@est.tech)
- */
-@Component
-public class VnfmHelper {
-
- private ApplicationConfig applicationConfig;
-
- @Autowired
- public VnfmHelper(ApplicationConfig applicationConfig) {
- this.applicationConfig = applicationConfig;
- }
-
- /**
- *
- * @param createVNFRequest
- * @return vnfInstance
- */
- public VnfInstance createVnfInstance(final CreateVnfRequest createVNFRequest, final String id) {
- final VnfInstance vnfInstance = new VnfInstance();
- vnfInstance.setId(id);
- vnfInstance.setVnfInstanceName(createVNFRequest.getVnfInstanceName());
- vnfInstance.setVnfInstanceDescription(createVNFRequest.getVnfInstanceDescription());
- vnfInstance.setVnfdId(createVNFRequest.getVnfdId());
- vnfInstance.setVnfProvider(Constant.VNF_PROVIDER);
- vnfInstance.setVnfProductName(Constant.VNF_PROVIDER_NAME);
- return vnfInstance;
- }
-
- /**
- *
- * @param vnfInstance
- * @return inlineResponse201
- * @throws IllegalAccessException
- * @throws InvocationTargetException
- */
- public InlineResponse201 getInlineResponse201(final VnfInstance vnfInstance)
- throws IllegalAccessException, InvocationTargetException {
- final InlineResponse201 inlineResponse201 = new InlineResponse201();
- BeanUtils.copyProperties(inlineResponse201, vnfInstance);
- inlineResponse201.setVnfdVersion(Constant.VNFD_VERSION);
- inlineResponse201.setVnfSoftwareVersion(Constant.VNF_SOFTWARE_VERSION);
- inlineResponse201.setInstantiationState(InstantiationStateEnum.NOT_INSTANTIATED);
- inlineResponse201.setVnfConfigurableProperties(getConfigProperties());
- addAdditionalPRopertyInlineResponse201(inlineResponse201);
- return inlineResponse201;
- }
-
- private Map<String, String> getConfigProperties() {
- final Map<String, String> configProperties = new HashMap<>();
- configProperties.put("ipAddress", "10.11.12.13");
- return configProperties;
- }
-
- private void addAdditionalPRopertyInlineResponse201(final InlineResponse201 inlineResponse201) {
- final InlineResponse201LinksSelf VnfInstancesLinksSelf = new InlineResponse201LinksSelf();
- VnfInstancesLinksSelf
- .setHref(applicationConfig.getBaseUrl() + "/vnflcm/v1/vnf_instances/" + inlineResponse201.getId());
- final InlineResponse201LinksSelf VnfInstancesLinksSelfInstantiate = new InlineResponse201LinksSelf();
- VnfInstancesLinksSelfInstantiate.setHref(applicationConfig.getBaseUrl() + "/vnflcm/v1/vnf_instances/"
- + inlineResponse201.getId() + "/instantiate");
- final InlineResponse201Links inlineResponse201Links = new InlineResponse201Links();
- inlineResponse201Links.setSelf(VnfInstancesLinksSelf);
- inlineResponse201Links.setInstantiate(VnfInstancesLinksSelfInstantiate);
- inlineResponse201.setLinks(inlineResponse201Links);
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml b/vnfm-simulator/vnfm-service/src/main/resources/application.yaml
deleted file mode 100644
index ea8105d891..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright © 2019 Nordix Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-spring:
- h2:
- console:
- enabled: true
- path: console
- datasource:
- url: jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
- username: admin
- password: admin
- http:
- converters:
- preferred-json-mapper: gson
- security:
- usercredentials:
- - username: vnfm
- password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
- role: BPEL-Client
-
-server:
- port: 9093
- tomcat:
- max-threads: 50
- ssl:
- key-alias: so@so.onap.org
- key--store-password: '7Em3&j4.19xYiMelhD5?xbQ.'
- key-store: classpath:so-vnfm-simulator.p12
- key-store-type: PKCS12
-
-vnfds:
- vnfdlist:
- - vnfdid: 1
- vnfclist:
- - vnfcid: VNFC1
- resourceTemplateId: vnfd1_vnfc1
- vduId: vnfd1_vduForVnfc1
- type: COMPUTE
- - vnfcid: VNFC2
- resourceTemplateId: vnfd1_vnfc2
- vduId: vnfd1_vduForVnfc2
- type: COMPUTE
- - vnfdid: 2
- vnfclist:
- - vnfcid: VNFC3
- resourceTemplateId: vnfd2_vnfc3
- vduId: vnfd2_vduForVnfc3
- type: COMPUTE
- - vnfcid: VNFC4
- resourceTemplateId: vnfd2_vnfc4
- vduId: vnfd2_vduForVnfc4
- type: COMPUTE
diff --git a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-adapter.crt.pem b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-adapter.crt.pem
deleted file mode 100644
index 3c899e3bf5..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-adapter.crt.pem
+++ /dev/null
@@ -1,30 +0,0 @@
-Bag Attributes
- friendlyName: so@so.onap.org
- localKeyID: 54 69 6D 65 20 31 35 36 33 34 36 33 36 32 39 35 38 33
-subject=/CN=so-vnfm-adapter/emailAddress=/OU=so@so.onap.org/OU=OSAAF/O=ONAP/C=US
-issuer=/C=US/O=ONAP/OU=OSAAF/CN=intermediateCA_9
------BEGIN CERTIFICATE-----
-MIIEITCCAwmgAwIBAgIILuAnLLineoYwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UE
-BhMCVVMxDTALBgNVBAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRkwFwYDVQQDDBBp
-bnRlcm1lZGlhdGVDQV85MB4XDTE5MDcxODE1MjcwOVoXDTIwMDcxODE1MjcwOVow
-cDEYMBYGA1UEAwwPc28tdm5mbS1hZGFwdGVyMQ8wDQYJKoZIhvcNAQkBFgAxFzAV
-BgNVBAsMDnNvQHNvLm9uYXAub3JnMQ4wDAYDVQQLDAVPU0FBRjENMAsGA1UECgwE
-T05BUDELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
-AQCu2NbWjFiZ5Tz5P7daCD6mqJqSWV3f+gkM2VC/UYM/43hd/2ILJbbtsv4uzS/P
-GXl3UIKBjb7zRiDCvLNMFsHCZ9/gIonG1z737S42LCrdVKq/KQ59yIOPrxYmLyiQ
-Xy81ChX77b2KvKPPeF+K/wnh5fLwlcJ18geeCoWGaMK0C/i6J/uUb9z+Ef0Nmtau
-NdXAuUnERCKMra+3kFxZwaRC/gSCy+/s6EQdeaGNiijg03AmrUx9XjrJjHbYMDVo
-OKSxtv0E4fxbfmTpHaKCuN4eg+0nEXw/eiIEuSHJuh3KKv7wRoP/hG/Tdog7x60M
-SD+hdNjCbFP6yAyMPfoxVnjHAgMBAAGjgecwgeQwCQYDVR0TBAIwADAOBgNVHQ8B
-Af8EBAMCBeAwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMFQGA1Ud
-IwRNMEuAFIH3mVsQuciM3vNSXupOaaBDPqzdoTCkLjAsMQ4wDAYDVQQLDAVPU0FB
-RjENMAsGA1UECgwET05BUDELMAkGA1UEBhMCVVOCAQcwHQYDVR0OBBYEFFLrO3T4
-QybeDQ28mHgC/xT5f03qMDAGA1UdEQQpMCeCD3NvLXZuZm0tYWRhcHRlcoIUc28t
-dm5mbS1hZGFwdGVyLm9uYXAwDQYJKoZIhvcNAQELBQADggEBACe+JaVIjTku/QNp
-XoQCNN+sllSZmEHTLmYfpSzY5BY2AeJsgTYqFtAhtp6uQf8Jr993CyEyeJ4if2Z9
-J5NWoJKmY1+a63UphB1mg4sNSCuDxvbxPjtrFkOx/DiB1XEUdoifS9IQSDIIuhaD
-YP6sih1TBOh/2ityCe51Mu1J9/wgb24rlYouVtEyQeIai4dqngFHeQHeNXOnGN0z
-osEcKSYa0C+ZOAomBMT58C2aDz9vyI8YPuzwVSDKndmXUgvrkkVnxk3qJRtghDQc
-RV+4SeZg8s4+5DxKL4AL15IAaAPMJHi+MRtfm7qNzqCEl5sAEzO7S4oVHeWLNFV8
-a9PHErg=
------END CERTIFICATE-----
diff --git a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12 b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12
deleted file mode 100644
index 7ac02855bc..0000000000
--- a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12
+++ /dev/null
Binary files differ
diff --git a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/controllers/TestSvnfmController.java b/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/controllers/TestSvnfmController.java
deleted file mode 100644
index 9cb0702ee0..0000000000
--- a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/controllers/TestSvnfmController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.svnfm.simulator.controllers;
-
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.controller.SvnfmController;
-import org.onap.svnfm.simulator.repository.VnfmCacheRepository;
-import org.onap.svnfm.simulator.services.SvnfmService;
-import org.springframework.http.MediaType;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-@RunWith(MockitoJUnitRunner.class)
-public class TestSvnfmController {
-
- @InjectMocks
- private SvnfmController svnfmController;
-
- private MockMvc mockMvc;
-
- @Mock
- private SvnfmService svnfmService;
-
- @Mock
- private VnfmCacheRepository vnfmCacheRepository;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- this.mockMvc = MockMvcBuilders.standaloneSetup(svnfmController).build();
- }
-
- @Test
- public void createVnfInstanceTest() throws Exception {
- final CreateVnfRequest createVnfRequest = new CreateVnfRequest();
-
- createVnfRequest.setVnfdId("123456798");
- createVnfRequest.setVnfInstanceName("createVnfInstanceTest");
- createVnfRequest.setVnfInstanceDescription("createVnfInstanceTest");
-
- when(vnfmCacheRepository.createVnf(eq(createVnfRequest), anyString())).thenReturn(new InlineResponse201());
-
- final String body = (new ObjectMapper()).valueToTree(createVnfRequest).toString();
- this.mockMvc
- .perform(post(Constant.BASE_URL + "/vnf_instances").content(body)
- .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isCreated()).andExpect(content().contentType(MediaType.APPLICATION_JSON));
- }
-}
-
-
diff --git a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/InstantiateOperatorProgressorTest.java b/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/InstantiateOperatorProgressorTest.java
deleted file mode 100644
index 46030e94d3..0000000000
--- a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/InstantiateOperatorProgressorTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.svnfm.simulator.services;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import java.util.ArrayList;
-import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201AddResources;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201VimConnections;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoVnfcResourceInfo;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.model.VnfOperation;
-import org.onap.svnfm.simulator.model.Vnfds;
-import org.onap.svnfm.simulator.model.Vnfds.Vnfc;
-import org.onap.svnfm.simulator.model.Vnfds.Vnfd;
-
-public class InstantiateOperatorProgressorTest {
-
- private static final String VNF_ID = "vnfTestId";
- private static final String CALLBACK_URI = "/lcn/uritest";
- private static final String VNFC_TYPE = "COMPUTE";
- private static final String RESOURCE_TEMPLATE_ID = "resTempIdTest";
- private static final String VDU_ID = "vduIdTest";
- private static final String VNF_INSTANCE_ID = "vnfInstanceId";
- private static final String VNFC_ID = "vnfcIdTest";
- private static final String RESOURCE_DEFINITION_ID = "resDefTestId";
- private static final String VIM_CONNECTION_ID = "vimConnTestId";
-
- private SvnfmService svnfmServiceMock;
-
- private InstantiateOperationProgressor testedObject;
-
- @Before
- public void setup() {
- svnfmServiceMock = mock(SvnfmService.class);
- VnfOperation vnfOperation = new VnfOperation();
- vnfOperation.setVnfInstanceId(VNF_INSTANCE_ID);
- testedObject = new InstantiateOperationProgressor(vnfOperation, svnfmServiceMock, null, new ApplicationConfig(),
- createVnfds(), createSubscriptionService());
- }
-
- @Test
- public void getAddResources_vnfIdFound() {
- List<GrantsAddResources> result = testedObject.getAddResources(VNF_ID);
- assertThat(result).hasSize(1);
- GrantsAddResources grantsAddResourceResult = result.get(0);
- assertThat(grantsAddResourceResult.getType()).hasToString(VNFC_TYPE);
- assertThat(grantsAddResourceResult.getResourceTemplateId()).isEqualTo(RESOURCE_TEMPLATE_ID);
- assertThat(grantsAddResourceResult.getVduId()).isEqualTo(VDU_ID);
- }
-
- @Test
- public void getAddResources_vnfIdNotFound() {
- List<GrantsAddResources> result = testedObject.getAddResources("otherVnfId");
- assertThat(result).isEmpty();
- }
-
- @Test
- public void handleGrantResponse_VnfdObjectsAvailable() {
- when(svnfmServiceMock.getVnf(VNF_INSTANCE_ID)).thenReturn(createInlineResponse201());
-
- InlineResponse201VimConnections inlineResponse201VimConnections = new InlineResponse201VimConnections();
- List<InlineResponse201VimConnections> listOfVimConnection = new ArrayList<>();
- listOfVimConnection.add(inlineResponse201VimConnections);
-
- InlineResponse201AddResources inlineResponse201AddResources = new InlineResponse201AddResources();
- inlineResponse201AddResources.setResourceDefinitionId(RESOURCE_DEFINITION_ID);
- inlineResponse201AddResources.setVimConnectionId(VIM_CONNECTION_ID);
- List<InlineResponse201AddResources> listOfResources = new ArrayList<>();
- listOfResources.add(inlineResponse201AddResources);
-
- InlineResponse201 inlineResponse201 = new InlineResponse201();
- inlineResponse201.setVimConnections(listOfVimConnection);
- inlineResponse201.setAddResources(listOfResources);
- List<InlineResponse201InstantiatedVnfInfoVnfcResourceInfo> resultList =
- testedObject.handleGrantResponse(inlineResponse201);
-
- assertThat(resultList).hasSize(1);
- InlineResponse201InstantiatedVnfInfoVnfcResourceInfo resultObject = resultList.get(0);
- assertThat(resultObject.getId()).isEqualTo(VNFC_ID);
- assertThat(resultObject.getVduId()).isEqualTo(VDU_ID);
- assertThat(resultObject.getComputeResource().getVimConnectionId()).isEqualTo(VIM_CONNECTION_ID);
- }
-
- @Test
- public void getVnfcChangeType_enumAdded() {
- assertThat(testedObject.getVnfcChangeType().getValue()).isEqualTo("ADDED");
- }
-
- @Test
- public void getRemoveResourcesShouldReturnEmptyList() {
- assertThat(testedObject.getRemoveResources("anyVnfId")).isEmpty();
- }
-
- private Vnfds createVnfds() {
- Vnfd vnfd = new Vnfd();
- vnfd.setVnfdId(VNF_ID);
- List<Vnfc> vnfcList = new ArrayList<>();
- vnfcList.add(createVnfc());
- vnfd.setVnfcList(vnfcList);
- List<Vnfd> vnfdList = new ArrayList<>();
- vnfdList.add(vnfd);
-
- Vnfds vnfds = new Vnfds();
- vnfds.setVnfdList(vnfdList);
- return vnfds;
- }
-
- private Vnfc createVnfc() {
- Vnfc vnfc = new Vnfc();
- vnfc.setVnfcId(VNFC_ID);
- vnfc.setType(VNFC_TYPE);
- vnfc.setResourceTemplateId(RESOURCE_TEMPLATE_ID);
- vnfc.setVduId(VDU_ID);
- vnfc.setGrantResourceId(RESOURCE_DEFINITION_ID);
- return vnfc;
- }
-
- private SubscriptionService createSubscriptionService() {
- SubscriptionService subscriptionService = new SubscriptionService();
- LccnSubscriptionRequest lccnSubscriptionRequest = new LccnSubscriptionRequest();
- lccnSubscriptionRequest.setCallbackUri(CALLBACK_URI);
- subscriptionService.registerSubscription(lccnSubscriptionRequest);
- return subscriptionService;
- }
-
- private org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201 createInlineResponse201() {
- org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201 inlineResponse201 =
- new org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201();
- inlineResponse201.setVnfdId(VNF_ID);
- return inlineResponse201;
- }
-}
diff --git a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java b/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java
deleted file mode 100644
index 2b9598e54f..0000000000
--- a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.svnfm.simulator.services;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
-import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
-import org.onap.svnfm.simulator.config.ApplicationConfig;
-import org.onap.svnfm.simulator.constants.Constant;
-import org.onap.svnfm.simulator.model.VnfInstance;
-
-public class VnfmHelperTest {
-
- private static final String VNF_INSTANCE_ID = "vnfInstanceTestId";
- private static final String VNFD_ID = "vnfdTestId";
- private static final String VNF_INSTANCE_NAME = "vnfInsNameTest";
- private static final String VNF_INSTANCE_DESCRIPTION = "vnfInstTestDescr";
- private static final String APPLICATION_CONFIG_BASE_URL = "appConfUrl";
- private VnfmHelper testedObject;
- private ApplicationConfig applicationConfigMock;
-
- @Before
- public void setup() {
- applicationConfigMock = mock(ApplicationConfig.class);
- testedObject = new VnfmHelper(applicationConfigMock);
- }
-
- @Test
- public void createVnfInstance() {
- // when
- VnfInstance result = testedObject.createVnfInstance(createVnfRequest(), VNF_INSTANCE_ID);
- // then
- assertThat(result.getId()).isEqualTo(VNF_INSTANCE_ID);
- assertThat(result.getVnfdId()).isEqualTo(VNFD_ID);
- assertThat(result.getVnfInstanceName()).isEqualTo(VNF_INSTANCE_NAME);
- assertThat(result.getVnfInstanceDescription()).isEqualTo(VNF_INSTANCE_DESCRIPTION);
- assertThat(result.getVnfProvider()).isEqualTo(Constant.VNF_PROVIDER);
- assertThat(result.getVnfProductName()).isEqualTo(Constant.VNF_PROVIDER_NAME);
- }
-
- @Test
- public void getInlineResponse201() throws Exception {
- // given
- when(applicationConfigMock.getBaseUrl()).thenReturn(APPLICATION_CONFIG_BASE_URL);
- // when
- InlineResponse201 result = testedObject.getInlineResponse201(prepareVnfInstance());
- // then
- assertThat(result.getVnfdVersion()).isEqualTo(Constant.VNFD_VERSION);
- assertThat(result.getVnfSoftwareVersion()).isEqualTo(Constant.VNF_SOFTWARE_VERSION);
- assertThat(result.getInstantiationState()).isEqualByComparingTo(InstantiationStateEnum.NOT_INSTANTIATED);
- verifyAdditionalPropertyInlineResponse201(result);
- }
-
- private CreateVnfRequest createVnfRequest() {
- CreateVnfRequest createVnfRequest = new CreateVnfRequest();
- createVnfRequest.setVnfdId(VNFD_ID);
- createVnfRequest.setVnfInstanceName(VNF_INSTANCE_NAME);
- createVnfRequest.setVnfInstanceDescription(VNF_INSTANCE_DESCRIPTION);
- return createVnfRequest;
- }
-
- private VnfInstance prepareVnfInstance() {
- VnfInstance vnfInstance = new VnfInstance();
- vnfInstance.setId(VNF_INSTANCE_ID);
- return vnfInstance;
- }
-
- private void verifyAdditionalPropertyInlineResponse201(InlineResponse201 result) {
- InlineResponse201LinksSelf expectedVnfInstancesLinksSelf = new InlineResponse201LinksSelf();
- expectedVnfInstancesLinksSelf
- .setHref(APPLICATION_CONFIG_BASE_URL + "/vnflcm/v1/vnf_instances/" + VNF_INSTANCE_ID);
- assertThat(result.getLinks().getSelf()).isEqualTo(expectedVnfInstancesLinksSelf);
-
- InlineResponse201LinksSelf expectedVnfInstancesLinksSelfInstantiate = new InlineResponse201LinksSelf();
- expectedVnfInstancesLinksSelfInstantiate.setHref(
- (APPLICATION_CONFIG_BASE_URL + "/vnflcm/v1/vnf_instances/" + VNF_INSTANCE_ID + "/instantiate"));
- assertThat(result.getLinks().getInstantiate()).isEqualTo(expectedVnfInstancesLinksSelfInstantiate);
- }
-
-}