summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java19
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java32
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql15
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql3
-rw-r--r--adapters/mso-cnf-adapter/pom.xml4
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java66
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java87
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/ErrorResponse.java)2
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java (renamed from adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java)13
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java509
-rw-r--r--adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java94
-rw-r--r--adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java62
-rw-r--r--adapters/mso-nssmf-adapter/pom.xml1
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/MSONssmfApplication.java1
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/annotation/ServiceLogger.java36
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/NssmfAdapterConfig.java36
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/RequestDbConfig.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/RequestDbConfig.java)2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/WebSecurityConfig.java)2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java187
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterController.java57
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/ErrorResponse.java63
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfInfo.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java)61
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfUrlInfo.java17
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/RestResponse.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestResponse.java)2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenRequest.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenRequest.java)29
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenResponse.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenResponse.java)22
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ActionType.java45
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ExecutorType.java25
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/HttpMethod.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java)2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/JobStatus.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java)2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/SelectionType.java27
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/exceptions/ApplicationException.java2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProvider.java4
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java10
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/interceptor/LoggerInterceptor.java92
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManager.java44
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java125
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java267
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java182
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java128
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java107
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalCnNssmfManager.java53
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalAnNssmfManager.java54
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalCnNssmfManager.java56
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java42
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfAdapterRest.java64
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java34
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/TrustAllHostNameVerifier.java1
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/NssmfManagerService.java45
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImpl.java143
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/NssmfAdapterUtil.java29
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestUtil.java)64
-rw-r--r--adapters/mso-nssmf-adapter/src/main/resources/application-test.yaml60
-rw-r--r--adapters/mso-nssmf-adapter/src/main/resources/application.yaml3
-rw-r--r--adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java335
-rw-r--r--adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java438
-rw-r--r--adapters/mso-nssmf-adapter/src/test/resources/application-test.yaml60
-rw-r--r--adapters/mso-oof-adapter/.gitignore33
-rw-r--r--adapters/mso-oof-adapter/pom.xml120
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/MsoOofAdapterApplication.java32
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/OofAdapterClientConfig.java76
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/WebSecurityConfig.java37
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/constants/Constants.java31
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/exceptions/OofAdapterException.java39
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/model/OofRequest.java52
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofCallbackHandler.java71
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofClient.java67
-rw-r--r--adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/utils/OofUtils.java110
-rw-r--r--adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofCallbackHandlerTest.java85
-rw-r--r--adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofClientTest.java86
-rw-r--r--adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/utils/OofUtilsTest.java76
-rw-r--r--adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionOofRequest.json84
-rw-r--r--adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionResponse.json20
-rw-r--r--adapters/mso-openstack-adapters/pom.xml2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java19
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java15
-rw-r--r--adapters/pom.xml1
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy103
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy36
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1.groovy409
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java5
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/oof/adapter/beans/payload/OofRequest.java49
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java9
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationService.java111
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java124
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy76
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy70
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/GenericPnfSoftwareUpgrade.groovy (renamed from bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/PNFSoftwareUpgrade.groovy)4
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn454
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfHealthCheck.bpmn2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSWUPDownload.bpmn (renamed from bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn)10
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSoftwareUpgrade.bpmn (renamed from bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn)10
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn6
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn220
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoHandleOofRequest.bpmn122
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSWUPDownloadTest.java (renamed from bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java)18
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java (renamed from bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java)11
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/ServiceLevelUpgradeTest.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/GenericPnfSoftwareUpgradeTest.json (renamed from bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json)0
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest.json (renamed from bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json)0
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest_catalogdb.json (renamed from bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json)0
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/level/impl/ServiceLevelConstants.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java73
-rw-r--r--common/pom.xml9
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java42
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java11
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java2
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java89
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java47
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java34
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java52
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java1
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java36
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java1
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java24
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java35
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java8
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java9
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java50
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java73
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java12
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbb.java (renamed from common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbbList.java)13
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllc.java (renamed from common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllcList.java)2
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java50
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java4
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java49
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java31
-rw-r--r--docs/api/swagger/swagger.html883
-rw-r--r--docs/developer_info/Mso_Openstack_Adapter.rst796
-rw-r--r--docs/developer_info/developer_information.rst1
-rw-r--r--docs/images/DeleteInventory.pngbin0 -> 23922 bytes
-rw-r--r--docs/images/InventoryAddAudit.pngbin0 -> 23291 bytes
-rw-r--r--docs/images/InventoryCreate.pngbin0 -> 23140 bytes
-rw-r--r--docs/images/InventoryDeleteAudit.pngbin0 -> 23275 bytes
-rw-r--r--docs/images/InventoryQueryAudit.pngbin0 -> 23456 bytes
-rw-r--r--docs/images/OpenstackAdapterInvoke.pngbin0 -> 25753 bytes
-rw-r--r--docs/images/OpenstackAdapterPoller.pngbin0 -> 26486 bytes
-rw-r--r--docs/images/OpenstackAdapterRollback.pngbin0 -> 25984 bytes
-rw-r--r--graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectPlurals.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java3
-rw-r--r--packages/docker/pom.xml31
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json57
-rw-r--r--version.properties2
147 files changed, 7983 insertions, 1500 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
index 59c6becfbd..fa5c57f447 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/AuthenticationMethodFactory.java
@@ -89,4 +89,23 @@ public final class AuthenticationMethodFactory {
v3Auth.setScope(scope);
return v3Auth;
}
+
+ public final com.woorea.openstack.keystone.v3.model.Authentication getAuthenticationForV3(
+ CloudIdentity cloudIdentity) {
+ Identity identity = new Identity();
+ Password password = new Password();
+ User user = new User();
+ Domain userDomain = new Domain();
+ userDomain.setName(cloudIdentity.getUserDomainName());
+ user.setName(cloudIdentity.getMsoId());
+ user.setPassword(CryptoUtils.decryptCloudConfigPassword(cloudIdentity.getMsoPass()));
+ user.setDomain(userDomain);
+ password.setUser(user);
+ identity.setPassword(password);
+ identity.setMethods(Collections.singletonList("password"));
+ com.woorea.openstack.keystone.v3.model.Authentication v3Auth =
+ new com.woorea.openstack.keystone.v3.model.Authentication();
+ v3Auth.setIdentity(identity);
+ return v3Auth;
+ }
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
index 16906957a7..3564b8f0a7 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
@@ -107,7 +107,7 @@ public class KeystoneV3Authentication {
return policy;
}
- protected String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
+ public String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) {
for (Service service : serviceCatalog) {
if (type.equals(service.getType())) {
for (Service.Endpoint endpoint : service.getEndpoints()) {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
index 63bc235363..072ab5a8d0 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneV3Utils.java
@@ -21,15 +21,29 @@
package org.onap.so.openstack.utils;
import java.util.Map;
+import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.openstack.beans.MsoTenant;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
+import org.onap.so.utils.CryptoUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import com.woorea.openstack.keystone.v3.model.Token;
+import com.woorea.openstack.base.client.OpenStackConnectException;
+import com.woorea.openstack.base.client.OpenStackResponseException;
+import com.woorea.openstack.keystone.v3.Keystone;
+import com.woorea.openstack.keystone.v3.api.TokensResource.Authenticate;
+import com.woorea.openstack.keystone.v3.model.Authentication;
+import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
@Component
public class MsoKeystoneV3Utils extends MsoTenantUtils {
+ @Autowired
+ private AuthenticationMethodFactory authenticationMethodFactory;
+
@Override
public String createTenant(String tenantName, String cloudSiteId, Map<String, String> metadata, boolean backout)
throws MsoException {
@@ -57,4 +71,22 @@ public class MsoKeystoneV3Utils extends MsoTenantUtils {
return cloudIdentity.getIdentityUrl();
}
+ public Token getKeystoneToken(CloudSite cloudSite) throws MsoException {
+ try {
+ CloudIdentity cloudIdentity = cloudSite.getIdentityService();
+
+ Keystone keystone = new Keystone(cloudIdentity.getIdentityUrl());
+
+ Authentication auth = authenticationMethodFactory.getAuthenticationForV3(cloudIdentity);
+
+ Authenticate authenticate = keystone.tokens().authenticate(auth);
+ return executeAndRecordOpenstackRequest(authenticate);
+
+ } catch (OpenStackResponseException e) {
+ throw keystoneErrorToMsoException(e, "TokenAuth");
+ } catch (OpenStackConnectException e) {
+ throw keystoneErrorToMsoException(e, "TokenAuth");
+ }
+ }
+
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
index c5eeb34157..968e7864b3 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClient.java
@@ -49,4 +49,6 @@ public class NovaClient extends MsoCommonUtils {
novaClient.token(keystone.getId());
return novaClient;
}
+
+
}
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 ea371f54f7..e4810840f1 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
@@ -33,6 +33,12 @@ INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, I
('VNF-InPlaceUpdate', 'inPlaceSoftwareUpdate', 'Vnf', true, true, '7','7', 'DEFAULT', '*'),
('VNF-Config-Update', 'applyUpdatedConfig', 'Vnf', true, true, '7','7', 'DEFAULT', '*');
+--
+-- northbound_request_ref_lookup for updateInstance (Macro Flow)
+--
+INSERT INTO northbound_request_ref_lookup(ID, REQUEST_SCOPE, MACRO_ACTION, ACTION, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW, CLOUD_OWNER, SERVICE_TYPE)
+VALUES (500, 'Vnf', 'VNF-Macro-Modify', 'updateInstance', 0, 7, 7, 1, 'k8scloudowner4', '*');
+
INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'DEFAULT')),
@@ -211,6 +217,15 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FL
('VNF-Config-Update', '8', 'VNFUnsetInMaintFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Config-Update' and CLOUD_OWNER = 'DEFAULT')),
('VNF-Config-Update', '9', 'VNFUnsetClosedLoopDisabledFlagActivity', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Config-Update' and CLOUD_OWNER = 'DEFAULT'));
+--
+-- orchestration_flow_reference for updateInstance (Macro Flow)
+--
+insert into orchestration_flow_reference (id,COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID,SCOPE,ACTION)
+values (901, 'VNF-Macro-Modify',1,'ControllerExecutionBB',1,500,'vnf','config-assign');
+insert into orchestration_flow_reference (id,COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID,SCOPE,ACTION)
+values (902, 'VNF-Macro-Modify',2,'ControllerExecutionBB',1,500,'vnf','config-deploy');
+
+
INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID, SCOPE, ACTION) VALUES
('Service-Macro-Create', '10', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT'), 'pnf', 'config-assign');
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql
index 1663fdd6a8..388d3c8b49 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql
@@ -33,6 +33,8 @@ INSERT INTO `service_recipe` (`id`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORC
INSERT INTO `service_recipe` (`id`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORCHESTRATION_URI`, `SERVICE_PARAM_XSD`, `RECIPE_TIMEOUT`, `SERVICE_TIMEOUT_INTERIM`, `CREATION_TIMESTAMP`, `SERVICE_MODEL_UUID`) VALUES (2,'deleteInstance','1','VID_DEFAULT recipe to delete service-instance if no custom BPMN flow is found','/mso/async/services/DeleteGenericALaCarteServiceInstance',NULL,180,NULL,'2017-10-05 18:52:03','48cc36cc-a9fe-11e7-8b4b-0242ac120002');
INSERT INTO `service_recipe` (`id`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORCHESTRATION_URI`, `SERVICE_PARAM_XSD`, `RECIPE_TIMEOUT`, `SERVICE_TIMEOUT_INTERIM`, `CREATION_TIMESTAMP`, `SERVICE_MODEL_UUID`) VALUES (3,'createInstance','1','DEFAULT recipe to create service-instance if no custom BPMN flow is found','/mso/async/services/CreateGenericALaCarteServiceInstance',NULL,180,NULL,'2017-10-05 18:52:03','48cc3acd-a9fe-11e7-8b4b-0242ac120002');
INSERT INTO `service_recipe` (`id`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORCHESTRATION_URI`, `SERVICE_PARAM_XSD`, `RECIPE_TIMEOUT`, `SERVICE_TIMEOUT_INTERIM`, `CREATION_TIMESTAMP`, `SERVICE_MODEL_UUID`) VALUES (4,'deleteInstance','1','DEFAULT recipe to delete service-instance if no custom BPMN flow is found','/mso/async/services/DeleteGenericALaCarteServiceInstance',NULL,180,NULL,'2017-10-05 18:52:03','48cc3acd-a9fe-11e7-8b4b-0242ac120002');
+insert into `service_recipe` (`id`, `ACTION`, `VERSION_STR`, `DESCRIPTION`, `ORCHESTRATION_URI`, `SERVICE_PARAM_XSD`, `RECIPE_TIMEOUT`, `SERVICE_TIMEOUT_INTERIM`, `CREATION_TIMESTAMP`, `SERVICE_MODEL_UUID`) values (500,'updateInstance','1.0','Gr api recipe to update service-instance', '/mso/async/services/WorkflowActionBB', NULL, 180, NULL, '2017-10-05 18:52:03', 'd88da85c-d9e8-4f73-b837-3a72a431622b');
+
--
-- Custom Reciepe for the VoLTE service added temporarily
@@ -60,6 +62,7 @@ INSERT INTO `vnf_components_recipe` (`id`, `VNF_TYPE`, `VNF_COMPONENT_TYPE`, `VF
INSERT INTO `vnf_components_recipe` (`id`, `VNF_TYPE`, `VNF_COMPONENT_TYPE`, `VF_MODULE_MODEL_UUID`, `ACTION`, `SERVICE_TYPE`, `VERSION`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_COMPONENT_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (11,NULL,'vfModule','VID_DEFAULT','deleteInstance',NULL,'1','VID_DEFAULT recipe t','/mso/async/services/DeleteVfModuleInfra',null,180,'2017-10-05 18:52:03');
INSERT INTO `vnf_components_recipe` (`id`, `VNF_TYPE`, `VNF_COMPONENT_TYPE`, `VF_MODULE_MODEL_UUID`, `ACTION`, `SERVICE_TYPE`, `VERSION`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_COMPONENT_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (12,NULL,'vfModule','VID_DEFAULT','updateInstance',NULL,'1','VID_DEFAULT recipe t','/mso/async/services/UpdateVfModuleInfra',null,180,'2017-10-05 18:52:03');
+
--
-- Default Reciepe for the VNF componnets added start #SO-334, to unblock the VNF operations
--
diff --git a/adapters/mso-cnf-adapter/pom.xml b/adapters/mso-cnf-adapter/pom.xml
index fb25157a96..0928da084e 100644
--- a/adapters/mso-cnf-adapter/pom.xml
+++ b/adapters/mso-cnf-adapter/pom.xml
@@ -110,11 +110,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
- <!-- <dependency>
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
- </dependency> -->
+ </dependency>
<!-- <dependency>
<groupId>org.onap.so</groupId>
<artifactId>mso-requests-db</artifactId>
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
new file mode 100644
index 0000000000..c950cf6b2a
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ */
+
+package org.onap.so.adapters.cnf.exceptions;
+
+import static org.onap.so.adapters.cnf.util.CNfAdapterUtil.marshal;
+import org.onap.so.adapters.cnf.model.ErrorResponse;
+import org.springframework.http.ResponseEntity;
+
+public class ApplicationException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ private int errorCode;
+
+ private String errorMsg;
+
+ public ApplicationException(int errorCode, String errorMsg) {
+ this.errorCode = errorCode;
+ this.errorMsg = errorMsg;
+ }
+
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorMsg() {
+ return errorMsg;
+ }
+
+ public void setErrorMsg(String errorMsg) {
+ this.errorMsg = errorMsg;
+ }
+
+ public ResponseEntity buildErrorResponse() {
+ String message;
+ try {
+ ErrorResponse err = new ErrorResponse(errorCode, errorMsg);
+ message = marshal(err);
+ } catch (ApplicationException e) {
+ return ResponseEntity.status(500).body("Internal Server Error");
+ }
+ return ResponseEntity.status(errorCode).body(message);
+ }
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
new file mode 100644
index 0000000000..2e76d51da2
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
@@ -0,0 +1,87 @@
+package org.onap.so.adapters.cnf.model;
+
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(value = "true")
+public class BpmnInstanceRequest {
+
+ @JsonProperty(value = "modelInvariantId")
+ private String modelInvariantId;
+
+ @JsonProperty(value = "modelVersionId")
+ private String modelVersionId;
+
+ @JsonProperty(value = "k8sRBProfileName")
+ private String k8sRBProfileName;
+
+ @JsonProperty(value = "cloudRegionId")
+ private String cloudRegionId;
+
+ @JsonProperty(value = "vfModuleUUID")
+ private String vfModuleUUID;
+
+ @JsonProperty(value = "labels")
+ private Map<String, String> labels;
+
+ @JsonProperty(value = "overrideValues")
+ private Map<String, String> overrideValues;
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getK8sRBProfileName() {
+ return k8sRBProfileName;
+ }
+
+ public void setK8sRBProfileName(String k8sRBProfileName) {
+ this.k8sRBProfileName = k8sRBProfileName;
+ }
+
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
+
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
+
+ public String getVfModuleUUID() {
+ return vfModuleUUID;
+ }
+
+ public void setVfModuleUUID(String vfModuleUUID) {
+ this.vfModuleUUID = vfModuleUUID;
+ }
+
+ public Map<String, String> getLabels() {
+ return labels;
+ }
+
+ public void setLabels(Map<String, String> labels) {
+ this.labels = labels;
+ }
+
+ public Map<String, String> getOverrideValues() {
+ return overrideValues;
+ }
+
+ public void setOverrideValues(Map<String, String> overrideValues) {
+ this.overrideValues = overrideValues;
+ }
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/ErrorResponse.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
index 188349c0bf..135adcc143 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/ErrorResponse.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.model;
+package org.onap.so.adapters.cnf.model;
public class ErrorResponse {
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
index 04f2f9d030..b1719cbd7d 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(value = "true")
-public class InstanceEntity {
+public class MulticloudInstanceRequest {
@JsonProperty(value = "cloud-region")
private String cloudRegion;
@@ -25,6 +25,9 @@ public class InstanceEntity {
@JsonProperty(value = "override-values")
private Map<String, String> overrideValues;
+ @JsonProperty(value = "release-name")
+ private String vfModuleUuid;
+
public String getCloudRegion() {
return cloudRegion;
}
@@ -73,4 +76,12 @@ public class InstanceEntity {
this.overrideValues = overrideValues;
}
+ public String getVfModuleUuid() {
+ return vfModuleUuid;
+ }
+
+ public void setVfModuleUuid(String vfModuleUuid) {
+ this.vfModuleUuid = vfModuleUuid;
+ }
+
}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
index 952edef7f6..b6d50da557 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
@@ -1,27 +1,39 @@
package org.onap.so.adapters.cnf.rest;
+import java.io.File;
+import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
import org.onap.so.adapters.cnf.model.ConfigTemplateEntity;
import org.onap.so.adapters.cnf.model.ConfigurationEntity;
+import org.onap.so.adapters.cnf.model.ConfigurationRollbackEntity;
import org.onap.so.adapters.cnf.model.ConnectivityInfo;
-import org.onap.so.adapters.cnf.model.InstanceEntity;
+import org.onap.so.adapters.cnf.model.MulticloudInstanceRequest;
import org.onap.so.adapters.cnf.model.ProfileEntity;
import org.onap.so.adapters.cnf.model.ResourceBundleEntity;
+import org.onap.so.adapters.cnf.model.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -32,14 +44,14 @@ public class CnfAdapterRest {
private final CloseableHttpClient httpClient = HttpClients.createDefault();
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/healthcheck"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/healthcheck"}, method = RequestMethod.GET,
produces = "application/json")
public String healthCheck() throws Exception {
logger.info("health check called.");
// TODO
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/healthcheck");
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/healthcheck");
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
return EntityUtils.toString(response.getEntity());
@@ -47,7 +59,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition"}, method = RequestMethod.POST,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.POST,
produces = "application/json")
public String createRB(@RequestBody ResourceBundleEntity rB) throws Exception {
@@ -55,7 +67,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
String requestBody = objectMapper.writeValueAsString(rB);
@@ -70,8 +82,8 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}"},
- method = RequestMethod.GET, produces = "application/json")
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"}, method = RequestMethod.GET,
+ produces = "application/json")
public String getRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
throws Exception {
@@ -79,16 +91,101 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet(
- "https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/" + rbVersion);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+ throws Exception {
+
+ logger.info("delete RB called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getListOfRB(@PathVariable("rb-name") String rbName) throws Exception {
+
+ logger.info("getListOfRB called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getListOfRBWithoutUsingRBName() throws Exception {
+
+ logger.info("getListOfRBWithoutUsingRBName called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition");
+
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
return EntityUtils.toString(response.getEntity());
}
+
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadArtifactForRB(@RequestParam("file") MultipartFile file, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion) throws Exception {
+
+ logger.info("Upload Artifact For RB called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post =
+ new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
method = RequestMethod.POST, produces = "application/json")
public String createProfile(@RequestBody ProfileEntity fE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion) throws Exception {
@@ -97,8 +194,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/profile");
+ HttpPost post =
+ new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(fE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -112,7 +209,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
method = RequestMethod.GET, produces = "application/json")
public String getProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
@PathVariable("pr-name") String prName) throws Exception {
@@ -121,8 +218,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName);
+ HttpGet req = new HttpGet(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -131,18 +228,130 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance"}, method = RequestMethod.POST,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+ method = RequestMethod.GET, produces = "application/json")
+ public String getListOfProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+ throws Exception {
+
+ logger.info("getListOfProfile called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("pr-name") String prName) throws Exception {
+
+ logger.info("delete Profile called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadArtifactForProfile(@RequestParam("file") MultipartFile file,
+ @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("pr-name") String prName) throws Exception {
+
+ logger.info("Upload Artifact For Profile called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+ + "/profile/" + prName + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.POST,
produces = "application/json")
- public String createInstance(@RequestBody InstanceEntity iE) throws Exception {
+ public String createInstance(@RequestBody BpmnInstanceRequest bpmnInstanceRequest) throws Exception {
logger.info("create Instance called.");
+ MulticloudInstanceRequest multicloudInstanceRequest = new MulticloudInstanceRequest();
+
+ if (bpmnInstanceRequest.getK8sRBProfileName() != null) {
+ multicloudInstanceRequest.setCloudRegion(bpmnInstanceRequest.getCloudRegionId());
+ multicloudInstanceRequest.setLabels(bpmnInstanceRequest.getLabels());
+ multicloudInstanceRequest.setOverrideValues(bpmnInstanceRequest.getOverrideValues());
+ multicloudInstanceRequest.setProfileName(bpmnInstanceRequest.getK8sRBProfileName());
+ multicloudInstanceRequest.setRbName(bpmnInstanceRequest.getModelInvariantId());
+ multicloudInstanceRequest.setRbVersion(bpmnInstanceRequest.getModelVersionId());
+ multicloudInstanceRequest.setVfModuleUuid(bpmnInstanceRequest.getVfModuleUUID());
+ } else {
+
+ logger.info("K8sRBProfileName is required");
+ return "K8sRBProfileName is required";
+ }
+
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/instance");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/instance");
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ String requestBody = objectMapper.writeValueAsString(multicloudInstanceRequest);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ // This api is not enabled in multicloud project ,but this is required in
+ // future.
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{vnfInstanceId}"}, method = RequestMethod.PUT,
+ produces = "application/json")
+ public String updateInstance(@RequestBody MulticloudInstanceRequest iE,
+ @PathVariable("vnfInstanceId") String instanceId) throws Exception {
+
+ logger.info("create Instance called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/instance/" + instanceId);
ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
String requestBody = objectMapper.writeValueAsString(iE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
post.setEntity(requestEntity);
@@ -155,14 +364,15 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
produces = "application/json")
public String getInstance(@PathVariable("instID") String instanceId) throws Exception {
logger.info("get Instance called.");
+
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/instance/" + instanceId);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -171,8 +381,62 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(
- value = {"/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}/status"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getInstanceStatus(@PathVariable("instID") String instanceId) throws Exception {
+
+ logger.info("getInstanceStatus called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId + "/status");
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.GET,
+ produces = "application/json")
+ public String getInstanceBasedOnRBNameOrRBVersionOrProfileName(
+ @RequestParam(value = "rb-name", required = false) String rbName,
+ @RequestParam(value = "rb-version", required = false) String rbVersion,
+ @RequestParam(value = "profile-name", required = false) String profileName) throws Exception {
+
+ logger.info("getInstanceBasedOnRBNameOrRBVersionOrProfileName called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance?rb-name=" + rbName + "&rb-version=" + rbVersion
+ + "&profile-name=" + profileName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.DELETE,
+ produces = "application/json")
+ public String deleteInstance(@PathVariable("instID") String instanceID) throws Exception {
+
+ logger.info("delete Instance called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/instance/" + instanceID);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
method = RequestMethod.POST, produces = "application/json")
public String createConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName)
@@ -182,8 +446,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName + "/config");
+ HttpPost post = new HttpPost(
+ "http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/" + prName + "/config");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(cE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -198,7 +462,7 @@ public class CnfAdapterRest {
@ResponseBody
@RequestMapping(value = {
- "/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
method = RequestMethod.GET, produces = "application/json")
public String getConfiguration(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
@PathVariable("profile-name") String prName, @PathVariable("cfg-name") String cfgName) throws Exception {
@@ -207,8 +471,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
- + rbVersion + "/profile/" + prName + "/config/" + cfgName);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/" + cfgName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -217,7 +481,79 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info"}, method = RequestMethod.POST,
+ @RequestMapping(value = {
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteConfiguration(@PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+ @PathVariable("cfg-name") String cfgName) throws Exception {
+
+ logger.info("delete Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion
+ + "/profile/" + prName + "/config/" + cfgName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {
+ "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+ method = RequestMethod.PUT, produces = "application/json")
+ public String updateConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+ @PathVariable("cfg-name") String cfgName) throws Exception {
+
+ logger.info("update Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/" + cfgName);
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(cE);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/tagit"},
+ method = RequestMethod.POST, produces = "application/json")
+ public String tagConfigurationValue(@RequestBody Tag tag, @PathVariable("rb-name") String rbName,
+ @PathVariable("rb-version") String rbVersion, @PathVariable("pr-name") String prName) throws Exception {
+ logger.info("Tag Configuration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/tagit");
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(tag);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info"}, method = RequestMethod.POST,
produces = "application/json")
public String createConnectivityInfo(@RequestBody ConnectivityInfo cIE) throws Exception {
@@ -225,7 +561,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info");
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/connectivity-info");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(cIE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -239,7 +575,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
produces = "application/json")
public String getConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
@@ -247,7 +583,7 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info/" + connName);
+ HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -256,7 +592,25 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.DELETE,
+ produces = "application/json")
+ public String deleteConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
+
+ logger.info("delete Connectivity Info called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
method = RequestMethod.POST, produces = "application/json")
public String createConfigTemplate(@RequestBody ConfigTemplateEntity tE, @PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion) throws Exception {
@@ -265,8 +619,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/config-template");
+ HttpPost post = new HttpPost(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template");
ObjectMapper objectMapper = new ObjectMapper();
String requestBody = objectMapper.writeValueAsString(tE);
StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -280,7 +634,7 @@ public class CnfAdapterRest {
}
@ResponseBody
- @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
method = RequestMethod.GET, produces = "application/json")
public String getConfigTemplate(@PathVariable("rb-name") String rbName,
@PathVariable("rb-version") String rbVersion, @PathVariable("tname") String tName) throws Exception {
@@ -289,8 +643,8 @@ public class CnfAdapterRest {
// TODO
// Below URL should be changed as appropriate multicloud URL.
- HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
- + rbVersion + "/config-template/" + tName);
+ HttpGet req = new HttpGet(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
try (CloseableHttpResponse response = httpClient.execute(req)) {
logger.info("response:" + response.getEntity());
@@ -298,4 +652,83 @@ public class CnfAdapterRest {
}
}
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String deleteTemplate(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("tname") String tName) throws Exception {
+
+ logger.info("deleteTemplate called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpDelete req = new HttpDelete(
+ "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
+
+ try (CloseableHttpResponse response = httpClient.execute(req)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+
+ }
+
+ @ResponseBody
+ @RequestMapping(
+ value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}/content"},
+ method = RequestMethod.POST, produces = "multipart/form-data")
+ public String uploadTarFileForTemplate(@RequestParam("file") MultipartFile file,
+ @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+ @PathVariable("tname") String tName) throws Exception {
+
+ logger.info("uploadTarFileForTemplate called.");
+
+ File convFile = new File(file.getOriginalFilename());
+ file.transferTo(convFile);
+ FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+ builder.addPart("file", fileBody);
+ HttpEntity entity = builder.build();
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+ + "/config-template/" + tName + "/content");
+ post.setHeader("Content-Type", "multipart/form-data");
+
+ logger.info(String.valueOf(post));
+ post.setEntity(entity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rbName}/{rbVersion}/profile/{prName}/config/rollback"},
+ method = RequestMethod.DELETE, produces = "application/json")
+ public String rollbackConfiguration(@RequestBody ConfigurationRollbackEntity rE,
+ @PathVariable("rbName") String rbName, @PathVariable("rbVersion") String rbVersion,
+ @PathVariable("prName") String prName) throws Exception {
+ logger.info("rollbackConfiguration called.");
+
+ // TODO
+ // Below URL should be changed as appropriate multicloud URL.
+ HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+ + prName + "/config/rollback");
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ String requestBody = objectMapper.writeValueAsString(rE);
+ StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+ post.setEntity(requestEntity);
+
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = httpClient.execute(post)) {
+ logger.info("response:" + response.getEntity());
+ return EntityUtils.toString(response.getEntity());
+ }
+ }
+
}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
new file mode 100644
index 0000000000..25e506c55e
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ */
+
+package org.onap.so.adapters.cnf.util;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.onap.so.adapters.cnf.exceptions.ApplicationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.onap.logging.filter.base.ErrorCode;
+import static org.onap.so.logger.LoggingAnchor.THREE;
+import static org.onap.so.logger.MessageEnum.RA_NS_EXC;
+
+public class CNfAdapterUtil {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CNfAdapterUtil.class);
+
+ public static final int BAD_REQUEST = 400;
+
+ private static final String UNMARSHAL_FAIL_MSG = "Failed to unmarshal json";
+
+ private static final String MARSHAL_FAIL_MSG = "Failed to marshal object";
+
+ private static final ObjectMapper MAPPER = new ObjectMapper();
+
+ public static class StatusDesc {
+
+ public static final String ALLOCATE_NSS_SUCCESS = "Allocating nss is " + "successful";
+
+ public static final String CREATE_NSS_SUCCESS = "Creating nss is " + "successful";
+
+ public static final String DEALLOCATE_NSS_SUCCESS = "Deallocate nss " + "is successful";
+
+ public static final String ACTIVATE_NSS_SUCCESS = "Activate nss " + "is successful";
+
+ public static final String DEACTIVATE_NSS_SUCCESS = "Deactivate nss " + "is successful";
+
+ public static final String QUERY_JOB_STATUS_FAILED = "Query job " + "status failed";
+
+ public static final String QUERY_JOB_STATUS_SUCCESS = "Query job " + "status is successful";
+
+ private StatusDesc() {
+
+ }
+ }
+
+ private CNfAdapterUtil() {
+
+ }
+
+ public static void assertObjectNotNull(Object object) throws ApplicationException {
+ if (null == object) {
+ LOGGER.error("Object is null.");
+ throw new ApplicationException(BAD_REQUEST, "An object is null.");
+ }
+ }
+
+ public static <T> T unMarshal(String jsonstr, Class<T> type) throws ApplicationException {
+ try {
+ return MAPPER.readValue(jsonstr, type);
+ } catch (IOException e) {
+ LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), UNMARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(BAD_REQUEST, UNMARSHAL_FAIL_MSG);
+ }
+ }
+
+ public static String marshal(Object srcObj) throws ApplicationException {
+ try {
+ return MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(srcObj);
+ } catch (IOException e) {
+ LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), MARSHAL_FAIL_MSG, e);
+ throw new ApplicationException(BAD_REQUEST, MARSHAL_FAIL_MSG);
+ }
+ }
+
+}
diff --git a/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
new file mode 100644
index 0000000000..38a10918bc
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ */
+
+package org.onap.so.adapters.cnf;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
+import org.onap.so.adapters.cnf.rest.CnfAdapterRest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+public class CnfAdapterRestTest {
+
+ @InjectMocks
+ CnfAdapterRest cnfAdapterRest;
+
+ @Test
+ public void createInstanceTest() throws Exception {
+
+ Map<String, String> labels = new HashMap<String, String>();
+ labels.put("custom-label-1", "label1");
+ Map<String, String> overrideValues = new HashMap<String, String>();
+ labels.put("image.tag", "latest");
+ labels.put("dcae_collector_ip", "1.2.3.4");
+ BpmnInstanceRequest bpmnInstanceRequest = new BpmnInstanceRequest();
+ bpmnInstanceRequest.setCloudRegionId("v1");
+ bpmnInstanceRequest.setLabels(labels);
+ bpmnInstanceRequest.setModelInvariantId("krd");
+ bpmnInstanceRequest.setModelVersionId("p1");
+ bpmnInstanceRequest.setOverrideValues(overrideValues);
+ bpmnInstanceRequest.setVfModuleUUID("20200824");
+
+ String mockedResponse = "K8sRBProfileName is required";
+ String actualResponse = cnfAdapterRest.createInstance(bpmnInstanceRequest);
+ assertNotNull(actualResponse);
+ assertEquals(mockedResponse, actualResponse);
+ }
+
+}
diff --git a/adapters/mso-nssmf-adapter/pom.xml b/adapters/mso-nssmf-adapter/pom.xml
index db791826c3..45fe77eecc 100644
--- a/adapters/mso-nssmf-adapter/pom.xml
+++ b/adapters/mso-nssmf-adapter/pom.xml
@@ -162,7 +162,6 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
- <version>1.18.2</version>
</dependency>
</dependencies>
</project>
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/MSONssmfApplication.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/MSONssmfApplication.java
index cd011e6437..83a09dc343 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/MSONssmfApplication.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/MSONssmfApplication.java
@@ -20,6 +20,7 @@
package org.onap.so.adapters.nssmf;
+
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/annotation/ServiceLogger.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/annotation/ServiceLogger.java
new file mode 100644
index 0000000000..1de29bcc2b
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/annotation/ServiceLogger.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.annotation;
+
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ServiceLogger {
+
+ String value() default "";
+
+ boolean ignore() default false;
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/NssmfAdapterConfig.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/NssmfAdapterConfig.java
new file mode 100644
index 0000000000..6a592448a6
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/NssmfAdapterConfig.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.config;
+
+import lombok.Getter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Getter
+public class NssmfAdapterConfig {
+
+ @Value("${mso.infra.endpoint}")
+ private String infraEndpoint;
+
+ @Value("${mso.infra.auth}")
+ private String infraAuth;
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/RequestDbConfig.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/RequestDbConfig.java
index 484f7624aa..dcb5d6198c 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/RequestDbConfig.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/RequestDbConfig.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf;
+package org.onap.so.adapters.nssmf.config;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/WebSecurityConfig.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java
index 1522ca9c6d..dfb2b61978 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/WebSecurityConfig.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf;
+package org.onap.so.adapters.nssmf.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
new file mode 100644
index 0000000000..28789f2a98
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
@@ -0,0 +1,187 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.consts;
+
+import org.onap.so.adapters.nssmf.entity.NssmfUrlInfo;
+import org.onap.so.adapters.nssmf.enums.ActionType;
+import org.onap.so.adapters.nssmf.enums.ExecutorType;
+import org.onap.so.adapters.nssmf.enums.HttpMethod;
+import org.onap.so.beans.nsmf.NetworkType;
+import java.util.HashMap;
+import java.util.Map;
+
+public class NssmfAdapterConsts {
+
+ public final static String ONAP_INTERNAL_TAG = "ONAP_internal";
+
+ public final static String CURRENT_INTERNAL_NSSMF_API_VERSION = "v1";
+
+ private static Map<String, NssmfUrlInfo> urlInfoMap = new HashMap<>();
+
+ private final static String EXTERNAL_CN_ALLOCATE_URL = "/api/rest/provMns/{apiVersion}/NSS/SliceProfiles";
+
+ private final static String EXTERNAL_TN_ALLOCATE_URL = "/api/rest/provMns/{apiVersion}/tn/NSS/SliceProfiles";
+
+ private final static String EXTERNAL_AN_ALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles";
+
+ private final static String INTERNAL_ALLOCATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/allocate";
+
+ private final static String EXTERNAL_CN_DEALLOCATE_URL =
+ "/api/rest/provMns/{apiVersion}/NSS/SliceProfiles/{sliceProfileId}";
+
+ private final static String EXTERNAL_TN_DEALLOCATE_URL =
+ "/api/rest/provMns/{apiVersion}/tn/NSS/SliceProfiles/{sliceProfileId}";
+
+ private final static String EXTERNAL_AN_DEALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles/{sliceProfileId}";
+
+ private final static String INTERNAL_DEALLOCATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/deAllocate";
+
+ private final static String EXTERNAL_CN_ACTIVATE_URL = "/api/rest/provMns/{apiVersion}/NSS/{snssai}/activation";
+
+ private final static String EXTERNAL_TN_ACTIVATE_URL = "/api/rest/provMns/{apiVersion}/tn/NSS/{snssai}/activation";
+
+ private final static String EXTERNAL_AN_ACTIVATE_URL = "/api/rest/provMns/{apiVersion}/an/NSS/{snssai}/activations";
+
+ private final static String INTERNAL_ACTIVATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/activate";
+
+ private final static String EXTERNAL_CN_DEACTIVATE_URL = "/api/rest/provMns/{apiVersion}/NSS/{snssai}/deactivation";
+
+ private final static String EXTERNAL_TN_DEACTIVATE_URL =
+ "/api/rest/provMns/{apiVersion}/tn/NSS/{snssai}/deactivation";
+
+ private final static String EXTERNAL_AN_DEACTIVATE_URL =
+ "/api/rest/provMns/{apiVersion}/an/NSS/{snssai}/deactivation";
+
+ private final static String INTERNAL_DEACTIVATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/deActivate";
+
+ //
+ private final static String EXTERNAL_CN_TERMINATE_URL =
+ "/api/rest/provMns/{apiVersion}/NSS/SliceProfiles/{SliceProfileId}";
+
+ private final static String EXTERNAL_TN_TERMINATE_URL =
+ "/api/rest/provMns/{apiVersion}/tn/NSS/SliceProfiles/{SliceProfileId}";
+
+ private final static String EXTERNAL_AN_TERMINATE_URL =
+ "/api/rest/provMns/{apiVersion}/an/NSS/SliceProfiles/{SliceProfileId}";
+
+ private final static String INTERNAL_TERMINATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/terminate";
+
+ //
+ private final static String EXTERNAL_AN_MODIFY_URL =
+ "/api/rest/provMns/{apiVersion}/an/NSS/SliceProfiles/{SliceProfileId}";
+
+ private final static String INTERNAL_MODIFY_URL = "/onap/so/infra/3gppservices/{apiVersion}/modify";
+
+ //
+ private final static String EXTERNAL_QUERY_JOB_STATUS =
+ "/api/rest/provMns/{apiVersion}/NSS/jobs/{jobId}?responseId={responseId}";
+
+ private final static String INTERNAL_QUERY_SUB_NET_CAPABILITY =
+ "/onap/so/infra/3gppservices/{apiVersion}/subnetCapabilityQuery";
+
+ static {
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.ALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_AN_ALLOCATE_URL, HttpMethod.POST));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.ALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_TN_ALLOCATE_URL, HttpMethod.POST));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.ALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_CN_ALLOCATE_URL, HttpMethod.POST));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.ALLOCATE),
+ new NssmfUrlInfo(INTERNAL_ALLOCATE_URL, HttpMethod.POST));
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.DEALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_AN_DEALLOCATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.DEALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_TN_DEALLOCATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.DEALLOCATE),
+ new NssmfUrlInfo(EXTERNAL_CN_DEALLOCATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.DEALLOCATE),
+ new NssmfUrlInfo(INTERNAL_DEALLOCATE_URL, HttpMethod.DELETE));
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.ACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_AN_ACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.ACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_TN_ACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.ACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_CN_ACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.ACTIVATE),
+ new NssmfUrlInfo(INTERNAL_ACTIVATE_URL, HttpMethod.PUT));
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.DEACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_AN_DEACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.DEACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_TN_DEACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.DEACTIVATE),
+ new NssmfUrlInfo(EXTERNAL_CN_DEACTIVATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.DEACTIVATE),
+ new NssmfUrlInfo(INTERNAL_DEACTIVATE_URL, HttpMethod.PUT));
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.TERMINATE),
+ new NssmfUrlInfo(EXTERNAL_AN_TERMINATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.TERMINATE),
+ new NssmfUrlInfo(EXTERNAL_TN_TERMINATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.TERMINATE),
+ new NssmfUrlInfo(EXTERNAL_CN_TERMINATE_URL, HttpMethod.DELETE));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.TERMINATE),
+ new NssmfUrlInfo(INTERNAL_TERMINATE_URL, HttpMethod.DELETE));
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.MODIFY),
+ new NssmfUrlInfo(EXTERNAL_AN_MODIFY_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.MODIFY),
+ new NssmfUrlInfo(EXTERNAL_CN_ALLOCATE_URL, HttpMethod.PUT));
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.MODIFY),
+ new NssmfUrlInfo(INTERNAL_MODIFY_URL, HttpMethod.PUT));
+
+
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.QUERY_JOB_STATUS),
+ new NssmfUrlInfo(EXTERNAL_QUERY_JOB_STATUS, HttpMethod.GET));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.QUERY_JOB_STATUS),
+ new NssmfUrlInfo(EXTERNAL_QUERY_JOB_STATUS, HttpMethod.GET));
+ urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.TRANSPORT, ActionType.QUERY_JOB_STATUS),
+ new NssmfUrlInfo(EXTERNAL_QUERY_JOB_STATUS, HttpMethod.GET));
+
+ urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.QUERY_SUB_NET_CAPABILITY),
+ new NssmfUrlInfo(INTERNAL_QUERY_SUB_NET_CAPABILITY, HttpMethod.POST));
+ }
+
+ /**
+ * get nssmf url info from consts
+ *
+ * @param executorType {@link ExecutorType}
+ * @param networkType {@link NetworkType}
+ * @param actionType {@link ActionType}
+ * @return {@link NssmfUrlInfo}
+ */
+ public static NssmfUrlInfo getNssmfUrlInfo(ExecutorType executorType, NetworkType networkType,
+ ActionType actionType) {
+
+ return urlInfoMap.get(generateKey(executorType, networkType, actionType));
+ }
+
+ private static String generateKey(ExecutorType executorType, NetworkType networkType, ActionType actionType) {
+ if (ExecutorType.EXTERNAL.equals(executorType)) {
+ return executorType.name() + "_" + networkType.name() + "_" + actionType.name();
+ }
+ return executorType.name() + "_" + actionType.name();
+ }
+
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterController.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterController.java
new file mode 100644
index 0000000000..02d7468a0c
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterController.java
@@ -0,0 +1,57 @@
+package org.onap.so.adapters.nssmf.controller;
+
+import org.onap.so.adapters.nssmf.service.NssmfManagerService;
+import org.onap.so.beans.nsmf.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+
+@RestController
+@RequestMapping(value = "/api/rest/provMns/v1", produces = {APPLICATION_JSON}, consumes = {APPLICATION_JSON})
+public class NssmfAdapterController {
+
+ @Autowired
+ private NssmfManagerService nssmfManagerService;
+
+ @PostMapping(value = "/NSS/SliceProfiles")
+ public ResponseEntity allocateNssi(@RequestBody NssmfAdapterNBIRequest nbiRequest) {
+ return nssmfManagerService.allocateNssi(nbiRequest);
+ }
+
+ @PostMapping(value = "/NSS/SliceProfiles/{sliceProfileId}")
+ public ResponseEntity deAllocateNssi(@RequestBody NssmfAdapterNBIRequest nbiRequest,
+ @PathVariable("sliceProfileId") final String sliceProfileId) {
+ return nssmfManagerService.deAllocateNssi(nbiRequest, sliceProfileId);
+ }
+
+
+ @PostMapping(value = "/NSS/{snssai}/activation")
+ public ResponseEntity activateNssi(@RequestBody NssmfAdapterNBIRequest nbiRequest,
+ @PathVariable("snssai") String snssai) {
+ return nssmfManagerService.activateNssi(nbiRequest, snssai);
+ }
+
+ @PostMapping(value = "/NSS/{snssai}/deactivation")
+ public ResponseEntity deactivateNssi(@RequestBody NssmfAdapterNBIRequest nbiRequest,
+ @PathVariable("snssai") String snssai) {
+ return nssmfManagerService.deActivateNssi(nbiRequest, snssai);
+ }
+
+ @PostMapping(value = "/NSS/jobs/{jobId}")
+ public ResponseEntity queryJobStatus(@RequestBody NssmfAdapterNBIRequest nbiRequest,
+ @PathVariable("jobId") String jobId) {
+ return nssmfManagerService.queryJobStatus(nbiRequest, jobId);
+ }
+
+ @PostMapping(value = "/NSS/NSSISelectionCapability")
+ public ResponseEntity queryNSSISelectionCapability(@RequestBody NssmfAdapterNBIRequest nbiRequest) {
+ return nssmfManagerService.queryNSSISelectionCapability(nbiRequest);
+ }
+
+ @PostMapping(value = "/NSS/subnetCapabilityQuery")
+ public ResponseEntity querySubnetCapability(@RequestBody NssmfAdapterNBIRequest nbiRequest) {
+ return nssmfManagerService.querySubnetCapability(nbiRequest);
+ }
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/ErrorResponse.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/ErrorResponse.java
new file mode 100644
index 0000000000..a8653f8d73
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/ErrorResponse.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ */
+
+package org.onap.so.adapters.nssmf.entity;
+
+public class ErrorResponse {
+
+ private int status;
+
+ private String error;
+
+ private String message;
+
+ public ErrorResponse(int status, String message) {
+ this.status = status;
+ this.message = message;
+ this.error = "Bad Request";
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public String getError() {
+ if (status == 500) {
+ this.error = "Internal Server Error";
+ }
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfInfo.java
index 6306643a97..af26264074 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfInfo.java
@@ -18,8 +18,11 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.rest;
+package org.onap.so.adapters.nssmf.entity;
+import lombok.Data;
+
+@Data
public class NssmfInfo {
private String url;
@@ -35,60 +38,4 @@ public class NssmfInfo {
private String userName;
private String password;
-
- public String getInsecure() {
- return insecure;
- }
-
- public void setInsecure(String insecure) {
- this.insecure = insecure;
- }
-
- public String getCacert() {
- return cacert;
- }
-
- public void setCacert(String cacert) {
- this.cacert = cacert;
- }
-
- public String getIpAddress() {
- return ipAddress;
- }
-
- public void setIpAddress(String ipAddress) {
- this.ipAddress = ipAddress;
- }
-
- public String getPort() {
- return port;
- }
-
- public void setPort(String port) {
- this.port = port;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfUrlInfo.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfUrlInfo.java
new file mode 100644
index 0000000000..f55ff10f1c
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/NssmfUrlInfo.java
@@ -0,0 +1,17 @@
+package org.onap.so.adapters.nssmf.entity;
+
+import lombok.Data;
+import org.onap.so.adapters.nssmf.enums.HttpMethod;
+
+@Data
+public class NssmfUrlInfo {
+
+ private String url;
+
+ private HttpMethod httpMethod;
+
+ public NssmfUrlInfo(String url, HttpMethod httpMethod) {
+ this.url = url;
+ this.httpMethod = httpMethod;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestResponse.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/RestResponse.java
index cc047e45c7..218867c1ab 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestResponse.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/RestResponse.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.rest;
+package org.onap.so.adapters.nssmf.entity;
import java.util.Map;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenRequest.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenRequest.java
index 3590c683e6..bfcb875290 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenRequest.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenRequest.java
@@ -18,8 +18,11 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.model;
+package org.onap.so.adapters.nssmf.entity;
+import lombok.Data;
+
+@Data
public class TokenRequest {
private String grantType;
@@ -27,28 +30,4 @@ public class TokenRequest {
private String userName;
private String value;
-
- public String getGrantType() {
- return grantType;
- }
-
- public void setGrantType(String grantType) {
- this.grantType = grantType;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenResponse.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenResponse.java
index 8007075e04..552612a6fb 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/model/TokenResponse.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/entity/TokenResponse.java
@@ -18,27 +18,15 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.model;
+package org.onap.so.adapters.nssmf.entity;
+
+import lombok.Data;
+
+@Data
public class TokenResponse {
private String accessToken;
private int expires;
-
- public String getAccessToken() {
- return accessToken;
- }
-
- public void setAccessToken(String accessToken) {
- this.accessToken = accessToken;
- }
-
- public int getExpires() {
- return expires;
- }
-
- public void setExpires(int expires) {
- this.expires = expires;
- }
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ActionType.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ActionType.java
new file mode 100644
index 0000000000..ed327fd981
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ActionType.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.enums;
+
+public enum ActionType {
+ ALLOCATE,
+
+ DEALLOCATE,
+
+ CREATE,
+
+ TERMINATE,
+
+ ACTIVATE,
+
+ DEACTIVATE,
+
+ QUERY_JOB_STATUS,
+
+ MODIFY_BY_ID,
+
+ MODIFY,
+
+ QUERY_NSSI_SELECTION_CAPABILITY,
+
+ QUERY_SUB_NET_CAPABILITY
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ExecutorType.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ExecutorType.java
new file mode 100644
index 0000000000..a76a54c348
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ExecutorType.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.enums;
+
+public enum ExecutorType {
+ INTERNAL, EXTERNAL
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/HttpMethod.java
index f6abd98794..9271bb50b3 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/HttpMethod.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.rest;
+package org.onap.so.adapters.nssmf.enums;
public enum HttpMethod {
GET, POST, PUT, DELETE, PATCH;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/JobStatus.java
index f2e651fd6e..d5cc1df377 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/JobStatus.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.rest;
+package org.onap.so.adapters.nssmf.enums;
import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/SelectionType.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/SelectionType.java
new file mode 100644
index 0000000000..420dfdce49
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/SelectionType.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.enums;
+
+public enum SelectionType {
+ NSSMF,
+
+ NSMF
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/exceptions/ApplicationException.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/exceptions/ApplicationException.java
index f63ba356a1..2461f5ca78 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/exceptions/ApplicationException.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/exceptions/ApplicationException.java
@@ -20,7 +20,7 @@
package org.onap.so.adapters.nssmf.exceptions;
-import org.onap.so.adapters.nssmf.model.ErrorResponse;
+import org.onap.so.adapters.nssmf.entity.ErrorResponse;
import org.springframework.http.ResponseEntity;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProvider.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProvider.java
index c737ba6440..665b111e03 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProvider.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProvider.java
@@ -22,6 +22,7 @@ package org.onap.so.adapters.nssmf.extclients.aai;
import org.onap.aai.domain.yang.EsrSystemInfoList;
import org.onap.aai.domain.yang.EsrThirdpartySdncList;
+import org.onap.aai.domain.yang.ServiceInstance;
public interface AaiServiceProvider {
@@ -29,4 +30,7 @@ public interface AaiServiceProvider {
EsrSystemInfoList invokeGetThirdPartySdncEsrSystemInfo(String sdncId);
+ void invokeCreateServiceInstance(ServiceInstance nssiInstance, String globalSubscriberId, String serviceType,
+ String serviceInstanceId);
+
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java
index 8cb47ebf38..3f2e5b23f2 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/extclients/aai/AaiServiceProviderImpl.java
@@ -23,7 +23,9 @@ package org.onap.so.adapters.nssmf.extclients.aai;
import org.onap.aai.domain.yang.EsrSystemInfoList;
import org.onap.aai.domain.yang.EsrThirdpartySdncList;
+import org.onap.aai.domain.yang.ServiceInstance;
import org.onap.aaiclient.client.aai.AAIObjectType;
+import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,4 +65,12 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
});
}
+
+ @Override
+ public void invokeCreateServiceInstance(ServiceInstance nssiInstance, String globalSubscriberId, String serviceType,
+ String serviceInstanceId) {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,
+ serviceType, serviceInstanceId);
+ aaiClientProvider.getAaiClient().create(uri, nssiInstance);
+ }
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/interceptor/LoggerInterceptor.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/interceptor/LoggerInterceptor.java
new file mode 100644
index 0000000000..ea6a1250d9
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/interceptor/LoggerInterceptor.java
@@ -0,0 +1,92 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.interceptor;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.onap.so.adapters.nssmf.annotation.ServiceLogger;
+import org.onap.so.adapters.nssmf.util.NssmfAdapterUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+import java.lang.reflect.Method;
+
+/**
+ * support to print logger of service method
+ */
+@Aspect
+@Order(100)
+@Component
+public class LoggerInterceptor {
+
+ private static final Logger logger = LoggerFactory.getLogger(LoggerInterceptor.class);
+
+ @Pointcut("execution(* org.onap.so.adapters.nssmf.service..*(..))")
+ public void serviceLogger() {
+
+ }
+
+ @Around("serviceLogger()")
+ public Object around(ProceedingJoinPoint joinPoint) {
+ try {
+ MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+ Method method = signature.getMethod();
+
+ Class<?> targetClass = method.getDeclaringClass();
+
+ StringBuilder classAndMethod = new StringBuilder();
+ ServiceLogger classAnnotation = targetClass.getAnnotation(ServiceLogger.class);
+ ServiceLogger methodAnnotation = method.getAnnotation(ServiceLogger.class);
+
+ if (classAnnotation == null && methodAnnotation == null) {
+ return joinPoint.proceed();
+ }
+
+ if (classAnnotation != null) {
+ if (classAnnotation.ignore()) {
+ return joinPoint.proceed();
+ }
+ classAndMethod.append(classAnnotation.value()).append("-");
+ }
+
+ String target = targetClass.getName() + "#" + method.getName();
+
+ String params = NssmfAdapterUtil.marshal(joinPoint.getArgs());
+
+ logger.info("{} Start: Method = {} \nParams = {}", classAndMethod.toString(), target, params);
+
+ long start = System.currentTimeMillis();
+ Object result = joinPoint.proceed();
+ long timeConsuming = System.currentTimeMillis() - start;
+
+ logger.info("\n{} End: Method = {}, Spend time = {}ms \nResult = {}", classAndMethod.toString(), target,
+ timeConsuming, NssmfAdapterUtil.marshal(result));
+ return result;
+
+ } catch (Throwable e) {
+ logger.error(e.getMessage(), e);
+ }
+ return null;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManager.java
new file mode 100644
index 0000000000..54ef1e09dd
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManager.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager;
+
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.beans.nsmf.*;
+
+public interface NssmfManager {
+
+ RestResponse allocateNssi(NssmfAdapterNBIRequest nssmfRequest) throws ApplicationException;
+
+ RestResponse deAllocateNssi(NssmfAdapterNBIRequest nssmfRequest, String sliceId) throws ApplicationException;
+
+ RestResponse activateNssi(NssmfAdapterNBIRequest nssmfRequest, String snssai) throws ApplicationException;
+
+ RestResponse deActivateNssi(NssmfAdapterNBIRequest nssmfRequest, String snssai) throws ApplicationException;
+
+ RestResponse queryJobStatus(NssmfAdapterNBIRequest jobReq, String jobId) throws ApplicationException;
+
+ RestResponse queryNSSISelectionCapability(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ RestResponse querySubnetCapability(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ RestResponse modifyNssi(NssmfAdapterNBIRequest modifyRequest) throws ApplicationException;
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java
new file mode 100644
index 0000000000..0b332af607
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/NssmfManagerBuilder.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager;
+
+import org.onap.so.adapters.nssmf.config.NssmfAdapterConfig;
+import org.onap.so.adapters.nssmf.consts.NssmfAdapterConsts;
+import org.onap.so.adapters.nssmf.enums.ActionType;
+import org.onap.so.adapters.nssmf.enums.ExecutorType;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.external.ExternalAnNssmfManager;
+import org.onap.so.adapters.nssmf.manager.impl.external.ExternalCnNssmfManager;
+import org.onap.so.adapters.nssmf.manager.impl.internal.InternalAnNssmfManager;
+import org.onap.so.adapters.nssmf.manager.impl.internal.InternalCnNssmfManager;
+import org.onap.so.adapters.nssmf.manager.impl.internal.InternalTnNssmfManager;
+import org.onap.so.adapters.nssmf.manager.impl.*;
+import org.onap.so.adapters.nssmf.util.RestUtil;
+import org.onap.so.beans.nsmf.EsrInfo;
+import org.onap.so.beans.nsmf.NetworkType;
+import org.onap.so.beans.nsmf.ServiceInfo;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+
+public class NssmfManagerBuilder {
+
+ private BaseNssmfManager nssmfManger;
+
+ private RestUtil restUtil;
+
+ private ActionType actionType;
+
+ private ResourceOperationStatusRepository repository;
+
+ private ServiceInfo serviceInfo;
+
+ private NssmfAdapterConfig adapterConfig;
+
+ public NssmfManagerBuilder(EsrInfo esrInfo) throws ApplicationException {
+
+ ExecutorType executorType = getExecutorType(esrInfo);
+ NetworkType networkType = esrInfo.getNetworkType();
+
+ if (ExecutorType.INTERNAL.equals(executorType) && NetworkType.CORE.equals(networkType)) {
+ this.nssmfManger = new InternalCnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType);
+ return;
+ }
+
+ if (ExecutorType.INTERNAL.equals(executorType) && NetworkType.TRANSPORT.equals(networkType)) {
+ this.nssmfManger = new InternalTnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType);
+ return;
+ }
+
+ if (ExecutorType.INTERNAL.equals(executorType) && NetworkType.ACCESS.equals(networkType)) {
+ this.nssmfManger = new InternalAnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType);
+ return;
+ }
+
+ if (ExecutorType.EXTERNAL.equals(executorType) && NetworkType.CORE.equals(networkType)) {
+ this.nssmfManger = new ExternalCnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType)
+ .setInitStatus("deactivated");
+ return;
+ }
+
+ if (ExecutorType.EXTERNAL.equals(executorType) && NetworkType.ACCESS.equals(networkType)) {
+ this.nssmfManger = new ExternalAnNssmfManager().setEsrInfo(esrInfo).setExecutorType(executorType)
+ .setInitStatus("activated");
+ return;
+ }
+
+ throw new ApplicationException(404, "invalid domain and simulator");
+ }
+
+ private ExecutorType getExecutorType(EsrInfo esrInfo) {
+ if (NssmfAdapterConsts.ONAP_INTERNAL_TAG.equals(esrInfo.getVendor())) {
+ return ExecutorType.INTERNAL;
+ }
+ return ExecutorType.EXTERNAL;
+ }
+
+ public NssmfManagerBuilder setRestUtil(RestUtil restUtil) {
+ this.restUtil = restUtil;
+ return this;
+ }
+
+ public NssmfManagerBuilder setActionType(ActionType actionType) {
+ this.actionType = actionType;
+ return this;
+ }
+
+ public NssmfManagerBuilder setRepository(ResourceOperationStatusRepository repository) {
+ this.repository = repository;
+ return this;
+ }
+
+ public NssmfManagerBuilder setServiceInfo(ServiceInfo serviceInfo) {
+ this.serviceInfo = serviceInfo;
+ return this;
+ }
+
+ public NssmfManagerBuilder setAdapterConfig(NssmfAdapterConfig adapterConfig) {
+ this.adapterConfig = adapterConfig;
+ return this;
+ }
+
+ public NssmfManager build() {
+ return this.nssmfManger.setRestUtil(restUtil).setAdapterConfig(adapterConfig).setRepository(repository)
+ .setActionType(actionType).setServiceInfo(serviceInfo);
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
new file mode 100644
index 0000000000..97a4c5e889
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
@@ -0,0 +1,267 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl;
+
+import org.onap.so.adapters.nssmf.config.NssmfAdapterConfig;
+import org.onap.so.adapters.nssmf.consts.NssmfAdapterConsts;
+import org.onap.so.adapters.nssmf.entity.NssmfUrlInfo;
+import org.onap.so.adapters.nssmf.enums.*;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.manager.NssmfManager;
+import org.onap.so.adapters.nssmf.util.RestUtil;
+import org.onap.so.beans.nsmf.*;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.springframework.data.domain.Example;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+public abstract class BaseNssmfManager implements NssmfManager {
+
+ protected RestUtil restUtil;
+
+ protected ResourceOperationStatusRepository repository;
+
+ protected NssmfAdapterConfig adapterConfig;
+
+ protected ActionType actionType;
+
+ protected EsrInfo esrInfo;
+
+ protected String nssmfUrl;
+
+ protected HttpMethod httpMethod;
+
+ protected String initStatus;
+
+ protected ServiceInfo serviceInfo;
+
+ protected RestResponse restResponse;
+
+ private ExecutorType executorType = ExecutorType.INTERNAL;
+
+ private Map<String, String> params = new HashMap<>(); // request params
+
+ @Override
+ public RestResponse allocateNssi(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+
+ this.params.clear();
+ this.urlHandler();
+ String requestBody = wrapAllocateReqBody(nbiRequest);
+
+ this.restResponse = sendRequest(requestBody);
+
+ this.afterRequest();
+
+ return restResponse;
+ }
+
+ protected abstract String wrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ public RestResponse modifyNssi(NssmfAdapterNBIRequest modifyRequest) throws ApplicationException {
+ this.params.clear();
+ this.urlHandler();
+ String requestBody = wrapModifyReqBody(modifyRequest);
+
+ this.restResponse = sendRequest(requestBody);
+
+ this.afterRequest();
+
+ return restResponse;
+ }
+
+ protected abstract String wrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ public RestResponse deAllocateNssi(NssmfAdapterNBIRequest nbiRequest, String sliceId) throws ApplicationException {
+ this.params.clear();
+ this.params.put("sliceProfileId", sliceId);
+
+ this.urlHandler();
+
+ String reqBody = wrapDeAllocateReqBody(nbiRequest.getDeAllocateNssi());
+
+ this.restResponse = sendRequest(reqBody);
+
+ this.afterRequest();
+
+ return restResponse;
+ }
+
+ protected abstract String wrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException;
+
+ protected abstract String wrapReqBody(Object object) throws ApplicationException;
+
+ @Override
+ public RestResponse activateNssi(NssmfAdapterNBIRequest nbiRequest, String snssai) throws ApplicationException {
+ this.params.clear();
+ this.params.put("snssai", snssai);
+
+ this.urlHandler();
+
+ String reqBody = wrapActDeActReqBody(nbiRequest.getActDeActNssi());
+
+ this.restResponse = sendRequest(reqBody);
+
+ this.afterRequest();
+
+ return restResponse;
+ }
+
+ @Override
+ public RestResponse deActivateNssi(NssmfAdapterNBIRequest nbiRequest, String snssai) throws ApplicationException {
+ return activateNssi(nbiRequest, snssai);
+ }
+
+ protected abstract String wrapActDeActReqBody(ActDeActNssi actDeActNssi) throws ApplicationException;
+
+ @Override
+ public RestResponse queryJobStatus(NssmfAdapterNBIRequest jobReq, String jobId) throws ApplicationException {
+ this.params.clear();
+ this.params.put("jobId", jobId);
+ this.params.put("responseId", jobReq.getResponseId());
+ this.urlHandler();
+
+ /**
+ * find by jobId and nsiId jobId -> OperationId nsiId -> ServiceId serviceUuid -> resourceTemplateUUID
+ */
+ ResourceOperationStatus status =
+ getOperationStatus(serviceInfo.getNsiId(), jobId, serviceInfo.getServiceUuid());
+
+ this.restResponse = doQueryJobStatus(status);
+
+ afterQueryJobStatus(status);
+ return restResponse;
+ }
+
+ protected abstract RestResponse doQueryJobStatus(ResourceOperationStatus status) throws ApplicationException;
+
+
+ protected abstract void afterQueryJobStatus(ResourceOperationStatus status);
+
+ private ResourceOperationStatus getOperationStatus(String nsiId, String jobId, String serviceUuid) {
+
+ ResourceOperationStatus status = new ResourceOperationStatus(nsiId, jobId, serviceUuid);
+
+ Optional<ResourceOperationStatus> optional = repository.findOne(Example.of(status));
+
+ return optional.orElse(null);
+ }
+
+ @Override
+ public RestResponse queryNSSISelectionCapability(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ SelectionType res = doQueryNSSISelectionCapability();
+ HashMap<String, String> hashMap = new HashMap<>();
+ hashMap.put("selection", res.name());
+ RestResponse restResponse = new RestResponse();
+ restResponse.setStatus(200);
+ restResponse.setResponseContent(marshal(hashMap));
+ return restResponse;
+ }
+
+ protected abstract SelectionType doQueryNSSISelectionCapability();
+
+ @Override
+ public RestResponse querySubnetCapability(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ this.params.clear();
+ this.urlHandler();
+
+ return doQuerySubnetCapability(nbiRequest.getSubnetCapabilityQuery());
+ }
+
+ protected abstract RestResponse doQuerySubnetCapability(String req) throws ApplicationException;
+
+ /**
+ * send request to nssmf
+ *
+ * @param content request body
+ * @return response
+ * @throws ApplicationException
+ */
+ protected abstract RestResponse sendRequest(String content) throws ApplicationException;
+
+ /**
+ * handle the url before request to nssmf, include get the nssmf request url, replace the path variable
+ */
+ private void urlHandler() {
+ NssmfUrlInfo nssmfUrlInfo =
+ NssmfAdapterConsts.getNssmfUrlInfo(this.executorType, this.esrInfo.getNetworkType(), actionType);
+ this.nssmfUrl = nssmfUrlInfo.getUrl();
+ this.httpMethod = nssmfUrlInfo.getHttpMethod();
+ this.nssmfUrl = nssmfUrl.replaceAll("\\{apiVersion}", getApiVersion());
+ this.params.forEach((k, v) -> this.nssmfUrl = this.nssmfUrl.replaceAll("\\{" + k + "}", v));
+ }
+
+ /**
+ * after request
+ */
+ protected abstract void afterRequest() throws ApplicationException;
+
+ protected abstract String getApiVersion();
+
+ public RestUtil getRestUtil() {
+ return restUtil;
+ }
+
+ public BaseNssmfManager setEsrInfo(EsrInfo esrInfo) {
+ this.esrInfo = esrInfo;
+ return this;
+ }
+
+ public BaseNssmfManager setExecutorType(ExecutorType executorType) {
+ this.executorType = executorType;
+ return this;
+ }
+
+ public BaseNssmfManager setRestUtil(RestUtil restUtil) {
+ this.restUtil = restUtil;
+ return this;
+ }
+
+ public BaseNssmfManager setActionType(ActionType actionType) {
+ this.actionType = actionType;
+ return this;
+ }
+
+ public BaseNssmfManager setRepository(ResourceOperationStatusRepository repository) {
+ this.repository = repository;
+ return this;
+ }
+
+ public BaseNssmfManager setServiceInfo(ServiceInfo serviceInfo) {
+ this.serviceInfo = serviceInfo;
+ return this;
+ }
+
+ public BaseNssmfManager setInitStatus(String initStatus) {
+ this.initStatus = initStatus;
+ return this;
+ }
+
+ public BaseNssmfManager setAdapterConfig(NssmfAdapterConfig adapterConfig) {
+ this.adapterConfig = adapterConfig;
+ return this;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
new file mode 100644
index 0000000000..16a5b2ada0
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
@@ -0,0 +1,182 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl;
+
+import org.apache.http.Header;
+import org.apache.http.message.BasicHeader;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.so.adapters.nssmf.entity.NssmfInfo;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.enums.JobStatus;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.util.NssmfAdapterUtil;
+import org.onap.so.beans.nsmf.*;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import static java.lang.String.valueOf;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.*;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.StatusDesc.*;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal;
+
+public abstract class ExternalNssmfManager extends BaseNssmfManager {
+
+ @Override
+ protected String wrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return doWrapExtAllocateReqBody(nbiRequest);
+ }
+
+ protected abstract String doWrapExtAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ protected String wrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return doWrapModifyReqBody(nbiRequest);
+ }
+
+ protected abstract String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ protected String wrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException {
+ return doWrapDeAllocateReqBody(deAllocateNssi);
+ }
+
+ protected abstract String doWrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException;
+
+ @Override
+ protected void afterQueryJobStatus(ResourceOperationStatus status) {
+ if (Integer.parseInt(status.getProgress()) == 100) {
+
+ ServiceInstance nssiInstance = new ServiceInstance();
+ nssiInstance.setServiceInstanceId(serviceInfo.getNssiId());
+ nssiInstance.setServiceInstanceName(serviceInfo.getNssiName());
+ nssiInstance.setServiceType(serviceInfo.getSST());
+
+ nssiInstance.setOrchestrationStatus(initStatus);
+ nssiInstance.setModelInvariantId(serviceInfo.getServiceInvariantUuid());
+ nssiInstance.setModelVersionId(serviceInfo.getServiceUuid());
+ nssiInstance.setServiceInstanceLocationId(serviceInfo.getPLMNIdList());
+ nssiInstance.setEnvironmentContext(esrInfo.getNetworkType().getNetworkType());
+ nssiInstance.setServiceRole("nssi");
+
+ restUtil.createServiceInstance(nssiInstance, serviceInfo);
+ }
+ }
+
+
+
+ @Override
+ protected String wrapActDeActReqBody(ActDeActNssi actDeActNssi) throws ApplicationException {
+ return marshal(actDeActNssi);
+ }
+
+ protected RestResponse doQueryJobStatus(ResourceOperationStatus status) throws ApplicationException {
+ return doResponseStatus(status);
+ }
+
+ private RestResponse doResponseStatus(ResourceOperationStatus status) throws ApplicationException {
+ RestResponse restResponse = sendRequest(null);
+ ResponseDescriptor rspDesc =
+ unMarshal(restResponse.getResponseContent(), JobStatusResponse.class).getResponseDescriptor();
+ updateRequestDbJobStatus(rspDesc, status, restResponse);
+ return restResponse;
+ }
+
+ @Override
+ protected String wrapReqBody(Object object) throws ApplicationException {
+ return marshal(object);
+ }
+
+ @Override
+ protected RestResponse sendRequest(String content) throws ApplicationException {
+ return sendExternalRequest(content);
+ }
+
+ @Override
+ protected String getApiVersion() {
+ return "v1";
+ }
+
+
+ // external
+ protected RestResponse sendExternalRequest(String content) throws ApplicationException {
+ NssmfInfo nssmfInfo = restUtil.getNssmfHost(esrInfo);
+ Header header = new BasicHeader("X-Auth-Token", restUtil.getToken(nssmfInfo));
+ String nssmfUrl = nssmfInfo.getUrl() + this.nssmfUrl;
+ return restUtil.send(nssmfUrl, this.httpMethod, content, header);
+ }
+
+ private void updateRequestDbJobStatus(ResponseDescriptor rspDesc, ResourceOperationStatus status, RestResponse rsp)
+ throws ApplicationException {
+
+ switch (fromString(rspDesc.getStatus())) {
+ case STARTED:
+ updateDbStatus(status, rsp.getStatus(), STARTED, QUERY_JOB_STATUS_SUCCESS);
+ break;
+ case PROCESSING:
+ updateDbStatus(status, rsp.getStatus(), PROCESSING, QUERY_JOB_STATUS_SUCCESS);
+ break;
+ case FINISHED:
+ if (rspDesc.getProgress() == 100) {
+ updateDbStatus(status, rsp.getStatus(), FINISHED, QUERY_JOB_STATUS_SUCCESS);
+ }
+ break;
+ case ERROR:
+ updateDbStatus(status, rsp.getStatus(), ERROR, QUERY_JOB_STATUS_FAILED);
+ throw new ApplicationException(500, QUERY_JOB_STATUS_FAILED);
+ }
+ }
+
+ protected void updateDbStatus(ResourceOperationStatus status, int rspStatus, JobStatus jobStatus,
+ String description) {
+ status.setErrorCode(valueOf(rspStatus));
+ status.setStatus(jobStatus.toString());
+ status.setStatusDescription(description);
+ repository.save(status);
+ }
+
+ @Override
+ protected RestResponse doQuerySubnetCapability(String req) throws ApplicationException {
+ RestResponse response = new RestResponse();
+ response.setStatus(200);
+ response.setResponseContent(null);
+ return response;
+ }
+
+ /**
+ * after request, if response code is 2XX, continue handle, else return
+ */
+ @Override
+ protected void afterRequest() throws ApplicationException {
+ if (valueOf(restResponse.getStatus()).startsWith("2")) {
+ doAfterRequest();
+ }
+ }
+
+
+ protected void doAfterRequest() throws ApplicationException {
+ //
+ NssiResponse response = unMarshal(restResponse.getResponseContent(), NssiResponse.class);
+ ResourceOperationStatus status =
+ new ResourceOperationStatus(serviceInfo.getNsiId(), response.getJobId(), serviceInfo.getServiceUuid());
+ status.setResourceInstanceID(response.getNssiId());
+
+ updateDbStatus(status, restResponse.getStatus(), STARTED, NssmfAdapterUtil.getStatusDesc(actionType));
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java
new file mode 100644
index 0000000000..f439b400d9
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl;
+
+import org.apache.http.Header;
+import org.apache.http.message.BasicHeader;
+import org.onap.so.adapters.nssmf.consts.NssmfAdapterConsts;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.enums.SelectionType;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.beans.nsmf.*;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.PROCESSING;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+public abstract class InternalNssmfManager extends BaseNssmfManager {
+
+ @Override
+ protected String wrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return doWrapAllocateReqBody(nbiRequest);
+ }
+
+ protected abstract String doWrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ protected String wrapReqBody(Object object) throws ApplicationException {
+ NssmfRequest nssmfRequest = new NssmfRequest(serviceInfo, esrInfo.getNetworkType(), object);
+ return marshal(nssmfRequest);
+ }
+
+
+ @Override
+ protected String wrapActDeActReqBody(ActDeActNssi actDeActNssi) throws ApplicationException {
+
+ return wrapReqBody(actDeActNssi);
+ }
+
+
+ @Override
+ protected String wrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException {
+ return wrapReqBody(deAllocateNssi);
+ }
+
+
+ @Override
+ protected RestResponse doQueryJobStatus(ResourceOperationStatus status) throws ApplicationException {
+ return responseDBStatus(status);
+ }
+
+ private RestResponse responseDBStatus(ResourceOperationStatus status) throws ApplicationException {
+ ResponseDescriptor descriptor = new ResponseDescriptor();
+ if (status == null) {
+ descriptor.setProgress(0);
+ descriptor.setStatus(PROCESSING.name());
+ descriptor.setStatusDescription("Initiating Nssi Instance");
+ return restUtil.createResponse(200, marshal(descriptor));
+ }
+ descriptor.setStatus(status.getStatus());
+ descriptor.setStatusDescription(status.getStatusDescription());
+ descriptor.setProgress(Integer.parseInt(status.getProgress()));
+ // descriptor.setResponseId(status.getOperationId());
+ return restUtil.createResponse(200, marshal(descriptor));
+ }
+
+ @Override
+ protected RestResponse sendRequest(String content) {
+ return sendInternalRequest(content);
+ }
+
+ @Override
+ protected void afterRequest() {
+ //
+ }
+
+ @Override
+ protected void afterQueryJobStatus(ResourceOperationStatus status) {
+ // internal
+ }
+
+ // internal
+ private RestResponse sendInternalRequest(String content) {
+ Header header = new BasicHeader("X-Auth-Token", adapterConfig.getInfraAuth());
+ this.nssmfUrl = adapterConfig.getInfraEndpoint() + this.nssmfUrl;
+ return restUtil.send(this.nssmfUrl, this.httpMethod, content, header);
+ }
+
+ @Override
+ protected String getApiVersion() {
+ return NssmfAdapterConsts.CURRENT_INTERNAL_NSSMF_API_VERSION;
+ }
+
+
+ @Override
+ protected SelectionType doQueryNSSISelectionCapability() {
+ return SelectionType.NSSMF;
+ }
+
+ @Override
+ protected String wrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return doWrapModifyReqBody(nbiRequest);
+ }
+
+ protected abstract String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException;
+
+ @Override
+ protected RestResponse doQuerySubnetCapability(String req) throws ApplicationException {
+ // handler
+ return sendRequest(req);
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java
new file mode 100644
index 0000000000..ef979a660f
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl.external;
+
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.enums.ActionType;
+import org.onap.so.adapters.nssmf.enums.JobStatus;
+import org.onap.so.adapters.nssmf.enums.SelectionType;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.ExternalNssmfManager;
+import org.onap.so.adapters.nssmf.util.NssmfAdapterUtil;
+import org.onap.so.beans.nsmf.DeAllocateNssi;
+import org.onap.so.beans.nsmf.NssiResponse;
+import org.onap.so.beans.nsmf.NssmfAdapterNBIRequest;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import java.util.HashMap;
+import java.util.Map;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal;
+
+
+public class ExternalAnNssmfManager extends ExternalNssmfManager {
+
+ @Override
+ protected String doWrapExtAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ Map<String, Object> request = new HashMap<>();
+ request.put("attributeListIn", nbiRequest.getAllocateAnNssi().getSliceProfile());
+ return marshal(request);
+ }
+
+ @Override
+ protected void doAfterRequest() throws ApplicationException {
+ if (ActionType.ALLOCATE.equals(actionType) || ActionType.DEALLOCATE.equals(actionType)) {
+ @SuppressWarnings("unchecked")
+ Map<String, String> response = unMarshal(restResponse.getResponseContent(), Map.class);
+
+ String nssiId = response.get("nSSId");
+
+ NssiResponse resp = new NssiResponse();
+ resp.setJobId(nssiId);
+ resp.setNssiId(nssiId);
+
+ RestResponse returnRsp = new RestResponse();
+
+ returnRsp.setStatus(202);
+ returnRsp.setResponseContent(marshal(resp));
+ restResponse = returnRsp;
+
+ ResourceOperationStatus status =
+ new ResourceOperationStatus(serviceInfo.getNsiId(), nssiId, serviceInfo.getServiceUuid());
+ status.setResourceInstanceID(nssiId);
+
+ updateDbStatus(status, restResponse.getStatus(), JobStatus.FINISHED,
+ NssmfAdapterUtil.getStatusDesc(actionType));
+ }
+ // todo
+ }
+
+ @Override
+ protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ // TODO
+ return null;
+ }
+
+ @Override
+ protected String doWrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException {
+ Map<String, String> request = new HashMap<>();
+ request.put("nSSId", deAllocateNssi.getNssiId());
+ return marshal(request);
+ }
+
+
+ @Override
+ public RestResponse modifyNssi(NssmfAdapterNBIRequest modifyRequest) throws ApplicationException {
+ // TODO
+ return null;
+ }
+
+ @Override
+ public RestResponse activateNssi(NssmfAdapterNBIRequest nbiRequest, String snssai) throws ApplicationException {
+ // TODO
+ return null;
+ }
+
+ @Override
+ protected SelectionType doQueryNSSISelectionCapability() {
+ return SelectionType.NSSMF;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalCnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalCnNssmfManager.java
new file mode 100644
index 0000000000..fb76adcce6
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalCnNssmfManager.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl.external;
+
+import org.onap.so.adapters.nssmf.enums.SelectionType;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.ExternalNssmfManager;
+import org.onap.so.beans.nsmf.DeAllocateNssi;
+import org.onap.so.beans.nsmf.NssmfAdapterNBIRequest;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+public class ExternalCnNssmfManager extends ExternalNssmfManager {
+
+ @Override
+ protected String doWrapExtAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return marshal(nbiRequest.getAllocateCnNssi());
+ }
+
+ @Override
+ protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ return marshal(nbiRequest.getAllocateCnNssi());
+ }
+
+ @Override
+ protected String doWrapDeAllocateReqBody(DeAllocateNssi deAllocateNssi) throws ApplicationException {
+ return marshal(deAllocateNssi);
+ }
+
+ @Override
+ protected SelectionType doQueryNSSISelectionCapability() {
+
+ return SelectionType.NSMF;
+ }
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalAnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalAnNssmfManager.java
new file mode 100644
index 0000000000..dc6528381b
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalAnNssmfManager.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl.internal;
+
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.InternalNssmfManager;
+import org.onap.so.beans.nsmf.*;
+import java.util.HashMap;
+import java.util.Map;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+
+public class InternalAnNssmfManager extends InternalNssmfManager {
+
+ @Override
+ protected String doWrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ NssmfRequest request =
+ new NssmfRequest(serviceInfo, nbiRequest.getEsrInfo().getNetworkType(), nbiRequest.getAllocateAnNssi());
+ request.setName(nbiRequest.getAllocateAnNssi().getNssiName());
+ return marshal(request);
+ }
+
+ @Override
+ protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ AllocateAnNssi allocateAnNssi = nbiRequest.getAllocateAnNssi();
+ AnSliceProfile sliceProfile = allocateAnNssi.getSliceProfile();
+ Map<String, Object> additional = new HashMap<>();
+ additional.put("modifyAction", "allocate");
+ additional.put("snssaiList", sliceProfile.getSNSSAIList());
+ additional.put("sliceProfileId", sliceProfile.getSliceProfileId());
+ additional.put("nsiInfo", allocateAnNssi.getNsiInfo());
+ additional.put("scriptName", allocateAnNssi.getScriptName());
+ NssmfRequest request = new NssmfRequest(serviceInfo, esrInfo.getNetworkType(), additional);
+ return marshal(request);
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalCnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalCnNssmfManager.java
new file mode 100644
index 0000000000..4a93b3007c
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalCnNssmfManager.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl.internal;
+
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.InternalNssmfManager;
+import org.onap.so.beans.nsmf.*;
+import java.util.HashMap;
+import java.util.Map;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+public class InternalCnNssmfManager extends InternalNssmfManager {
+
+ @Override
+ protected String doWrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+
+ NssmfRequest request =
+ new NssmfRequest(serviceInfo, nbiRequest.getEsrInfo().getNetworkType(), nbiRequest.getAllocateCnNssi());
+ request.setName(nbiRequest.getAllocateCnNssi().getNssiName());
+ return marshal(request);
+ }
+
+ @Override
+ protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ AllocateCnNssi allocateCnNssi = nbiRequest.getAllocateCnNssi();
+ CnSliceProfile cnSliceProfile = allocateCnNssi.getSliceProfile();
+ Map<String, Object> additional = new HashMap<>();
+ additional.put("modifyAction", "allocate");
+ additional.put("nsiInfo", allocateCnNssi.getNsiInfo());
+ additional.put("scriptName", allocateCnNssi.getScriptName());
+ additional.put("snssaiList", cnSliceProfile.getSnssaiList());
+ additional.put("sliceProfileId", cnSliceProfile.getSliceProfileId());
+
+ NssmfRequest request = new NssmfRequest(serviceInfo, esrInfo.getNetworkType(), additional);
+ return marshal(request);
+ }
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java
new file mode 100644
index 0000000000..8bfbd55387
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.manager.impl.internal;
+
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.impl.InternalNssmfManager;
+import org.onap.so.beans.nsmf.*;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+
+public class InternalTnNssmfManager extends InternalNssmfManager {
+
+ @Override
+ protected String doWrapAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+
+ return marshal(new NssmfRequest(serviceInfo, nbiRequest.getEsrInfo().getNetworkType(),
+ nbiRequest.getAllocateTnNssi()));
+ }
+
+ @Override
+ protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException {
+ // TODO
+ return null;
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfAdapterRest.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfAdapterRest.java
index d8e1e36058..4fdcbf110f 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfAdapterRest.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfAdapterRest.java
@@ -20,6 +20,7 @@
package org.onap.so.adapters.nssmf.rest;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
import org.onap.so.beans.nsmf.JobStatusRequest;
import org.onap.so.beans.nsmf.NssiActDeActRequest;
@@ -43,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.assertObjectNotNull;
+@Deprecated
@Controller
@RequestMapping(value = "/api/rest/provMns/v1", produces = {APPLICATION_JSON}, consumes = {APPLICATION_JSON})
public class NssmfAdapterRest {
@@ -52,17 +54,6 @@ public class NssmfAdapterRest {
@Autowired
private NssmfManager nssmfMgr;
- @PostMapping(value = "/NSS/SliceProfiles")
- public ResponseEntity allocateNssi(@RequestBody NssiAllocateRequest allocate) {
- try {
- logger.info("Nssmi allocate request is invoked");
- assertObjectNotNull(allocate);
- RestResponse rsp = getNssmfMgr().allocateNssi(allocate);
- return buildResponse(rsp);
- } catch (ApplicationException e) {
- return e.buildErrorResponse();
- }
- }
@PostMapping(value = "/NSS/nssi")
public ResponseEntity createNssi(@RequestBody NssiCreateRequest create) {
@@ -76,19 +67,6 @@ public class NssmfAdapterRest {
}
}
- @PostMapping(value = "/NSS/SliceProfiles/{sliceProfileId}")
- public ResponseEntity deAllocateNssi(@RequestBody NssiDeAllocateRequest deAllocate,
- @PathVariable("sliceProfileId") final String sliceId) {
- try {
- logger.info("Nssmf deallocate request is invoked");
- assertObjectNotNull(deAllocate);
- RestResponse rsp = getNssmfMgr().deAllocateNssi(deAllocate, sliceId);
- return buildResponse(rsp);
- } catch (ApplicationException e) {
- return e.buildErrorResponse();
- }
- }
-
@PostMapping(value = "/NSS/nssi/{nssiId}")
public ResponseEntity terminateNssi(@RequestBody NssiTerminateRequest terminate,
@PathVariable("nssiId") String nssiId) {
@@ -128,44 +106,6 @@ public class NssmfAdapterRest {
}
}
- @PostMapping(value = "/NSS/{snssai}/activation")
- public ResponseEntity activateNssi(@RequestBody NssiActDeActRequest activate,
- @PathVariable("snssai") String snssai) {
- try {
- logger.info("Nssmf activate request is invoked");
- assertObjectNotNull(activate);
- RestResponse rsp = getNssmfMgr().activateNssi(activate, snssai);
- return buildResponse(rsp);
- } catch (ApplicationException e) {
- return e.buildErrorResponse();
- }
- }
-
- @PostMapping(value = "/NSS/{snssai}/deactivation")
- public ResponseEntity deactivateNssi(@RequestBody NssiActDeActRequest deActivate,
- @PathVariable("snssai") String snssai) {
- try {
- logger.info("Nssmf activate request is invoked");
- assertObjectNotNull(deActivate);
- RestResponse rsp = getNssmfMgr().deActivateNssi(deActivate, snssai);
- return buildResponse(rsp);
- } catch (ApplicationException e) {
- return e.buildErrorResponse();
- }
- }
-
- @PostMapping(value = "/NSS/jobs/{jobId}")
- public ResponseEntity queryJobStatus(@RequestBody JobStatusRequest jobStatusReq,
- @PathVariable("jobId") String jobId) {
- try {
- logger.info("Nssmf query job status request is invoked");
- assertObjectNotNull(jobStatusReq);
- RestResponse rsp = getNssmfMgr().queryJobStatus(jobStatusReq, jobId);
- return buildResponse(rsp);
- } catch (ApplicationException e) {
- return e.buildErrorResponse();
- }
- }
@GetMapping(value = "/vendor/{vendorName}/type/{networkType}/NSS" + "/SliceProfiles/{sliceProfileId}")
public ResponseEntity queryNssi(@PathVariable("vendorName") String vendorName,
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java
index 0e25729610..2d0980f60e 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfManager.java
@@ -20,7 +20,10 @@
package org.onap.so.adapters.nssmf.rest;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.enums.JobStatus;
import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.util.RestUtil;
import org.onap.so.beans.nsmf.ActDeActNssi;
import org.onap.so.beans.nsmf.AllocateAnNssi;
import org.onap.so.beans.nsmf.AllocateCnNssi;
@@ -52,15 +55,15 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Component;
import static java.lang.String.valueOf;
-import static org.onap.so.adapters.nssmf.rest.HttpMethod.DELETE;
-import static org.onap.so.adapters.nssmf.rest.HttpMethod.GET;
-import static org.onap.so.adapters.nssmf.rest.HttpMethod.POST;
-import static org.onap.so.adapters.nssmf.rest.HttpMethod.PUT;
-import static org.onap.so.adapters.nssmf.rest.JobStatus.ERROR;
-import static org.onap.so.adapters.nssmf.rest.JobStatus.FINISHED;
-import static org.onap.so.adapters.nssmf.rest.JobStatus.PROCESSING;
-import static org.onap.so.adapters.nssmf.rest.JobStatus.STARTED;
-import static org.onap.so.adapters.nssmf.rest.JobStatus.fromString;
+import static org.onap.so.adapters.nssmf.enums.HttpMethod.DELETE;
+import static org.onap.so.adapters.nssmf.enums.HttpMethod.GET;
+import static org.onap.so.adapters.nssmf.enums.HttpMethod.POST;
+import static org.onap.so.adapters.nssmf.enums.HttpMethod.PUT;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.ERROR;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.FINISHED;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.PROCESSING;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.STARTED;
+import static org.onap.so.adapters.nssmf.enums.JobStatus.fromString;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.StatusDesc.ACTIVATE_NSS_SUCCESS;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.StatusDesc.ALLOCATE_NSS_SUCCESS;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.StatusDesc.CREATE_NSS_SUCCESS;
@@ -76,6 +79,7 @@ import static org.onap.so.beans.nsmf.ActDeActNssi.DE_ACT_URL;
@Component
@Primary
+@Deprecated
public class NssmfManager {
private static final Logger logger = LoggerFactory.getLogger(NssmfManager.class);
@@ -129,14 +133,15 @@ public class NssmfManager {
case TRANSPORT:
AllocateTnNssi tn = nssmiAllocate.getAllocateTnNssi();
assertObjectNotNull(tn);
- assertObjectNotNull(tn.getNsiInfo());
- assertObjectNotNull(tn.getNsiInfo().getNsiId());
- nsiId = tn.getNsiInfo().getNsiId();
+ // assertObjectNotNull(tn.getNsiInfo());
+ // assertObjectNotNull(tn.getNsiInfo().getNsiId());
+ // nsiId = tn.getNsiInfo().getNsiId();
allocateReq = marshal(tn);
- allocateUrl = AllocateTnNssi.URL;
+ // allocateUrl = AllocateTnNssi.URL;
break;
}
+
RestResponse rsp = restUtil.sendRequest(allocateUrl, POST, allocateReq, nssmiAllocate.getEsrInfo());
assertObjectNotNull(rsp);
@@ -152,6 +157,8 @@ public class NssmfManager {
return rsp;
}
+
+
public RestResponse createNssi(NssiCreateRequest nssiCreate) throws ApplicationException {
assertObjectNotNull(nssiCreate.getEsrInfo());
@@ -192,6 +199,7 @@ public class NssmfManager {
return rsp;
}
+ @Deprecated
public RestResponse deAllocateNssi(NssiDeAllocateRequest nssiDeallocate, String sliceId)
throws ApplicationException {
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/TrustAllHostNameVerifier.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/TrustAllHostNameVerifier.java
index 254186bda8..fc0f3ddde5 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/TrustAllHostNameVerifier.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/TrustAllHostNameVerifier.java
@@ -23,6 +23,7 @@ package org.onap.so.adapters.nssmf.rest;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
+@Deprecated
public class TrustAllHostNameVerifier implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/NssmfManagerService.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/NssmfManagerService.java
new file mode 100644
index 0000000000..92fe5576dd
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/NssmfManagerService.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.service;
+
+import org.onap.so.adapters.nssmf.annotation.ServiceLogger;
+import org.onap.so.beans.nsmf.*;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service
+@ServiceLogger
+public interface NssmfManagerService {
+ ResponseEntity allocateNssi(NssmfAdapterNBIRequest allocateRequest);
+
+ ResponseEntity deAllocateNssi(NssmfAdapterNBIRequest allocateRequest, String sliceProfileId);
+
+ ResponseEntity activateNssi(NssmfAdapterNBIRequest deActRequest, String snssai);
+
+ ResponseEntity deActivateNssi(NssmfAdapterNBIRequest nssiDeActivate, String snssai);
+
+ ResponseEntity queryJobStatus(NssmfAdapterNBIRequest jobReq, String jobId);
+
+ ResponseEntity queryNSSISelectionCapability(NssmfAdapterNBIRequest nbiRequest);
+
+ ResponseEntity querySubnetCapability(NssmfAdapterNBIRequest nbiRequest);
+
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImpl.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImpl.java
new file mode 100644
index 0000000000..5f7fe76b72
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImpl.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.service.impl;
+
+import org.apache.commons.lang3.StringUtils;
+import org.onap.so.adapters.nssmf.annotation.ServiceLogger;
+import org.onap.so.adapters.nssmf.config.NssmfAdapterConfig;
+import org.onap.so.adapters.nssmf.enums.ActionType;
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+import org.onap.so.adapters.nssmf.manager.NssmfManagerBuilder;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
+import org.onap.so.adapters.nssmf.manager.NssmfManager;
+import org.onap.so.adapters.nssmf.service.NssmfManagerService;
+import org.onap.so.adapters.nssmf.util.RestUtil;
+import org.onap.so.beans.nsmf.*;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+
+@Service
+@ServiceLogger
+public class NssmfManagerServiceImpl implements NssmfManagerService {
+
+ @Autowired
+ private RestUtil restUtil;
+
+ @Autowired
+ private ResourceOperationStatusRepository repository;
+
+ @Autowired
+ private NssmfAdapterConfig nssmfAdapterConfig;
+
+ @Override
+ public ResponseEntity allocateNssi(NssmfAdapterNBIRequest request) {
+ try {
+
+ if (StringUtils.isNotBlank(request.getServiceInfo().getNssiId())) {
+ return buildResponse(buildNssmfManager(request, ActionType.MODIFY).modifyNssi(request));
+ }
+
+ return buildResponse(buildNssmfManager(request, ActionType.ALLOCATE).allocateNssi(request));
+
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity deAllocateNssi(NssmfAdapterNBIRequest request, String sliceProfileId) {
+ try {
+ return buildResponse(
+ buildNssmfManager(request, ActionType.DEALLOCATE).deAllocateNssi(request, sliceProfileId));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity activateNssi(NssmfAdapterNBIRequest request, String snssai) {
+ try {
+ return buildResponse(buildNssmfManager(request, ActionType.ACTIVATE).activateNssi(request, snssai));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity deActivateNssi(NssmfAdapterNBIRequest request, String snssai) {
+ try {
+ return buildResponse(buildNssmfManager(request, ActionType.DEACTIVATE).deActivateNssi(request, snssai));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity queryJobStatus(NssmfAdapterNBIRequest jobReq, String jobId) {
+ try {
+ return buildResponse(buildNssmfManager(jobReq, ActionType.QUERY_JOB_STATUS).queryJobStatus(jobReq, jobId));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity queryNSSISelectionCapability(NssmfAdapterNBIRequest nbiRequest) {
+ EsrInfo esrInfo = nbiRequest.getEsrInfo();
+ try {
+ return buildResponse(buildNssmfManager(esrInfo, ActionType.QUERY_JOB_STATUS, null)
+ .queryNSSISelectionCapability(nbiRequest));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ @Override
+ public ResponseEntity querySubnetCapability(NssmfAdapterNBIRequest nbiRequest) {
+ EsrInfo esrInfo = nbiRequest.getEsrInfo();
+ try {
+ return buildResponse(
+ buildNssmfManager(esrInfo, ActionType.QUERY_JOB_STATUS, null).querySubnetCapability(nbiRequest));
+ } catch (ApplicationException e) {
+ return e.buildErrorResponse();
+ }
+ }
+
+ private ResponseEntity buildResponse(RestResponse rsp) {
+ return ResponseEntity.status(rsp.getStatus()).body(rsp.getResponseContent());
+ }
+
+
+ private NssmfManager buildNssmfManager(NssmfAdapterNBIRequest request, ActionType actionType)
+ throws ApplicationException {
+ return buildNssmfManager(request.getEsrInfo(), actionType, request.getServiceInfo());
+ }
+
+ private NssmfManager buildNssmfManager(EsrInfo esrInfo, ActionType actionType, ServiceInfo serviceInfo)
+ throws ApplicationException {
+
+ return new NssmfManagerBuilder(esrInfo).setActionType(actionType).setRepository(repository)
+ .setRestUtil(restUtil).setAdapterConfig(nssmfAdapterConfig).setServiceInfo(serviceInfo).build();
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/NssmfAdapterUtil.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/NssmfAdapterUtil.java
index 3a7c2f19df..090417ddc2 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/NssmfAdapterUtil.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/NssmfAdapterUtil.java
@@ -22,10 +22,12 @@ package org.onap.so.adapters.nssmf.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
+import org.onap.so.adapters.nssmf.enums.ActionType;
import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.onap.logging.filter.base.ErrorCode;
+import org.springframework.stereotype.Component;
import static org.onap.so.logger.LoggingAnchor.THREE;
import static org.onap.so.logger.MessageEnum.RA_NS_EXC;
@@ -45,6 +47,8 @@ public class NssmfAdapterUtil {
public static final String ALLOCATE_NSS_SUCCESS = "Allocating nss is " + "successful";
+ public static final String MODIFY_NSS_SUCCESS = "Modify nss is " + "successful";
+
public static final String CREATE_NSS_SUCCESS = "Creating nss is " + "successful";
public static final String DEALLOCATE_NSS_SUCCESS = "Deallocate nss " + "is successful";
@@ -91,4 +95,29 @@ public class NssmfAdapterUtil {
}
}
+
+ public static String getStatusDesc(ActionType actionType) {
+ String desc = "";
+ switch (actionType) {
+ case ALLOCATE:
+ desc = StatusDesc.ALLOCATE_NSS_SUCCESS;
+ break;
+ case DEALLOCATE:
+ desc = StatusDesc.DEALLOCATE_NSS_SUCCESS;
+ break;
+ case ACTIVATE:
+ desc = StatusDesc.ACTIVATE_NSS_SUCCESS;
+ break;
+ case DEACTIVATE:
+ desc = StatusDesc.DEACTIVATE_NSS_SUCCESS;
+ break;
+ case MODIFY:
+ desc = StatusDesc.MODIFY_NSS_SUCCESS;
+ break;
+ default:
+ break;
+ }
+
+ return desc;
+ }
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestUtil.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java
index dcc6f5ba72..0c5999b20e 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/RestUtil.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java
@@ -18,11 +18,9 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.nssmf.rest;
+package org.onap.so.adapters.nssmf.util;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
+import javax.net.ssl.*;
import javax.ws.rs.core.UriBuilder;
import java.net.SocketTimeoutException;
import java.net.URI;
@@ -30,32 +28,29 @@ import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.client.methods.*;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicHeader;
import org.apache.http.util.EntityUtils;
-import org.onap.aai.domain.yang.EsrSystemInfo;
-import org.onap.aai.domain.yang.EsrSystemInfoList;
-import org.onap.aai.domain.yang.EsrThirdpartySdnc;
-import org.onap.aai.domain.yang.EsrThirdpartySdncList;
+import org.onap.aai.domain.yang.*;
import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
import org.onap.so.adapters.nssmf.extclients.aai.AaiServiceProvider;
-import org.onap.so.adapters.nssmf.model.TokenRequest;
-import org.onap.so.adapters.nssmf.model.TokenResponse;
+import org.onap.so.adapters.nssmf.entity.TokenRequest;
+import org.onap.so.adapters.nssmf.entity.TokenResponse;
+import org.onap.so.adapters.nssmf.enums.HttpMethod;
+import org.onap.so.adapters.nssmf.entity.NssmfInfo;
+import org.onap.so.adapters.nssmf.entity.RestResponse;
import org.onap.so.beans.nsmf.EsrInfo;
+import org.onap.so.beans.nsmf.ServiceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.apache.http.entity.ContentType.APPLICATION_JSON;
-import static org.onap.so.adapters.nssmf.rest.HttpMethod.POST;
+import static org.onap.so.adapters.nssmf.enums.HttpMethod.POST;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.BAD_REQUEST;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal;
@@ -77,6 +72,10 @@ public class RestUtil {
@Autowired
private AaiServiceProvider aaiSvcProv;
+ public void createServiceInstance(ServiceInstance serviceInstance, ServiceInfo serviceInfo) {
+ aaiSvcProv.invokeCreateServiceInstance(serviceInstance, serviceInfo.getGlobalSubscriberId(),
+ serviceInfo.getSubscriptionServiceType(), serviceInfo.getNssiId());
+ }
public NssmfInfo getNssmfHost(EsrInfo esrInfo) throws ApplicationException {
EsrThirdpartySdncList sdncList = aaiSvcProv.invokeGetThirdPartySdncList();
@@ -112,10 +111,9 @@ public class RestUtil {
throw new ApplicationException(BAD_REQUEST, "ESR information is improper");
}
- public RestResponse sendRequest(String url, HttpMethod methodType, String content, EsrInfo esrInfo)
- throws ApplicationException {
- NssmfInfo nssmfInfo = getNssmfHost(esrInfo);
+ public String getToken(NssmfInfo nssmfInfo) throws ApplicationException {
+
TokenRequest req = new TokenRequest();
req.setGrantType("password");
@@ -128,13 +126,12 @@ public class RestUtil {
RestResponse tokenRes = send(nssmfInfo.getUrl() + TOKEN_URL, POST, tokenReq, null);
TokenResponse res = unMarshal(tokenRes.getResponseContent(), TokenResponse.class);
- String token = res.getAccessToken();
- Header header = new BasicHeader("X-Auth-Token", token);
- String nssmfUrl = nssmfInfo.getUrl() + url;
- return send(nssmfUrl, methodType, content, header);
+
+ return res.getAccessToken();
}
- private RestResponse send(String url, HttpMethod methodType, String content, Header header) {
+
+ public RestResponse send(String url, HttpMethod methodType, String content, Header header) {
HttpRequestBase req = null;
HttpResponse res = null;
@@ -168,8 +165,6 @@ public class RestUtil {
}
if (null != req) {
req.reset();
- } else {
- logger.debug("method is NULL:");
}
req = null;
@@ -201,7 +196,7 @@ public class RestUtil {
}
}
- private RestResponse createResponse(int statusCode, String errMsg) {
+ public RestResponse createResponse(int statusCode, String errMsg) {
RestResponse restResponse = new RestResponse();
restResponse.setStatus(statusCode);
restResponse.setResponseContent(errMsg);
@@ -210,7 +205,7 @@ public class RestUtil {
private HttpRequestBase getHttpReq(String url, HttpMethod method, Header header, RequestConfig config,
String content) throws ApplicationException {
- HttpRequestBase base = null;
+ HttpRequestBase base;
switch (method) {
case POST:
HttpPost post = new HttpPost(url);
@@ -229,6 +224,7 @@ public class RestUtil {
break;
case PATCH:
+ base = new HttpPatch(url);
break;
case DELETE:
@@ -238,6 +234,8 @@ public class RestUtil {
}
base = delete;
break;
+ default:
+ throw new ApplicationException(404, "invalid method: " + method);
}
base.setConfig(config);
@@ -247,6 +245,14 @@ public class RestUtil {
return base;
}
+ public RestResponse sendRequest(String allocateUrl, HttpMethod post, String allocateReq, EsrInfo esrInfo)
+ throws ApplicationException {
+ NssmfInfo nssmfInfo = getNssmfHost(esrInfo);
+ Header header = new BasicHeader("X-Auth-Token", getToken(nssmfInfo));
+ String nssmfUrl = nssmfInfo.getUrl() + allocateUrl;
+ return send(nssmfUrl, post, allocateReq, header);
+ }
+
class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
public static final String METHOD_NAME = "DELETE";
@@ -289,7 +295,7 @@ public class RestUtil {
// HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
SSLConnectionSocketFactory sslsf =
- new SSLConnectionSocketFactory(sc, new String[] {"TLSv1"}, null, new TrustAllHostNameVerifier());
+ new SSLConnectionSocketFactory(sc, new String[] {"TLSv1"}, null, (s, sslSession) -> true);
return HttpClients.custom().setSSLSocketFactory(sslsf).build();
} catch (Exception e) {
throw new IllegalArgumentException(e);
diff --git a/adapters/mso-nssmf-adapter/src/main/resources/application-test.yaml b/adapters/mso-nssmf-adapter/src/main/resources/application-test.yaml
new file mode 100644
index 0000000000..8e10dfb72b
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/main/resources/application-test.yaml
@@ -0,0 +1,60 @@
+
+aai:
+ auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586
+ endpoint: https://aai.onap:30233
+logging:
+ path: logs
+
+spring:
+ datasource:
+ jdbcUrl: jdbc:mariadb://49.232.146.162:8989/requestdb
+ username: root
+ password: 123456
+ driver-class-name: org.mariadb.jdbc.Driver
+ initialization-mode: always
+ jpa:
+ generate-ddl: false
+ show-sql: false
+ hibernate:
+ ddl-auto: none
+ naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+ enable-lazy-load-no-trans: true
+ database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+ security:
+ usercredentials:
+ - username: bpel
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: BPEL-Client
+ - username: mso_admin
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: ACTUATOR
+server:
+ port: 8080
+ tomcat:
+ max-threads: 50
+
+mso:
+ key: 07a7159d3bf51a0e53be7a8f89699be7
+ site-name: localSite
+ logPath: ./logs/nssmf
+ adapters:
+ requestDb:
+ endpoint: https://so-request-db-adapter.onap:8083
+ auth: Basic YnBlbDpwYXNzd29yZDEk
+ infra:
+ endpoint: https://so.onap:8080
+ auth: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==
+
+#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/mso-nssmf-adapter/src/main/resources/application.yaml b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
index 303d63d4a2..8da911d4e0 100644
--- a/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
@@ -58,6 +58,9 @@ mso:
requestDb:
endpoint: https://so-request-db-adapter.{{ include "common.namespace" . }}:8083
auth: Basic YnBlbDpwYXNzd29yZDEk
+ infra:
+ endpoint: https://so.{{ include "common.namespace" . }}:8080
+ auth: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==
#Actuator
management:
diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
index 5bfd39096c..67cd913b3e 100644
--- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
+++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
@@ -24,6 +24,7 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
+import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
@@ -35,12 +36,12 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import org.onap.so.adapters.nssmf.model.TokenResponse;
-import org.onap.so.adapters.nssmf.rest.HttpMethod;
+import org.onap.so.adapters.nssmf.entity.TokenResponse;
+import org.onap.so.adapters.nssmf.enums.HttpMethod;
import org.onap.so.adapters.nssmf.rest.NssmfAdapterRest;
-import org.onap.so.adapters.nssmf.rest.NssmfInfo;
+import org.onap.so.adapters.nssmf.entity.NssmfInfo;
import org.onap.so.adapters.nssmf.rest.NssmfManager;
-import org.onap.so.adapters.nssmf.rest.RestUtil;
+import org.onap.so.adapters.nssmf.util.RestUtil;
import org.onap.so.beans.nsmf.ActDeActNssi;
import org.onap.so.beans.nsmf.AllocateCnNssi;
import org.onap.so.beans.nsmf.CnSliceProfile;
@@ -53,7 +54,7 @@ import org.onap.so.beans.nsmf.NssiAllocateRequest;
import org.onap.so.beans.nsmf.NssiDeAllocateRequest;
import org.onap.so.beans.nsmf.NssiResponse;
import org.onap.so.beans.nsmf.PerfReq;
-import org.onap.so.beans.nsmf.PerfReqEmbbList;
+import org.onap.so.beans.nsmf.PerfReqEmbb;
import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
@@ -127,13 +128,16 @@ public class NssmfAdapterRestTest {
}
private void createCommonMock(int statusCode, NssmfInfo nssmf) throws Exception {
+ when(this.restUtil.send(any(String.class), any(HttpMethod.class), any(String.class), any(Header.class)))
+ .thenCallRealMethod();
+ when(this.restUtil.createResponse(any(Integer.class), any(String.class))).thenCallRealMethod();
when(nssmfRest.getNssmfMgr()).thenReturn(nssmfMgr);
- when(nssmfRest.allocateNssi(any(NssiAllocateRequest.class))).thenCallRealMethod();
- when(nssmfRest.deAllocateNssi(any(NssiDeAllocateRequest.class), any(String.class))).thenCallRealMethod();
- when(nssmfRest.activateNssi(any(NssiActDeActRequest.class), any(String.class))).thenCallRealMethod();
- when(nssmfRest.deactivateNssi(any(NssiActDeActRequest.class), any(String.class))).thenCallRealMethod();
-
- when(nssmfRest.queryJobStatus(any(JobStatusRequest.class), any(String.class))).thenCallRealMethod();
+ // when(nssmfRest.createAllocateNssi(any(NssiAllocateRequest.class))).thenCallRealMethod();
+ // when(nssmfRest.deAllocateNssi(any(NssiDeAllocateRequest.class), any(String.class))).thenCallRealMethod();
+ // when(nssmfRest.activateNssi(any(NssiActDeActRequest.class), any(String.class))).thenCallRealMethod();
+ // when(nssmfRest.deactivateNssi(any(NssiActDeActRequest.class), any(String.class))).thenCallRealMethod();
+ //
+ // when(nssmfRest.queryJobStatus(any(JobStatusRequest.class), any(String.class))).thenCallRealMethod();
when(restUtil.sendRequest(any(String.class), any(HttpMethod.class), any(String.class), any(EsrInfo.class)))
.thenCallRealMethod();
when(restUtil.getHttpsClient()).thenReturn(httpClient);
@@ -168,113 +172,113 @@ public class NssmfAdapterRestTest {
doAnswer(answer).when(httpClient).execute(any(HttpRequestBase.class));
}
- @Test
- public void testNssiAllocate() throws Exception {
- NssmfInfo nssmf = new NssmfInfo();
- nssmf.setUserName("nssmf-user");
- nssmf.setPassword("nssmf-pass");
- nssmf.setPort("8080");
- nssmf.setIpAddress("127.0.0.1");
-
- NssiResponse nssiRes = new NssiResponse();
- nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
- nssiRes.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
-
- TokenResponse token = new TokenResponse();
- token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
- token.setExpires(1800);
-
- postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
- tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
-
- createCommonMock(200, nssmf);
- // assertEquals(prettyPrint(allocateNssi()), ALLOCATE);
- ResponseEntity res = nssmfRest.allocateNssi(allocateNssi());
- assertNotNull(res);
- assertNotNull(res.getBody());
- NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
- assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
- assertEquals(allRes.getNssiId(), "NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
- }
-
- @Test
- public void testNssiDeAllocate() throws Exception {
- NssmfInfo nssmf = new NssmfInfo();
- nssmf.setUserName("nssmf-user");
- nssmf.setPassword("nssmf-pass");
- nssmf.setPort("8080");
- nssmf.setIpAddress("127.0.0.1");
-
- NssiResponse nssiRes = new NssiResponse();
- nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
-
- TokenResponse token = new TokenResponse();
- token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
- token.setExpires(1800);
-
- postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
- tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
-
- createCommonMock(200, nssmf);
- ResponseEntity res = nssmfRest.deAllocateNssi(deAllocateNssi(), "ab9af40f13f721b5f13539d87484098");
- assertNotNull(res);
- assertNotNull(res.getBody());
- NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
- assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
- }
-
- @Test
- public void testNssiActivate() throws Exception {
- NssmfInfo nssmf = new NssmfInfo();
- nssmf.setUserName("nssmf-user");
- nssmf.setPassword("nssmf-pass");
- nssmf.setPort("8080");
- nssmf.setIpAddress("127.0.0.1");
-
- NssiResponse nssiRes = new NssiResponse();
- nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
-
- TokenResponse token = new TokenResponse();
- token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
- token.setExpires(1800);
-
- postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
- tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
-
- createCommonMock(200, nssmf);
- ResponseEntity res = nssmfRest.activateNssi(activateNssi(), "001-100001");
- assertNotNull(res);
- assertNotNull(res.getBody());
- NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
- assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
- }
-
- @Test
- public void testNssiDeActivate() throws Exception {
- NssmfInfo nssmf = new NssmfInfo();
- nssmf.setUserName("nssmf-user");
- nssmf.setPassword("nssmf-pass");
- nssmf.setPort("8080");
- nssmf.setIpAddress("127.0.0.1");
-
- NssiResponse nssiRes = new NssiResponse();
- nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
-
- TokenResponse token = new TokenResponse();
- token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
- token.setExpires(1800);
-
- postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
- tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
-
- createCommonMock(200, nssmf);
- ResponseEntity res = nssmfRest.deactivateNssi(deActivateNssi(), "001-100001");
- assertNotNull(res);
- assertNotNull(res.getBody());
- NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
- assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
- }
-
+ // @Test
+ // public void testNssiAllocate() throws Exception {
+ // NssmfInfo nssmf = new NssmfInfo();
+ // nssmf.setUserName("nssmf-user");
+ // nssmf.setPassword("nssmf-pass");
+ // nssmf.setPort("8080");
+ // nssmf.setIpAddress("127.0.0.1");
+ //
+ // NssiResponse nssiRes = new NssiResponse();
+ // nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ // nssiRes.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ //
+ // TokenResponse token = new TokenResponse();
+ // token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ // token.setExpires(1800);
+ //
+ // postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ // tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+ //
+ // createCommonMock(200, nssmf);
+ // // assertEquals(prettyPrint(createAllocateNssi()), ALLOCATE);
+ // ResponseEntity res = nssmfRest.createAllocateNssi(createAllocateNssi());
+ // assertNotNull(res);
+ // assertNotNull(res.getBody());
+ // NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ // assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ // assertEquals(allRes.getNssiId(), "NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ // }
+ //
+ // @Test
+ // public void testNssiDeAllocate() throws Exception {
+ // NssmfInfo nssmf = new NssmfInfo();
+ // nssmf.setUserName("nssmf-user");
+ // nssmf.setPassword("nssmf-pass");
+ // nssmf.setPort("8080");
+ // nssmf.setIpAddress("127.0.0.1");
+ //
+ // NssiResponse nssiRes = new NssiResponse();
+ // nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ //
+ // TokenResponse token = new TokenResponse();
+ // token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ // token.setExpires(1800);
+ //
+ // postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ // tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+ //
+ // createCommonMock(200, nssmf);
+ // ResponseEntity res = nssmfRest.deAllocateNssi(deAllocateNssi(), "ab9af40f13f721b5f13539d87484098");
+ // assertNotNull(res);
+ // assertNotNull(res.getBody());
+ // NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ // assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ // }
+ //
+ // @Test
+ // public void testNssiActivate() throws Exception {
+ // NssmfInfo nssmf = new NssmfInfo();
+ // nssmf.setUserName("nssmf-user");
+ // nssmf.setPassword("nssmf-pass");
+ // nssmf.setPort("8080");
+ // nssmf.setIpAddress("127.0.0.1");
+ //
+ // NssiResponse nssiRes = new NssiResponse();
+ // nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ //
+ // TokenResponse token = new TokenResponse();
+ // token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ // token.setExpires(1800);
+ //
+ // postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ // tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+ //
+ // createCommonMock(200, nssmf);
+ // ResponseEntity res = nssmfRest.activateNssi(activateNssi(), "001-100001");
+ // assertNotNull(res);
+ // assertNotNull(res.getBody());
+ // NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ // assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ // }
+ //
+ // @Test
+ // public void testNssiDeActivate() throws Exception {
+ // NssmfInfo nssmf = new NssmfInfo();
+ // nssmf.setUserName("nssmf-user");
+ // nssmf.setPassword("nssmf-pass");
+ // nssmf.setPort("8080");
+ // nssmf.setIpAddress("127.0.0.1");
+ //
+ // NssiResponse nssiRes = new NssiResponse();
+ // nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ //
+ // TokenResponse token = new TokenResponse();
+ // token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ // token.setExpires(1800);
+ //
+ // postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ // tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+ //
+ // createCommonMock(200, nssmf);
+ // ResponseEntity res = nssmfRest.deactivateNssi(deActivateNssi(), "001-100001");
+ // assertNotNull(res);
+ // assertNotNull(res.getBody());
+ // NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ // assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ // }
+ //
@Test
public void testAllocateJsonSerDeSer() throws Exception {
assertEquals(marshal(allocateNssi()), ALLOCATE);
@@ -285,7 +289,7 @@ public class NssmfAdapterRestTest {
assertEquals(all.getAllocateCnNssi().getSliceProfile().getResourceSharingLevel(), NON_SHARED);
assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq());
assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList());
- PerfReqEmbbList embb =
+ PerfReqEmbb embb =
all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList().iterator().next();
assertNotNull(embb);
assertEquals(embb.getActivityFactor(), 50);
@@ -298,9 +302,9 @@ public class NssmfAdapterRestTest {
List<String> plmn = new LinkedList<>();
plmn.add("460-00");
plmn.add("460-01");
- PerfReqEmbbList embb = new PerfReqEmbbList();
+ PerfReqEmbb embb = new PerfReqEmbb();
embb.setActivityFactor(50);
- List<PerfReqEmbbList> embbList = new LinkedList<>();
+ List<PerfReqEmbb> embbList = new LinkedList<>();
embbList.add(embb);
PerfReq perfReq = new PerfReq();
perfReq.setPerfReqEmbbList(embbList);
@@ -334,50 +338,51 @@ public class NssmfAdapterRestTest {
return allocate;
}
- public NssiDeAllocateRequest deAllocateNssi() throws Exception {
- DeAllocateNssi deAllocateNssi = new DeAllocateNssi();
- deAllocateNssi.setTerminateNssiOption(0);
- List<String> snssai = new LinkedList<>();
- snssai.add("001-100001");
- deAllocateNssi.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
- deAllocateNssi.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
- deAllocateNssi.setScriptName("CN1");
- deAllocateNssi.setSnssaiList(snssai);
- EsrInfo esrInfo = new EsrInfo();
- esrInfo.setVendor("huawei");
- esrInfo.setNetworkType(CORE);
- NssiDeAllocateRequest deAllocate = new NssiDeAllocateRequest();
- deAllocate.setDeAllocateNssi(deAllocateNssi);
- deAllocate.setEsrInfo(esrInfo);
- return deAllocate;
- }
-
- public NssiActDeActRequest activateNssi() throws Exception {
- EsrInfo esrInfo = new EsrInfo();
- esrInfo.setVendor("huawei");
- esrInfo.setNetworkType(CORE);
- ActDeActNssi act = new ActDeActNssi();
- act.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
- act.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
- NssiActDeActRequest actReq = new NssiActDeActRequest();
- actReq.setActDeActNssi(act);
- actReq.setEsrInfo(esrInfo);
- return actReq;
- }
-
- public NssiActDeActRequest deActivateNssi() throws Exception {
- EsrInfo esrInfo = new EsrInfo();
- esrInfo.setVendor("huawei");
- esrInfo.setNetworkType(CORE);
- ActDeActNssi deAct = new ActDeActNssi();
- deAct.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
- deAct.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
- NssiActDeActRequest deActReq = new NssiActDeActRequest();
- deActReq.setActDeActNssi(deAct);
- deActReq.setEsrInfo(esrInfo);
- return deActReq;
- }
-
+ //
+ // public NssiDeAllocateRequest deAllocateNssi() throws Exception {
+ // DeAllocateNssi deAllocateNssi = new DeAllocateNssi();
+ // deAllocateNssi.setTerminateNssiOption(0);
+ // List<String> snssai = new LinkedList<>();
+ // snssai.add("001-100001");
+ // deAllocateNssi.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ // deAllocateNssi.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ // deAllocateNssi.setScriptName("CN1");
+ // deAllocateNssi.setSnssaiList(snssai);
+ // EsrInfo esrInfo = new EsrInfo();
+ // esrInfo.setVendor("huawei");
+ // esrInfo.setNetworkType(CORE);
+ // NssiDeAllocateRequest deAllocate = new NssiDeAllocateRequest();
+ // deAllocate.setDeAllocateNssi(deAllocateNssi);
+ // deAllocate.setEsrInfo(esrInfo);
+ // return deAllocate;
+ // }
+ //
+ // public NssiActDeActRequest activateNssi() throws Exception {
+ // EsrInfo esrInfo = new EsrInfo();
+ // esrInfo.setVendor("huawei");
+ // esrInfo.setNetworkType(CORE);
+ // ActDeActNssi act = new ActDeActNssi();
+ // act.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ // act.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ // NssiActDeActRequest actReq = new NssiActDeActRequest();
+ // actReq.setActDeActNssi(act);
+ // actReq.setEsrInfo(esrInfo);
+ // return actReq;
+ // }
+ //
+ // public NssiActDeActRequest deActivateNssi() throws Exception {
+ // EsrInfo esrInfo = new EsrInfo();
+ // esrInfo.setVendor("huawei");
+ // esrInfo.setNetworkType(CORE);
+ // ActDeActNssi deAct = new ActDeActNssi();
+ // deAct.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ // deAct.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ // NssiActDeActRequest deActReq = new NssiActDeActRequest();
+ // deActReq.setActDeActNssi(deAct);
+ // deActReq.setEsrInfo(esrInfo);
+ // return deActReq;
+ // }
+ //
public String queryJobStatusNssi() throws Exception {
EsrInfo esrInfo = new EsrInfo();
esrInfo.setVendor("huawei");
diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
new file mode 100644
index 0000000000..4a659e1ca3
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
@@ -0,0 +1,438 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.nssmf.service.impl;
+
+
+import org.apache.http.Header;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.stubbing.Answer;
+import org.onap.so.adapters.nssmf.consts.NssmfAdapterConsts;
+import org.onap.so.adapters.nssmf.entity.NssmfInfo;
+import org.onap.so.adapters.nssmf.entity.TokenResponse;
+import org.onap.so.adapters.nssmf.enums.HttpMethod;
+import org.onap.so.adapters.nssmf.util.RestUtil;
+import org.onap.so.beans.nsmf.*;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.junit4.SpringRunner;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.util.*;
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.when;
+import static org.mockito.MockitoAnnotations.initMocks;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
+import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal;
+import static org.onap.so.beans.nsmf.NetworkType.CORE;
+import static org.onap.so.beans.nsmf.ResourceSharingLevel.NON_SHARED;
+
+@RunWith(SpringRunner.class)
+public class NssmfManagerServiceImplTest {
+
+ @Mock
+ private RestUtil restUtil;
+
+
+ private NssmfManagerServiceImpl nssiManagerService;
+
+ @Mock
+ private HttpResponse tokenResponse;
+
+ @Mock
+ private HttpEntity tokenEntity;
+
+ @Mock
+ private HttpResponse commonResponse;
+
+ @Mock
+ private HttpEntity commonEntity;
+
+ @Mock
+ private StatusLine statusLine;
+
+ @Mock
+ private HttpClient httpClient;
+
+ private InputStream postStream;
+
+ private InputStream tokenStream;
+
+ @Mock
+ private ResourceOperationStatusRepository repository;
+
+ @Before
+ public void setUp() throws Exception {
+ initMocks(this);
+
+ nssiManagerService = new NssmfManagerServiceImpl();
+
+ Field restUtil = nssiManagerService.getClass().getDeclaredField("restUtil");
+ restUtil.setAccessible(true);
+ restUtil.set(nssiManagerService, this.restUtil);
+
+ Field repository = nssiManagerService.getClass().getDeclaredField("repository");
+ repository.setAccessible(true);
+ repository.set(nssiManagerService, this.repository);
+ // nssiManagerService.setRestUtil(this.restUtil);
+
+ when(this.restUtil.send(any(String.class), any(HttpMethod.class), any(), any(Header.class)))
+ .thenCallRealMethod();
+ when(this.restUtil.createResponse(any(Integer.class), any(String.class))).thenCallRealMethod();
+ }
+
+ private void createCommonMock(int statusCode, NssmfInfo nssmf) throws Exception {
+ when(restUtil.getToken(any(NssmfInfo.class))).thenReturn("7512eb3feb5249eca5ddd742fedddd39");
+ when(restUtil.getHttpsClient()).thenReturn(httpClient);
+
+ when(statusLine.getStatusCode()).thenReturn(statusCode);
+ when(restUtil.getNssmfHost(any(EsrInfo.class))).thenReturn(nssmf);
+
+ when(tokenResponse.getEntity()).thenReturn(tokenEntity);
+ when(tokenResponse.getStatusLine()).thenReturn(statusLine);
+ when(tokenEntity.getContent()).thenReturn(tokenStream);
+
+ when(commonResponse.getEntity()).thenReturn(commonEntity);
+ when(commonResponse.getStatusLine()).thenReturn(statusLine);
+ when(commonEntity.getContent()).thenReturn(postStream);
+
+ Answer<HttpResponse> answer = invocation -> {
+ Object[] arguments = invocation.getArguments();
+ if (arguments != null && arguments.length == 1 && arguments[0] != null) {
+
+ HttpRequestBase base = (HttpRequestBase) arguments[0];
+ if (base.getURI().toString().endsWith("/oauth/token")) {
+ return tokenResponse;
+ } else {
+ return commonResponse;
+ }
+ }
+ return commonResponse;
+ };
+
+ doAnswer(answer).when(httpClient).execute(any(HttpRequestBase.class));
+
+ }
+
+ @Test
+ public void allocateNssi() throws Exception {
+
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+ nssmf.setUrl("http://127.0.0.1:8080");
+
+ NssiResponse nssiRes = new NssiResponse();
+ nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+ nssiRes.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ createCommonMock(200, nssmf);
+
+
+ NssmfAdapterNBIRequest nbiRequest = createAllocateNssi();
+ assertNotNull(nbiRequest);
+ System.out.println(marshal(nbiRequest));
+ ResponseEntity res = nssiManagerService.allocateNssi(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ assertEquals(allRes.getNssiId(), "NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ System.out.println(res);
+ }
+
+
+
+ private NssmfAdapterNBIRequest createAllocateNssi() {
+ CnSliceProfile sP = new CnSliceProfile();
+ List<String> sns = new LinkedList<>();
+ sns.add("001-100001");
+ List<String> plmn = new LinkedList<>();
+ plmn.add("460-00");
+ plmn.add("460-01");
+ PerfReqEmbb embb = new PerfReqEmbb();
+ embb.setActivityFactor(50);
+ List<PerfReqEmbb> embbList = new LinkedList<>();
+ embbList.add(embb);
+ PerfReq perfReq = new PerfReq();
+ perfReq.setPerfReqEmbbList(embbList);
+ List<String> taList = new LinkedList<>();
+ taList.add("1");
+ taList.add("2");
+ taList.add("3");
+ sP.setSnssaiList(sns);
+ sP.setSliceProfileId("ab9af40f13f721b5f13539d87484098");
+ sP.setPlmnIdList(plmn);
+ sP.setPerfReq(perfReq);
+ sP.setMaxNumberofUEs(200);
+ sP.setCoverageAreaTAList(taList);
+ sP.setLatency(6);
+ sP.setResourceSharingLevel(NON_SHARED);
+ NsiInfo nsiInfo = new NsiInfo();
+ nsiInfo.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ nsiInfo.setNsiName("eMBB-001");
+ AllocateCnNssi cnNssi = new AllocateCnNssi();
+ cnNssi.setNssiId("NSST-C-001-HDBNJ-NSSMF-01-A-ZX");
+ cnNssi.setNssiName("eMBB-001");
+ cnNssi.setScriptName("CN1");
+ cnNssi.setSliceProfile(sP);
+ cnNssi.setNsiInfo(nsiInfo);
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ nbiRequest.setAllocateCnNssi(cnNssi);
+ return nbiRequest;
+ }
+
+ @Test
+ public void deAllocateNssi() throws Exception {
+ DeAllocateNssi deAllocateNssi = new DeAllocateNssi();
+ deAllocateNssi.setTerminateNssiOption(0);
+ List<String> snssai = new LinkedList<>();
+ snssai.add("001-100001");
+ deAllocateNssi.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ deAllocateNssi.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+ deAllocateNssi.setScriptName("CN1");
+ deAllocateNssi.setSnssaiList(snssai);
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ nbiRequest.setDeAllocateNssi(deAllocateNssi);
+
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+
+ NssiResponse nssiRes = new NssiResponse();
+ nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ createCommonMock(202, nssmf);
+ ResponseEntity res = nssiManagerService.deAllocateNssi(nbiRequest, "ab9af40f13f721b5f13539d87484098");
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ }
+
+ @Test
+ public void activateNssi() throws Exception {
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+
+ NssiResponse nssiRes = new NssiResponse();
+ nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ ActDeActNssi act = new ActDeActNssi();
+ act.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ act.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ nbiRequest.setActDeActNssi(act);
+
+ createCommonMock(200, nssmf);
+ ResponseEntity res = nssiManagerService.activateNssi(nbiRequest, "001-100001");
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ }
+
+ @Test
+ public void deActivateNssi() throws Exception {
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+
+ NssiResponse nssiRes = new NssiResponse();
+ nssiRes.setJobId("4b45d919816ccaa2b762df5120f72067");
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(nssiRes).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ ActDeActNssi act = new ActDeActNssi();
+ act.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ act.setNssiId("NSSI-C-001-HDBNJ-NSSMF-01-A-ZX");
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ nbiRequest.setActDeActNssi(act);
+
+ createCommonMock(200, nssmf);
+ ResponseEntity res = nssiManagerService.deActivateNssi(nbiRequest, "001-100001");
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ NssiResponse allRes = unMarshal(res.getBody().toString(), NssiResponse.class);
+ assertEquals(allRes.getJobId(), "4b45d919816ccaa2b762df5120f72067");
+ }
+
+ @Test
+ public void queryJobStatus() throws Exception {
+ NssmfInfo nssmf = new NssmfInfo();
+ nssmf.setUserName("nssmf-user");
+ nssmf.setPassword("nssmf-pass");
+ nssmf.setPort("8080");
+ nssmf.setIpAddress("127.0.0.1");
+
+ JobStatusResponse jobStatusResponse = new JobStatusResponse();
+ ResponseDescriptor descriptor = new ResponseDescriptor();
+ descriptor.setResponseId("7512eb3feb5249eca5ddd742fedddd39");
+ descriptor.setProgress(20);
+ descriptor.setStatusDescription("Initiating VNF Instance");
+ descriptor.setStatus("processing");
+ jobStatusResponse.setResponseDescriptor(descriptor);
+
+ TokenResponse token = new TokenResponse();
+ token.setAccessToken("7512eb3feb5249eca5ddd742fedddd39");
+ token.setExpires(1800);
+
+ postStream = new ByteArrayInputStream(marshal(jobStatusResponse).getBytes(UTF_8));
+ tokenStream = new ByteArrayInputStream(marshal(token).getBytes(UTF_8));
+
+ ResourceOperationStatus operationStatus = new ResourceOperationStatus();
+ operationStatus.setOperationId("4b45d919816ccaa2b762df5120f72067");
+ operationStatus.setResourceTemplateUUID("8ee5926d-720b-4bb2-86f9-d20e921c143b");
+ operationStatus.setServiceId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ nbiRequest.setResponseId("7512eb3feb5249eca5ddd742fedddd39");
+ Optional<ResourceOperationStatus> optional = Optional.of(operationStatus);
+
+ doAnswer(invocation -> optional).when(repository).findOne(any());
+
+ createCommonMock(200, nssmf);
+
+ ResponseEntity res = nssiManagerService.queryJobStatus(nbiRequest, "4b45d919816ccaa2b762df5120f72067");
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ JobStatusResponse allRes = unMarshal(res.getBody().toString(), JobStatusResponse.class);
+ assertEquals(allRes.getResponseDescriptor().getProgress(), 20);
+ assertEquals(allRes.getResponseDescriptor().getStatus(), "processing");
+ assertEquals(allRes.getResponseDescriptor().getResponseId(), "7512eb3feb5249eca5ddd742fedddd39");
+
+ System.out.println(res);
+
+ }
+
+ @Test
+ public void queryNSSISelectionCapability() throws Exception {
+
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+ ResponseEntity res = nssiManagerService.queryNSSISelectionCapability(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ Map allRes = unMarshal(res.getBody().toString(), Map.class);
+ assertEquals(allRes.get("selection"), "NSMF");
+
+ System.out.println(res);
+
+ nbiRequest.getEsrInfo().setVendor(NssmfAdapterConsts.ONAP_INTERNAL_TAG);
+ res = nssiManagerService.queryNSSISelectionCapability(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ allRes = unMarshal(res.getBody().toString(), Map.class);
+ assertEquals(allRes.get("selection"), "NSSMF");
+
+ System.out.println(res);
+
+ nbiRequest.getEsrInfo().setNetworkType(NetworkType.ACCESS);
+ res = nssiManagerService.queryNSSISelectionCapability(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ allRes = unMarshal(res.getBody().toString(), Map.class);
+ assertEquals(allRes.get("selection"), "NSSMF");
+
+ System.out.println(res);
+ }
+
+ private NssmfAdapterNBIRequest createNbiRequest() {
+ NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest();
+ EsrInfo esrInfo = new EsrInfo();
+ esrInfo.setVendor("huawei");
+ esrInfo.setNetworkType(CORE);
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.setServiceUuid("8ee5926d-720b-4bb2-86f9-d20e921c143b");
+ serviceInfo.setServiceInvariantUuid("e75698d9-925a-4cdd-a6c0-edacbe6a0b51");
+ serviceInfo.setGlobalSubscriberId("5GCustomer");
+ serviceInfo.setServiceType("5G");
+ serviceInfo.setNsiId("NSI-M-001-HDBNJ-NSMF-01-A-ZX");
+ nbiRequest.setEsrInfo(esrInfo);
+ nbiRequest.setServiceInfo(serviceInfo);
+ return nbiRequest;
+ }
+
+ @Test
+ public void querySubnetCapability() {
+ NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
+
+ String subnetCapabilityQuery = "\"subnetTypes\": [\"TN-FH\",\"TN-MH\",\"TN-BH\"]";
+ nbiRequest.setSubnetCapabilityQuery(subnetCapabilityQuery);
+ ResponseEntity res = nssiManagerService.queryNSSISelectionCapability(nbiRequest);
+ assertNotNull(res);
+ assertNotNull(res.getBody());
+ }
+}
diff --git a/adapters/mso-nssmf-adapter/src/test/resources/application-test.yaml b/adapters/mso-nssmf-adapter/src/test/resources/application-test.yaml
new file mode 100644
index 0000000000..fa323e887b
--- /dev/null
+++ b/adapters/mso-nssmf-adapter/src/test/resources/application-test.yaml
@@ -0,0 +1,60 @@
+
+aai:
+ auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586
+ endpoint: https://aai.onap:30233
+logging:
+ path: logs
+
+spring:
+ datasource:
+ username: root
+ password: 123456
+ driver-class-name: org.mariadb.jdbc.Driver
+ initialization-mode: always
+ url: jdbc:mariadb://49.232.146.162:8989/requestdb
+ jpa:
+ generate-ddl: false
+ show-sql: false
+ hibernate:
+ ddl-auto: none
+ naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+ enable-lazy-load-no-trans: true
+ database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+ security:
+ usercredentials:
+ - username: bpel
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: BPEL-Client
+ - username: mso_admin
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: ACTUATOR
+server:
+ port: 8080
+ tomcat:
+ max-threads: 50
+
+mso:
+ key: 07a7159d3bf51a0e53be7a8f89699be7
+ site-name: localSite
+ logPath: ./logs/nssmf
+ adapters:
+ requestDb:
+ endpoint: https://so-request-db-adapter.{{ include "common.namespace" . }}:8083
+ auth: Basic YnBlbDpwYXNzd29yZDEk
+ infra:
+ endpoint: https://so.{{ include "common.namespace" . }}:8080
+ auth: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==
+
+#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/mso-oof-adapter/.gitignore b/adapters/mso-oof-adapter/.gitignore
new file mode 100644
index 0000000000..549e00a2a9
--- /dev/null
+++ b/adapters/mso-oof-adapter/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/adapters/mso-oof-adapter/pom.xml b/adapters/mso-oof-adapter/pom.xml
new file mode 100644
index 0000000000..98150d39e0
--- /dev/null
+++ b/adapters/mso-oof-adapter/pom.xml
@@ -0,0 +1,120 @@
+<?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 https://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.7.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.onap.so.adapters</groupId>
+ <artifactId>mso-oof-adapter</artifactId>
+ <name>mso-oof-adapter</name>
+ <description>mso oof adapter</description>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${springboot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-webflux</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.onap.so.adapters.oof.MsoOofAdapterApplication</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-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/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/MsoOofAdapterApplication.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/MsoOofAdapterApplication.java
new file mode 100644
index 0000000000..78fbe6e271
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/MsoOofAdapterApplication.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class MsoOofAdapterApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(MsoOofAdapterApplication.class, args);
+ }
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/OofAdapterClientConfig.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/OofAdapterClientConfig.java
new file mode 100644
index 0000000000..5e13c592b7
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/OofAdapterClientConfig.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.web.client.RestTemplate;
+
+@Configuration
+public class OofAdapterClientConfig {
+
+ @Bean
+ public RestTemplate getRestTemplate() {
+ HttpComponentsClientHttpRequestFactory requestFactory =
+ new HttpComponentsClientHttpRequestFactory(getHttpsClient());
+ requestFactory.setConnectTimeout(60000);
+ requestFactory.setReadTimeout(60000);
+ return new RestTemplate(requestFactory);
+ }
+
+ private HttpClient getHttpsClient() {
+ TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
+ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+
+ public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
+
+ public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
+ }};
+
+ // Install the all-trusting trust manager
+ try {
+ SSLContext sc = SSLContext.getInstance("SSL");
+ sc.init(null, trustAllCerts, new java.security.SecureRandom());
+ HostnameVerifier hostnameVerifier = new HostnameVerifier() {
+ @Override
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ };
+ SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sc,
+ new String[] {"TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}, null, hostnameVerifier);
+ return HttpClients.custom().setSSLSocketFactory(sslsf).build();
+ } catch (Exception e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/WebSecurityConfig.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/WebSecurityConfig.java
new file mode 100644
index 0000000000..9a07b0119f
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/WebSecurityConfig.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+
+@EnableWebSecurity
+@Configuration
+public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.csrf().disable();
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/constants/Constants.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/constants/Constants.java
new file mode 100644
index 0000000000..5d91bf38f8
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/constants/Constants.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.constants;
+
+public class Constants {
+
+ public static final String OOF_ENDPOINT = "mso.oof.endpoint";
+ public static final String OOF_AUTH = "mso.oof.auth";
+ public static final String MSO_KEY = "mso.msoKey";
+ public static final String CAMUNDA_URL = "mso.camundaURL";
+ public static final String CAMUNDA_AUTH = "mso.camundaAuth";
+ public static final String WORKFLOW_MESSAGE_ENPOINT = "mso.workflow.message.endpoint";
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/exceptions/OofAdapterException.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/exceptions/OofAdapterException.java
new file mode 100644
index 0000000000..ff16d7442c
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/exceptions/OofAdapterException.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.exceptions;
+
+public class OofAdapterException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public OofAdapterException(String message) {
+ super(message);
+ }
+
+ public OofAdapterException(Throwable e) {
+ super(e);
+ }
+
+ public OofAdapterException(String message, Throwable e) {
+ super(message, e);
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/model/OofRequest.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/model/OofRequest.java
new file mode 100644
index 0000000000..1eb694fd96
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/model/OofRequest.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.model;
+
+/**
+ * POJO representing generic request payload from BPMN processes
+ */
+public class OofRequest {
+
+ private String apiPath;
+
+ private Object requestDetails;
+
+ public String getApiPath() {
+ return apiPath;
+ }
+
+ public void setApiPath(String apiPath) {
+ this.apiPath = apiPath;
+ }
+
+ public Object getRequestDetails() {
+ return requestDetails;
+ }
+
+ public void setRequestDetails(Object requestDetails) {
+ this.requestDetails = requestDetails;
+ }
+
+ @Override
+ public String toString() {
+ return "{\"apiPath:\"\"" + apiPath + "\"\", requestDetails:\"\"" + requestDetails + "}";
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofCallbackHandler.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofCallbackHandler.java
new file mode 100644
index 0000000000..f8da6c6d2e
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofCallbackHandler.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.rest;
+
+import org.onap.so.adapters.oof.exceptions.OofAdapterException;
+import org.onap.so.adapters.oof.utils.OofUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.ResponseEntity;
+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.RestController;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * A generic call back handler to receive async response from OOF
+ */
+@RestController
+@RequestMapping("/so/adapters/oof/callback/")
+public class OofCallbackHandler {
+
+ @Autowired
+ OofUtils utils;
+
+ @Autowired
+ RestTemplate restTemplate;
+
+ private static final Logger logger = LoggerFactory.getLogger(OofCallbackHandler.class);
+
+ @PostMapping("/{version:[vV][1]}/{messageEventName}/{correlator}")
+ public ResponseEntity<String> processCallback(@PathVariable("messageEventName") String messageEventName,
+ @PathVariable("correlator") String correlator, @RequestBody String oofCallbackRequest)
+ throws OofAdapterException {
+ logger.debug("Oof Async response received for event : {} , callback request body : {} ", messageEventName,
+ oofCallbackRequest);
+ String camundaMsgUrl = utils.getCamundaMsgUrl(messageEventName, correlator);
+ HttpEntity<String> request = new HttpEntity<String>(oofCallbackRequest, utils.getCamundaHeaders());
+ try {
+ ResponseEntity<String> response = restTemplate.postForEntity(camundaMsgUrl, request, String.class);
+ logger.debug("Response from BPMN : {} ", response);
+ return response;
+ } catch (Exception e) {
+ logger.warn("Error injecting message event into BPMN {} {} ", e.getCause(), e.getMessage());
+ throw new OofAdapterException(e);
+ }
+
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofClient.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofClient.java
new file mode 100644
index 0000000000..3a91ec495e
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/rest/OofClient.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.rest;
+
+import org.onap.so.adapters.oof.exceptions.OofAdapterException;
+import org.onap.so.adapters.oof.model.OofRequest;
+import org.onap.so.adapters.oof.utils.OofUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * A generic client class to call OOF with request from BPMN
+ */
+@RestController
+@RequestMapping("/so/adapters/oof/")
+public class OofClient {
+
+ @Autowired
+ RestTemplate restTemplate;
+
+ @Autowired
+ OofUtils utils;
+
+ private static final Logger logger = LoggerFactory.getLogger(OofClient.class);
+
+ @PostMapping("/{version:[vV][1]}")
+ public ResponseEntity<String> callOof(@RequestBody OofRequest oofRequest) throws OofAdapterException {
+ try {
+ logger.debug("Received Request from BPEL {} ", oofRequest);
+ String oofUrl = utils.getOofurl(oofRequest.getApiPath());
+ HttpEntity<?> request = new HttpEntity<>(oofRequest.getRequestDetails(), utils.getOofHttpHeaders());
+ ResponseEntity<String> response = restTemplate.postForEntity(oofUrl, request, String.class);
+ logger.debug("Response from OOF : {} ", response);
+ return response;
+ } catch (Exception e) {
+ logger.warn("Error while calling OOF {} {} ", e.getCause(), e.getMessage());
+ throw new OofAdapterException(e);
+ }
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/utils/OofUtils.java b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/utils/OofUtils.java
new file mode 100644
index 0000000000..f45baa30fe
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/main/java/org/onap/so/adapters/oof/utils/OofUtils.java
@@ -0,0 +1,110 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.utils;
+
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.DatatypeConverter;
+import org.onap.so.adapters.oof.constants.Constants;
+import org.onap.so.utils.CryptoUtils;
+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.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+
+@Component
+public class OofUtils {
+ private static Logger logger = LoggerFactory.getLogger(OofUtils.class);
+
+ @Autowired
+ private Environment env;
+
+ /**
+ * @param messageEventName
+ * @param correlator
+ * @return
+ */
+ public String getCamundaMsgUrl(String messageEventName, String correlator) {
+ System.out.println(env);
+ String camundaMsgUrl = new StringBuilder(env.getRequiredProperty(Constants.WORKFLOW_MESSAGE_ENPOINT))
+ .append("/").append(messageEventName).append("/").append(correlator).toString();
+ return camundaMsgUrl;
+ }
+
+ /**
+ * @return
+ */
+ public HttpHeaders getCamundaHeaders() {
+ HttpHeaders headers = new HttpHeaders();
+ List<MediaType> acceptableMediaTypes = new ArrayList<>();
+ acceptableMediaTypes.add(MediaType.ALL);
+ headers.setAccept(acceptableMediaTypes);
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ headers.add(HttpHeaders.AUTHORIZATION, addAuthorizationHeader(env.getRequiredProperty(Constants.CAMUNDA_AUTH),
+ env.getRequiredProperty(Constants.MSO_KEY)));
+ return headers;
+ }
+
+ /**
+ * @param auth
+ * @param msoKey
+ * @return
+ */
+ protected String addAuthorizationHeader(String auth, String msoKey) {
+ String basicAuth = null;
+ try {
+ String userCredentials = CryptoUtils.decrypt(auth, msoKey);
+ if (userCredentials != null) {
+ basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+ }
+ } catch (GeneralSecurityException e) {
+ logger.error("Security exception", e);
+ }
+ return basicAuth;
+ }
+
+ /**
+ * @return
+ * @throws Exception
+ */
+ public HttpHeaders getOofHttpHeaders() throws Exception {
+ HttpHeaders headers = new HttpHeaders();
+ List<MediaType> acceptableMediaTypes = new ArrayList<>();
+ acceptableMediaTypes.add(MediaType.APPLICATION_JSON);
+ headers.setAccept(acceptableMediaTypes);
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ return headers;
+ }
+
+ /**
+ * @param apiPath
+ * @return
+ */
+ public String getOofurl(String apiPath) {
+ return new StringBuilder(env.getRequiredProperty(Constants.OOF_ENDPOINT)).append(apiPath).toString();
+ }
+
+
+}
diff --git a/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofCallbackHandlerTest.java b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofCallbackHandlerTest.java
new file mode 100644
index 0000000000..3a2f7f5e11
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofCallbackHandlerTest.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.rest;
+
+import static org.mockito.Mockito.when;
+import java.io.File;
+import java.io.IOException;
+import org.junit.Before;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+import org.onap.so.adapters.oof.utils.OofUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.core.io.ClassPathResource;
+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.RestTemplate;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+class OofCallbackHandlerTest {
+
+ @Autowired
+ TestRestTemplate restTemplate;
+
+ @MockBean
+ OofUtils oofutils;
+
+ @MockBean
+ RestTemplate mockrestTemplate;
+
+ @Before
+ void prepareMocks() throws Exception {
+ ResponseEntity<Object> responseEntity = new ResponseEntity<>(HttpStatus.OK);
+ when(oofutils.getCamundaHeaders()).thenReturn(new HttpHeaders());
+ when(oofutils.getCamundaMsgUrl(Mockito.anyString(), Mockito.anyString())).thenReturn("oofurl");
+ when(mockrestTemplate.postForEntity(Mockito.anyString(), Mockito.any(), Mockito.any()))
+ .thenReturn(responseEntity);
+ }
+
+ @Test
+ void processCallbackTest() throws Exception {
+ Object request = prepareOofResponse();
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ HttpEntity<Object> entity = new HttpEntity<Object>(request, headers);
+ ResponseEntity<String> response = restTemplate.postForEntity(
+ "/so/adapters/oof/callback/v1/NSISelectionResponse/d88da85c-d9e8-4f73-b837-3a72a431622a", entity,
+ String.class);
+ Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
+ }
+
+ private Object prepareOofResponse() throws IOException {
+ File file = new ClassPathResource("testInputs/NsiSelectionResponse.json").getFile();
+ ObjectMapper objectMapper = new ObjectMapper();
+ return objectMapper.readValue(file, Object.class);
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofClientTest.java b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofClientTest.java
new file mode 100644
index 0000000000..ff38a9af63
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/rest/OofClientTest.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.rest;
+
+import static org.mockito.Mockito.when;
+import java.io.File;
+import java.io.IOException;
+import org.junit.Before;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.so.adapters.oof.model.OofRequest;
+import org.onap.so.adapters.oof.utils.OofUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.core.io.ClassPathResource;
+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.RestTemplate;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+class OofClientTest {
+
+ @Autowired
+ TestRestTemplate restTemplate;
+
+ @MockBean
+ OofUtils oofutils;
+
+ @MockBean
+ RestTemplate mockrestTemplate;
+
+ @Before
+ void prepareMocks() throws Exception {
+ ResponseEntity<Object> responseEntity = new ResponseEntity<>(HttpStatus.OK);
+ when(oofutils.getOofHttpHeaders()).thenReturn(new HttpHeaders());
+ when(oofutils.getOofurl(Mockito.anyString())).thenReturn("oofurl");
+ when(mockrestTemplate.postForEntity(Mockito.anyString(), Mockito.any(), Mockito.any()))
+ .thenReturn(responseEntity);
+ }
+
+ @Test
+ void callOofTest() throws Exception {
+ OofRequest request = prepareOofRequest();
+ System.out.println(request);
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ HttpEntity<OofRequest> entity = new HttpEntity<OofRequest>(request, headers);
+ ResponseEntity<String> response = restTemplate.postForEntity("/so/adapters/oof/v1", entity, String.class);
+ Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
+ }
+
+ private OofRequest prepareOofRequest() throws IOException {
+ File file = new ClassPathResource("testInputs/NsiSelectionOofRequest.json").getFile();
+ ObjectMapper objectMapper = new ObjectMapper();
+ return objectMapper.readValue(file, OofRequest.class);
+ }
+
+
+}
diff --git a/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/utils/OofUtilsTest.java b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/utils/OofUtilsTest.java
new file mode 100644
index 0000000000..e68fa10c3e
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/test/java/org/onap/so/adapters/oof/utils/OofUtilsTest.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.utils;
+
+import static org.mockito.Mockito.when;
+import java.security.GeneralSecurityException;
+import javax.xml.bind.DatatypeConverter;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.so.utils.CryptoUtils;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpHeaders;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+
+@ExtendWith(SpringExtension.class)
+class OofUtilsTest {
+
+ @InjectMocks
+ OofUtils oofUtils;
+
+ @Mock
+ Environment env;
+
+ @Test
+ void testGetCamundaMsgUrl() {
+ when(env.getRequiredProperty(Mockito.anyString())).thenReturn("dummyString");
+ String camundamsgUrl = oofUtils.getCamundaMsgUrl("samplemessage", "sampleCorrelator");
+ Assertions.assertNotNull(camundamsgUrl);
+ }
+
+
+ void testGetCamundaHeaders() throws GeneralSecurityException {
+ when(env.getRequiredProperty(Mockito.anyString())).thenReturn("dummyString");
+ when(CryptoUtils.decrypt(Mockito.anyString(), Mockito.anyString())).thenReturn("decryptedString");
+ HttpHeaders headers = oofUtils.getCamundaHeaders();
+ Assertions.assertNotNull(headers);
+ }
+
+
+ @Test
+ void testGetOofHttpHeaders() throws Exception {
+ when(env.getRequiredProperty(Mockito.anyString())).thenReturn("dummyString");
+ HttpHeaders headers = oofUtils.getOofHttpHeaders();
+ Assertions.assertNotNull(headers);
+ }
+
+ @Test
+ void testGetOofurl() {
+ when(env.getRequiredProperty(Mockito.anyString())).thenReturn("dummyString");
+ String oofurl = oofUtils.getOofurl("/api/v1/");
+ Assertions.assertNotNull(oofurl);
+ }
+
+}
diff --git a/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionOofRequest.json b/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionOofRequest.json
new file mode 100644
index 0000000000..569aae9f38
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionOofRequest.json
@@ -0,0 +1,84 @@
+{
+ "apiPath":"/api/oof/selection/nsi/v1",
+ "requestDetails":{
+ "serviceProfile":{
+ "blob":"content"
+ },
+ "requestInfo":{
+ "transactionId":"d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "requestId":"d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "callbackUrl":"myDomain.com/myCallback",
+ "callbackHeader":{
+ "blob":"content"
+ },
+ "sourceId":"d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "timeout":5,
+ "numSolutions":1
+ },
+ "NSTInfo":{
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa1",
+ "invariantUUID":"7ua85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-nst"
+ },
+ "NSSTInfo":[
+ {
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa2",
+ "invariantUUID":"2fa85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-an-nf"
+ },
+ {
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa3",
+ "invariantUUID":"4fa85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-cn"
+ },
+ {
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa4",
+ "invariantUUID":"5ta85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-tn-fh"
+ },
+ {
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa5",
+ "invariantUUID":"6ya85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-tn-mh"
+ },
+ {
+ "UUID":"3fa85f64-5717-4562-b3fc-2c963f66afa7",
+ "invariantUUID":"7ua85f64-5717-4562-b3fc-2c963f66afa6",
+ "name":"embb-tn-bh"
+ }
+ ],
+ "preferReuse":false,
+ "subnetCapabilities":[
+ {
+ "domainType":"AN-NF",
+ "capabilityDetails":{
+ "blob":"content"
+ }
+ },
+ {
+ "domainType":"CN",
+ "capabilityDetails":{
+ "blob":"content"
+ }
+ },
+ {
+ "domainType":"TN-FH",
+ "capabilityDetails":{
+ "blob":"content"
+ }
+ },
+ {
+ "domainType":"TN-MH",
+ "capabilityDetails":{
+ "blob":"content"
+ }
+ },
+ {
+ "domainType":"TN-BH",
+ "capabilityDetails":{
+ "blob":"content"
+ }
+ }
+ ]
+}
+} \ No newline at end of file
diff --git a/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionResponse.json b/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionResponse.json
new file mode 100644
index 0000000000..4ddca3eaf9
--- /dev/null
+++ b/adapters/mso-oof-adapter/src/test/resources/testInputs/NsiSelectionResponse.json
@@ -0,0 +1,20 @@
+{
+ "transactionId": "s4r0f1ee-6c54-4b01-90e6-d701748f0851",
+ "requestId": "r500f1ee-6c54-4b01-90e6-d701748f0851",
+ "requestStatus": "completed",
+ "solutions": [
+ {
+ "existingNSI": false,
+ "newNSISolution": {
+ "sliceProfiles": [
+ {
+ "domainType":"CN"
+ }
+ ],
+ "matchLevel": {
+ "blob": "content"
+ }
+ }
+ }
+ ]
+}
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index ad41b0f050..eb6cba5510 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -298,7 +298,7 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
- <version>1.4.0</version>
+ <version>1.4.1</version>
</dependency>
<!-- added for unit testing -->
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 ef2577d6fe..10f39f717f 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
@@ -49,6 +49,7 @@ import org.apache.commons.validator.routines.InetAddressValidator;
import org.onap.aai.domain.yang.Flavor;
import org.onap.aai.domain.yang.Image;
import org.onap.aai.domain.yang.L3InterfaceIpv4AddressList;
+import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList;
import org.onap.aai.domain.yang.L3Network;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.PInterface;
@@ -303,6 +304,8 @@ public class HeatBridgeImpl implements HeatBridgeApi {
Objects.requireNonNull(osClient, ERR_MSG_NULL_OS_CLIENT);
List<String> portIds =
extractStackResourceIdsByResourceType(stackResources, HeatBridgeConstants.OS_PORT_RESOURCE_TYPE);
+ if (portIds == null)
+ return;
for (String portId : portIds) {
Port port = osClient.getPortById(portId);
Network network = osClient.getNetworkById(port.getNetworkId());
@@ -320,7 +323,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
lIf.setInterfaceRole(port.getvNicType());
}
boolean isL2Multicast = false;
- if (port.getProfile().get("trusted") != null) {
+ if (port.getProfile() != null && port.getProfile().get("trusted") != null) {
String trusted = port.getProfile().get("trusted").toString();
if (Boolean.parseBoolean(trusted)) {
isL2Multicast = true;
@@ -522,6 +525,20 @@ public class HeatBridgeImpl implements HeatBridgeApi {
.cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
.lInterface(lIf.getInterfaceName()).l3InterfaceIpv4AddressList(ipAddress)),
Optional.of(lInterfaceIp));
+ } else if (InetAddressValidator.getInstance().isValidInet6Address(ipAddress)) {
+ Subnet subnet = osClient.getSubnetById(ip.getSubnetId());
+ IPAddressString cidr = new IPAddressString(subnet.getCidr());
+ L3InterfaceIpv6AddressList ipv6 = new L3InterfaceIpv6AddressList();
+ ipv6.setL3InterfaceIpv6Address(ipAddress);
+ ipv6.setNeutronNetworkId(port.getNetworkId());
+ ipv6.setNeutronSubnetId(ip.getSubnetId());
+ ipv6.setL3InterfaceIpv6PrefixLength(Long.parseLong(cidr.getNetworkPrefixLength().toString()));
+
+ transaction.createIfNotExists(
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
+ .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId())
+ .lInterface(lIf.getInterfaceName()).l3InterfaceIpv6AddressList(ipAddress)),
+ Optional.of(ipv6));
}
}
}
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 8c21e3f7f7..03f6c737f3 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
@@ -423,6 +423,18 @@ public class HeatBridgeImplTest {
when(port.getProfile()).thenReturn(ImmutableMap.of(HeatBridgeConstants.OS_PCI_SLOT_KEY, pfPciId,
HeatBridgeConstants.OS_PHYSICAL_NETWORK_KEY, "physical_network_id"));
+ IP ip = mock(IP.class);
+
+ Set<IP> ipSet = new HashSet<>();
+ ipSet.add(ip);
+ when(ip.getIpAddress()).thenReturn("2606:ae00:2e60:100::226");
+ when(ip.getSubnetId()).thenReturn("testSubnetId");
+ when(port.getFixedIps()).thenAnswer(x -> ipSet);
+
+ Subnet subnet = mock(Subnet.class);
+ when(subnet.getCidr()).thenReturn("169.254.100.0/24");
+ when(osClient.getSubnetById("testSubnetId")).thenReturn(subnet);
+
Network network = mock(Network.class);
when(network.getId()).thenReturn("test-network-id");
when(network.getNetworkType()).thenReturn(NetworkType.VLAN);
@@ -446,8 +458,9 @@ public class HeatBridgeImplTest {
heatbridge.buildAddVserverLInterfacesToAaiAction(stackResources, Arrays.asList("1", "2"), "CloudOwner");
// Assert
- verify(transaction, times(15)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
+ verify(transaction, times(20)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
verify(osClient, times(5)).getPortById(anyString());
+ verify(osClient, times(5)).getSubnetById("testSubnetId");
verify(osClient, times(10)).getNetworkById(anyString());
}
diff --git a/adapters/pom.xml b/adapters/pom.xml
index 3c71b3c031..49f25b8102 100644
--- a/adapters/pom.xml
+++ b/adapters/pom.xml
@@ -24,6 +24,7 @@
<module>mso-openstack-adapters</module>
<module>etsi-sol003-adapter</module>
<module>mso-nssmf-adapter</module>
+ <module>mso-oof-adapter</module>
<module>so-appc-orchestrator</module>
</modules>
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy
new file mode 100644
index 0000000000..ebc5f4ac58
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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
+
+import javax.ws.rs.core.Response
+
+import org.apache.commons.lang3.StringUtils
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.logging.filter.base.ONAPComponents
+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.client.oof.adapter.beans.payload.OofRequest
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import com.fasterxml.jackson.databind.ObjectMapper
+
+
+import static org.onap.so.bpmn.common.scripts.GenericUtils.*
+
+
+class DoHandleOofRequest extends AbstractServiceTaskProcessor {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+ private static final Logger logger = LoggerFactory.getLogger(DoHandleOofRequest.class)
+
+ @Override
+ public void preProcessRequest(DelegateExecution execution) {
+ logger.debug("In Preprocess Oof Request Handler")
+ String apiPath = execution.getVariable("apiPath")
+ if (isBlank(apiPath)) {
+ String msg = "Cannot process OOF adapter call : API PATH is null"
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+
+ //msoRequestId is used for correlation
+ String requestId = execution.getVariable("correlator")
+ if (isBlank(requestId)) {
+ String msg = "Cannot process OOF adapter call : correlator is null"
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+
+ String messageType = execution.getVariable("messageType")
+ if (isBlank(messageType)) {
+ String msg = "Cannot process OOF adapter call : messageType is null"
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+
+ String timeout = execution.getVariable("timeout")
+ if (isBlank(timeout)) {
+ timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
+ if (isBlank(timeout)) {
+ logger.debug("Setting OOF timeout to default : PT30M")
+ timeout = "PT30M"
+ }
+ }
+
+ Object requestDetails = execution.getVariable("oofRequest")
+ OofRequest oofRequestPayload = new OofRequest()
+ oofRequestPayload.setApiPath(apiPath)
+ oofRequestPayload.setRequestDetails(requestDetails)
+ ObjectMapper objectMapper = new ObjectMapper()
+ String requestJson = objectMapper.writeValueAsString(oofRequestPayload)
+ execution.setVariable("oofRequestPayload", requestJson)
+ }
+
+ public void callOofAdapter(DelegateExecution execution) {
+ logger.debug("Start callOofAdapter")
+ String requestId = execution.getVariable("msoRequestId")
+ String oofAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.oof.endpoint", execution)
+ String basicAuthCred = execution.getVariable("BasicAuthHeaderValue")
+ URL requestUrl = new URL(oofAdapterEndpoint)
+ String oofRequest = execution.getVariable("oofRequestPayload")
+ logger.debug("oofRequest : " + oofRequest)
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(requestUrl, ONAPComponents.EXTERNAL)
+ Response httpResponse = httpClient.post(oofRequest)
+ int responseCode = httpResponse.getStatus()
+ logger.debug("OOF sync response code is: " + responseCode)
+ if(responseCode != 200){
+ exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from OOF.")
+ }
+ }
+
+}
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 69dfacd9bc..2c96e7d3bb 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
@@ -22,42 +22,28 @@
package org.onap.so.bpmn.common.scripts
-import com.fasterxml.jackson.databind.ObjectMapper
+import static org.onap.so.bpmn.common.scripts.GenericUtils.*
+
+import javax.ws.rs.core.UriBuilder
+
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
-import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.util.OofInfraUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
+import org.onap.so.bpmn.core.domain.AllottedResource
import org.onap.so.bpmn.core.domain.HomingSolution
import org.onap.so.bpmn.core.domain.ModelInfo
import org.onap.so.bpmn.core.domain.Resource
-import org.onap.so.bpmn.core.domain.AllottedResource
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.ServiceInstance
import org.onap.so.bpmn.core.domain.Subscriber
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.db.catalog.beans.CloudSite
import org.onap.so.db.catalog.beans.HomingInstance
-import org.onap.logging.filter.base.ONAPComponents;
-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.web.client.RestTemplate
-import org.springframework.web.util.UriComponentsBuilder
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import javax.ws.rs.core.MediaType
-import javax.ws.rs.core.Response
-import javax.ws.rs.core.UriBuilder
-
-import static org.onap.so.bpmn.common.scripts.GenericUtils.*
+import com.fasterxml.jackson.databind.ObjectMapper
class OofUtils {
private static final Logger logger = LoggerFactory.getLogger( OofUtils.class);
@@ -530,10 +516,11 @@ class OofUtils {
return UriBuilder.fromPath("").host(msbHost).port(msbPort).scheme("http").build().toString()
}
- public String buildSelectNSTRequest(String requestId, Map<String, Object> profileInfo) {
+ public String buildSelectNSTRequest(String requestId,String messageType, Map<String, Object> profileInfo) {
def transactionId = requestId
logger.debug( "transactionId is: " + transactionId)
- String callbackUrl = "http://0.0.0.0:9000/callback/"
+ String correlator = requestId
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
ObjectMapper objectMapper = new ObjectMapper()
String json = objectMapper.writeValueAsString(profileInfo)
StringBuilder response = new StringBuilder()
@@ -554,11 +541,12 @@ class OofUtils {
return response.toString()
}
- public String buildSelectNSIRequest(String requestId, String nstInfo, Map<String, Object> profileInfo){
+ public String buildSelectNSIRequest(String requestId, String nstInfo,String messageType, Map<String, Object> profileInfo){
def transactionId = requestId
logger.debug( "transactionId is: " + transactionId)
- String callbackUrl = "http://0.0.0.0:9000/callback/"
+ String correlator = requestId
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writeValueAsString(profileInfo);
StringBuilder response = new StringBuilder();
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 08c032fba3..146889351a 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
@@ -64,208 +64,211 @@ import org.slf4j.LoggerFactory
class SniroHomingV1 extends AbstractServiceTaskProcessor{
private static final Logger logger = LoggerFactory.getLogger( SniroHomingV1.class);
- ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtil = new JsonUtils()
- SniroUtils sniroUtils = new SniroUtils(this)
-
- /**
- * This method validates the incoming variables.
- * The method then prepares the sniro request
- * and posts it to sniro's rest api.
- *
- * @param execution
- *
- * @author cb645j
- */
- public void callSniro(DelegateExecution execution){
- execution.setVariable("prefix","HOME_")
- logger.trace("Started Sniro Homing Call Sniro ")
- try{
- execution.setVariable("rollbackData", null)
- execution.setVariable("rolledBack", false)
-
- String requestId = execution.getVariable("msoRequestId")
- logger.debug("Incoming Request Id is: " + requestId)
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
- ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
- logger.debug("Incoming Service Decomposition is: " + serviceDecomposition)
- String subscriberInfo = execution.getVariable("subscriberInfo")
- logger.debug("Incoming Subscriber Information is: " + subscriberInfo)
-
- if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
- exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
- }else{
- String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
- String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
- String subCommonSiteId = ""
- if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
- subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
- }
- Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
-
- String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
- String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
-
- //Authentication
- String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
- execution.setVariable("BasicAuthHeaderValue", authHeader)
-
- //Prepare Callback
- String timeout = execution.getVariable("timeout")
- if(isBlank(timeout)){
- timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
- if(isBlank(timeout)) {
- timeout = "PT30M";
- }
- }
- logger.debug("Async Callback Timeout will be: " + timeout)
-
- execution.setVariable("timeout", timeout);
- execution.setVariable("correlator", requestId);
- execution.setVariable("messageType", "SNIROResponse");
-
- //Build Request & Call Sniro
- String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
- execution.setVariable("sniroRequest", sniroRequest)
- logger.debug("SNIRO Request is: " + sniroRequest)
-
- String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
- String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
- String urlString = host + endpoint
- logger.debug("Sniro Url is: " + urlString)
-
- URL url = new URL(urlString);
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
- httpClient.addAdditionalHeader("Authorization", authHeader)
- Response httpResponse = httpClient.post(sniroRequest)
-
- int responseCode = httpResponse.getStatus()
-
- logger.debug("Sniro sync response code is: " + responseCode)
- if(httpResponse.hasEntity()){
- logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
- }
-
- if(responseCode != 202){
- exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
- }
-
- logger.trace("Completed Sniro Homing Call Sniro")
- }
- }catch(BpmnError b){
- throw b
- }catch(Exception e){
- logger.debug("Error encountered within Homing CallSniro method: " + e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
- }
- }
-
- /**
- * This method processes the callback response
- * and the contained homing solution. It sets
- * homing solution assignment and license
- * information to the corresponding resources
- *
- * @param execution
- *
- * @author cb645j
- */
- public void processHomingSolution(DelegateExecution execution){
- logger.trace("Started Sniro Homing Process Homing Solution")
- try{
- String response = execution.getVariable("asyncCallbackResponse")
- logger.debug("Sniro Async Callback Response is: " + response)
-
- sniroUtils.validateCallbackResponse(execution, response)
-
- ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
- List<Resource> resourceList = decomposition.getServiceResources()
-
- if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
- String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
- JSONArray arr = new JSONArray(placements)
- for(int i = 0; i < arr.length(); i++){
- JSONObject placement = arr.getJSONObject(i)
- String jsonServiceResourceId = placement.getString("serviceResourceId")
- for(Resource resource:resourceList){
- String serviceResourceId = resource.getResourceId()
- if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
- //match
- String inventoryType = placement.getString("inventoryType")
- resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
- resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
- resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
- JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
- Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
- resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
- resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
- resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
- if(inventoryType.equalsIgnoreCase("service")){
- VnfResource vnf = new VnfResource()
- vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
- resource.getHomingSolution().setVnf(vnf)
- resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
- }
- }
- }
- }
- }
-
- if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
- String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
- JSONArray licenseArr = new JSONArray(licenseInfo)
- for(int l = 0; l < licenseArr.length(); l++){
- JSONObject license = licenseArr.getJSONObject(l)
- String jsonServiceResourceId = license.getString("serviceResourceId")
- for(Resource resource:resourceList){
- String serviceResourceId = resource.getResourceId()
- if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
- //match
- String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
- List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
- resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
-
- String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
- List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
- resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
- }
- }
- }
- }
- execution.setVariable("serviceDecomposition", decomposition)
-
- logger.trace("Completed Sniro Homing Process Homing Solution")
- }catch(BpmnError b){
- throw b
- }catch(Exception e){
- logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
- }
- }
-
- /**
- * This method logs the start of DHVCreateService
- * to make debugging easier.
- *
- * @param - execution
- * @author cb645j
- */
- public String logStart(DelegateExecution execution){
- String requestId = execution.getVariable("testReqId")
- if(isBlank(requestId)){
- requestId = execution.getVariable("msoRequestId")
- }
- execution.setVariable("DHVCS_requestId", requestId)
- logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
- logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled") + " *****")
- logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
- }
-
-
- /**
- * Auto-generated method stub
- */
- public void preProcessRequest(DelegateExecution execution){}
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+ SniroUtils sniroUtils = new SniroUtils(this)
+
+ /**
+ * This method validates the incoming variables.
+ * The method then prepares the sniro request
+ * and posts it to sniro's rest api.
+ *
+ * @param execution
+ *
+ * @author cb645j
+ */
+ public void callSniro(DelegateExecution execution){
+ execution.setVariable("prefix","HOME_")
+ logger.trace("Started Sniro Homing Call Sniro ")
+ try{
+ execution.setVariable("rollbackData", null)
+ execution.setVariable("rolledBack", false)
+
+ String requestId = execution.getVariable("msoRequestId")
+ logger.debug("Incoming Request Id is: " + requestId)
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ logger.debug("Incoming Service Decomposition is: " + serviceDecomposition)
+ String subscriberInfo = execution.getVariable("subscriberInfo")
+ logger.debug("Incoming Subscriber Information is: " + subscriberInfo)
+
+ if(isBlank(requestId) || isBlank(serviceInstanceId) || isBlank(serviceDecomposition.toString()) || isBlank(subscriberInfo)){
+ exceptionUtil.buildAndThrowWorkflowException(execution, 4000, "A required input variable is missing or null")
+ }else{
+ String subId = jsonUtil.getJsonValue(subscriberInfo, "globalSubscriberId")
+ String subName = jsonUtil.getJsonValue(subscriberInfo, "subscriberName")
+ String subCommonSiteId = ""
+ if(jsonUtil.jsonElementExist(subscriberInfo, "subscriberCommonSiteId")){
+ subCommonSiteId = jsonUtil.getJsonValue(subscriberInfo, "subscriberCommonSiteId")
+ }
+ Subscriber subscriber = new Subscriber(subId, subName, subCommonSiteId)
+
+ String cloudConfiguration = execution.getVariable("cloudConfiguration") // TODO Currently not being used
+ String homingParameters = execution.getVariable("homingParameters") // (aka. request parameters) Should be json format. TODO confirm its json format
+
+ //Authentication
+ String authHeader = UrnPropertiesReader.getVariable("sniro.manager.headers.auth", execution)
+ execution.setVariable("BasicAuthHeaderValue", authHeader)
+
+ //Prepare Callback
+ String timeout = execution.getVariable("timeout")
+ if(isBlank(timeout)){
+ timeout = UrnPropertiesReader.getVariable("sniro.manager.timeout", execution)
+ if(isBlank(timeout)) {
+ timeout = "PT30M";
+ }
+ }
+ logger.debug("Async Callback Timeout will be: " + timeout)
+
+ execution.setVariable("timeout", timeout);
+ execution.setVariable("correlator", requestId);
+ execution.setVariable("messageType", "SNIROResponse");
+
+ //Build Request & Call Sniro
+ String sniroRequest = sniroUtils.buildRequest(execution, requestId, serviceDecomposition, subscriber, homingParameters)
+ execution.setVariable("sniroRequest", sniroRequest)
+ logger.debug("SNIRO Request is: " + sniroRequest)
+
+ String endpoint = UrnPropertiesReader.getVariable("sniro.manager.uri.v1", execution)
+ String host = UrnPropertiesReader.getVariable("sniro.manager.host", execution)
+ String urlString = host + endpoint
+ logger.debug("Sniro Url is: " + urlString)
+
+ URL url = new URL(urlString);
+ HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.SNIRO)
+ httpClient.addAdditionalHeader("Authorization", authHeader)
+ Response httpResponse = httpClient.post(sniroRequest)
+
+ int responseCode = httpResponse.getStatus()
+
+ logger.debug("Sniro sync response code is: " + responseCode)
+ if(httpResponse.hasEntity()){
+ logger.debug("Sniro sync response is: " + httpResponse.readEntity(String.class))
+ }
+
+ if(responseCode != 202){
+ exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from Sniro.")
+ }
+
+ logger.trace("Completed Sniro Homing Call Sniro")
+ }
+ }catch(BpmnError b){
+ throw b
+ }catch(Exception e){
+ logger.debug("Error encountered within Homing CallSniro method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Homing CallSniro: " + e.getMessage())
+ }
+ }
+
+ /**
+ * This method processes the callback response
+ * and the contained homing solution. It sets
+ * homing solution assignment and license
+ * information to the corresponding resources
+ *
+ * @param execution
+ *
+ * @author cb645j
+ */
+ public void processHomingSolution(DelegateExecution execution){
+ logger.trace("Started Sniro Homing Process Homing Solution")
+ try{
+ String response = execution.getVariable("asyncCallbackResponse")
+ logger.debug("Sniro Async Callback Response is: " + response)
+
+ sniroUtils.validateCallbackResponse(execution, response)
+
+ ServiceDecomposition decomposition = execution.getVariable("serviceDecomposition")
+ List<Resource> resourceList = decomposition.getServiceResources()
+
+ if(JsonUtils.jsonElementExist(response, "solutionInfo.placementInfo")){
+ String placements = jsonUtil.getJsonValue(response, "solutionInfo.placementInfo")
+ JSONArray arr = new JSONArray(placements)
+ for(int i = 0; i < arr.length(); i++){
+ JSONObject placement = arr.getJSONObject(i)
+ String jsonServiceResourceId = placement.getString("serviceResourceId")
+ for(Resource resource:resourceList){
+ String serviceResourceId = resource.getResourceId()
+ if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+ //match
+ String inventoryType = placement.getString("inventoryType")
+ resource.getHomingSolution().setInventoryType(InventoryType.valueOf(inventoryType))
+ resource.getHomingSolution().setCloudRegionId(placement.getString("cloudRegionId"))
+ resource.getHomingSolution().setRehome(placement.getBoolean("isRehome"))
+ JSONArray assignmentArr = placement.getJSONArray("assignmentInfo")
+ Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "variableName", "variableValue")
+ resource.getHomingSolution().setCloudOwner(assignmentMap.get("cloudOwner"))
+ resource.getHomingSolution().setAicClli(assignmentMap.get("aicClli"))
+ resource.getHomingSolution().setAicVersion(assignmentMap.get("aicVersion"))
+ if(inventoryType.equalsIgnoreCase("service")){
+ VnfResource vnf = new VnfResource()
+ vnf.setVnfHostname(assignmentMap.get("vnfHostName"))
+ resource.getHomingSolution().setVnf(vnf)
+ resource.getHomingSolution().setServiceInstanceId(placement.getString("serviceInstanceId"))
+ }
+ if(placement.getBoolean("isRehome")) {
+ resource.getHomingSolution().setAllottedResourceId(assignmentMap.get("serviceResourceId"))
+ }
+ }
+ }
+ }
+ }
+
+ if(JsonUtils.jsonElementExist(response, "solutionInfo.licenseInfo")){
+ String licenseInfo = jsonUtil.getJsonValue(response, "solutionInfo.licenseInfo")
+ JSONArray licenseArr = new JSONArray(licenseInfo)
+ for(int l = 0; l < licenseArr.length(); l++){
+ JSONObject license = licenseArr.getJSONObject(l)
+ String jsonServiceResourceId = license.getString("serviceResourceId")
+ for(Resource resource:resourceList){
+ String serviceResourceId = resource.getResourceId()
+ if(serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)){
+ //match
+ String jsonEntitlementPoolList = jsonUtil.getJsonValue(license.toString(), "entitlementPoolList")
+ List<String> entitlementPoolList = jsonUtil.StringArrayToList(execution, jsonEntitlementPoolList)
+ resource.getHomingSolution().getLicense().setEntitlementPoolList(entitlementPoolList)
+
+ String jsonLicenseKeyGroupList = jsonUtil.getJsonValue(license.toString(), "licenseKeyGroupList")
+ List<String> licenseKeyGroupList = jsonUtil.StringArrayToList(execution, jsonLicenseKeyGroupList)
+ resource.getHomingSolution().getLicense().setLicenseKeyGroupList(licenseKeyGroupList)
+ }
+ }
+ }
+ }
+ execution.setVariable("serviceDecomposition", decomposition)
+
+ logger.trace("Completed Sniro Homing Process Homing Solution")
+ }catch(BpmnError b){
+ throw b
+ }catch(Exception e){
+ logger.debug("Error encountered within Homing ProcessHomingSolution method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in Sniro Homing Process Solution")
+ }
+ }
+
+ /**
+ * This method logs the start of DHVCreateService
+ * to make debugging easier.
+ *
+ * @param - execution
+ * @author cb645j
+ */
+ public String logStart(DelegateExecution execution){
+ String requestId = execution.getVariable("testReqId")
+ if(isBlank(requestId)){
+ requestId = execution.getVariable("msoRequestId")
+ }
+ execution.setVariable("DHVCS_requestId", requestId)
+ logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
+ logger.debug("****** Homing Subflow Global Debug Enabled: " + execution.getVariable("isDebugLogEnabled") + " *****")
+ logger.trace("STARTED Homing Subflow for request: " + requestId + " ")
+ }
+
+
+ /**
+ * Auto-generated method stub
+ */
+ public void preProcessRequest(DelegateExecution execution){}
}
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 989bba0a6e..5a8244266b 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
@@ -1863,8 +1863,9 @@ public class BBInputSetup implements JavaDelegate {
}
private void mapRelationship(ServiceInstance serviceInstance, Relationships relationships) {
- this.mapProject(relationships.getByType(AAIObjectType.PROJECT), serviceInstance);
- this.mapOwningEntity(relationships.getByType(AAIObjectType.OWNING_ENTITY), serviceInstance);
+ this.mapProject(relationships.getByType(AAIObjectType.PROJECT, uri -> uri.nodesOnly(true)), serviceInstance);
+ this.mapOwningEntity(relationships.getByType(AAIObjectType.OWNING_ENTITY, uri -> uri.nodesOnly(true)),
+ serviceInstance);
this.mapL3Networks(relationships.getRelatedAAIUris(AAIObjectType.L3_NETWORK), serviceInstance.getNetworks());
this.mapGenericVnfs(relationships.getRelatedAAIUris(AAIObjectType.GENERIC_VNF), serviceInstance.getVnfs());
this.mapPnfs(relationships.getRelatedAAIUris(AAIObjectType.PNF), serviceInstance.getPnfs());
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/oof/adapter/beans/payload/OofRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/oof/adapter/beans/payload/OofRequest.java
new file mode 100644
index 0000000000..9d81332ed7
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/oof/adapter/beans/payload/OofRequest.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Wipro Limited. 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.oof.adapter.beans.payload;
+
+public class OofRequest {
+
+ private String apiPath;
+
+ private Object requestDetails;
+
+ public String getApiPath() {
+ return apiPath;
+ }
+
+ public void setApiPath(String apiPath) {
+ this.apiPath = apiPath;
+ }
+
+ public Object getRequestDetails() {
+ return requestDetails;
+ }
+
+ public void setRequestDetails(Object requestDetails) {
+ this.requestDetails = requestDetails;
+ }
+
+ @Override
+ public String toString() {
+ return "OofRequest [apiPath=" + apiPath + ", requestDetails=" + requestDetails + "]";
+ }
+
+}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
index 309b053589..ddfb29e97e 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/HomingSolution.java
@@ -37,6 +37,7 @@ public class HomingSolution extends JsonWrapper implements Serializable {
private InventoryType inventoryType;
private boolean isRehome;
private String serviceInstanceId; // TODO should start using si object instead
+ private String allottedResourceId;
private String cloudOwner;
private String cloudRegionId;
private String aicClli;
@@ -74,6 +75,14 @@ public class HomingSolution extends JsonWrapper implements Serializable {
this.serviceInstanceId = serviceInstanceId;
}
+ public String getAllottedResourceId() {
+ return allottedResourceId;
+ }
+
+ public void setAllottedResourceId(String allottedResourceId) {
+ this.allottedResourceId = allottedResourceId;
+ }
+
public String getCloudOwner() {
return cloudOwner;
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationService.java
deleted file mode 100644
index 58d0c6d374..0000000000
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationService.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.onap.so.bpmn.common.workflow.service;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.ProcessEngine;
-import org.camunda.bpm.engine.RepositoryService;
-import org.camunda.bpm.engine.RuntimeService;
-import org.camunda.bpm.engine.migration.MigrationInstruction;
-import org.camunda.bpm.engine.migration.MigrationPlan;
-import org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder;
-import org.camunda.bpm.engine.repository.ProcessDefinition;
-import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.camunda.bpm.engine.runtime.ProcessInstanceQuery;
-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.boot.context.event.ApplicationReadyEvent;
-import org.springframework.context.event.EventListener;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AutoProcessInstanceMigrationService {
-
- private static Logger logger = LoggerFactory.getLogger(AutoProcessInstanceMigrationService.class);
-
- @Autowired
- private Environment env;
- @Autowired
- protected ProcessEngine processEngine;
-
- @Value("${migration.autoMigrationEnabled:false}")
- private boolean autoMigrationEnabled;
-
- private RuntimeService runtimeService;
- private RepositoryService repositoryService;
- private List<String> processDefinitionKeys;
-
- @EventListener(ApplicationReadyEvent.class)
- protected void executeAutoProcessInstanceMigrations() {
- if (autoMigrationEnabled) {
- runtimeService = processEngine.getRuntimeService();
- repositoryService = processEngine.getRepositoryService();
- for (ProcessDefinition definition : getProcessDefinitions()) {
- for (ProcessDefinition procDefOld : getOldProcessDefinitions(definition.getKey(),
- definition.getVersion())) {
- migrate(procDefOld.getId(), definition.getId());
- }
- }
- }
- }
-
- protected List<ProcessDefinition> getProcessDefinitions() {
-
- List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
- processDefinitionKeys = env.getProperty("migration.processDefinitionKeys", List.class, new ArrayList<String>());
- for (String key : processDefinitionKeys) {
- processDefinitions.add(repositoryService.createProcessDefinitionQuery().processDefinitionKey(key)
- .latestVersion().singleResult());
- }
- return processDefinitions;
- }
-
- private void migrate(String sourceProcessDefinitionId, String targetProcessDefinitionId) {
- MigrationPlan migrationPlan =
- runtimeService.createMigrationPlan(sourceProcessDefinitionId, targetProcessDefinitionId)
- .mapEqualActivities().updateEventTriggers().build();
- List<String> activityIds = new ArrayList<>();
-
- for (MigrationInstruction instruction : migrationPlan.getInstructions()) {
- activityIds.add(instruction.getSourceActivityId());
- }
- for (String activityId : activityIds) {
- ProcessInstanceQuery activeProcessInstancesQuery = runtimeService.createProcessInstanceQuery()
- .processDefinitionId(sourceProcessDefinitionId).activityIdIn(activityId).active();
- if (!activeProcessInstancesQuery.list().isEmpty()) {
- logger.info("Migrating {} process instance(s) from {} to {}",
- Long.valueOf(activeProcessInstancesQuery.count()), sourceProcessDefinitionId,
- targetProcessDefinitionId);
- MigrationPlanExecutionBuilder migration =
- runtimeService.newMigration(migrationPlan).processInstanceQuery(activeProcessInstancesQuery);
- migration.executeAsync();
- }
- }
- suspendEmptyProcessDefinition(sourceProcessDefinitionId);
- }
-
- private void suspendEmptyProcessDefinition(String sourceProcessDefinitionId) {
- List<ProcessInstance> activeProcessInstances = runtimeService.createProcessInstanceQuery()
- .processDefinitionId(sourceProcessDefinitionId).active().list();
- if (activeProcessInstances.isEmpty()) {
- repositoryService.suspendProcessDefinitionById(sourceProcessDefinitionId);
- } else {
- logger.info("Unable to migrate {} process instance(s) from {}",
- Integer.valueOf(activeProcessInstances.size()), sourceProcessDefinitionId);
- }
- }
-
- protected List<ProcessDefinition> getOldProcessDefinitions(String key, int version) {
- List<ProcessDefinition> processDefinitions =
- repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).list();
- List<ProcessDefinition> oldProcessDefinitions = new ArrayList<>();
- for (ProcessDefinition processDef : processDefinitions) {
- if (!processDef.isSuspended() && (processDef.getVersion() != version)) {
- oldProcessDefinitions.add(processDef);
- }
- }
- return oldProcessDefinitions;
- }
-}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java
deleted file mode 100644
index 36e828448d..0000000000
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2020 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.workflow.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.ProcessEngine;
-import org.camunda.bpm.engine.RepositoryService;
-import org.camunda.bpm.engine.repository.ProcessDefinition;
-import org.camunda.bpm.engine.repository.ProcessDefinitionQuery;
-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.springframework.core.env.Environment;
-
-@RunWith(MockitoJUnitRunner.class)
-public class AutoProcessInstanceMigrationServiceTest {
-
- @Mock
- private ProcessEngine processEngine;
-
- @Mock
- private ProcessDefinition outdated;
-
- @Mock
- private ProcessDefinition newDef;
-
- @Mock
- private ProcessDefinition key;
-
- @Mock
- private ProcessDefinition testKey;
-
- @Mock
- private ProcessDefinition suspendedDef;
-
- @Mock
- private RepositoryService repositoryService;
-
- @Mock
- private ProcessDefinitionQuery query;
-
- @Mock
- private ProcessDefinitionQuery keyQuery;
-
- @Mock
- private Environment env;
-
- @Spy
- @InjectMocks
- private AutoProcessInstanceMigrationService migrationService;
-
-
- @Test
- public void getOldProcessDefinitionsTest() {
- List<ProcessDefinition> expectedList = new ArrayList<>();
- expectedList.add(outdated);
-
- List<ProcessDefinition> defList = new ArrayList<>();
- defList.add(outdated);
- defList.add(newDef);
- defList.add(suspendedDef);
-
-
- doReturn(query).when(repositoryService).createProcessDefinitionQuery();
- doReturn(query).when(query).processDefinitionKey("test");
- doReturn(defList).when(query).list();
- doReturn(3).when(outdated).getVersion();
- doReturn(4).when(newDef).getVersion();
- doReturn(true).when(suspendedDef).isSuspended();
- List<ProcessDefinition> outdatedList = migrationService.getOldProcessDefinitions("test", 4);
-
- assertEquals(expectedList, outdatedList);
- }
-
- @Test
- public void getProcessDefinitionsTest() {
- List<ProcessDefinition> expected = new ArrayList<ProcessDefinition>();
- expected.add(testKey);
- expected.add(key);
-
- List<String> processDefinitionKeys = new ArrayList<String>();
- processDefinitionKeys.add("testKey");
- processDefinitionKeys.add("key");
-
- doReturn(processDefinitionKeys).when(env).getProperty("migration.processDefinitionKeys", List.class,
- new ArrayList<String>());
-
- doReturn(query).when(repositoryService).createProcessDefinitionQuery();
- doReturn(query).when(query).processDefinitionKey("testKey");
- doReturn(query).when(query).latestVersion();
- doReturn(testKey).when(query).singleResult();
-
- doReturn(keyQuery).when(query).processDefinitionKey("key");
- doReturn(keyQuery).when(keyQuery).latestVersion();
- doReturn(key).when(keyQuery).singleResult();
-
- List<ProcessDefinition> actualProcessDefinitions = migrationService.getProcessDefinitions();
-
- assertEquals(expected, actualProcessDefinitions);
- }
-}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
index 15a0f34482..389f0a089c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
@@ -178,60 +178,36 @@ public class CreateSliceService extends AbstractServiceTaskProcessor {
logger.debug("Finish preProcessRequest")
}
- public void getNSTSelection(DelegateExecution execution) {
- logger.debug("Start getNSTSelection")
+ public void prepareSelectNSTRequest(DelegateExecution execution) {
+ logger.debug("Start prepareSelectNSTRequest")
String requestId = execution.getVariable("msoRequestId")
+ String messageType = "NSTSelectionResponse"
Map<String, Object> serviceProfile = execution.getVariable("serviceProfile")
- String oofUrl = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
-
- def authHeader = ""
- String basicAuth = UrnPropertiesReader.getVariable("mso.oof.auth", execution)
- String msokey = UrnPropertiesReader.getVariable("mso.msoKey", execution)
-
- String basicAuthValue = utils.encrypt(basicAuth, msokey)
- if (basicAuthValue != null) {
- logger.debug( "Obtained BasicAuth username and password for OOF: " + basicAuthValue)
- try {
- authHeader = utils.getBasicAuth(basicAuthValue, msokey)
- execution.setVariable("BasicAuthHeaderValue", authHeader)
- } catch (Exception ex) {
- logger.debug( "Unable to encode username and password string: " + ex)
- exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Internal Error - Unable to " +
- "encode username and password string")
- }
- } else {
- logger.debug( "Unable to obtain BasicAuth - BasicAuth value null")
- exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Internal Error - BasicAuth " +
- "value null")
- }
-
- URL requestUrl = new URL(oofUrl + "/api/oof/v1/selection/nst")
- String oofRequest = oofUtils.buildSelectNSTRequest(requestId, serviceProfile)
- HttpClient httpClient = new HttpClientFactory().newJsonClient(requestUrl, ONAPComponents.OOF)
- httpClient.addAdditionalHeader("Authorization", authHeader)
- Response httpResponse = httpClient.post(oofRequest)
-
- int responseCode = httpResponse.getStatus()
- logger.debug("OOF sync response code is: " + responseCode)
-
- if(responseCode != 200){
- exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from OOF.")
- }
-
- Map<String, Object> nstSolution
- try {
- Map<String, Object> resMap = httpResponse.readEntity(Map.class)
- List<Map<String, Object>> nstSolutions = (List<Map<String, Object>>) resMap.get("solutions")
- nstSolution = nstSolutions.get(0)
- execution.setVariable("nstSolution", nstSolution)
- } catch (Exception ex) {
- logger.debug( "Failed to get NST solution suggested by OOF.")
- exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Failed to get NST solution suggested by OOF.")
- }
-
- logger.debug("Finish getNSTSelection")
+ execution.setVariable("nstSelectionUrl", "/api/oof/v1/selection/nst")
+ execution.setVariable("nstSelection_messageType",messageType)
+ execution.setVariable("nstSelection_correlator",requestId)
+ String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
+ execution.setVariable("nstSelection_timeout",timeout)
+ String oofRequest = oofUtils.buildSelectNSTRequest(requestId,messageType, serviceProfile)
+ execution.setVariable("nstSelection_oofRequest",oofRequest)
+ logger.debug("Finish prepareSelectNSTRequest")
}
+
+ public void processNSTSolutions(DelegateExecution execution) {
+ Map<String, Object> nstSolution
+ try {
+ logger.debug("Start processing NSTSolutions")
+ Map<String, Object> resMap = objectMapper.readValue(execution.getVariable("nstSelection_oofResponse"),Map.class)
+ List<Map<String, Object>> nstSolutions = (List<Map<String, Object>>) resMap.get("solutions")
+ nstSolution = nstSolutions.get(0)
+ execution.setVariable("nstSolution", nstSolution)
+ } catch (Exception ex) {
+ logger.debug( "Failed to get NST solution suggested by OOF.")
+ exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Failed to get NST solution suggested by OOF.")
+ }
+
+ }
public void prepareDecomposeService(DelegateExecution execution) {
logger.debug("Start prepareDecomposeService")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
index 081dddab99..88edd79d6d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
@@ -15,8 +15,8 @@ import org.onap.so.beans.nsmf.NetworkType
import org.onap.so.beans.nsmf.NsiInfo
import org.onap.so.beans.nsmf.NssiAllocateRequest
import org.onap.so.beans.nsmf.PerfReq
-import org.onap.so.beans.nsmf.PerfReqEmbbList
-import org.onap.so.beans.nsmf.PerfReqUrllcList
+import org.onap.so.beans.nsmf.PerfReqEmbb
+import org.onap.so.beans.nsmf.PerfReqUrllc
import org.onap.so.beans.nsmf.ResourceSharingLevel
import org.onap.so.beans.nsmf.SliceTaskParams
import org.onap.so.beans.nsmf.TnSliceProfile
@@ -411,20 +411,20 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
execution.setVariable("esrInfo",esrInfo)
- PerfReqEmbbList perfReqEmbb = new PerfReqEmbbList()
+ PerfReqEmbb perfReqEmbb = new PerfReqEmbb()
perfReqEmbb.setActivityFactor(sliceProfileCn.get("activityFactor"))
perfReqEmbb.setAreaTrafficCapDL(sliceProfileCn.get("areaTrafficCapDL"))
perfReqEmbb.setAreaTrafficCapUL(sliceProfileCn.get("areaTrafficCapUL"))
perfReqEmbb.setExpDataRateDL(sliceProfileCn.get("expDataRateDL"))
perfReqEmbb.setExpDataRateUL(sliceProfileCn.get("expDataRateUL"))
- List<PerfReqEmbbList> listPerfReqEmbbList = new ArrayList<>()
+ List<PerfReqEmbb> listPerfReqEmbbList = new ArrayList<>()
listPerfReqEmbbList.add(perfReqEmbb)
PerfReq perfReq = new PerfReq()
perfReq.setPerfReqEmbbList(listPerfReqEmbbList)
- PerfReqUrllcList perfReqUrllc = new PerfReqUrllcList()
+ PerfReqUrllc perfReqUrllc = new PerfReqUrllc()
perfReqUrllc.setConnDensity(0)
perfReqUrllc.setTrafficDensity(0)
perfReqUrllc.setExpDataRate(0)
@@ -436,7 +436,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
perfReqUrllc.setPayloadSize("0")
perfReqUrllc.setServiceAreaDimension("")
- List<PerfReqUrllcList> perfReqUrllcList = new ArrayList<>()
+ List<PerfReqUrllc> perfReqUrllcList = new ArrayList<>()
perfReqUrllcList.add(perfReqUrllc)
perfReq.setPerfReqUrllcList(perfReqUrllcList)
@@ -558,20 +558,20 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
execution.setVariable("esrInfo",esrInfo)
- PerfReqEmbbList perfReqEmbb = new PerfReqEmbbList()
+ PerfReqEmbb perfReqEmbb = new PerfReqEmbb()
perfReqEmbb.setActivityFactor(sliceProfileCn.get("activityFactor"))
perfReqEmbb.setAreaTrafficCapDL(sliceProfileCn.get("areaTrafficCapDL"))
perfReqEmbb.setAreaTrafficCapUL(sliceProfileCn.get("areaTrafficCapUL"))
perfReqEmbb.setExpDataRateDL(sliceProfileCn.get("expDataRateDL"))
perfReqEmbb.setExpDataRateUL(sliceProfileCn.get("expDataRateUL"))
- List<PerfReqEmbbList> listPerfReqEmbbList = new ArrayList<>()
+ List<PerfReqEmbb> listPerfReqEmbbList = new ArrayList<>()
listPerfReqEmbbList.add(perfReqEmbb)
PerfReq perfReq = new PerfReq()
perfReq.setPerfReqEmbbList(listPerfReqEmbbList)
- PerfReqUrllcList perfReqUrllc = new PerfReqUrllcList()
+ PerfReqUrllc perfReqUrllc = new PerfReqUrllc()
perfReqUrllc.setConnDensity(0)
perfReqUrllc.setTrafficDensity(0)
perfReqUrllc.setExpDataRate(0)
@@ -583,7 +583,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
perfReqUrllc.setPayloadSize("0")
perfReqUrllc.setServiceAreaDimension("")
- List<PerfReqUrllcList> perfReqUrllcList = new ArrayList<>()
+ List<PerfReqUrllc> perfReqUrllcList = new ArrayList<>()
perfReqUrllcList.add(perfReqUrllc)
perfReq.setPerfReqUrllcList(perfReqUrllcList)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
index ec9596e7f3..9b78afba03 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
@@ -64,38 +64,16 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
}
- void getNSIOptionfromOOF(DelegateExecution execution) {
+ void prepareSelectNSIRequest(DelegateExecution execution) {
String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
logger.debug( "get NSI option OOF Url: " + urlString)
boolean isNSISuggested = true
execution.setVariable("isNSISuggested",isNSISuggested)
-
- //Prepare auth for OOF - Begin
- def authHeader = ""
- String basicAuth = UrnPropertiesReader.getVariable("mso.oof.auth", execution)
- String msokey = UrnPropertiesReader.getVariable("mso.msoKey", execution)
-
- String basicAuthValue = utils.encrypt(basicAuth, msokey)
- if (basicAuthValue != null) {
- logger.debug( "Obtained BasicAuth username and password for OOF: " + basicAuthValue)
- try {
- authHeader = utils.getBasicAuth(basicAuthValue, msokey)
- execution.setVariable("BasicAuthHeaderValue", authHeader)
- } catch (Exception ex) {
- logger.debug( "Unable to encode username and password string: " + ex)
- exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Internal Error - Unable to " +
- "encode username and password string")
- }
- } else {
- logger.debug( "Unable to obtain BasicAuth - BasicAuth value null")
- exceptionUtil.buildAndThrowWorkflowException(execution, 401, "Internal Error - BasicAuth " +
- "value null")
- }
- //Prepare auth for OOF - End
-
String requestId = execution.getVariable("msoRequestId")
+ String messageType = "NSISelectionResponse"
+
Map<String, Object> profileInfo = execution.getVariable("serviceProfile")
Map<String, Object> nstSolution = execution.getVariable("nstSolution")
logger.debug("Get NST selection from OOF: " + nstSolution.toString())
@@ -104,36 +82,21 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
"modelVersionId":"${nstSolution.UUID}",
"modelName":"${nstSolution.NSTName}"
}"""
-
- String oofRequest = oofUtils.buildSelectNSIRequest(requestId, nstInfo, profileInfo)
- logger.debug("Sending request to OOF: " + oofRequest)
-
- //send request to get NSI option - Begin
- URL url = new URL(urlString+"/api/oof/selection/nsi/v1")
- HttpClient httpClient = new HttpClientFactory().newJsonClient(url, ONAPComponents.OOF)
- httpClient.addAdditionalHeader("Authorization", authHeader)
- Response httpResponse = httpClient.post(oofRequest)
-
- processOOFResponse(httpResponse, execution)
-
- //解析sliceProfile
- logger.debug("start parseServiceProfile")
- parseServiceProfile(execution)
- logger.debug("end parseServiceProfile")
+
+ execution.setVariable("nsiSelectionUrl", "/api/oof/selection/nsi/v1")
+ execution.setVariable("nsiSelection_messageType",messageType)
+ execution.setVariable("nsiSelection_correlator",requestId)
+ String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
+ execution.setVariable("nsiSelection_timeout",timeout)
+ String oofRequest = oofUtils.buildSelectNSIRequest(requestId, nstInfo,messageType, profileInfo)
+ execution.setVariable("nsiSelection_oofRequest",oofRequest)
+ logger.debug("Sending request to OOF: " + oofRequest)
}
- private void processOOFResponse(Response httpResponse, DelegateExecution execution) {
+ void processOOFResponse(Response httpResponse, DelegateExecution execution) {
int responseCode = httpResponse.getStatus()
- logger.debug("OOF sync response code is: " + responseCode)
-
- if (responseCode != 200) {
- exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from OOF.")
- logger.debug("Info: No NSI suggested by OOF")
- }
-
SliceTaskParams sliceTaskParams = execution.getVariable("sliceTaskParams")
- if (httpResponse.hasEntity()) {
- String OOFResponse = httpResponse.readEntity(String.class)
+ String OOFResponse = execution.getVariable("nsiSelection_oofResponse")
logger.debug("NSI OOFResponse is: " + OOFResponse)
execution.setVariable("OOFResponse", OOFResponse)
//This needs to be changed to derive a value when we add policy to decide the solution options.
@@ -154,8 +117,11 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
}
execution.setVariable("sliceTaskParams", sliceTaskParams)
logger.debug("sliceTaskParams: "+sliceTaskParams.convertToJson())
- }
logger.debug("*** Completed options Call to OOF ***")
+ //解析sliceProfile
+ logger.debug("start parseServiceProfile")
+ parseServiceProfile(execution)
+ logger.debug("end parseServiceProfile")
}
private boolean hasSharedNSIsolutions( Map solutions){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/PNFSoftwareUpgrade.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/GenericPnfSoftwareUpgrade.groovy
index 8e7a4f727d..89902209a0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/PNFSoftwareUpgrade.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/GenericPnfSoftwareUpgrade.groovy
@@ -31,8 +31,8 @@ import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder
import org.onap.so.bpmn.core.WorkflowException
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.*
-class PNFSoftwareUpgrade extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger(PNFSoftwareUpgrade.class)
+class GenericPnfSoftwareUpgrade extends AbstractServiceTaskProcessor {
+ private static final Logger logger = LoggerFactory.getLogger(GenericPnfSoftwareUpgrade.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
String prefix = "PnfSwUpgrade_"
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn
index f27794a389..27bd01bda9 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn
@@ -1,5 +1,5 @@
<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.4.1">
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1">
<bpmn:process id="CreateSliceService" name="CreateSliceService" isExecutable="true">
<bpmn:startEvent id="StartEvent_1nbljfd" name="Create Slice Service Creation Flow">
<bpmn:outgoing>SequenceFlow_03s744c</bpmn:outgoing>
@@ -34,12 +34,12 @@ css.processUserOptions(execution)</bpmn:script>
def css = new CreateSliceService()
css.processDecomposition(execution)</bpmn:script>
</bpmn:scriptTask>
- <bpmn:scriptTask id="ScriptTask_1eo3m4q" name="Get NST Selection" scriptFormat="groovy">
+ <bpmn:scriptTask id="ScriptTask_1eo3m4q" name="Prepare NST Selection" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_046irye</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1o23s0i</bpmn:outgoing>
+ <bpmn:outgoing>Flow_1l8mfej</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def css = new CreateSliceService()
-css.getNSTSelection(execution)</bpmn:script>
+css.prepareSelectNSTRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_139l55g" name="Call DoCreateSliceServiceInstance&#10;" calledElement="DoCreateSliceServiceInstance">
<bpmn:extensionElements>
@@ -176,7 +176,7 @@ css.prepareUpdateServiceOperationStatus(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_1t19ips</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:scriptTask id="ScriptTask_0o2r07o" name="Prepare&#10;Decompose&#10;Service&#10;" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1o23s0i</bpmn:incoming>
+ <bpmn:incoming>Flow_1u4srgq</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0q7yc2c</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new CreateSliceService()
@@ -446,7 +446,6 @@ css.sendSyncResponse(execution)</bpmn:script>
</bpmn:callActivity>
<bpmn:sequenceFlow id="SequenceFlow_1aaozcg" sourceRef="CallActivity_0v4mw2x" targetRef="ScriptTask_0gb975b" />
<bpmn:sequenceFlow id="SequenceFlow_046irye" sourceRef="ServiceTask_0kd6p6p" targetRef="ScriptTask_1eo3m4q" />
- <bpmn:sequenceFlow id="SequenceFlow_1o23s0i" sourceRef="ScriptTask_1eo3m4q" targetRef="ScriptTask_0o2r07o" />
<bpmn:sequenceFlow id="SequenceFlow_0jrclmc" sourceRef="ScriptTask_0l3d1ai" targetRef="IntermediateThrowEvent_1ex8ke9" />
<bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0n4xku8</bpmn:incoming>
@@ -457,12 +456,205 @@ def css = new CreateSliceService()
css.updateAAIOrchStatus(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ef3voz" />
+ <bpmn:sequenceFlow id="Flow_1l8mfej" sourceRef="ScriptTask_1eo3m4q" targetRef="Activity_1ge49xu" />
+ <bpmn:callActivity id="Activity_1ge49xu" name="Handle NST Selection OOF request" calledElement="DoHandleOofRequest">
+ <bpmn:extensionElements>
+ <camunda:in source="nstSelectionUrl" target="apiPath" />
+ <camunda:in source="nstSelection_correlator" target="correlator" />
+ <camunda:in source="nstSelection_messageType" target="messageType" />
+ <camunda:in source="nstSelection_timeout" target="timeout" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:out source="asyncCallbackResponse" target="nstSelection_oofResponse" />
+ <camunda:in source="nstSelection_oofRequest" target="oofRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>Flow_1l8mfej</bpmn:incoming>
+ <bpmn:outgoing>Flow_0vq2rmw</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="Flow_0vq2rmw" sourceRef="Activity_1ge49xu" targetRef="Activity_12v8ykp" />
+ <bpmn:scriptTask id="Activity_12v8ykp" name="Process NST Solutions" scriptFormat="groovy">
+ <bpmn:incoming>Flow_0vq2rmw</bpmn:incoming>
+ <bpmn:outgoing>Flow_1u4srgq</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def css = new CreateSliceService()
+css.processNSTSolutions(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="Flow_1u4srgq" sourceRef="Activity_12v8ykp" targetRef="ScriptTask_0o2r07o" />
</bpmn:process>
<bpmn:message id="Message_0c4b2r5" name="SliceServiceTask" />
<bpmn:error id="Error_03akl5v" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateSliceService">
+ <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj">
+ <di:waypoint x="745" y="801" />
+ <di:waypoint x="823" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0jrclmc_di" bpmnElement="SequenceFlow_0jrclmc">
+ <di:waypoint x="1540" y="121" />
+ <di:waypoint x="1584" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_046irye_di" bpmnElement="SequenceFlow_046irye">
+ <di:waypoint x="650" y="121" />
+ <di:waypoint x="685" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1aaozcg_di" bpmnElement="SequenceFlow_1aaozcg">
+ <di:waypoint x="1115" y="289" />
+ <di:waypoint x="1193" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_12qt5ci_di" bpmnElement="SequenceFlow_12qt5ci">
+ <di:waypoint x="335" y="514" />
+ <di:waypoint x="335" y="611" />
+ <di:waypoint x="335" y="593" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_16uz2t9_di" bpmnElement="SequenceFlow_16uz2t9">
+ <di:waypoint x="385" y="456" />
+ <di:waypoint x="467" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1fk37v7_di" bpmnElement="SequenceFlow_1fk37v7">
+ <di:waypoint x="214" y="456" />
+ <di:waypoint x="285" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ey6m1e_di" bpmnElement="SequenceFlow_1ey6m1e">
+ <di:waypoint x="930" y="289" />
+ <di:waypoint x="1015" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1bevt3a_di" bpmnElement="SequenceFlow_1bevt3a">
+ <di:waypoint x="214" y="801" />
+ <di:waypoint x="285" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_10ng1vx_di" bpmnElement="SequenceFlow_10ng1vx">
+ <di:waypoint x="1471" y="645" />
+ <di:waypoint x="1584" y="645" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_19lsayh_di" bpmnElement="SequenceFlow_19lsayh">
+ <di:waypoint x="1293" y="645" />
+ <di:waypoint x="1371" y="645" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h2oree_di" bpmnElement="SequenceFlow_0h2oree">
+ <di:waypoint x="567" y="456" />
+ <di:waypoint x="645" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0477975_di" bpmnElement="SequenceFlow_0477975">
+ <di:waypoint x="1471" y="456" />
+ <di:waypoint x="1584" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0thd6ny_di" bpmnElement="SequenceFlow_0thd6ny">
+ <di:waypoint x="1293" y="456" />
+ <di:waypoint x="1371" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1sq6kp6_di" bpmnElement="SequenceFlow_1sq6kp6">
+ <di:waypoint x="385" y="289" />
+ <di:waypoint x="467" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0q7yc2c_di" bpmnElement="SequenceFlow_0q7yc2c">
+ <di:waypoint x="1240" y="121" />
+ <di:waypoint x="1280" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1">
+ <di:waypoint x="1297" y="801" />
+ <di:waypoint x="1375" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0lbdfmt_di" bpmnElement="SequenceFlow_0lbdfmt">
+ <di:waypoint x="1105" y="801" />
+ <di:waypoint x="1197" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1o1tu0f_di" bpmnElement="SequenceFlow_1o1tu0f">
+ <di:waypoint x="214" y="289" />
+ <di:waypoint x="285" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0t094g7_di" bpmnElement="SequenceFlow_0t094g7">
+ <di:waypoint x="510" y="121" />
+ <di:waypoint x="550" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_11rbv41_di" bpmnElement="SequenceFlow_11rbv41">
+ <di:waypoint x="1475" y="801" />
+ <di:waypoint x="1585" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0klb3ey_di" bpmnElement="SequenceFlow_0klb3ey">
+ <di:waypoint x="923" y="801" />
+ <di:waypoint x="1005" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0n4xku8_di" bpmnElement="SequenceFlow_0n4xku8">
+ <di:waypoint x="538" y="801" />
+ <di:waypoint x="645" y="801" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="584" y="783" width="18" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1c6ka9h_di" bpmnElement="SequenceFlow_1c6ka9h">
+ <di:waypoint x="513" y="826" />
+ <di:waypoint x="513" y="926" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="521" y="832" width="15" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0mlrlbv_di" bpmnElement="SequenceFlow_0mlrlbv">
+ <di:waypoint x="385" y="801" />
+ <di:waypoint x="488" y="801" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_18kur12_di" bpmnElement="SequenceFlow_18kur12">
+ <di:waypoint x="1293" y="289" />
+ <di:waypoint x="1371" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0it2g9j_di" bpmnElement="SequenceFlow_0it2g9j">
+ <di:waypoint x="1471" y="289" />
+ <di:waypoint x="1584" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1g8m7tq_di" bpmnElement="SequenceFlow_1g8m7tq">
+ <di:waypoint x="745" y="289" />
+ <di:waypoint x="830" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1p8vxo5_di" bpmnElement="SequenceFlow_1p8vxo5">
+ <di:waypoint x="567" y="289" />
+ <di:waypoint x="645" y="289" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1t19ips_di" bpmnElement="SequenceFlow_1t19ips">
+ <di:waypoint x="1380" y="121" />
+ <di:waypoint x="1440" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_038lb9m_di" bpmnElement="SequenceFlow_038lb9m">
+ <di:waypoint x="1065" y="481" />
+ <di:waypoint x="1065" y="645" />
+ <di:waypoint x="1193" y="645" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1067" y="560" width="27" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_12t5exy_di" bpmnElement="SequenceFlow_12t5exy">
+ <di:waypoint x="1090" y="456" />
+ <di:waypoint x="1193" y="456" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1121.5" y="438" width="42" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_197cm2e_di" bpmnElement="SequenceFlow_197cm2e">
+ <di:waypoint x="930" y="456" />
+ <di:waypoint x="1040" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1cv0wop_di" bpmnElement="SequenceFlow_1cv0wop">
+ <di:waypoint x="745" y="456" />
+ <di:waypoint x="830" y="456" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt">
+ <di:waypoint x="350" y="121" />
+ <di:waypoint x="410" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c">
+ <di:waypoint x="214" y="121" />
+ <di:waypoint x="250" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_1l8mfej_di" bpmnElement="Flow_1l8mfej">
+ <di:waypoint x="785" y="121" />
+ <di:waypoint x="830" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_0vq2rmw_di" bpmnElement="Flow_0vq2rmw">
+ <di:waypoint x="930" y="121" />
+ <di:waypoint x="1000" y="121" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_1u4srgq_di" bpmnElement="Flow_1u4srgq">
+ <di:waypoint x="1100" y="121" />
+ <di:waypoint x="1140" y="121" />
+ </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd">
<dc:Bounds x="178" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
@@ -475,9 +667,6 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<dc:Bounds x="168" y="481" width="60" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge">
- <dc:Bounds x="285" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1jgtb0y_di" bpmnElement="ScriptTask_1jgtb0y">
<dc:Bounds x="830" y="416" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -487,12 +676,6 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<dc:Bounds x="1027" y="413" width="78" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_0l3d1ai_di" bpmnElement="ScriptTask_0l3d1ai">
- <dc:Bounds x="1370" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1eo3m4q_di" bpmnElement="ScriptTask_1eo3m4q">
- <dc:Bounds x="830" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_139l55g_di" bpmnElement="CallActivity_139l55g">
<dc:Bounds x="645" y="249" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -514,9 +697,53 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<bpmndi:BPMNShape id="EndEvent_0x406rw_di" bpmnElement="EndEvent_0x406rw">
<dc:Bounds x="495" y="926" width="36" height="36" />
</bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_0l3d1ai_di" bpmnElement="ScriptTask_0l3d1ai">
+ <dc:Bounds x="1440" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="CallActivity_1bnkmaz_di" bpmnElement="CallActivity_1bnkmaz">
+ <dc:Bounds x="1280" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_0o2r07o_di" bpmnElement="ScriptTask_0o2r07o">
+ <dc:Bounds x="1140" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge">
+ <dc:Bounds x="250" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_0yce5sp_di" bpmnElement="Activity_12v8ykp">
+ <dc:Bounds x="1000" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_0uymgnp_di" bpmnElement="Activity_1ge49xu">
+ <dc:Bounds x="830" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1eo3m4q_di" bpmnElement="ScriptTask_1eo3m4q">
+ <dc:Bounds x="685" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0kd6p6p_di" bpmnElement="ServiceTask_0kd6p6p">
+ <dc:Bounds x="550" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1xxag1o_di" bpmnElement="ScriptTask_1xxag1o">
+ <dc:Bounds x="410" y="81" width="100" height="80" />
+ </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true">
<dc:Bounds x="685" y="1080" width="781" height="196" />
</bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz">
+ <di:waypoint x="1079" y="1184" />
+ <di:waypoint x="1353" y="1184" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s">
+ <di:waypoint x="751" y="1184" />
+ <di:waypoint x="979" y="1184" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56">
+ <dc:Bounds x="715" y="1166" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026">
+ <dc:Bounds x="1353" y="1166" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw">
+ <dc:Bounds x="979" y="1144" width="100" height="80" />
+ </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1ef3voz_di" bpmnElement="ScriptTask_1ef3voz">
<dc:Bounds x="823" y="761" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -526,9 +753,6 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<dc:Bounds x="1593" y="826" width="20" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1xxag1o_di" bpmnElement="ScriptTask_1xxag1o">
- <dc:Bounds x="468" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1ex8ke9_di" bpmnElement="IntermediateThrowEvent_1ex8ke9">
<dc:Bounds x="1584" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
@@ -544,15 +768,6 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9">
<dc:Bounds x="1197" y="761" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_0kd6p6p_di" bpmnElement="ServiceTask_0kd6p6p">
- <dc:Bounds x="645" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="CallActivity_1bnkmaz_di" bpmnElement="CallActivity_1bnkmaz">
- <dc:Bounds x="1193" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_0o2r07o_di" bpmnElement="ScriptTask_0o2r07o">
- <dc:Bounds x="1015" y="81" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0b7senu_di" bpmnElement="ScriptTask_0b7senu">
<dc:Bounds x="285" y="249" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -613,197 +828,18 @@ css.updateAAIOrchStatus(execution)</bpmn:script>
<bpmndi:BPMNShape id="EndEvent_0bh0kwx_di" bpmnElement="EndEvent_0bh0kwx">
<dc:Bounds x="317" y="593" width="36" height="36" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c">
- <di:waypoint x="214" y="121" />
- <di:waypoint x="285" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt">
- <di:waypoint x="385" y="121" />
- <di:waypoint x="468" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1cv0wop_di" bpmnElement="SequenceFlow_1cv0wop">
- <di:waypoint x="745" y="456" />
- <di:waypoint x="830" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_197cm2e_di" bpmnElement="SequenceFlow_197cm2e">
- <di:waypoint x="930" y="456" />
- <di:waypoint x="1040" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_12t5exy_di" bpmnElement="SequenceFlow_12t5exy">
- <di:waypoint x="1090" y="456" />
- <di:waypoint x="1193" y="456" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1121.5" y="438" width="42" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_038lb9m_di" bpmnElement="SequenceFlow_038lb9m">
- <di:waypoint x="1065" y="481" />
- <di:waypoint x="1065" y="645" />
- <di:waypoint x="1193" y="645" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1067" y="560" width="27" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1t19ips_di" bpmnElement="SequenceFlow_1t19ips">
- <di:waypoint x="1293" y="121" />
- <di:waypoint x="1370" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1p8vxo5_di" bpmnElement="SequenceFlow_1p8vxo5">
- <di:waypoint x="567" y="289" />
- <di:waypoint x="645" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1g8m7tq_di" bpmnElement="SequenceFlow_1g8m7tq">
- <di:waypoint x="745" y="289" />
- <di:waypoint x="830" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0it2g9j_di" bpmnElement="SequenceFlow_0it2g9j">
- <di:waypoint x="1471" y="289" />
- <di:waypoint x="1584" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_18kur12_di" bpmnElement="SequenceFlow_18kur12">
- <di:waypoint x="1293" y="289" />
- <di:waypoint x="1371" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0mlrlbv_di" bpmnElement="SequenceFlow_0mlrlbv">
- <di:waypoint x="385" y="801" />
- <di:waypoint x="488" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1c6ka9h_di" bpmnElement="SequenceFlow_1c6ka9h">
- <di:waypoint x="513" y="826" />
- <di:waypoint x="513" y="926" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="521" y="832" width="15" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0n4xku8_di" bpmnElement="SequenceFlow_0n4xku8">
- <di:waypoint x="538" y="801" />
- <di:waypoint x="645" y="801" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="584" y="783" width="18" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0klb3ey_di" bpmnElement="SequenceFlow_0klb3ey">
- <di:waypoint x="923" y="801" />
- <di:waypoint x="1005" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_11rbv41_di" bpmnElement="SequenceFlow_11rbv41">
- <di:waypoint x="1475" y="801" />
- <di:waypoint x="1585" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0t094g7_di" bpmnElement="SequenceFlow_0t094g7">
- <di:waypoint x="568" y="121" />
- <di:waypoint x="645" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1o1tu0f_di" bpmnElement="SequenceFlow_1o1tu0f">
- <di:waypoint x="214" y="289" />
- <di:waypoint x="285" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0lbdfmt_di" bpmnElement="SequenceFlow_0lbdfmt">
- <di:waypoint x="1105" y="801" />
- <di:waypoint x="1197" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1">
- <di:waypoint x="1297" y="801" />
- <di:waypoint x="1375" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0q7yc2c_di" bpmnElement="SequenceFlow_0q7yc2c">
- <di:waypoint x="1115" y="121" />
- <di:waypoint x="1193" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1sq6kp6_di" bpmnElement="SequenceFlow_1sq6kp6">
- <di:waypoint x="385" y="289" />
- <di:waypoint x="467" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0thd6ny_di" bpmnElement="SequenceFlow_0thd6ny">
- <di:waypoint x="1293" y="456" />
- <di:waypoint x="1371" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0477975_di" bpmnElement="SequenceFlow_0477975">
- <di:waypoint x="1471" y="456" />
- <di:waypoint x="1584" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0h2oree_di" bpmnElement="SequenceFlow_0h2oree">
- <di:waypoint x="567" y="456" />
- <di:waypoint x="645" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_19lsayh_di" bpmnElement="SequenceFlow_19lsayh">
- <di:waypoint x="1293" y="645" />
- <di:waypoint x="1371" y="645" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_10ng1vx_di" bpmnElement="SequenceFlow_10ng1vx">
- <di:waypoint x="1471" y="645" />
- <di:waypoint x="1584" y="645" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1bevt3a_di" bpmnElement="SequenceFlow_1bevt3a">
- <di:waypoint x="214" y="801" />
- <di:waypoint x="285" y="801" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1ey6m1e_di" bpmnElement="SequenceFlow_1ey6m1e">
- <di:waypoint x="930" y="289" />
- <di:waypoint x="1015" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56">
- <dc:Bounds x="715" y="1166" width="36" height="36" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026">
- <dc:Bounds x="1353" y="1166" width="36" height="36" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw">
- <dc:Bounds x="979" y="1144" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s">
- <di:waypoint x="751" y="1184" />
- <di:waypoint x="979" y="1184" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz">
- <di:waypoint x="1079" y="1184" />
- <di:waypoint x="1353" y="1184" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ReceiveTask_0zkpdpa_di" bpmnElement="Task_1b5t88h">
<dc:Bounds x="285" y="416" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1fk37v7_di" bpmnElement="SequenceFlow_1fk37v7">
- <di:waypoint x="214" y="456" />
- <di:waypoint x="285" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_16uz2t9_di" bpmnElement="SequenceFlow_16uz2t9">
- <di:waypoint x="385" y="456" />
- <di:waypoint x="467" y="456" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="BoundaryEvent_15igwk2_di" bpmnElement="BoundaryEvent_0clo9pv">
- <dc:Bounds x="317" y="478" width="36" height="36" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_12qt5ci_di" bpmnElement="SequenceFlow_12qt5ci">
- <di:waypoint x="335" y="514" />
- <di:waypoint x="335" y="611" />
- <di:waypoint x="335" y="593" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0v4mw2x_di" bpmnElement="CallActivity_0v4mw2x">
<dc:Bounds x="1015" y="249" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1aaozcg_di" bpmnElement="SequenceFlow_1aaozcg">
- <di:waypoint x="1115" y="289" />
- <di:waypoint x="1193" y="289" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_046irye_di" bpmnElement="SequenceFlow_046irye">
- <di:waypoint x="745" y="121" />
- <di:waypoint x="830" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1o23s0i_di" bpmnElement="SequenceFlow_1o23s0i">
- <di:waypoint x="930" y="121" />
- <di:waypoint x="1015" y="121" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0jrclmc_di" bpmnElement="SequenceFlow_0jrclmc">
- <di:waypoint x="1470" y="121" />
- <di:waypoint x="1584" y="121" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8">
<dc:Bounds x="645" y="761" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj">
- <di:waypoint x="745" y="801" />
- <di:waypoint x="823" y="801" />
- </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="BoundaryEvent_15igwk2_di" bpmnElement="BoundaryEvent_0clo9pv">
+ <dc:Bounds x="317" y="478" width="36" height="36" />
+ </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfHealthCheck.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfHealthCheck.bpmn
index 1722137056..36f6221da9 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfHealthCheck.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfHealthCheck.bpmn
@@ -56,7 +56,7 @@ taskProcessor.prepareCompletion(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_05haut5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_09y0mpc</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_00psvtk" name="Call FalloutHandler" calledElement="FalloutHandler">
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSWUPDownload.bpmn
index 5d523194bb..8b1b8367f8 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSWUPDownload.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSWUPDownload.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: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" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0474hns" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.0">
- <bpmn:process id="PNFSWUPDownload" name="PNFSWUPDownload" isExecutable="true">
+ <bpmn:process id="GenericPnfSWUPDownload" name="GenericPnfSWUPDownload" isExecutable="true">
<bpmn:startEvent id="download_StartEvent" name="Start Flow">
<bpmn:outgoing>SequenceFlow_1fdclh0</bpmn:outgoing>
</bpmn:startEvent>
@@ -95,7 +95,7 @@
<bpmn:incoming>SequenceFlow_0swi04u</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1ppn4a8</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_0ikcgtm" name="Call FalloutHandler" calledElement="FalloutHandler">
@@ -117,7 +117,7 @@ pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_0kusy70</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_12155q6</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.sendResponse(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0kusy70" sourceRef="ServiceTask_1mpt2eq" targetRef="ScriptTask_1ankfw8" />
@@ -125,7 +125,7 @@ pnfSwUpgrade.sendResponse(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_1d2rfyx</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_183s0wo</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_0tq2dug" name="Complete Process" calledElement="CompleteMsoProcess">
@@ -143,7 +143,7 @@ pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
</bpmn:process>
<bpmn:error id="Error_1q14dnd" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PNFSWUPDownload">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="GenericPnfSWUPDownload">
<bpmndi:BPMNShape id="StartEvent_1k8gssq_di" bpmnElement="download_StartEvent">
<dc:Bounds x="172" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSoftwareUpgrade.bpmn
index 4ff0af4549..f4a6196fc1 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/PNFSoftwareUpgrade.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/GenericPnfSoftwareUpgrade.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:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yd8m0g" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.0">
- <bpmn:process id="PNFSoftwareUpgrade" name="PNFSoftwareUpgrade" isExecutable="true">
+ <bpmn:process id="GenericPnfSoftwareUpgrade" name="GenericPnfSoftwareUpgrade" isExecutable="true">
<bpmn:startEvent id="softwareUpgrade_startEvent" name="Start Flow">
<bpmn:outgoing>SequenceFlow_1ng4b6l</bpmn:outgoing>
</bpmn:startEvent>
@@ -123,7 +123,7 @@
<bpmn:incoming>SequenceFlow_12ejx4m</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ks3p41</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.sendResponse(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0ks3p41" sourceRef="ScriptTask_10klpg8" targetRef="ServiceTask_0slpahe" />
@@ -131,7 +131,7 @@ pnfSwUpgrade.sendResponse(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_1atiydu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ipc3nt</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0ipc3nt" sourceRef="ScriptTask_1igtc83" targetRef="CallActivity_0o1mi8u" />
@@ -152,7 +152,7 @@ pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_05haut5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_09y0mpc</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_00psvtk" name="Call FalloutHandler" calledElement="FalloutHandler">
@@ -173,7 +173,7 @@ pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
</bpmn:process>
<bpmn:error id="Error_12cpov5" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PNFSoftwareUpgrade">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="GenericPnfSoftwareUpgrade">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="softwareUpgrade_startEvent">
<dc:Bounds x="162" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn
index a1d4178962..3d37430723 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn
@@ -55,14 +55,14 @@
<bpmn:incoming>Flow_1b392qs</bpmn:incoming>
<bpmn:outgoing>Flow_1v0mxe7</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.sendResponse(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:scriptTask id="Activity_1n4rk7m" name="Prepare Completion" scriptFormat="groovy">
<bpmn:incoming>Flow_0l67uzl</bpmn:incoming>
<bpmn:outgoing>Flow_0frhsd0</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="Activity_1lz38px" name="Complete Process" calledElement="CompleteMsoProcess">
@@ -78,7 +78,7 @@ pnfSwUpgrade.prepareCompletion(execution)</bpmn:script>
<bpmn:incoming>Flow_0iayg6u</bpmn:incoming>
<bpmn:outgoing>Flow_0lb7zv5</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def pnfSwUpgrade = new PNFSoftwareUpgrade()
+def pnfSwUpgrade = new GenericPnfSoftwareUpgrade()
pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="Activity_0ai3z2q" name="Call FalloutHandler" calledElement="FalloutHandler">
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn
index ad0732df4d..3ed1999d9a 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn
@@ -1,17 +1,17 @@
<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.4.1">
+<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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1">
<bpmn:process id="DoCreateSliceServiceOption" name="DoCreateSliceServiceOption" isExecutable="true">
<bpmn:startEvent id="createNS_StartEvent" name="createOption_StartEvent">
<bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1qo2pln" sourceRef="createNS_StartEvent" targetRef="PreprocessIncomingRequest_task" />
<bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="Task_09nzhwk" />
- <bpmn:scriptTask id="Task_09nzhwk" name="send request to OOF for NSI options" scriptFormat="groovy">
+ <bpmn:scriptTask id="Task_09nzhwk" name="Prepare OOF Select NSI options request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1utpplq</bpmn:outgoing>
+ <bpmn:outgoing>Flow_15c2jcx</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcso = new DoCreateSliceServiceOption()
-dcso.getNSIOptionfromOOF(execution)</bpmn:script>
+dcso.prepareSelectNSIRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:scriptTask id="PreprocessIncomingRequest_task" name="Preprocess Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_1qo2pln</bpmn:incoming>
@@ -73,7 +73,6 @@ dcso.prepareNSSTDecompose(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_0a5f5y6</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="SequenceFlow_0a5f5y6" sourceRef="CallActivity_1rfnoe2" targetRef="ScriptTask_1mlytov" />
- <bpmn:sequenceFlow id="SequenceFlow_1utpplq" sourceRef="Task_09nzhwk" targetRef="ScriptTask_1umbyel" />
<bpmn:exclusiveGateway id="ExclusiveGateway_1skfk7w" default="SequenceFlow_0wy6oag">
<bpmn:incoming>SequenceFlow_0d774n5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0wy6oag</bpmn:outgoing>
@@ -84,7 +83,7 @@ dcso.prepareNSSTDecompose(execution)</bpmn:script>
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{(execution.getVariable("isNSISuggested" ) == true)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:scriptTask id="ScriptTask_1umbyel" name="prepare NST decomposition" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1utpplq</bpmn:incoming>
+ <bpmn:incoming>Flow_07ustqm</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0piifl1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcso = new DoCreateSliceServiceOption()
@@ -112,124 +111,159 @@ dcso.prepareNSTDecompose(execution)</bpmn:script>
def dcso = new DoCreateSliceServiceOption()
dcso.processDecomposition(execution)</bpmn:script>
</bpmn:scriptTask>
+ <bpmn:callActivity id="Activity_0dlr4ra" name="Handle NSI Selection OOF request" calledElement="DoHandleOofRequest">
+ <bpmn:extensionElements>
+ <camunda:in source="nsiSelectionUrl" target="apiPath" />
+ <camunda:in source="nsiSelection_correlator" target="correlator" />
+ <camunda:in source="nsiSelection_messageType" target="messageType" />
+ <camunda:in source="nsiSelection_timeout" target="timeout" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:out source="asyncCallbackResponse" target="nsiSelection_oofResponse" />
+ <camunda:in source="nsiSelection_oofRequest" target="oofRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>Flow_15c2jcx</bpmn:incoming>
+ <bpmn:outgoing>Flow_1mcx2ja</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:scriptTask id="Activity_049mjag" name="Process OOF response " scriptFormat="groovy">
+ <bpmn:incoming>Flow_1mcx2ja</bpmn:incoming>
+ <bpmn:outgoing>Flow_07ustqm</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def dcso = new DoCreateSliceServiceOption()
+dcso.processOOFResponse(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="Flow_1mcx2ja" sourceRef="Activity_0dlr4ra" targetRef="Activity_049mjag" />
+ <bpmn:sequenceFlow id="Flow_15c2jcx" sourceRef="Task_09nzhwk" targetRef="Activity_0dlr4ra" />
+ <bpmn:sequenceFlow id="Flow_07ustqm" sourceRef="Activity_049mjag" targetRef="ScriptTask_1umbyel" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateSliceServiceOption">
- <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="createNS_StartEvent">
- <dc:Bounds x="175" y="107" width="36" height="36" />
+ <bpmndi:BPMNEdge id="SequenceFlow_0d774n5_di" bpmnElement="SequenceFlow_0d774n5">
+ <di:waypoint x="1220" y="125" />
+ <di:waypoint x="1275" y="125" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_086yszq_di" bpmnElement="SequenceFlow_086yszq">
+ <di:waypoint x="1060" y="125" />
+ <di:waypoint x="1120" y="125" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0piifl1_di" bpmnElement="SequenceFlow_0piifl1">
+ <di:waypoint x="920" y="125" />
+ <di:waypoint x="960" y="125" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0hnsycl_di" bpmnElement="SequenceFlow_0hnsycl">
+ <di:waypoint x="1325" y="125" />
+ <di:waypoint x="1993" y="125" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0wy6oag_di" bpmnElement="SequenceFlow_0wy6oag">
+ <di:waypoint x="1300" y="150" />
+ <di:waypoint x="1300" y="351" />
+ <di:waypoint x="1430" y="351" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0a5f5y6_di" bpmnElement="SequenceFlow_0a5f5y6">
+ <di:waypoint x="2061" y="351" />
+ <di:waypoint x="2148" y="351" />
+ <di:waypoint x="2148" y="493" />
+ <di:waypoint x="1960" y="493" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_016vi3s_di" bpmnElement="SequenceFlow_016vi3s">
+ <di:waypoint x="1872" y="351" />
+ <di:waypoint x="1961" y="351" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1r9n9ef_di" bpmnElement="SequenceFlow_1r9n9ef">
+ <di:waypoint x="1860" y="493" />
+ <di:waypoint x="1666" y="493" />
+ <di:waypoint x="1666" y="376" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0m2mr0o_di" bpmnElement="SequenceFlow_0m2mr0o">
+ <di:waypoint x="1691" y="351" />
+ <di:waypoint x="1772" y="351" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0lt2cdo_di" bpmnElement="SequenceFlow_0lt2cdo">
+ <di:waypoint x="1530" y="351" />
+ <di:waypoint x="1641" y="351" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ap8kar_di" bpmnElement="SequenceFlow_1ap8kar">
+ <di:waypoint x="1666" y="326" />
+ <di:waypoint x="1666" y="235" />
+ <di:waypoint x="2011" y="235" />
+ <di:waypoint x="2011" y="143" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova">
+ <di:waypoint x="350" y="125" />
+ <di:waypoint x="390" y="125" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="151" y="143" width="86" height="27" />
+ <dc:Bounds x="436" y="108" width="0" height="12" />
</bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
+ </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln">
- <di:waypoint x="211" y="125" />
- <di:waypoint x="251" y="125" />
- <di:waypoint x="251" y="125" />
- <di:waypoint x="293" y="125" />
+ <di:waypoint x="218" y="125" />
+ <di:waypoint x="250" y="125" />
<bpmndi:BPMNLabel>
<dc:Bounds x="266" y="123" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova">
- <di:waypoint x="393" y="125" />
- <di:waypoint x="460" y="125" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="436" y="108" width="0" height="12" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNEdge id="Flow_1mcx2ja_di" bpmnElement="Flow_1mcx2ja">
+ <di:waypoint x="640" y="125" />
+ <di:waypoint x="680" y="125" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_15c2jcx_di" bpmnElement="Flow_15c2jcx">
+ <di:waypoint x="490" y="122" />
+ <di:waypoint x="540" y="120" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_07ustqm_di" bpmnElement="Flow_07ustqm">
+ <di:waypoint x="780" y="125" />
+ <di:waypoint x="820" y="125" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_1dw39hg_di" bpmnElement="Task_09nzhwk">
- <dc:Bounds x="460" y="85" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task">
- <dc:Bounds x="293" y="85" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
- <dc:Bounds x="1813" y="107" width="36" height="36" />
+ <dc:Bounds x="1993" y="107" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="412" y="617" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0kecvrc_di" bpmnElement="ScriptTask_0kecvrc">
- <dc:Bounds x="1250" y="311" width="100" height="80" />
+ <dc:Bounds x="1430" y="311" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1mlytov_di" bpmnElement="ScriptTask_1mlytov">
- <dc:Bounds x="1680" y="453" width="100" height="80" />
+ <dc:Bounds x="1860" y="453" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_1y1wzs9_di" bpmnElement="ExclusiveGateway_1y1wzs9" isMarkerVisible="true">
- <dc:Bounds x="1461" y="326" width="50" height="50" />
+ <dc:Bounds x="1641" y="326" width="50" height="50" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1ap8kar_di" bpmnElement="SequenceFlow_1ap8kar">
- <di:waypoint x="1486" y="326" />
- <di:waypoint x="1486" y="235" />
- <di:waypoint x="1831" y="235" />
- <di:waypoint x="1831" y="143" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0lt2cdo_di" bpmnElement="SequenceFlow_0lt2cdo">
- <di:waypoint x="1350" y="351" />
- <di:waypoint x="1461" y="351" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0m2mr0o_di" bpmnElement="SequenceFlow_0m2mr0o">
- <di:waypoint x="1511" y="351" />
- <di:waypoint x="1592" y="351" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1r9n9ef_di" bpmnElement="SequenceFlow_1r9n9ef">
- <di:waypoint x="1680" y="493" />
- <di:waypoint x="1486" y="493" />
- <di:waypoint x="1486" y="376" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1e5ysya_di" bpmnElement="ScriptTask_1e5ysya">
- <dc:Bounds x="1592" y="311" width="100" height="80" />
+ <dc:Bounds x="1772" y="311" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_016vi3s_di" bpmnElement="SequenceFlow_016vi3s">
- <di:waypoint x="1692" y="351" />
- <di:waypoint x="1781" y="351" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_1rfnoe2_di" bpmnElement="CallActivity_1rfnoe2">
- <dc:Bounds x="1781" y="311" width="100" height="80" />
+ <dc:Bounds x="1961" y="311" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0a5f5y6_di" bpmnElement="SequenceFlow_0a5f5y6">
- <di:waypoint x="1881" y="351" />
- <di:waypoint x="1968" y="351" />
- <di:waypoint x="1968" y="493" />
- <di:waypoint x="1780" y="493" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1utpplq_di" bpmnElement="SequenceFlow_1utpplq">
- <di:waypoint x="560" y="125" />
- <di:waypoint x="620" y="125" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_1skfk7w_di" bpmnElement="ExclusiveGateway_1skfk7w" isMarkerVisible="true">
- <dc:Bounds x="1095" y="100" width="50" height="50" />
+ <dc:Bounds x="1275" y="100" width="50" height="50" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0wy6oag_di" bpmnElement="SequenceFlow_0wy6oag">
- <di:waypoint x="1120" y="150" />
- <di:waypoint x="1120" y="351" />
- <di:waypoint x="1250" y="351" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0hnsycl_di" bpmnElement="SequenceFlow_0hnsycl">
- <di:waypoint x="1145" y="125" />
- <di:waypoint x="1813" y="125" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_1umbyel_di" bpmnElement="ScriptTask_1umbyel">
- <dc:Bounds x="620" y="85" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0piifl1_di" bpmnElement="SequenceFlow_0piifl1">
- <di:waypoint x="720" y="125" />
- <di:waypoint x="780" y="125" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0ly8xiw_di" bpmnElement="CallActivity_0ly8xiw">
- <dc:Bounds x="780" y="85" width="100" height="80" />
+ <dc:Bounds x="960" y="85" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_086yszq_di" bpmnElement="SequenceFlow_086yszq">
- <di:waypoint x="880" y="125" />
- <di:waypoint x="940" y="125" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0d774n5_di" bpmnElement="SequenceFlow_0d774n5">
- <di:waypoint x="1040" y="125" />
- <di:waypoint x="1095" y="125" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1895p18_di" bpmnElement="Task_1k2ypj0">
- <dc:Bounds x="940" y="85" width="100" height="80" />
+ <dc:Bounds x="1120" y="85" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="createNS_StartEvent">
+ <dc:Bounds x="182" y="107" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="158" y="143" width="86" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task">
+ <dc:Bounds x="250" y="85" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1dw39hg_di" bpmnElement="Task_09nzhwk">
+ <dc:Bounds x="390" y="85" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_049mjag_di" bpmnElement="Activity_049mjag">
+ <dc:Bounds x="680" y="85" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_0dlr4ra_di" bpmnElement="Activity_0dlr4ra">
+ <dc:Bounds x="540" y="85" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1umbyel_di" bpmnElement="ScriptTask_1umbyel">
+ <dc:Bounds x="820" y="85" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions> \ No newline at end of file
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoHandleOofRequest.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoHandleOofRequest.bpmn
new file mode 100644
index 0000000000..7ca1a62312
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoHandleOofRequest.bpmn
@@ -0,0 +1,122 @@
+<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0nlt5gi" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1">
+ <bpmn:process id="DoHandleOofRequest" name="DoHandleOofRequest" isExecutable="true">
+ <bpmn:startEvent id="StartEvent_1">
+ <bpmn:outgoing>Flow_1jorico</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:sequenceFlow id="Flow_1fbzzqg" sourceRef="Activity_0tki17o" targetRef="Activity_08ozlfa" />
+ <bpmn:scriptTask id="Activity_08ozlfa" name="Call Oof Adapter" scriptFormat="groovy">
+ <bpmn:incoming>Flow_1fbzzqg</bpmn:incoming>
+ <bpmn:outgoing>Flow_013jfci</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.common.scripts.*
+def oofHandler = new DoHandleOofRequest()
+oofHandler .callOofAdapter(execution)
+</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="Flow_1jorico" sourceRef="StartEvent_1" targetRef="Activity_0tki17o" />
+ <bpmn:scriptTask id="Activity_0tki17o" name="Preprocess Request" scriptFormat="groovy">
+ <bpmn:incoming>Flow_1jorico</bpmn:incoming>
+ <bpmn:outgoing>Flow_1fbzzqg</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.common.scripts.*
+def oofHandler = new DoHandleOofRequest()
+oofHandler .preProcessRequest(execution)
+</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:subProcess id="Activity_02ru8n9" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true">
+ <bpmn:startEvent id="Event_1r00tca">
+ <bpmn:outgoing>Flow_072knve</bpmn:outgoing>
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_1sy4yh2" />
+ </bpmn:startEvent>
+ <bpmn:endEvent id="Event_1rwmekw">
+ <bpmn:incoming>Flow_0ykpxpc</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:scriptTask id="Activity_11rvko0" name="Handle Unexpected Error" scriptFormat="groovy">
+ <bpmn:incoming>Flow_072knve</bpmn:incoming>
+ <bpmn:outgoing>Flow_0ykpxpc</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.common.scripts.*
+ExceptionUtil ex = new ExceptionUtil()
+ex.processJavaException(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="Flow_0ykpxpc" sourceRef="Activity_11rvko0" targetRef="Event_1rwmekw" />
+ <bpmn:sequenceFlow id="Flow_072knve" sourceRef="Event_1r00tca" targetRef="Activity_11rvko0" />
+ </bpmn:subProcess>
+ <bpmn:callActivity id="Activity_1yq993l" name="Receive Async Callback" camunda:modelerTemplate="receiveWorkflowMessage" calledElement="ReceiveWorkflowMessage">
+ <bpmn:extensionElements>
+ <camunda:in source="true" target="isDebugLogEnabled" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:in source="messageType" target="RCVWFMSG_messageType" />
+ <camunda:in source="correlator" target="RCVWFMSG_correlator" />
+ <camunda:in source="timeout" target="RCVWFMSG_timeout" />
+ <camunda:out source="WorkflowResponse" target="asyncCallbackResponse" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>Flow_013jfci</bpmn:incoming>
+ <bpmn:outgoing>Flow_1nmoiqi</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="Flow_013jfci" sourceRef="Activity_08ozlfa" targetRef="Activity_1yq993l" />
+ <bpmn:endEvent id="Event_179tp7r" name="End event">
+ <bpmn:incoming>Flow_1nmoiqi</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="Flow_1nmoiqi" sourceRef="Activity_1yq993l" targetRef="Event_179tp7r" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoHandleOofRequest">
+ <bpmndi:BPMNEdge id="Flow_1jorico_di" bpmnElement="Flow_1jorico">
+ <di:waypoint x="218" y="130" />
+ <di:waypoint x="270" y="130" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_1fbzzqg_di" bpmnElement="Flow_1fbzzqg">
+ <di:waypoint x="370" y="130" />
+ <di:waypoint x="450" y="130" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_013jfci_di" bpmnElement="Flow_013jfci">
+ <di:waypoint x="550" y="130" />
+ <di:waypoint x="641" y="130" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_1nmoiqi_di" bpmnElement="Flow_1nmoiqi">
+ <di:waypoint x="741" y="127" />
+ <di:waypoint x="832" y="127" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
+ <dc:Bounds x="182" y="112" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="154" y="142" width="87" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_1nfzvjq_di" bpmnElement="Activity_0tki17o">
+ <dc:Bounds x="270" y="90" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_0wi75kt_di" bpmnElement="Activity_08ozlfa">
+ <dc:Bounds x="450" y="90" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_1yq993l_di" bpmnElement="Activity_1yq993l">
+ <dc:Bounds x="641" y="87" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Event_179tp7r_di" bpmnElement="Event_179tp7r">
+ <dc:Bounds x="832" y="109" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="826" y="152" width="50" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_02ru8n9_di" bpmnElement="Activity_02ru8n9" isExpanded="true">
+ <dc:Bounds x="160" y="420" width="781" height="196" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Flow_0ykpxpc_di" bpmnElement="Flow_0ykpxpc">
+ <di:waypoint x="554" y="524" />
+ <di:waypoint x="828" y="524" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="Flow_072knve_di" bpmnElement="Flow_072knve">
+ <di:waypoint x="226" y="524" />
+ <di:waypoint x="454" y="524" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="Event_1r00tca_di" bpmnElement="Event_1r00tca">
+ <dc:Bounds x="190" y="506" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Event_1rwmekw_di" bpmnElement="Event_1rwmekw">
+ <dc:Bounds x="828" y="506" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Activity_11rvko0_di" bpmnElement="Activity_11rvko0">
+ <dc:Bounds x="454" y="484" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSWUPDownloadTest.java
index a0ef90d7b8..b9c5fdf145 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSWUPDownloadTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSWUPDownloadTest.java
@@ -49,15 +49,15 @@ import static org.assertj.core.api.Assertions.fail;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
/**
- * Basic Integration test for PNFSWUPDownloadTest.bpmn workflow.
+ * Basic Integration test for GenericPnfSWUPDownloadTest.bpmn workflow.
*/
-public class PNFSWUPDownloadTest extends BaseBPMNTest {
+public class GenericPnfSWUPDownloadTest extends BaseBPMNTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
private static final long WORKFLOW_WAIT_TIME = 1000L;
- private static final String TEST_PROCESSINSTANCE_KEY = "PNFSWUPDownload";
+ private static final String TEST_PROCESSINSTANCE_KEY = "GenericPnfSWUPDownload";
private static final AAIVersion VERSION = AAIVersion.LATEST;
private static final Map<String, Object> executionVariables = new HashMap();
private final String[] actionNames = new String[3];
@@ -76,8 +76,8 @@ public class PNFSWUPDownloadTest extends BaseBPMNTest {
executionVariables.clear();
- requestObject = FileUtil.readResourceFile("request/PNFSoftwareUpgradeTest.json");
- responseObject = FileUtil.readResourceFile("response/PNFSoftwareUpgradeTest.json");
+ requestObject = FileUtil.readResourceFile("request/GenericPnfSoftwareUpgradeTest.json");
+ responseObject = FileUtil.readResourceFile("response/GenericPnfSoftwareUpgradeTest.json");
executionVariables.put("bpmnRequest", requestObject);
@@ -136,7 +136,7 @@ public class PNFSWUPDownloadTest extends BaseBPMNTest {
}
} catch (Exception e) {
e.printStackTrace();
- fail("PNFSWUPDownload request exception", e);
+ fail("GenericPnfSWUPDownload request exception", e);
}
assertThat(count == actionNames.length);
}
@@ -152,7 +152,8 @@ public class PNFSWUPDownloadTest extends BaseBPMNTest {
ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
/**
- * the fields of actionIdentifiers should match the one in the response/PNFSoftwareUpgrade_catalogdb.json.
+ * the fields of actionIdentifiers should match the one in the
+ * response/GenericPnfSoftwareUpgradeTest_catalogdb.json.
*/
Assertions.assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_pnf_software_upgrade_restconf");
Assertions.assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0");
@@ -202,7 +203,8 @@ public class PNFSWUPDownloadTest extends BaseBPMNTest {
*/
private void mockCatalogDb() {
- String catalogdbClientResponse = FileUtil.readResourceFile("response/PNFSoftwareUpgradeTest_catalogdb.json");
+ String catalogdbClientResponse =
+ FileUtil.readResourceFile("response/GenericPnfSoftwareUpgradeTest_catalogdb.json");
/**
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java
index 0bf14d7443..de81f91e66 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/PNFSoftwareUpgradeTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java
@@ -49,15 +49,15 @@ import static org.assertj.core.api.Assertions.fail;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
/**
- * Basic Integration test for PNFSoftwareUpgrade.bpmn workflow.
+ * Basic Integration test for GenericPnfSoftwareUpgrade.bpmn workflow.
*/
-public class PNFSoftwareUpgradeTest extends BaseBPMNTest {
+public class GenericPnfSoftwareUpgradeTest extends BaseBPMNTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
private static final long WORKFLOW_WAIT_TIME = 1000L;
- private static final String TEST_PROCESSINSTANCE_KEY = "PNFSoftwareUpgrade";
+ private static final String TEST_PROCESSINSTANCE_KEY = "GenericPnfSoftwareUpgrade";
private static final AAIVersion VERSION = AAIVersion.LATEST;
private static final Map<String, Object> executionVariables = new HashMap();
private static final String REQUEST_ID = "50ae41ad-049c-4fe2-9950-539f111120f5";
@@ -140,7 +140,7 @@ public class PNFSoftwareUpgradeTest extends BaseBPMNTest {
}
} catch (Exception e) {
e.printStackTrace();
- fail("PNFSoftwareUpgrade request exception", e);
+ fail("GenericPnfSoftwareUpgrade request exception", e);
}
assertThat(count == actionNames.length);
}
@@ -156,7 +156,8 @@ public class PNFSoftwareUpgradeTest extends BaseBPMNTest {
ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
/**
- * the fields of actionIdentifiers should match the one in the response/PNFSoftwareUpgrade_catalogdb.json.
+ * the fields of actionIdentifiers should match the one in the
+ * response/GenericPnfSoftwareUpgrade_catalogdb.json.
*/
assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_pnf_software_upgrade_restconf");
assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0");
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/ServiceLevelUpgradeTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/ServiceLevelUpgradeTest.java
index 00dda299b6..bdad46f3ca 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/ServiceLevelUpgradeTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/ServiceLevelUpgradeTest.java
@@ -145,7 +145,7 @@ public class ServiceLevelUpgradeTest extends BaseBPMNTest {
}
} catch (Exception e) {
e.printStackTrace();
- fail("PNFSoftwareUpgrade request exception", e);
+ fail("GenericPnfSoftwareUpgrade request exception", e);
}
assertThat(count == actionNames.length);
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/GenericPnfSoftwareUpgradeTest.json
index a101118623..a101118623 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/PNFSoftwareUpgradeTest.json
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/request/GenericPnfSoftwareUpgradeTest.json
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest.json
index 32539844ba..32539844ba 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest.json
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest.json
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest_catalogdb.json
index faec947fec..faec947fec 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/PNFSoftwareUpgradeTest_catalogdb.json
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/response/GenericPnfSoftwareUpgradeTest_catalogdb.json
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/level/impl/ServiceLevelConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/level/impl/ServiceLevelConstants.java
index d94641846d..7b73fff20c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/level/impl/ServiceLevelConstants.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/level/impl/ServiceLevelConstants.java
@@ -45,7 +45,7 @@ public class ServiceLevelConstants {
Map.of(PNF, "GenericPnfHealthCheck", VNF, "GenericVNFHealthCheck");
public static final Map<String, String> DEFAULT_SOFTWARE_UP_WORKFLOWS =
- Map.of(PNF, "PNFSoftwareUpgrade", VNF, "GenericVnfSoftwareUpgrade");
+ Map.of(PNF, "GenericPnfSoftwareUpgrade", VNF, "GenericVnfSoftwareUpgrade");
// Maps operation name with workflows
public static final Map<String, Map<String, String>> WORKFLOW_OPERATIONS_MAP = Map.of(HEALTH_CHECK_OPERATION,
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 75d3ddf2e6..9b9433afdb 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
@@ -300,6 +300,9 @@ public class WorkflowAction {
|| ("recreateInstance".equalsIgnoreCase(requestAction)))) {
traverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
workflowResourceIds.getVnfId(), aaiResourceIds);
+ } else if (resourceType == WorkflowType.VNF && "updateInstance".equalsIgnoreCase(requestAction)) {
+ customTraverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
+ workflowResourceIds.getVnfId(), aaiResourceIds);
} else {
buildAndThrowException(execution, "Current Macro Request is not supported");
}
@@ -568,6 +571,10 @@ public class WorkflowAction {
WorkflowResourceIds workflowIdsCopy = SerializationUtils.clone(dataObj.getWorkflowResourceIds());
org.onap.aai.domain.yang.Configuration configuration = getRelatedResourcesInVnfc(vnfc,
org.onap.aai.domain.yang.Configuration.class, AAIObjectType.CONFIGURATION);
+ if (configuration == null) {
+ logger.warn(String.format("No configuration found for VNFC %s in AAI", vnfc.getVnfcName()));
+ continue;
+ }
workflowIdsCopy.setConfigurationId(configuration.getConfigurationId());
for (OrchestrationFlow orchFlow : result) {
dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID);
@@ -584,7 +591,6 @@ public class WorkflowAction {
dataObj.getRequestAction(), dataObj.isaLaCarte(), dataObj.getVnfType(), workflowIdsCopy,
dataObj.getRequestDetails(), false, null, vnfcName, true, null);
flowsToExecuteConfigs.add(ebb);
-
}
}
return flowsToExecuteConfigs;
@@ -1108,6 +1114,51 @@ public class WorkflowAction {
}
}
+ private void customTraverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId,
+ String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds) {
+ try {
+ ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO =
+ bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
+ resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false));
+ if (serviceInstanceMSO.getVnfs() != null) {
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
+ if (vnf.getVnfId().equals(vnfId)) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
+
+ String vnfCustomizationUUID =
+ bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId();
+ resourceList.add(new Resource(WorkflowType.VNF, vnfCustomizationUUID, false));
+
+ if (vnf.getVfModules() != null) {
+ for (VfModule vfModule : vnf.getVfModules()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
+ resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false));
+ findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(),
+ resourceList, aaiResourceIds);
+ }
+ }
+ if (vnf.getVolumeGroups() != null) {
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf
+ .getVolumeGroups()) {
+ aaiResourceIds
+ .add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
+ resourceList.add(
+ new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
+ }
+ }
+ break;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ logger.error("Exception in customTraverseAAIVnf", ex);
+ buildAndThrowException(execution,
+ "Could not find existing Vnf or related Instances to execute the request on.");
+ }
+
+ }
+
private void findConfigurationsInsideVfModule(DelegateExecution execution, String vnfId, String vfModuleId,
List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) {
try {
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 407a844c4e..c1970ec32c 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
@@ -1601,6 +1601,79 @@ public class WorkflowActionTest extends BaseTaskTest {
}
@Test
+ public void getConfigBuildingBlocksNullConfigurationTest() throws Exception {
+ String gAction = "deleteInstance";
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
+
+ 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);
+
+ List<OrchestrationFlow> orchFlows = createFlowList("DeactivateVfModuleBB", "DeleteVfModuleBB",
+ "UnassignVfModuleBB", "DeleteFabricConfigurationBB");
+
+ 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(any())).thenReturn(vnf);
+
+ org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule();
+ vfModule.setModelCustomizationId("modelCustomizationId");
+
+ /* this is a test case where configuration for vnfc is null */
+ org.onap.aai.domain.yang.Configuration config1 = null;
+ org.onap.aai.domain.yang.Configuration config2 = new org.onap.aai.domain.yang.Configuration();
+ config2.setConfigurationId("config2");
+
+ List<org.onap.aai.domain.yang.Vnfc> vnfcs = new ArrayList<org.onap.aai.domain.yang.Vnfc>();
+ org.onap.aai.domain.yang.Vnfc vnfc1 = new org.onap.aai.domain.yang.Vnfc();
+ vnfc1.setVnfcName("zauk53avetd02svm001");
+ org.onap.aai.domain.yang.Vnfc vnfc2 = new org.onap.aai.domain.yang.Vnfc();
+ vnfc2.setVnfcName("zauk53avetd02tvm001");
+ vnfcs.add(vnfc1);
+ vnfcs.add(vnfc2);
+
+ when(bbSetupUtils.getAAIVfModule(any(), any())).thenReturn(vfModule);
+ doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(any(), any(),
+ eq(org.onap.aai.domain.yang.Vnfc.class), eq(AAIObjectType.VNFC));
+ doReturn(config1).when(SPY_workflowAction).getRelatedResourcesInVnfc(eq(vnfc1),
+ eq(org.onap.aai.domain.yang.Configuration.class), eq(AAIObjectType.CONFIGURATION));
+ doReturn(config2).when(SPY_workflowAction).getRelatedResourcesInVnfc(eq(vnfc2),
+ eq(org.onap.aai.domain.yang.Configuration.class), eq(AAIObjectType.CONFIGURATION));
+
+ List<ExecuteBuildingBlock> results = SPY_workflowAction.getConfigBuildingBlocks(dataObj);
+
+ assertFalse(results.isEmpty());
+ assertEquals(1, results.size());
+ assertEquals("config2", results.get(0).getWorkflowResourceIds().getConfigurationId());
+ assertEquals("zauk53avetd02tvm001", results.get(0).getConfigurationResourceKeys().getVnfcName());
+ }
+
+ @Test
public void selectExecutionListALaCarteVfModuleNoFabricDeleteTest() throws Exception {
String gAction = "deleteInstance";
String resource = "VfModule";
diff --git a/common/pom.xml b/common/pom.xml
index 08554480c3..ff13da4ee6 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -271,6 +271,15 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java b/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
new file mode 100644
index 0000000000..5b070bb00f
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class AdditionalProperties implements Serializable {
+
+ private static final long serialVersionUID = -4020397418955518175L;
+
+ private SliceProfile sliceProfile;
+
+ private List<EndPoint> endPoints;
+
+ private NsiInfo nsiInfo;
+
+ private String scriptName;
+
+ private ModifyAction modifyAction;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java
index 484f5b42b1..156f999773 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateAnNssi.java
@@ -25,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AllocateAnNssi {
+ @Deprecated
public final static String URL = "/api/rest/provMns/v1/an/NSS" + "/SliceProfiles";
private String nsstId;
- private String flavorId;
-
private String nssiId;
private String nssiName;
@@ -51,14 +50,6 @@ public class AllocateAnNssi {
this.nsstId = nsstId;
}
- public String getFlavorId() {
- return flavorId;
- }
-
- public void setFlavorId(String flavorId) {
- this.flavorId = flavorId;
- }
-
public String getNssiId() {
return nssiId;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
index d03673368c..bdc2c608e2 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateCnNssi.java
@@ -26,7 +26,9 @@ import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AllocateCnNssi implements Serializable {
+ @Deprecated
public final static String URL = "/api/rest/provMns/v1/NSS/SliceProfiles";
+ private static final long serialVersionUID = 4909074863148869163L;
private String nsstId;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
index b66fb133d2..f85cb0cd85 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
@@ -20,90 +20,17 @@
package org.onap.so.beans.nsmf;
-import com.fasterxml.jackson.annotation.JsonInclude;
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AllocateTnNssi {
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
- public final static String URL = "/api/rest/provMns/v1/tn/NSS" + "/SliceProfiles";
+@Data
+public class AllocateTnNssi implements Serializable {
- private String nsstId;
+ private static final long serialVersionUID = -7069801712339914746L;
- private String flavorId;
+ private List<NetworkSliceInfo> networkSliceInfos;
- private String nssiId;
-
- private String nssiName;
-
- private TnSliceProfile sliceProfile;
-
- private String scriptName;
-
- private Object extension;
-
- private NsiInfo nsiInfo;
-
- public String getNsstId() {
- return nsstId;
- }
-
- public void setNsstId(String nsstId) {
- this.nsstId = nsstId;
- }
-
- public String getFlavorId() {
- return flavorId;
- }
-
- public void setFlavorId(String flavorId) {
- this.flavorId = flavorId;
- }
-
- public String getNssiId() {
- return nssiId;
- }
-
- public void setNssiId(String nssiId) {
- this.nssiId = nssiId;
- }
-
- public String getNssiName() {
- return nssiName;
- }
-
- public void setNssiName(String nssiName) {
- this.nssiName = nssiName;
- }
-
- public TnSliceProfile getSliceProfile() {
- return sliceProfile;
- }
-
- public void setSliceProfile(TnSliceProfile sliceProfile) {
- this.sliceProfile = sliceProfile;
- }
-
- public String getScriptName() {
- return scriptName;
- }
-
- public void setScriptName(String scriptName) {
- this.scriptName = scriptName;
- }
-
- public Object getExtension() {
- return extension;
- }
-
- public void setExtension(Object extension) {
- this.extension = extension;
- }
-
- public NsiInfo getNsiInfo() {
- return nsiInfo;
- }
-
- public void setNsiInfo(NsiInfo nsiInfo) {
- this.nsiInfo = nsiInfo;
- }
+ private List<TransportSliceNetwork> transportSliceNetworks;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java b/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java
new file mode 100644
index 0000000000..418f8a5065
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ */
+
+package org.onap.so.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class AnPerfReq {
+
+ private PerfReqEmbb perfReqEmbb;
+
+ private PerfReqUrllc perfReqUrllc;
+
+ public PerfReqEmbb getPerfReqEmbb() {
+ return perfReqEmbb;
+ }
+
+ public void setPerfReqEmbb(PerfReqEmbb perfReqEmbb) {
+ this.perfReqEmbb = perfReqEmbb;
+ }
+
+ public PerfReqUrllc getPerfReqUrllc() {
+ return perfReqUrllc;
+ }
+
+ public void setPerfReqUrllc(PerfReqUrllc perfReqUrllc) {
+ this.perfReqUrllc = perfReqUrllc;
+ }
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
index 3d60949385..26c3c0012a 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
@@ -21,41 +21,31 @@
package org.onap.so.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
public class AnSliceProfile {
- @JsonProperty("5QI")
- private String qi;
+ private List<String> sNSSAIList;
- private List<String> coverageAreaTAList;
+ private String sliceProfileId;
+
+ private List<Integer> coverageAreaTAList;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private int latency;
- public String getQi() {
- return qi;
- }
+ private List<String> pLMNIdList;
- public void setQi(String qi) {
- this.qi = qi;
- }
+ private AnPerfReq perfReq;
- public List<String> getCoverageAreaTAList() {
- return coverageAreaTAList;
- }
+ @JsonInclude(JsonInclude.Include.NON_DEFAULT)
+ private long maxNumberofUEs;
- public void setCoverageAreaTAList(List<String> coverageAreaTAList) {
- this.coverageAreaTAList = coverageAreaTAList;
- }
+ private UeMobilityLevel uEMobilityLevel;
- public int getLatency() {
- return latency;
- }
+ private ResourceSharingLevel resourceSharingLevel;
- public void setLatency(int latency) {
- this.latency = latency;
- }
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java b/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
new file mode 100644
index 0000000000..99a8525974
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+
+import java.io.Serializable;
+
+
+public class ConnectionLink implements Serializable {
+ private static final long serialVersionUID = -1834584960407180427L;
+
+ private String transportEndpointA;
+
+ private String transportEndpointB;
+
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+
+ public String getTransportEndpointA() {
+ return transportEndpointA;
+ }
+
+ public void setTransportEndpointA(String transportEndpointA) {
+ this.transportEndpointA = transportEndpointA;
+ }
+
+ public String getTransportEndpointB() {
+ return transportEndpointB;
+ }
+
+ public void setTransportEndpointB(String transportEndpointB) {
+ this.transportEndpointB = transportEndpointB;
+ }
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java
index 648fd4985f..1ee83c7db0 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/DeAllocateNssi.java
@@ -26,6 +26,7 @@ import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DeAllocateNssi {
+ @Deprecated
public final static String URL = "/api/rest/provMns/v1/NSS" + "/SliceProfiles/%s";
private String nsiId;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java b/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
new file mode 100644
index 0000000000..dab9b3a990
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/EndPoint.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class EndPoint implements Serializable {
+
+ private static final long serialVersionUID = 2479795890807020491L;
+
+ private String nodeId;
+
+ private Map<String, Object> additionalInfo;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
index d720399293..f8ff5be70e 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
@@ -26,6 +26,7 @@ import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EsrInfo implements Serializable {
+ private static final long serialVersionUID = -7696600990607396263L;
private String vendor;
private NetworkType networkType;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java b/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
new file mode 100644
index 0000000000..57cb2b02aa
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ModifyAction.java
@@ -0,0 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+public enum ModifyAction {
+ allocate, deallocate
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
new file mode 100644
index 0000000000..a190a82646
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NetworkSliceInfo.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+
+import lombok.Data;
+import java.io.Serializable;
+
+@Data
+public class NetworkSliceInfo implements Serializable {
+ private static final long serialVersionUID = 4401921718259398587L;
+
+ private String snssai;
+
+ private String customer;
+
+ private String serviceType;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java
index 0ff554d10d..d1679c6dfa 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NsiInfo.java
@@ -37,11 +37,11 @@ public class NsiInfo {
this.nsiName = nsiName;
}
- public void setNsiId(String nsiId) {
- this.nsiId = nsiId;
- }
-
public String getNsiId() {
return nsiId;
}
+
+ public void setNsiId(String nsiId) {
+ this.nsiId = nsiId;
+ }
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java
index f72a74a063..9a25d6fea3 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NssiAllocateRequest.java
@@ -21,10 +21,15 @@
package org.onap.so.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
-public class NssiAllocateRequest {
+public class NssiAllocateRequest implements Serializable {
+ private static final long serialVersionUID = -454145891489457960L;
+
+ @NotNull
private EsrInfo esrInfo;
private AllocateCnNssi allocateCnNssi;
@@ -33,6 +38,8 @@ public class NssiAllocateRequest {
private AllocateAnNssi allocateAnNssi;
+ private ServiceInfo serviceInfo;
+
public EsrInfo getEsrInfo() {
return esrInfo;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
new file mode 100644
index 0000000000..a44dbd636f
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class NssmfAdapterNBIRequest implements Serializable {
+
+ private static final long serialVersionUID = -454145891489457960L;
+
+ private EsrInfo esrInfo;
+
+ private ServiceInfo serviceInfo;
+
+ private AllocateCnNssi allocateCnNssi;
+
+ private AllocateTnNssi allocateTnNssi;
+
+ private AllocateAnNssi allocateAnNssi;
+
+ private ActDeActNssi actDeActNssi;
+
+ private DeAllocateNssi deAllocateNssi;
+
+ private String subnetCapabilityQuery;
+
+ private String responseId;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
new file mode 100644
index 0000000000..3292730f29
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NssmfRequest.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class NssmfRequest implements Serializable {
+
+ private static final long serialVersionUID = 3313218757241310655L;
+
+ private String name;
+
+ private String modelInvariantUuid;
+
+ private String modelUuid;
+
+ private String globalSubscriberId;
+
+ private String serviceInstanceId;
+
+ private String subscriptionServiceType;
+
+ private NetworkType networkType;
+
+ private Object additionalProperties;
+
+ public NssmfRequest() {}
+
+ public NssmfRequest(ServiceInfo serviceInfo, NetworkType networkType, Object additionalProperties) {
+ this.modelInvariantUuid = serviceInfo.getServiceInvariantUuid();
+ this.modelUuid = serviceInfo.getServiceUuid();
+ this.globalSubscriberId = serviceInfo.getGlobalSubscriberId();
+ this.subscriptionServiceType = serviceInfo.getSubscriptionServiceType();
+ this.networkType = networkType;
+ this.additionalProperties = additionalProperties;
+ this.serviceInstanceId = serviceInfo.getNssiId();
+ this.name = serviceInfo.getNssiName();
+ }
+
+}
+
+
+/**
+ * { "name": "eMBB-001", "modelInvariantUuid": "NSST-C-001-HDBNJ-NSSMF-01-A-ZX", "modelUuid":
+ * "NSST-C-001-HDBNJ-NSSMF-01-A-ZX-UUID", "globalSubscriberId": "5GCustomer", "subscriptionServiceType": "5G",
+ * "networkType": "AN/CN/TN", "additionalProperties": { "sliceProfile": { "snssaiList": [ "001-100001" ],
+ * "sliceProfileId": "ab9af40f13f721b5f13539d87484098", "plmnIdList": [ "460-00", "460-01" ], "perfReq": {
+ * "perfReqEmbbList ": [ { "activityFactor": 50 } ] }, "maxNumberofUEs": 200, "coverageAreaTAList": [ "1", "2", "3", "4"
+ * ], "latency": 2, "resourceSharingLevel": "non-shared" }, "endPoints": [ { "nodeId": "", "additionalInfo": { "xxx":
+ * "xxx" } }, { "nodeId": "", "additionalInfo": { "xxx": "xxx" } } ], "nsiInfo": { "nsiId":
+ * "NSI-M-001-HDBNJ-NSMF-01-A-ZX", "nsiName": "eMBB-001" }, "scriptName": "AN1" } }
+ */
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java
index 4aabc3f26f..c67f193a02 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java
@@ -26,23 +26,23 @@ import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PerfReq {
- private List<PerfReqEmbbList> perfReqEmbbList;
+ private List<PerfReqEmbb> perfReqEmbbList;
- private List<PerfReqUrllcList> perfReqUrllcList;
+ private List<PerfReqUrllc> perfReqUrllcList;
- public List<PerfReqEmbbList> getPerfReqEmbbList() {
+ public List<PerfReqEmbb> getPerfReqEmbbList() {
return perfReqEmbbList;
}
- public void setPerfReqEmbbList(List<PerfReqEmbbList> perfReqEmbbList) {
+ public void setPerfReqEmbbList(List<PerfReqEmbb> perfReqEmbbList) {
this.perfReqEmbbList = perfReqEmbbList;
}
- public List<PerfReqUrllcList> getPerfReqUrllcList() {
+ public List<PerfReqUrllc> getPerfReqUrllcList() {
return perfReqUrllcList;
}
- public void setPerfReqUrllcList(List<PerfReqUrllcList> perfReqUrllcList) {
+ public void setPerfReqUrllcList(List<PerfReqUrllc> perfReqUrllcList) {
this.perfReqUrllcList = perfReqUrllcList;
}
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbbList.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbb.java
index 9e9fcaa19e..bce0d56f9a 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbbList.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbb.java
@@ -23,7 +23,7 @@ package org.onap.so.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
-public class PerfReqEmbbList {
+public class PerfReqEmbb {
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private int expDataRateDL;
@@ -38,6 +38,9 @@ public class PerfReqEmbbList {
private int areaTrafficCapUL;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
+ private int overallUserDensity;
+
+ @JsonInclude(JsonInclude.Include.NON_DEFAULT)
private int activityFactor;
public int getExpDataRateDL() {
@@ -72,6 +75,14 @@ public class PerfReqEmbbList {
this.areaTrafficCapUL = areaTrafficCapUL;
}
+ public int getOverallUserDensity() {
+ return overallUserDensity;
+ }
+
+ public void setOverallUserDensity(int overallUserDensity) {
+ this.overallUserDensity = overallUserDensity;
+ }
+
public int getActivityFactor() {
return activityFactor;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllcList.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllc.java
index 00f0a917aa..0b05d39bab 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllcList.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllc.java
@@ -23,7 +23,7 @@ package org.onap.so.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
-public class PerfReqUrllcList {
+public class PerfReqUrllc {
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private int e2eLatency;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
new file mode 100644
index 0000000000..7a52cc85cb
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class ServiceInfo implements Serializable {
+
+ private static final long serialVersionUID = 7895110339097615695L;
+
+ private String serviceInvariantUuid;
+
+ private String serviceUuid;
+
+ private String globalSubscriberId;
+
+ private String subscriptionServiceType;
+
+ private String serviceType;
+
+ private String nsiId;
+
+ private String nssiId;
+
+ private String sST;
+
+ private String nssiName;
+
+ private String pLMNIdList;
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java
index 6c5d9c6909..cc6c9bbb82 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java
@@ -21,7 +21,11 @@
package org.onap.so.beans.nsmf;
import java.io.Serializable;
+import java.util.HashMap;
import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
new file mode 100644
index 0000000000..919a5d8114
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfile.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class SliceProfile implements Serializable {
+
+ private static final long serialVersionUID = 7924389625656716814L;
+
+ private List<String> snssaiList;
+
+ private String sliceProfileId;
+
+ private List<String> plmnIdList;
+
+ private PerfReq perfReq;
+
+ private Integer maxNumberofUEs;
+
+ private List<String> coverageAreaTAList;
+
+ private Integer latency;
+
+ private String resourceSharingLevel;
+
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java b/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
new file mode 100644
index 0000000000..aa2579edf8
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2020, CMCC Technologies Co., Ltd.
+ #
+ # 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.beans.nsmf;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class TransportSliceNetwork implements Serializable {
+ private static final long serialVersionUID = 809947462399806990L;
+
+ private List<ConnectionLink> connectionLinks;
+}
diff --git a/docs/api/swagger/swagger.html b/docs/api/swagger/swagger.html
index 5d7c963a8a..514c2bdda2 100644
--- a/docs/api/swagger/swagger.html
+++ b/docs/api/swagger/swagger.html
@@ -843,11 +843,191 @@ margin-bottom: 20px;
},
"description" : "This describes the subnet capabilities that can be queried"
};
+ defs["RetrievingWorkflowResponse"] = {
+ "type" : "object",
+ "properties" : {
+ "workflowSpecificationList" : {
+ "type" : "array",
+ "description" : "List of Workflow specification data",
+ "items" : {
+ "$ref" : "#/definitions/WorkflowSpecification"
+ }
+ }
+ },
+ "description" : "Response body of fetching workflows using resource target"
+};
+ defs["ServiceLevelWorkflowExecution"] = {
+ "type" : "object",
+ "properties" : {
+ "requestInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestInfo"
+ },
+ "modelInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_modelInfo"
+ },
+ "requestParameters" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestParameters"
+ },
+ "subscriberInfo" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_subscriberInfo"
+ },
+ "project" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_project"
+ },
+ "owningEntity" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution_owningEntity"
+ }
+ },
+ "description" : "This describes the request body of service level custom workflow execution"
+};
+ defs["ServiceLevelWorkflowExecution_modelInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "modelType" : {
+ "type" : "string",
+ "description" : "Type of the model to be executed"
+ },
+ "modelInvariantUuid" : {
+ "type" : "string",
+ "description" : "Model invariant id corresponding to the service"
+ },
+ "modelUuid" : {
+ "type" : "string",
+ "description" : "Model uuid corresponding to the service"
+ },
+ "modelVersionId" : {
+ "type" : "string",
+ "description" : "Model version of the service instance"
+ },
+ "modelName" : {
+ "type" : "string",
+ "description" : "Name of the service"
+ },
+ "modelVersion" : {
+ "type" : "string",
+ "description" : "Version of the service instance"
+ }
+ },
+ "description" : "Parameters related to the service model"
+};
+ defs["ServiceLevelWorkflowExecution_owningEntity"] = {
+ "type" : "object",
+ "properties" : {
+ "owningEntityId" : {
+ "type" : "string",
+ "description" : "Id of the owning Entity"
+ },
+ "owningEntityName" : {
+ "type" : "string",
+ "description" : "Name of the owning Entity"
+ }
+ },
+ "description" : "Object describes the entity details"
+};
+ defs["ServiceLevelWorkflowExecution_project"] = {
+ "type" : "object",
+ "properties" : {
+ "projectName" : {
+ "type" : "string",
+ "description" : "Name of the target project"
+ }
+ },
+ "description" : "Information about the target project name"
+};
+ defs["ServiceLevelWorkflowExecution_requestInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "source" : {
+ "type" : "string",
+ "description" : "Name of the sender"
+ },
+ "suppressRollback" : {
+ "type" : "boolean",
+ "description" : "Enable/disable rollback suppression"
+ },
+ "requestorId" : {
+ "type" : "string",
+ "description" : "Id of the sender"
+ }
+ },
+ "description" : "Request object contains source information"
+};
+ defs["ServiceLevelWorkflowExecution_requestParameters"] = {
+ "type" : "object",
+ "properties" : {
+ "subscriptionServiceType" : {
+ "type" : "string",
+ "description" : "Type of service subscription"
+ }
+ },
+ "description" : "User parameter object"
+};
+ defs["ServiceLevelWorkflowExecution_subscriberInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "globalSubscriberId" : {
+ "type" : "string",
+ "description" : "Id of the subscriber sending the request"
+ }
+ },
+ "description" : "Subscriber id information"
+};
defs["SubnetTypes"] = {
"type" : "string",
"description" : "This describes allowed subnet types",
"enum" : [ "AN", "AN_NF", "CN", "TN_FH", "TN_MH", "TN_BH" ]
};
+ defs["WorkflowSpecification"] = {
+ "type" : "object",
+ "properties" : {
+ "artifactInfo" : {
+ "$ref" : "#/definitions/WorkflowSpecification_artifactInfo"
+ }
+ },
+ "description" : "This describes workflow specification object"
+};
+ defs["WorkflowSpecification_artifactInfo"] = {
+ "type" : "object",
+ "properties" : {
+ "artifactType" : {
+ "type" : "string",
+ "description" : "Type of the artifact to be queried"
+ },
+ "artifactUuid" : {
+ "type" : "string",
+ "description" : "UUID of the artifact"
+ },
+ "artifactName" : {
+ "type" : "string",
+ "description" : "Name of the artifact"
+ },
+ "artifactVersion" : {
+ "type" : "string",
+ "description" : "Artifact's Version"
+ },
+ "artifactDescription" : {
+ "type" : "string",
+ "description" : ""
+ },
+ "workflowName" : {
+ "type" : "string",
+ "description" : "Name of the workflow fetched for the resource type"
+ },
+ "operationName" : {
+ "type" : "string",
+ "description" : "Mapped operation name of the corresponding workflow"
+ },
+ "workflowSource" : {
+ "type" : "string",
+ "description" : ""
+ },
+ "workflowResourceTarget" : {
+ "type" : "string",
+ "description" : "Type of Resource mapped against the workflow"
+ }
+ },
+ "description" : "Attributes related to artifact information "
+};
</script>
<div class="container-fluid">
@@ -930,6 +1110,10 @@ margin-bottom: 20px;
<li data-group="OnapsoinfracloudResourcesRequests" data-name="unlockOrchestrationRequestForReqId" class="">
<a href="#api-OnapsoinfracloudResourcesRequests-unlockOrchestrationRequestForReqId">unlockOrchestrationRequestForReqId</a>
</li>
+ <li class="nav-header" data-group="OnapsoinfrainstanceManagement"><a href="#api-OnapsoinfrainstanceManagement">API Methods - OnapsoinfrainstanceManagement</a></li>
+ <li data-group="OnapsoinfrainstanceManagement" data-name="executeServiceLevelCustomWorkflow" class="">
+ <a href="#api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow">executeServiceLevelCustomWorkflow</a>
+ </li>
<li class="nav-header" data-group="OnapsoinframodelDistributions"><a href="#api-OnapsoinframodelDistributions">API Methods - OnapsoinframodelDistributions</a></li>
<li data-group="OnapsoinframodelDistributions" data-name="updateModelDistributionStatus" class="">
<a href="#api-OnapsoinframodelDistributions-updateModelDistributionStatus">updateModelDistributionStatus</a>
@@ -1067,6 +1251,10 @@ margin-bottom: 20px;
<li data-group="Onapsoinfratasks" data-name="queryFilters" class="">
<a href="#api-Onapsoinfratasks-queryFilters">queryFilters</a>
</li>
+ <li class="nav-header" data-group="OnapsoinfraworkflowSpecifications"><a href="#api-OnapsoinfraworkflowSpecifications">API Methods - OnapsoinfraworkflowSpecifications</a></li>
+ <li data-group="OnapsoinfraworkflowSpecifications" data-name="queryWorkflowSpecifications" class="">
+ <a href="#api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications">queryWorkflowSpecifications</a>
+ </li>
</ul>
</nav>
</div>
@@ -1449,7 +1637,7 @@ $(document).ready(function() {
<article id="api-E2eServiceInstances-compareModelwithTargetVersion-0" data-group="User" data-name="compareModelwithTargetVersion" data-version="0">
<div class="pull-left">
<h1>compareModelwithTargetVersion</h1>
- <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId </p>
+ <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId</p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
@@ -1536,7 +1724,7 @@ String *body = body_example; // (optional)
E2eServiceInstancesApi *apiInstance = [[E2eServiceInstancesApi alloc] init];
-// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
[apiInstance compareModelwithTargetVersionWith:serviceId
version:version
body:body
@@ -1596,7 +1784,7 @@ namespace Example
try
{
- // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+ // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
apiInstance.compareModelwithTargetVersion(serviceId, version, body);
}
catch (Exception e)
@@ -1658,7 +1846,7 @@ version = version_example # String |
body = body_example # String | (optional)
try:
- # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
+ # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId
api_instance.compare_modelwith_target_version(serviceId, version, body=body)
except ApiException as e:
print("Exception when calling E2eServiceInstancesApi->compareModelwithTargetVersion: %s\n" % e)</code></pre>
@@ -7385,6 +7573,366 @@ $(document).ready(function() {
</div>
<hr>
</section>
+ <section id="api-OnapsoinfrainstanceManagement">
+ <h1>OnapsoinfrainstanceManagement</h1>
+ <div id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow">
+ <article id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0" data-group="User" data-name="executeServiceLevelCustomWorkflow" data-version="0">
+ <div class="pull-left">
+ <h1>executeServiceLevelCustomWorkflow</h1>
+ <p>Executing service level custom workflow</p>
+ </div>
+ <div class="pull-right"></div>
+ <div class="clearfix"></div>
+ <p></p>
+ <p class="marked"></p>
+ <p></p>
+ <br />
+ <pre class="prettyprint language-html prettyprinted" data-type="post"><code><span class="pln">/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}</span></code></pre>
+ <p>
+ <h3>Usage and SDK Samples</h3>
+ </p>
+ <ul class="nav nav-tabs nav-tabs-examples">
+ <li class="active"><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl">Curl</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java">Java</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android">Android</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy">Groovy</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc">Obj-C</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript">JavaScript</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular">Angular</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp">C#</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php">PHP</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl">Perl</a></li>
+ <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python">Python</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl">
+ <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}"</code></pre>
+ </div>
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
+import io.swagger.client.auth.*;
+import io.swagger.client.model.*;
+import io.swagger.client.api.OnapsoinfrainstanceManagementApi;
+
+import java.io.File;
+import java.util.*;
+
+public class OnapsoinfrainstanceManagementApiExample {
+
+ public static void main(String[] args) {
+
+ OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi();
+ String version = version_example; // String |
+ String serviceInstanceId = serviceInstanceId_example; // String |
+ String workflowUUID = workflowUUID_example; // String |
+ ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution |
+ try {
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfrainstanceManagementApi;
+
+public class OnapsoinfrainstanceManagementApiExample {
+
+ public static void main(String[] args) {
+ OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi();
+ String version = version_example; // String |
+ String serviceInstanceId = serviceInstanceId_example; // String |
+ String workflowUUID = workflowUUID_example; // String |
+ ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution |
+ try {
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+ <!--
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div> -->
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc">
+ <pre class="prettyprint"><code class="language-cpp">String *version = version_example; //
+String *serviceInstanceId = serviceInstanceId_example; //
+String *workflowUUID = workflowUUID_example; //
+ServiceLevelWorkflowExecution *body = ; // (optional)
+
+OnapsoinfrainstanceManagementApi *apiInstance = [[OnapsoinfrainstanceManagementApi alloc] init];
+
+// Executing service level custom workflow
+[apiInstance executeServiceLevelCustomWorkflowWith:version
+ serviceInstanceId:serviceInstanceId
+ workflowUUID:workflowUUID
+ body:body
+ completionHandler: ^(NSError* error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+ }];
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript">
+ <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is');
+
+var api = new SoGuilinApIs.OnapsoinfrainstanceManagementApi()
+
+var version = version_example; // {String}
+
+var serviceInstanceId = serviceInstanceId_example; // {String}
+
+var workflowUUID = workflowUUID_example; // {String}
+
+var opts = {
+ 'body': // {ServiceLevelWorkflowExecution}
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully.');
+ }
+};
+api.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, opts, callback);
+</code></pre>
+ </div>
+
+ <!--<div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div>-->
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp">
+ <pre class="prettyprint"><code class="language-cs">using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+ public class executeServiceLevelCustomWorkflowExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new OnapsoinfrainstanceManagementApi();
+ var version = version_example; // String |
+ var serviceInstanceId = serviceInstanceId_example; // String |
+ var workflowUUID = workflowUUID_example; // String |
+ var body = new ServiceLevelWorkflowExecution(); // ServiceLevelWorkflowExecution | (optional)
+
+ try
+ {
+ // Executing service level custom workflow
+ apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling OnapsoinfrainstanceManagementApi.executeServiceLevelCustomWorkflow: " + e.Message );
+ }
+ }
+ }
+}
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php">
+ <pre class="prettyprint"><code class="language-php"><&#63;php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+$api_instance = new Swagger\Client\Api\OnapsoinfrainstanceManagementApi();
+$version = version_example; // String |
+$serviceInstanceId = serviceInstanceId_example; // String |
+$workflowUUID = workflowUUID_example; // String |
+$body = ; // ServiceLevelWorkflowExecution |
+
+try {
+ $api_instance->executeServiceLevelCustomWorkflow($version, $serviceInstanceId, $workflowUUID, $body);
+} catch (Exception $e) {
+ echo 'Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: ', $e->getMessage(), PHP_EOL;
+}
+?></code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl">
+ <pre class="prettyprint"><code class="language-perl">use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::OnapsoinfrainstanceManagementApi;
+
+my $api_instance = WWW::SwaggerClient::OnapsoinfrainstanceManagementApi->new();
+my $version = version_example; # String |
+my $serviceInstanceId = serviceInstanceId_example; # String |
+my $workflowUUID = workflowUUID_example; # String |
+my $body = WWW::SwaggerClient::Object::ServiceLevelWorkflowExecution->new(); # ServiceLevelWorkflowExecution |
+
+eval {
+ $api_instance->executeServiceLevelCustomWorkflow(version => $version, serviceInstanceId => $serviceInstanceId, workflowUUID => $workflowUUID, body => $body);
+};
+if ($@) {
+ warn "Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: $@\n";
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python">
+ <pre class="prettyprint"><code class="language-python">from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# create an instance of the API class
+api_instance = swagger_client.OnapsoinfrainstanceManagementApi()
+version = version_example # String |
+serviceInstanceId = serviceInstanceId_example # String |
+workflowUUID = workflowUUID_example # String |
+body = # ServiceLevelWorkflowExecution | (optional)
+
+try:
+ # Executing service level custom workflow
+ api_instance.execute_service_level_custom_workflow(version, serviceInstanceId, workflowUUID, body=body)
+except ApiException as e:
+ print("Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: %s\n" % e)</code></pre>
+ </div>
+ </div>
+
+ <h2>Parameters</h2>
+
+ <div class="methodsubtabletitle">Path parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">version*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_version">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ <tr><td style="width:150px;">serviceInstanceId*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_serviceInstanceId">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ <tr><td style="width:150px;">workflow_UUID*</td>
+<td>
+
+
+ <div id="d2e199_executeServiceLevelCustomWorkflow_workflowUUID">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+
+ <div class="methodsubtabletitle">Body parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">body </td>
+<td>
+
+
+<script>
+$(document).ready(function() {
+ var schemaWrapper = {
+ "in" : "body",
+ "name" : "body",
+ "required" : false,
+ "schema" : {
+ "$ref" : "#/definitions/ServiceLevelWorkflowExecution"
+ }
+};
+ var schema = schemaWrapper.schema;
+ if (schema.$ref != null) {
+ schema = defsParser.$refs.get(schema.$ref);
+ } else {
+ schemaWrapper.definitions = Object.assign({}, defs);
+ $RefParser.dereference(schemaWrapper).catch(function(err) {
+ console.log(err);
+ });
+ }
+
+ var view = new JSONSchemaView(schema,2,{isBodyParam: true});
+ var result = $('#d2e199_executeServiceLevelCustomWorkflow_body');
+ result.empty();
+ result.append(view.render());
+});
+</script>
+<div id="d2e199_executeServiceLevelCustomWorkflow_body"></div>
+</td>
+</tr>
+
+ </table>
+
+
+
+ <h2>Responses</h2>
+ <h3> Status: default - successful operation </h3>
+
+ <ul class="nav nav-tabs nav-tabs-examples" >
+ </ul>
+
+ <div class="tab-content" style='margin-bottom: 10px;'>
+ </div>
+
+ </article>
+ </div>
+ <hr>
+ </section>
<section id="api-OnapsoinframodelDistributions">
<h1>OnapsoinframodelDistributions</h1>
<div id="api-OnapsoinframodelDistributions-updateModelDistributionStatus">
@@ -22297,6 +22845,333 @@ except ApiException as e:
</div>
<hr>
</section>
+ <section id="api-OnapsoinfraworkflowSpecifications">
+ <h1>OnapsoinfraworkflowSpecifications</h1>
+ <div id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications">
+ <article id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0" data-group="User" data-name="queryWorkflowSpecifications" data-version="0">
+ <div class="pull-left">
+ <h1>queryWorkflowSpecifications</h1>
+ <p>Retrieve Workflow details based on the filter criteria</p>
+ </div>
+ <div class="pull-right"></div>
+ <div class="clearfix"></div>
+ <p></p>
+ <p class="marked"></p>
+ <p></p>
+ <br />
+ <pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/onap/so/infra/workflowSpecifications/{version}/workflows</span></code></pre>
+ <p>
+ <h3>Usage and SDK Samples</h3>
+ </p>
+ <ul class="nav nav-tabs nav-tabs-examples">
+ <li class="active"><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl">Curl</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java">Java</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android">Android</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy">Groovy</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc">Obj-C</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript">JavaScript</a></li>
+ <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular">Angular</a></li>-->
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp">C#</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php">PHP</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl">Perl</a></li>
+ <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python">Python</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl">
+ <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/workflowSpecifications/{version}/workflows?resourceTarget="</code></pre>
+ </div>
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.*;
+import io.swagger.client.auth.*;
+import io.swagger.client.model.*;
+import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi;
+
+import java.io.File;
+import java.util.*;
+
+public class OnapsoinfraworkflowSpecificationsApiExample {
+
+ public static void main(String[] args) {
+
+ OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ String version = version_example; // String |
+ String resourceTarget = resourceTarget_example; // String |
+ try {
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android">
+ <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi;
+
+public class OnapsoinfraworkflowSpecificationsApiExample {
+
+ public static void main(String[] args) {
+ OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ String version = version_example; // String |
+ String resourceTarget = resourceTarget_example; // String |
+ try {
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications");
+ e.printStackTrace();
+ }
+ }
+}</code></pre>
+ </div>
+ <!--
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div> -->
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc">
+ <pre class="prettyprint"><code class="language-cpp">String *version = version_example; //
+String *resourceTarget = resourceTarget_example; // (optional)
+
+OnapsoinfraworkflowSpecificationsApi *apiInstance = [[OnapsoinfraworkflowSpecificationsApi alloc] init];
+
+// Retrieve Workflow details based on the filter criteria
+[apiInstance queryWorkflowSpecificationsWith:version
+ resourceTarget:resourceTarget
+ completionHandler: ^(RetrievingWorkflowResponse output, NSError* error) {
+ if (output) {
+ NSLog(@"%@", output);
+ }
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+ }];
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript">
+ <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is');
+
+var api = new SoGuilinApIs.OnapsoinfraworkflowSpecificationsApi()
+
+var version = version_example; // {String}
+
+var opts = {
+ 'resourceTarget': resourceTarget_example // {String}
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+};
+api.queryWorkflowSpecifications(version, opts, callback);
+</code></pre>
+ </div>
+
+ <!--<div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular">
+ <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
+ </div>-->
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp">
+ <pre class="prettyprint"><code class="language-cs">using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+ public class queryWorkflowSpecificationsExample
+ {
+ public void main()
+ {
+
+ var apiInstance = new OnapsoinfraworkflowSpecificationsApi();
+ var version = version_example; // String |
+ var resourceTarget = resourceTarget_example; // String | (optional)
+
+ try
+ {
+ // Retrieve Workflow details based on the filter criteria
+ RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget);
+ Debug.WriteLine(result);
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Exception when calling OnapsoinfraworkflowSpecificationsApi.queryWorkflowSpecifications: " + e.Message );
+ }
+ }
+ }
+}
+</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php">
+ <pre class="prettyprint"><code class="language-php"><&#63;php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+$api_instance = new Swagger\Client\Api\OnapsoinfraworkflowSpecificationsApi();
+$version = version_example; // String |
+$resourceTarget = resourceTarget_example; // String |
+
+try {
+ $result = $api_instance->queryWorkflowSpecifications($version, $resourceTarget);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: ', $e->getMessage(), PHP_EOL;
+}
+?></code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl">
+ <pre class="prettyprint"><code class="language-perl">use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi;
+
+my $api_instance = WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi->new();
+my $version = version_example; # String |
+my $resourceTarget = resourceTarget_example; # String |
+
+eval {
+ my $result = $api_instance->queryWorkflowSpecifications(version => $version, resourceTarget => $resourceTarget);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: $@\n";
+}</code></pre>
+ </div>
+
+ <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python">
+ <pre class="prettyprint"><code class="language-python">from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# create an instance of the API class
+api_instance = swagger_client.OnapsoinfraworkflowSpecificationsApi()
+version = version_example # String |
+resourceTarget = resourceTarget_example # String | (optional)
+
+try:
+ # Retrieve Workflow details based on the filter criteria
+ api_response = api_instance.query_workflow_specifications(version, resourceTarget=resourceTarget)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: %s\n" % e)</code></pre>
+ </div>
+ </div>
+
+ <h2>Parameters</h2>
+
+ <div class="methodsubtabletitle">Path parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">version*</td>
+<td>
+
+
+ <div id="d2e199_queryWorkflowSpecifications_version">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ <div class="inner required">
+ Required
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+
+
+
+ <div class="methodsubtabletitle">Query parameters</div>
+ <table id="methodsubtable">
+ <tr>
+ <th width="150px">Name</th>
+ <th>Description</th>
+ </tr>
+ <tr><td style="width:150px;">resourceTarget</td>
+<td>
+
+
+ <div id="d2e199_queryWorkflowSpecifications_resourceTarget">
+ <div class="json-schema-view">
+ <div class="primitive">
+ <span class="type">
+ String
+ </span>
+
+ </div>
+ </div>
+ </div>
+</td>
+</tr>
+
+ </table>
+
+ <h2>Responses</h2>
+ <h3> Status: default - List of workflow specifications on successful operation </h3>
+
+ <ul class="nav nav-tabs nav-tabs-examples" >
+ <li class="active">
+ <a data-toggle="tab" href="#responses-queryWorkflowSpecifications-default-schema">Schema</a>
+ </li>
+
+ </ul>
+
+ <div class="tab-content" style='margin-bottom: 10px;'>
+ <div class="tab-pane active" id="responses-queryWorkflowSpecifications-default-schema">
+ <div id='responses-queryWorkflowSpecifications-default-schema-default' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
+ <script>
+ $(document).ready(function() {
+ var schemaWrapper = {
+ "description" : "List of workflow specifications on successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/RetrievingWorkflowResponse"
+ }
+};
+ var schema = schemaWrapper.schema;
+ if (schema.$ref != null) {
+ schema = defsParser.$refs.get(schema.$ref);
+ } else {
+ schemaWrapper.definitions = defs;
+ $RefParser.dereference(schemaWrapper).catch(function(err) {
+ console.log(err);
+ });
+ }
+
+ //console.log(JSON.stringify(schema));
+ var view = new JSONSchemaView(schema, 3);
+ $('#responses-queryWorkflowSpecifications-default-schema-data').val(stringify(schema));
+ var result = $('#responses-queryWorkflowSpecifications-default-schema-default');
+ result.empty();
+ result.append(view.render());
+ });
+ </script>
+ </div>
+ <input id='responses-queryWorkflowSpecifications-default-schema-data' type='hidden' value=''></input>
+ </div>
+ </div>
+
+ </article>
+ </div>
+ <hr>
+ </section>
</div>
<div id="footer">
<div id="api-_footer">
diff --git a/docs/developer_info/Mso_Openstack_Adapter.rst b/docs/developer_info/Mso_Openstack_Adapter.rst
new file mode 100644
index 0000000000..a8ca362537
--- /dev/null
+++ b/docs/developer_info/Mso_Openstack_Adapter.rst
@@ -0,0 +1,796 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2020 Huawei Technologies Co., Ltd.
+
+MSO-OPENSTACK-ADAPTER :
+=======================
+
+.. contents:: :depth: 3
+
+Cloud site operations
+++++++++++++++++++++++
+* Here we have 3 api's createCloudRegion, updateCloudRegion, deleteCloudRegion.
+
+1.Create Cloud site/Cloud region:
+
+Path: /v1/cloud-region
+
+Method Type: POST
+
+Request Body:
+*************
+{
+ "id": "MTN13",
+ "regionId": "mtn13",
+ "cloudVersion": "3.0",
+ "clli": "MDT13",
+ "platform": "testFlatform",
+ "orchestrator": "testOrchestrator",
+ "cloudifyId": "mtn13",
+ "cloudOwner": "testCloudOwner",
+
+ "identityService": {
+ "identityUrl": "testUrl",
+ "msoId": "admin",
+ "msoPass": "admin",
+ "projectDomainName": "testDomain",
+ "userDomainName": "testDomain",
+ "adminTenant": "test",
+ "memberRole": "test",
+ "tenantMetadata": "test",
+ "identityServerType": "test",
+ "identityAuthenticationType": "test",
+ "lastUpdatedBy": "test",
+ "created": "date",
+ "updated": "date"
+
+ },
+
+ "identityServiceId": "123",
+ "lastUpdatedBy": "test",
+ "created": "test",
+ "updated": "test",
+ "supportFabric": "true",
+ "uri": "test"
+
+}
+
+* In this api we can create cloud region and cloud site and saving in catalog db and in AAI.
+
+* This api requires cloud-region-id and cloudSite as inputs.
+
+* In createCloudRegion two steps are there.
+
+* CreateRegionInCatalogDb(cloudSite) :- here we are creating cloud region in catalogdb if it is not exists in db(cloud_sites).
+
+* CreateCloudRegionInAAI(cloudSite) :- mapping cloudSite into cloudregion , this cloudregion we are creating in AAI and create CloudRegion NetworkTechnology Relationship.
+
+2.Delete Cloud site:
+
+* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner}
+
+* Here we can delete Cloud site by cloud region id
+
+3.Update Cloud site:
+
+* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner}
+
+* Here we can update Cloud site by cloud region id
+
+Create Tenant in Cloud:
+++++++++++++++++++++++++
+
+Path: http://host:port/vnfs/rest/v1/tenants
+
+Method Type: POST
+
+Request Body:
+*************
+
+{
+"cloudSiteId": "DAN",
+"tenantName":"RAA_1",
+"failIfExists": true,
+"msoRequest": {
+"requestId": "ra1",
+"serviceInstanceId":"sa1"
+}
+}
+
+RESPONSE:
+**********
+
+{
+
+"cloudSiteId": "DAN",
+"tenantId": "128e10b9996d43a7874f19bbc4eb6749",
+"tenantCreated": true,
+"tenantRollback": {
+"tenantId": "128e10b9996d43a7874f19bbc4eb6749",
+"cloudId": "DAN", // RAA? cloudId instead of cloudSiteId
+"tenantCreated": true,
+"msoRequest": {
+"requestId": "ra1",
+"serviceInstanceId": "sa1"
+
+}
+}
+}
+
+Code Flow:
+
+* Call to MSO createTenant adapter then call to catalog db for cloud site info and from cloud site get IdentityServerType.
+* based on Cloud IdentityServerType it returns ORM or KEYSTONE Utils
+* Query for a tenant with the specified name in the given cloud. If the tenant exists, return an MsoTenant object. If not, return null.
+* Create a tenant with the specified name in the given cloud. If the tenant already exists, an Exception will be thrown. The MSO User will also be added to the "member" list of the new tenant to perform subsequent Nova/Heat commands in the tenant. If the MSO User association fails, the entire transaction will be rolled back.
+
+TaskServices
+++++++++++++++
+**1. CreateInventory**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryCreate.png
+
+Code Flow:
+
+* Get cloud site using cloud region id from catalog db.
+
+* Instantiate heat bridge client by passing required values.
+
+* Authenticate heat bridge client.
+
+* If authentication is success we are getting all stack resources(openstack servers. servers contains openstack images and flavours.)
+
+* From stack resources we are getting osServers/ compute resources.
+
+* CreatePserversAndPinterfacesIfNotPresentInAai --Transform Openstack Server object to AAI Pserver object. create pserver in AAI if it is not exist. and get openstackresource id's / ports -- transform ports to pinterface Object in AAI.
+
+* After extract osimages and os flavours from osservers.
+
+* After that transform osimages to AAI images and osflavours to AAI flavors and add to AAI.
+
+* Create Vservers in AAI and make relationships to AAI image, AAI flavor, AAI pserver, vf-module.
+
+* Add Vservers and Linterfaces to AAI--Transform port to Linterface and for that port Get Ip addresses and updateLInterfaceIps and updateLInterfaceVlan.
+
+* Finally update AAI.
+
+**2. AuditCreateStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryAddAudit.png
+
+Code Flow:
+
+* First we are capturing entry timestamp, MSO REQUESTID, Servicename/topic name,partnername as openstack adapter, invocation id is generating one random uuid.
+
+* After that getting auditInventory details from externalTask object
+
+* From auditInventory object we are getting cloud region,clowd owner,tenant id, heatstack name.these details we are passing to get AAIObjectAuditList.
+
+* Use cloudRegion, tenantId, heatStackName to get resources from Heat client.
+
+* To get resources we need heat client it means getting keystone url and token.
+
+* Get keystone url based on server type(keystone/keystonev3)
+
+* From resources object we are getting novaResources and resource groups and neutronPortDetails.
+
+* Create VserverSet by passing resources, novaResources, neutronPortDetails and setting up servers with ports to Set of Servers.
+
+* From resource groups we are getting Link(stackLink) from that link we are extracting resource path .if path is present we are Fetching nested Resource Stack Information.
+
+* audit all vservers,l-interfaces and sub l-interfaces. and checking in these vservers , l-interfaces and sub interfaces are existed or not in AAI.
+
+* If AAIObjectAuditList is present then we are setting audit type as create and Heat stack name to AAIObjectAuditList.
+
+* If Audit create success putting in variable to complete external task other wise sending exception.
+
+* If retrycount=1 sending error as retrycount exhausted.
+
+**3. AuditQueryStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryQueryAudit.png
+
+
+Code Flow:
+
+* Get AuditInventory details from external task.
+
+* Get AAIObjectAuditList from auditHeatStack by passing these parametersauditInventory.getCloudRegion(),auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName().
+
+* Fetching Top Level Stack Information.i.e get all the heat model resources.
+
+* From heat model resources get all OS::Nova::Servers and OS::Heat::ResourceGroups and neutronPortDetails.
+
+* Once u got all the stack info u create vserverset and add that vserverset to AAIObjectAuditList.
+
+* After add AAIObjectAuditList to requestdb if it is not exist in requestdb.
+
+* If it is success complete the external task.
+
+**4. AuditDeleteStack**
+
+Flow Diagram:
+
+.. image :: ../images/InventoryDeleteAudit.png
+
+Code Flow:
+
+* Get AuditInventory details from external task
+
+* GetStackDataFromRequestDb usiing AuditInventory details.
+
+* Get RequestProcessingData from requestdb using auditInventory.getVfModuleId(),auditInventory.getHeatStackName(), "AuditStackData".
+
+* From RequestProcessingData get AAIObjectAuditList.
+
+* If AAIObjectAuditList is empty check vservers is exist or not in AAI and set that result as setDoesObjectExist(true/false).
+
+* Else Auditing Vservers based on vf module relationships--i.e based on genericVnfId and vfModuleName get all the vservers and create AAIObject and set setDoesObjectExist(true) and set that object to list.
+
+* After that set audit type as delete and heatstackname and check that audit create success or not.
+
+* If it is success complete the external task.
+
+**5. DeleteInventory**
+
+Flow Diagram:
+
+.. image :: ../images/DeleteInventory.png
+
+
+Code Flow:
+
+* Get CloudInformation from external task.
+
+* First get CloudSite details from catalog db by using regionid.
+
+* From CloudSite get CloudIdentity details.
+
+* Create a heatbridgeclient. and authenticate the heatbridge.
+
+* After that delete the VFmodule data using vnfid and vf moduleid.
+
+* Once delete success complete the external task.
+
+**6. StackService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterInvoke.png
+
+
+Code Flow:
+
+* From external task getting openstackAdapterTaskRequest and adding to string(xmlRequest).
+
+* From xmlrequest we are getting requestType.
+
+1. If requestType is createVolumeGroupRequest then we are creating volume group.
+
+* Marshalling xmlRequest to CreateVolumeGroupRequest.
+
+* From CreateVolumeGroupRequest getting completeVnfVfModuleType.
+
+* After that we are creating vf module by passing required paremeters.
+
+* If request type Start with X then we are orchestrating a VNF - *NOT* a module!
+
+* RequestType start with Volume then then we are sending true as volume request.
+
+* Creating a VnfRollback object by passing required parameters.
+
+* If nestedStackId is not null we are getting nested heat stack(stack information).
+
+* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object.
+
+* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack.
+
+* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc);
+
+* If we get VFModuleCustomization then we are extracting VfModule.
+
+* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion.
+
+* By here - we would have either a vf or vnfResource.
+
+* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf.
+
+* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions.
+
+* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
+
+* If it is old way we will get heatTemplate directly. else if vf module is not null then
+* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment.
+* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment.
+
+* Once we get heat templates we are getting nestedtemplates.
+
+* Also add the files: for any get_files associated with this vnf_resource_id
+
+* Add ability to turn on adding get_files with volume requests (by property).
+
+* If it is not a volume request get heat files from vf module.
+
+* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS.
+
+* Parse envt entries to see if reqd parameter is there (before used a simple grep
+
+* Only submit to openstack the parameters in the envt that are in the heat template
+
+* 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
+
+* Now simply add the outputs as we received them - no need to convert to string
+
+* Add in the volume stack outputs if applicable
+
+* Get all heat template parameters and add to list.
+
+* Check for missing parameters null or not.if no missing parameters we can proceed for next step.
+
+* Next create stack with all required values.
+
+* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully.
+
+* After sending the response to create volume group.once it is created that response we are setting to VolumeGroup response object.
+
+2. If requestType is createVfModuleRequest then we are creating VfModule.
+
+* Marshalling xmlRequest to CreateVolumeGroupRequest.
+
+* From CreateVolumeGroupRequest getting completeVnfVfModuleType.
+
+* After that we are creating vf module by passing required paremeters.
+
+* If request type Start with X then we are orchestrating a VNF - *NOT* a module!
+
+* RequestType start with Volume then then we are sending true as volume request.
+
+* Creating a VnfRollback object by passing required parameters.
+
+* If nestedStackId is not null we are getting nested heat stack(stack information).
+
+* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object.
+
+* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack.
+
+* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc);
+
+* If we get VFModuleCustomization then we are extracting VfModule.
+
+* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion.
+
+* By here - we would have either a vf or vnfResource.
+
+* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf.
+
+* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions.
+
+* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
+
+* If it is old way we will get heatTemplate directly. else if vf module is not null then
+
+* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment.
+
+* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment.
+
+* Once we get heat templates we are getting nestedtemplates.
+
+* Also add the files: for any get_files associated with this vnf_resource_id
+
+* Add ability to turn on adding get_files with volume requests (by property).
+
+* If it is not a volume request get heat files from vf module.
+
+* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS.
+
+* Parse envt entries to see if reqd parameter is there (before used a simple grep
+
+* Only submit to openstack the parameters in the envt that are in the heat template
+
+* 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
+
+* Now simply add the outputs as we received them - no need to convert to string
+
+* Add in the volume stack outputs if applicable
+
+* Get all heat template parameters and add to list.
+
+* Check for missing parameters null or not.if no missing parameters we can proceed for next step.
+
+* Next create stack with all required values.
+
+* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully.
+
+3. If requestType is deleteVfModuleRequest then we are deleting VfModule .
+
+* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters.
+
+* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate.
+
+* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus.
+
+4. If requestType is deleteVolumeGroupRequest then we are deleting volume group.
+
+* Making DeleteVolumeGroupRequest by Unmarshalling xml request.
+
+* Getting stack information by passing stackName, cloudSiteId, tenantId.
+
+* If current stack is null then we confirm that heat status not found.
+
+* If current stack is not null then we are deleting the stack.
+
+* Once volumegroup is deleted we are setting the response to perticular response class.
+
+5. If requestType is createNetworkRequest then we are creating network.
+
+* Making CreateNetworkRequest by Unmarshalling xmlrequest.
+
+* Check request is contrailRequest or not if it is contrailRequest we are setting shared,external,routeTargets,fqdns,routeTable values else we are setting physicalNetworkName and vlans.
+
+* Now all the above required values we are passing to create network.
+
+* Build a default NetworkRollback object (if no actions performed).
+
+* Getting the cloud site by passing cloudsite id.
+
+* After we are doing a network check and Retrieve the Network Resource definition.
+
+* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource.
+
+* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource.
+
+* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource.
+
+* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType.
+
+* From the network resource we are extracting mode and network type.
+
+* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error.
+
+* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error.
+
+* After that validating the network parameters that if any parameter is missing.
+
+* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that.
+
+* From the heat template we are getting template and checking that template contains os3nw if it is contains making flag is true.
+
+* 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
+
+* If stack is already exist with the network name throw an error.
+
+* After that from stackinfo get network id and network fqdn and get outputs from Stackinfo.
+
+* After that get subnetIdMap based on one subnet_id output or multiples subnet_%aaid% outputs from Stackinfo outputs.
+
+* After that update the updateResourceStatus as exits in requestdb.
+
+* Now we are Ready to deploy the new Network and Build the common set of HEAT template parameters
+
+* Validate (and update) the input parameters against the DB definition
+
+* Shouldn't happen unless DB config is wrong, since all networks use same inputs and inputs were already validated.
+
+* If subnets are not null and template is os3template then mergesubnetsAIC3.
+
+* If subnets are not null and template is not os3template then merge subnets.
+
+* If policyFqdns are not null & os3template true then mergePolicyRefs.
+
+* After that deploy the network stack-- create stack and once stack is created save into stackinfo.
+
+* For Heat-based orchestration, the MSO-tracked network ID is the heat stack, and the neutronNetworkId is the network UUID returned in stack outputs.
+
+* After update the resource status like network created successfully.
+
+* After set response to CreateNetworkResponse object.
+
+
+6. If requestType is deleteNetworkRequest then we are deleting network.
+
+* Form a DeleteNetworkRequest by unmarshlling Xml request.
+
+* check for mandatory fields networkId, cloudSiteId, tenantId.
+
+* If it is there Retrieve the Network Resource definition.
+
+* After that get networkResource.from networkResource get heat template.
+
+* After that delete stackinfo udpate resource status as deleted.
+
+7. If requestType is updateNetworkRequest then we are updating Network.
+
+* Make UpdateNetworkRequest by unmarshalling xmlRequest.
+
+* Check the params contains key shared and external if it is contains get that shared and external keys.
+
+* Check the request is ContrailRequest or not, if it is ContrailRequest then get routeTargets , fqdns, routeTable from the actual request.
+
+* If it is not ContrailRequest then get the ProviderVlanNetwork details like physicalNetworkName and vlans.
+
+* Params to update network-req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName,vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), subnetIdMap, networkRollback.
+
+* Update Network adapter with Network using networkName, networkType,cloudSiteId, tenantId.
+
+* Capture execution time for metrics.
+
+* Build a default rollback object (no actions performed)
+
+* Get cloud site details from catalog db using cloud site id.
+
+* If cloud site is not present send the error message like CloudSite does not exist in MSO Configuration.
+
+* Getting the cloud site by passing cloudsite id.
+
+* After we are doing a network check and Retrieve the Network Resource definition.
+
+* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource.
+
+* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource.
+
+* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource.
+
+* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType.
+
+* From the network resource we are extracting mode and network type.
+
+* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error.
+
+* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error.
+
+* After that validating the network parameters that if any parameter is missing.
+
+* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that.
+
+* Use an MsoNeutronUtils for all Neutron commands
+
+* If Orchestaration mode is NEUTRON Verify that the Network exists and For Neutron-based orchestration, the networkId is the Neutron Network UUID.
+
+* Get NetworkInfo from cloud site using networkId, tenantId, cloudSiteId as params.
+
+* If NetworkInfo is null then throw the error message as Network is does not exist.
+
+* Update the network in cloud site which is in catalog db using cloudSiteId,tenantId,networkId, neutronNetworkType, physicalNetworkName, vlans as params.
+
+* Add the network ID and previously queried vlans to the rollback object.
+
+* Save previous parameters such as NetworkName,PhysicalNetwork,Vlans to the NetworkRollback.
+
+* If Orchestaration mode is HEAT then First, look up to see that the Network already exists. For Heat-based orchestration, the networkId is the network Stack ID.
+
+* Get StackInfo by querystack using cloudSiteId, CLOUD_OWNER, tenantId, networkName.
+
+* If StackInfo is null throw error as Network not found else continue the flow.
+
+* Get the previous parameters such as previousNetworkName and previousPhysicalNetwork for rollback from StackInfo.
+
+* Get the previous vlans from the heat params and Update Stack with Previous VLANS.
+
+* Now we are Ready to deploy the updated Network via Heat.
+
+* Get the HeatTemplate from NetworkResource and now we got HEAT Template from DB.
+
+* Now get the OS::ContrailV2::VirtualNetwork property from property file , if template contains os3nw set flag as true.
+
+* Build the common set of HEAT template parameters such as neutronNetworkType, networkName, physicalNetworkName, vlans, routeTargets, shared, external, os3template.
+
+* Validate and update the input parameters against the DB definition and Shouldn't happen unless DB config is wrong, since all networks use same inputs.
+
+* If subnets are not null and template is os3template then mergesubnetsAIC3.
+
+* If subnets are not null and template is not os3template then merge subnets.
+
+* If policyFqdns are not null & os3template true then mergePolicyRefs.
+
+* If routeTableFqdns are not null os3template not null then mergeRouteTableRefs using routeTableFqdns, stackParams as params.
+
+* Get outputs from StackInfo and if key is contains subnet and os3template not null then one subnet output expected else multiples subnet outputs allowed.
+
+* Reach this point if createStack is successful.Populate remaining rollback info and response parameters and save previous parameters.
+
+* Now Network successfully updated via HEAT.
+
+8. If requestType is rollbackNetworkRequest then we are doing rollbackNetwork.
+
+* Make RollbackNetworkRequest by unmarshalling xmlRequest.
+
+* Get NetworkRollback from RollbackNetworkRequest.
+
+* If pollForCompletion is null then set flag as true.
+
+* Get the elements of the VnfRollback object for easier access.
+
+* ROLLBACK Network using networkId, cloudSiteId, tenantId.
+
+* If NetworkCreated then use tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes params to delete stack.
+
+* Once deletion is success set the response to RollbackNetworkResponse.
+
+* Once task stack service is success set the status completed for the external task.
+
+
+**7. PollService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterPoller.png
+
+
+Code Flow:
+
+* Get openstackAdapterTaskRequest as xmlRequest from the the external task.
+
+* Get requestType from the xmlRequest.
+
+1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group.
+
+* Create CreateVolumeGroupRequest by unmarshalling xmlRequest.
+
+* Use CloudSiteId, CloudOwner, TenantId,VolumeGroupName, MsoRequest ,pollStackStatus as params to delete vnf.
+
+* Call to openstack to delete vnf if it is success nothing to return if it is failure return failure exception.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module.
+
+* Create CreateVfModuleRequest by unmarshalling xmlRequest.
+
+* Use CloudSiteId, CloudOwner, TenantId,VfModuleName, VnfId, VfModuleId, ModelCustomizationUuid,MsoRequest ,Holder as params to delete vf module.
+
+* Call to openstack to get the stack outputs.
+
+* If modelCustomizationUuid is not null then use as a param to get the VfModuleCustomization and from VfModuleCustomization get the vf module details.
+
+* Use tenantId, cloudOwner, cloudSiteId, vnfName, pollForCompletion, timeoutMinutes as params to delete the stack .once it is success update the resources.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+3. If requestType is deleteVfModuleRequest then Execute External Task Poll Service for Delete Vf Module.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+
+4. If requestType is deleteVolumeGroupRequest then Execute Execute External Task Poll Service for Delete Volume Group.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+5. If requestType is deleteNetworkRequest then Execute External Task Poll Service for Delete Network.
+
+* Create DeleteVfModuleRequest by unmarshalling xmlRequest.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+6. If requestType is createNetworkRequest then get the PollRollbackStatus from the external task.
+
+* If pollRollbackStatus is true then Execute External Task Poll Service for Rollback Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully.
+
+* If pollRollbackStatus is false then Execute External Task Poll Service for Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is CREATE_COMPLETE then Stack Creation completed successfully.
+
+7. If requestType is createNetworkRequest then Execute External Task Rollback Service for Create Network.
+
+* Get stackId from external task by using that get Stack.
+
+* Get pollingFrequency from properties file and calculate no.of polling attempts.
+
+* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object.
+
+* If Stack object is not null update the stack status in requestdb and it returns Stack object.
+
+* If Stack object is not null check the status is UPDATE_COMPLETE then Stack Updation completed successfully.
+
+* Once task stack service is success set the status completed for the external task.
+
+**8. RollbackService**
+
+Flow Diagram:
+
+.. image :: ../images/OpenstackAdapterRollback.png
+
+
+Code Flow:
+
+* Get openstackAdapterTaskRequest as xmlRequest from the the external task.
+
+* Get requestType from the xmlRequest.
+
+1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group.
+
+* Making DeleteVolumeGroupRequest by Unmarshalling xml request.
+
+* Getting stack information by passing stackName, cloudSiteId, tenantId.
+
+* If current stack is null then we confirm that heat status not found.
+
+* If current stack is not null then we are deleting the stack.
+
+* Once volumegroup is deleted we are setting the response to perticular response class.
+
+2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module.
+
+* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters.
+
+* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate.
+
+* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus.
+
+* Once it is success set the boolean flags pollRollbackStatus and status as true.
+
+3. If request type is createNetworkRequest then Execute External Task Rollback Service for Create Network.
+
+* Form a DeleteNetworkRequest by unmarshlling Xml request.
+
+* Check for mandatory fields networkId, cloudSiteId, tenantId.
+
+* If it is there Retrieve the Network Resource definition.
+
+* After that get networkResource.from networkResource get heat template.
+
+* After that delete stackinfo udpate resource status as deleted.
+
+* Once task stack service is success set the status completed for the external task.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst
index 570861345c..1b9e83b840 100644
--- a/docs/developer_info/developer_information.rst
+++ b/docs/developer_info/developer_information.rst
@@ -20,5 +20,6 @@ SO Developer Information
BPMN_Subprocess_Process_Flows.rst
BPMN_Project_Deployment_Strategy.rst
BPMN-INFRA_Workflow_Understanding.rst
+ Mso_Openstack_Adapter.rst
instantiate/index.rst
FAQs.rst
diff --git a/docs/images/DeleteInventory.png b/docs/images/DeleteInventory.png
new file mode 100644
index 0000000000..0fd6629db8
--- /dev/null
+++ b/docs/images/DeleteInventory.png
Binary files differ
diff --git a/docs/images/InventoryAddAudit.png b/docs/images/InventoryAddAudit.png
new file mode 100644
index 0000000000..9e61c15804
--- /dev/null
+++ b/docs/images/InventoryAddAudit.png
Binary files differ
diff --git a/docs/images/InventoryCreate.png b/docs/images/InventoryCreate.png
new file mode 100644
index 0000000000..7df732f1d1
--- /dev/null
+++ b/docs/images/InventoryCreate.png
Binary files differ
diff --git a/docs/images/InventoryDeleteAudit.png b/docs/images/InventoryDeleteAudit.png
new file mode 100644
index 0000000000..f2f08bf52b
--- /dev/null
+++ b/docs/images/InventoryDeleteAudit.png
Binary files differ
diff --git a/docs/images/InventoryQueryAudit.png b/docs/images/InventoryQueryAudit.png
new file mode 100644
index 0000000000..34f6cad128
--- /dev/null
+++ b/docs/images/InventoryQueryAudit.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterInvoke.png b/docs/images/OpenstackAdapterInvoke.png
new file mode 100644
index 0000000000..998c4721b0
--- /dev/null
+++ b/docs/images/OpenstackAdapterInvoke.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterPoller.png b/docs/images/OpenstackAdapterPoller.png
new file mode 100644
index 0000000000..e95bede9a2
--- /dev/null
+++ b/docs/images/OpenstackAdapterPoller.png
Binary files differ
diff --git a/docs/images/OpenstackAdapterRollback.png b/docs/images/OpenstackAdapterRollback.png
new file mode 100644
index 0000000000..1e554263b0
--- /dev/null
+++ b/docs/images/OpenstackAdapterRollback.png
Binary files differ
diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectPlurals.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectPlurals.java
index 5b68d0c69a..78f8350eff 100644
--- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectPlurals.java
+++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectPlurals.java
@@ -74,6 +74,8 @@ public class AAIObjectPlurals implements AAIObjectBase, GraphInventoryObjectPlur
new AAIObjectPlurals(AAIObjectType.INSTANCE_GROUP, AAINamespaceConstants.NETWORK, "/instance-groups");
public static final AAIObjectPlurals PNF =
new AAIObjectPlurals(AAIObjectType.PNF, AAINamespaceConstants.NETWORK, "/pnfs");
+ public static final AAIObjectPlurals PROJECT =
+ new AAIObjectPlurals(AAIObjectType.PROJECT, AAINamespaceConstants.BUSINESS, "/projects");
private final String uriTemplate;
private final String partialUri;
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 7711608288..1f944da7ba 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
@@ -335,7 +335,6 @@ public class OrchestrationRequestsTest extends BaseTest {
Map<String, List<String>> orchestrationMap = new HashMap<>();
orchestrationMap.put("modelType", values);
- List<GetOrchestrationResponse> testResponses = new ArrayList<>();
List<InfraActiveRequests> requests = requestsDbClient.getOrchestrationFiltersFromInfraActive(orchestrationMap);
HttpHeaders headers = new HttpHeaders();
@@ -427,7 +426,6 @@ public class OrchestrationRequestsTest extends BaseTest {
public void testUnlockOrchestrationRequest_Valid_Status()
throws JsonParseException, JsonMappingException, IOException, ValidationException {
setupTestUnlockOrchestrationRequest_Valid_Status("5ffbabd6-b793-4377-a1ab-082670fbc7ac", "PENDING");
- ObjectMapper mapper = new ObjectMapper();
String requestJSON =
new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/Request.json")));
HttpHeaders headers = new HttpHeaders();
@@ -481,7 +479,6 @@ 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/packages/docker/pom.xml b/packages/docker/pom.xml
index a4a1e378d5..20b61e638a 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -271,6 +271,30 @@
</build>
</image>
<image>
+ <name>${docker.image.prefix}/so-oof-adapter</name>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFile>docker-files/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:mso-oof-adapter</include>
+ </includes>
+ <outputFileNameMapping>app.jar</outputFileNameMapping>
+ </dependencySet>
+ </dependencySets>
+ </inline>
+ </assembly>
+ </build>
+ </image>
+ <image>
<name>${docker.image.prefix}/so-appc-orchestrator</name>
<build>
<cleanup>try</cleanup>
@@ -469,7 +493,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}/so-simulator,${docker.image.prefix}/mso-nssmf-adapter,${docker.image.prefix}/mso-cnf-adapter,${docker.image.prefix}/so-etsi-nfvo-ns-lcm</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,${docker.image.prefix}/mso-nssmf-adapter,${docker.image.prefix}/so-oof-adapter,${docker.image.prefix}/mso-cnf-adapter,${docker.image.prefix}/so-etsi-nfvo-ns-lcm</image>
</configuration>
</execution>
</executions>
@@ -529,6 +553,11 @@
</dependency>
<dependency>
<groupId>org.onap.so.adapters</groupId>
+ <artifactId>mso-oof-adapter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so.adapters</groupId>
<artifactId>so-appc-orchestrator</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
index 8257e6ba22..8a7eb9d006 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-api/src/main/resources/SOL005-NSLifecycleManagement-API.json
@@ -75,7 +75,8 @@
},
"retirementDate":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
}
@@ -9667,7 +9668,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstantiationLevelId":{
"description":"An identifier that is unique within a NS descriptor. Representation: string of variable length.\n",
@@ -10745,7 +10747,8 @@
},
"scaleTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
},
@@ -13113,7 +13116,8 @@
},
"updateTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
}
}
},
@@ -15175,7 +15179,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -15194,7 +15199,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -15202,14 +15208,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"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",
@@ -16396,7 +16395,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -16415,7 +16415,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -16423,14 +16424,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"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",
@@ -19521,7 +19515,8 @@
},
"statusEnteredTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"nsInstanceId":{
"description":"An identifier with the intention of being globally unique.\n",
@@ -19540,7 +19535,8 @@
},
"startTime":{
"description":"Date-time stamp. Representation: String formatted according toas defined by the date-time production in IETF RFC 3339.\n",
- "format":"date-time"
+ "format":"date-time",
+ "type":"string"
},
"isAutomaticInvocation":{
"description":"Set to true if this NS LCM operation occurrence has been automatically triggered by the NFVO. This occurs in the case of auto-scaling, auto-healing and when a nested NS is modified as a result of an operation on its composite NS. Set to false otherwise.\n",
@@ -19548,14 +19544,7 @@
},
"operationParams":{
"description":"Input parameters of the LCM operation. This attribute shall be formatted according to the request data type of the related LCM operation. The following mapping between lcmOperationType and the data type of this attribute shall apply: - INSTANTIATE: InstantiateNsRequest - SCALE: ScaleNsRequest - UPDATE: UpdateNsRequest - HEAL: HealNsRequest - TERMINATE: TerminateNsRequest This attribute shall be present if this data type is returned in a response to reading an individual resource, and may be present according to the chosen attribute selector parameter if this data type is returned in a response to a query of a container resource.\n",
- "type":"string",
- "enum":[
- "INSTANTIATE",
- "SCALE",
- "UPDATE",
- "HEAL",
- "TERMINATE"
- ]
+ "type":"object"
},
"isCancelPending":{
"description":"If the LCM operation occurrence is in \"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",
diff --git a/version.properties b/version.properties
index 4bdcfa1b54..f56901fc20 100644
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=1
minor=7
-patch=1
+patch=2
base_version=${major}.${minor}.${patch}