summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java6
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java4
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java1
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy26
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy38
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn4
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn207
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn4
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java49
-rw-r--r--docs/developer_info/Docker-Config_Understanding.rst364
-rw-r--r--docs/developer_info/developer_information.rst1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstances.java18
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java20
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java6
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/beans/BeansTest.java8
-rw-r--r--pom.xml2
-rw-r--r--releases/1.7.4.yaml33
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/AbstractNetworkServiceTask.java10
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/CreateInstantiateVnfTask.java17
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/TerminateVnfTask.java34
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/CancelModeType.java (renamed from adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java)29
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java44
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql3
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/lifecycle/NsLcmOperationOccurrenceManager.java122
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesController.java24
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesControllerTest.java72
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml6
-rw-r--r--version.properties2
39 files changed, 963 insertions, 243 deletions
diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java
index a2af1a4580..4a8e95ff07 100644
--- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java
+++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java
@@ -199,9 +199,9 @@ public class LifecycleManager {
private String sendInstantiateRequestToVnfm(final EsrVnfm vnfm, final GenericVnf genericVnf,
final CreateVnfRequest createVnfRequest) {
- final InstantiateVnfRequest instantiateVnfRequest =
- vnfmHelper.createInstantiateRequest(createVnfRequest.getTenant(), createVnfRequest,
- packageProvider.getFlavourId(genericVnf.getModelVersionId()));
+ final String pkgId = getPackageId(createVnfRequest, genericVnf);
+ final InstantiateVnfRequest instantiateVnfRequest = vnfmHelper.createInstantiateRequest(
+ createVnfRequest.getTenant(), createVnfRequest, packageProvider.getFlavourId(pkgId));
final String jobId = vnfmServiceProvider.instantiateVnf(vnfm, genericVnf.getSelflink(), instantiateVnfRequest);
logger.info("Instantiate VNF request successfully sent to " + genericVnf.getSelflink());
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
index c69800d640..c2b3ffddca 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java
@@ -57,9 +57,11 @@ public class ASDCConfiguration implements IConfiguration {
public static final String WORKFLOW = "WORKFLOW";
public static final String VF_MODULES_METADATA = "VF_MODULES_METADATA";
public static final String CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT = "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT";
+ public static final String HELM = "HELM";
+
private static final String[] SUPPORTED_ARTIFACT_TYPES = {HEAT, HEAT_ARTIFACT, HEAT_ENV, HEAT_NESTED, HEAT_NET,
- HEAT_VOL, OTHER, TOSCA_CSAR, VF_MODULES_METADATA, WORKFLOW, CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT};
+ HEAT_VOL, OTHER, TOSCA_CSAR, VF_MODULES_METADATA, WORKFLOW, CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT, HELM};
public static final List<String> SUPPORTED_ARTIFACT_TYPES_LIST =
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
index f5b0e17cf5..1b5463211c 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/VfResourceStructure.java
@@ -119,6 +119,7 @@ public class VfResourceStructure extends ResourceStructure {
case ASDCConfiguration.HEAT_NET:
case ASDCConfiguration.OTHER:
case ASDCConfiguration.CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT:
+ case ASDCConfiguration.HELM:
artifactsMapByUUID.put(artifactInfo.getArtifactUUID(), vfModuleArtifact);
break;
case ASDCConfiguration.VF_MODULES_METADATA:
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
index 55d76819fc..e5d8a921a5 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
@@ -92,7 +92,7 @@ public class AbstractCDSProcessingBBUtils {
*
* @param execution BuildingBlockExecution object
*/
- public void constructExecutionServiceInputObject(BuildingBlockExecution execution) {
+ public void constructExecutionServiceInputObjectBB(BuildingBlockExecution execution) {
logger.trace("Start AbstractCDSProcessingBBUtils.preProcessRequest for BuildingBlockExecution object.");
try {
@@ -136,7 +136,7 @@ public class AbstractCDSProcessingBBUtils {
*
* @param execution BuildingBlockExecution object
*/
- public void sendRequestToCDSClient(BuildingBlockExecution execution) {
+ public void sendRequestToCDSClientBB(BuildingBlockExecution execution) {
logger.trace("Start AbstractCDSProcessingBBUtils.sendRequestToCDSClient for BuildingBlockExecution object.");
try {
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
index 10844ec652..40b0ed5624 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java
@@ -97,7 +97,7 @@ public class AbstractCDSProcessingBBUtilsTest {
BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
when(execution.getVariable("executionObject")).thenReturn(abstractCDSPropertiesBean);
- abstractCDSProcessingBBUtils.constructExecutionServiceInputObject(execution);
+ abstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(execution);
verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(),
any(Exception.class));
}
@@ -107,7 +107,7 @@ public class AbstractCDSProcessingBBUtilsTest {
BuildingBlockExecution execution = mock(BuildingBlockExecution.class);
when(execution.getVariable("executionServiceInput")).thenReturn(abstractCDSPropertiesBean);
- abstractCDSProcessingBBUtils.sendRequestToCDSClient(execution);
+ abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(execution);
verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(),
any(Exception.class));
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn
index ccd6b0bd48..a69ee25a3a 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn
@@ -10,11 +10,11 @@
<bpmn:endEvent id="EndEvent_1h3epjc">
<bpmn:incoming>SequenceFlow_161g9uz</bpmn:incoming>
</bpmn:endEvent>
- <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObject(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_02v5z4h</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0gksy4i</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:serviceTask id="Task_0kjfr5o" name="CDS&#10;(Call SelfServiceAPI)&#10;" camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClient(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="Task_0kjfr5o" name="CDS&#10;(Call SelfServiceAPI)&#10;" camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClientBB(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_0gksy4i</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_161g9uz</bpmn:outgoing>
</bpmn:serviceTask>
@@ -47,4 +47,4 @@
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn:definitions>
+</bpmn:definitions> \ No newline at end of file
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 8993127dbc..1d5232f3c5 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
@@ -95,7 +95,7 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
List<TemplateInfo> nsstInfos = new ArrayList<>()
ServiceDecomposition nstServiceDecomposition =
execution.getVariable("nstServiceDecomposition") as ServiceDecomposition
- //todo:
+
List<AllottedResource> allottedResources = nstServiceDecomposition.getAllottedResources()
for (AllottedResource allottedResource : allottedResources) {
TemplateInfo nsstInfo = new TemplateInfo()
@@ -150,9 +150,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
execution.setVariable("nsstServiceDecompositions", nsstServiceDecompositions)
-
-
-
int num = execution.getVariable("maxNsstIndex") as Integer
int index = execution.getVariable("currentNsstIndex") as Integer
@@ -180,8 +177,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
List<SubnetCapability> subnetCapabilities = new ArrayList<>()
-
-
for (ServiceDecomposition serviceDecomposition : nsstServiceDecompositions) {
SubnetCapability subnetCapability = new SubnetCapability()
handleByType(execution, serviceDecomposition, sliceParams, subnetCapability)
@@ -206,7 +201,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
sliceParams.tnBHSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid()
sliceParams.tnBHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid()
sliceParams.tnBHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName()
-
break
case SubnetType.TN_MH:
sliceParams.tnMHSliceTaskInfo.vendor = vendor
@@ -215,7 +209,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
sliceParams.tnMHSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid()
sliceParams.tnMHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid()
sliceParams.tnMHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName()
-
break
case SubnetType.AN_NF:
sliceParams.anSliceTaskInfo.vendor = vendor
@@ -236,9 +229,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
default:
subnetType = null
break
-
- //todo
-
}
if (null == subnetType) {
def msg = "Get subnetType failed, modelUUId=" + modelInfo.getModelUuid()
@@ -297,17 +287,16 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
private static String buildQuerySubnetCapRequest(String vendor, SubnetType subnetType) {
NssmfAdapterNBIRequest request = new NssmfAdapterNBIRequest()
- List<String> subnetTypes = new ArrayList<>()
- subnetTypes.add(subnetType.subnetType)
+// List<String> subnetTypes = new ArrayList<>()
+// subnetTypes.add(subnetType.subnetType)
Map<String, Object> paramMap = new HashMap()
- paramMap.put("subnetTypes", subnetTypes)
+ paramMap.put("subnetType", subnetType.subnetType)
request.setSubnetCapabilityQuery(objectMapper.writeValueAsString(paramMap))
EsrInfo esrInfo = new EsrInfo()
esrInfo.setVendor(vendor)
esrInfo.setNetworkType(subnetType.networkType)
-
request.setEsrInfo(esrInfo)
String strRequest = objectMapper.writeValueAsString(request)
@@ -320,7 +309,8 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
* prepare select nsi request
* @param execution
*/
- public void preNSIRequest(DelegateExecution execution, boolean preferReuse) {
+ public void preNSIRequest(DelegateExecution execution) {
+ boolean preferReuse = execution.getVariable("needQuerySliceProfile") ? false : true
String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
logger.debug( "get NSI option OOF Url: " + urlString)
@@ -378,8 +368,9 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
if (isSharable && solution.get("existingNSI")) {
//sharedNSISolution
processSharedNSI(solution, sliceTaskParams)
+ execution.setVariable("needQuerySliceProfile", true)
}
- else if(solution.containsKey("newNSISolution")) {
+ else {
processNewNSI(solution, sliceTaskParams)
}
}
@@ -395,6 +386,7 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
String nsiName = sharedNSISolution.get("NSIName")
sliceParams.setSuggestNsiId(nsiId)
sliceParams.setSuggestNsiName(nsiName)
+
}
private void processNewNSI(Map<String, Object> solution, SliceTaskParamsAdapter sliceParams) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy
index baf0333a19..fbb2b00854 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy
@@ -93,7 +93,7 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor {
try {
String serviceInstanceId = execution.getVariable("serviceInstanceID")
- String sdncRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, "deallocate")
+ String sdncRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, "delete")
execution.setVariable("TNNSSMF_SDNCRequest", sdncRequest)
logger.debug("Outgoing SDNCRequest is: \n" + sdncRequest)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy
index 1bb0e8aca7..92953fd60b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy
@@ -66,7 +66,29 @@ class TnNssmfUtils {
}
}
- String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action) {
+ String buildSDNCRequest(DelegateExecution execution, String svcInstId, String svcAction) {
+ String reqAction
+ switch (svcAction) {
+ case "create":
+ reqAction = "AllocateTransportSliceInstance"
+ break
+ case "delete":
+ reqAction = "DeleteTransportSliceInstance"
+ break
+ case "activate":
+ reqAction = "ActivateTransportSliceInstance"
+ break
+ case "deactivate":
+ reqAction = "DeactivateTransportSliceInstance"
+ break
+ default:
+ reqAction = svcAction
+ }
+
+ buildSDNCRequest(execution, svcInstId, svcAction, reqAction)
+ }
+
+ String buildSDNCRequest(DelegateExecution execution, String svcInstId, String svcAction, String reqAction) {
String uuid = execution.getVariable('testReqId') // for junits
if (uuid == null) {
@@ -105,7 +127,7 @@ class TnNssmfUtils {
<sdncadapter:RequestHeader>
<sdncadapter:RequestId>${MsoUtils.xmlEscape(uuid)}</sdncadapter:RequestId>
<sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction>
+ <sdncadapter:SvcAction>${MsoUtils.xmlEscape(svcAction)}</sdncadapter:SvcAction>
<sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
<sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl>
<sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
@@ -113,7 +135,7 @@ class TnNssmfUtils {
<sdncadapterworkflow:SDNCRequestData>
<request-information>
<request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
- <request-action>AllocateTnNssi</request-action>
+ <request-action>${MsoUtils.xmlEscape(reqAction)}</request-action>
<source>${MsoUtils.xmlEscape(source)}</source>
<notification-url/>
<order-number/>
@@ -168,7 +190,7 @@ class TnNssmfUtils {
String msg
- String prefix = execution.setVariable("prefix")
+ String prefix = execution.getVariable("prefix")
if (isBlank(prefix)) {
if (exceptionOnErr) {
msg = "validateSDNCResponse: prefix is null"
@@ -181,7 +203,8 @@ class TnNssmfUtils {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- logger.debug("workflowException: " + workflowException)
+ logger.debug("TnNssmfUtils.validateSDNCResponse: SDNCResponse: " + response)
+ logger.debug("TnNssmfUtils.validateSDNCResponse: workflowException: " + workflowException)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
@@ -189,6 +212,9 @@ class TnNssmfUtils {
if (execution.getVariable(prefix + 'sdncResponseSuccess') == true) {
logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
RollbackData rollbackData = execution.getVariable("rollbackData")
+ if (rollbackData == null) {
+ rollbackData = new RollbackData()
+ }
if (method.equals("allocate")) {
rollbackData.put("VNFMODULE", "rollbackSDNCRequestAllocate", "true")
@@ -204,7 +230,7 @@ class TnNssmfUtils {
execution.setVariable("rollbackData", rollbackData)
} else {
if (exceptionOnErr) {
- msg = "validateSDNCResponse: bad Response from SDNC Adapter for " + method + " SDNC Call."
+ msg = "TnNssmfUtils.validateSDNCResponse: bad Response from SDNC Adapter for " + method + " SDNC Call."
logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
index 8ecce46ac0..4447b32f4a 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
@@ -56,8 +56,8 @@ runScript.preprocessSdncActOrDeactTnNssiRequest(execution)</bpmn:script>
<bpmn:extensionElements>
<camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+ <camunda:in source="msoRequestId" target="mso-request-id" />
+ <camunda:in source="sliceServiceInstanceId" target="mso-service-instance-id" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" />
<camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" />
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 1bda596c6a..7699e804b4 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
@@ -160,10 +160,11 @@ dcso.processNSIResp(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:scriptTask id="ScriptTask_0bgvphs" name="Prepare OOF Select NSI options request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_1iawj3m</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1e7iqkm</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_14o0fxe</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcso = new DoCreateSliceServiceOption()
-dcso.preNSIRequest(execution,true)</bpmn:script>
+dcso.preNSIRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:intermediateCatchEvent id="IntermediateCatchEvent_00uke3g" name=" Select NSSI ">
<bpmn:outgoing>SequenceFlow_1iawj3m</bpmn:outgoing>
@@ -190,7 +191,7 @@ dcso.handleNssiSelect(execution)</bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_103oxyw" sourceRef="CallActivity_0melx8d" targetRef="ParallelGateway_06a2n9u" />
<bpmn:sequenceFlow id="SequenceFlow_14rhmx9" sourceRef="CallActivity_1vzxvna" targetRef="ParallelGateway_06a2n9u" />
<bpmn:parallelGateway id="ParallelGateway_05zg916">
- <bpmn:incoming>SequenceFlow_1h3kdce</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0vfe8hp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0il5j01</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_0euwvgf</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_05250mp</bpmn:outgoing>
@@ -198,7 +199,7 @@ dcso.handleNssiSelect(execution)</bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_0il5j01" sourceRef="ParallelGateway_05zg916" targetRef="CallActivity_0otry7e" />
<bpmn:sequenceFlow id="SequenceFlow_0euwvgf" sourceRef="ParallelGateway_05zg916" targetRef="CallActivity_0melx8d" />
<bpmn:sequenceFlow id="SequenceFlow_05250mp" sourceRef="ParallelGateway_05zg916" targetRef="CallActivity_1vzxvna" />
- <bpmn:sequenceFlow id="SequenceFlow_1h3kdce" sourceRef="ScriptTask_12t6v71" targetRef="ParallelGateway_05zg916" />
+ <bpmn:sequenceFlow id="SequenceFlow_1h3kdce" sourceRef="ScriptTask_12t6v71" targetRef="ExclusiveGateway_015qbbq" />
<bpmn:sequenceFlow id="SequenceFlow_1tqg26p" sourceRef="CallActivity_0tzazs0" targetRef="Task_00nfg5x" />
<bpmn:sequenceFlow id="SequenceFlow_1tey3hz" sourceRef="Task_1jyj2vs" targetRef="ExclusiveGateway_0b52m39" />
<bpmn:sequenceFlow id="SequenceFlow_0abqxa1" sourceRef="Task_1m9qoo3" targetRef="CallActivity_0tzazs0" />
@@ -216,212 +217,234 @@ dcso.handleNssiSelect(execution)</bpmn:script>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1nrfy6i" sourceRef="ExclusiveGateway_0b52m39" targetRef="EndEvent_0p0cjhl" />
<bpmn:sequenceFlow id="SequenceFlow_1ezi1oi" sourceRef="Task_00nfg5x" targetRef="ExclusiveGateway_0b52m39" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_015qbbq" default="SequenceFlow_0vfe8hp">
+ <bpmn:incoming>SequenceFlow_1h3kdce</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0vfe8hp</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1e7iqkm</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_0vfe8hp" sourceRef="ExclusiveGateway_015qbbq" targetRef="ParallelGateway_05zg916" />
+ <bpmn:sequenceFlow id="SequenceFlow_1e7iqkm" sourceRef="ExclusiveGateway_015qbbq" targetRef="ScriptTask_0bgvphs">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("needQuerySliceProfile") == true}</bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateSliceServiceOption">
<bpmndi:BPMNShape id="ScriptTask_11rb2ju_di" bpmnElement="ScriptTask_11rb2ju">
- <dc:Bounds x="400" y="140" width="100" height="80" />
+ <dc:Bounds x="470" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0c567r4_di" bpmnElement="CallActivity_0c567r4">
- <dc:Bounds x="560" y="140" width="100" height="80" />
+ <dc:Bounds x="630" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0z0dwk2_di" bpmnElement="ScriptTask_0z0dwk2">
- <dc:Bounds x="710" y="140" width="100" height="80" />
+ <dc:Bounds x="780" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1kzy63m_di" bpmnElement="SequenceFlow_1kzy63m">
- <di:waypoint x="500" y="180" />
- <di:waypoint x="560" y="180" />
+ <di:waypoint x="570" y="180" />
+ <di:waypoint x="630" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1t317y2_di" bpmnElement="SequenceFlow_1t317y2">
- <di:waypoint x="660" y="180" />
- <di:waypoint x="710" y="180" />
+ <di:waypoint x="730" y="180" />
+ <di:waypoint x="780" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0tzazs0_di" bpmnElement="CallActivity_0tzazs0">
- <dc:Bounds x="1410" y="320" width="100" height="80" />
+ <dc:Bounds x="1560" y="320" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_0mwlirs_di" bpmnElement="StartEvent_0mwlirs">
- <dc:Bounds x="162" y="162" width="36" height="36" />
+ <dc:Bounds x="232" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="169" y="198" width="25" height="14" />
+ <dc:Bounds x="239" y="198" width="25" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0w34e57_di" bpmnElement="ScriptTask_0w34e57">
- <dc:Bounds x="230" y="140" width="100" height="80" />
+ <dc:Bounds x="300" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1fuwy35_di" bpmnElement="SequenceFlow_1fuwy35">
- <di:waypoint x="198" y="180" />
- <di:waypoint x="230" y="180" />
+ <di:waypoint x="268" y="180" />
+ <di:waypoint x="300" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1anc3ln_di" bpmnElement="CallActivity_1vzxvna">
- <dc:Bounds x="740" y="320" width="100" height="80" />
+ <dc:Bounds x="950" y="330" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1xgkaqi_di" bpmnElement="CallActivity_0melx8d">
- <dc:Bounds x="740" y="460" width="100" height="80" />
+ <dc:Bounds x="950" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_11y7ba5_di" bpmnElement="CallActivity_0otry7e">
- <dc:Bounds x="740" y="580" width="100" height="80" />
+ <dc:Bounds x="950" y="580" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1icyh1a_di" bpmnElement="Task_1m9qoo3">
- <dc:Bounds x="1410" y="460" width="100" height="80" />
+ <dc:Bounds x="1560" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0aqbm7t_di" bpmnElement="Task_00nfg5x">
- <dc:Bounds x="1210" y="320" width="100" height="80" />
+ <dc:Bounds x="1360" y="320" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_12sydez_di" bpmnElement="ScriptTask_12sydez">
- <dc:Bounds x="860" y="140" width="100" height="80" />
+ <dc:Bounds x="930" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0hfiogq_di" bpmnElement="CallActivity_0hfiogq">
- <dc:Bounds x="1010" y="140" width="100" height="80" />
+ <dc:Bounds x="1080" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_14j28c2_di" bpmnElement="ScriptTask_14j28c2">
- <dc:Bounds x="1170" y="140" width="100" height="80" />
+ <dc:Bounds x="1240" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_12pvazb_di" bpmnElement="SequenceFlow_12pvazb">
- <di:waypoint x="960" y="180" />
- <di:waypoint x="1010" y="180" />
+ <di:waypoint x="1030" y="180" />
+ <di:waypoint x="1080" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1inonqp_di" bpmnElement="SequenceFlow_1inonqp">
- <di:waypoint x="1110" y="180" />
- <di:waypoint x="1170" y="180" />
+ <di:waypoint x="1180" y="180" />
+ <di:waypoint x="1240" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1bxdugq_di" bpmnElement="IntermediateThrowEvent_1bxdugq">
- <dc:Bounds x="1482" y="162" width="36" height="36" />
+ <dc:Bounds x="1552" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1459" y="205" width="87" height="14" />
+ <dc:Bounds x="1529" y="205" width="87" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_067xdx1_di" bpmnElement="SequenceFlow_067xdx1">
- <di:waypoint x="330" y="180" />
<di:waypoint x="400" y="180" />
+ <di:waypoint x="470" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_049glzl_di" bpmnElement="SequenceFlow_049glzl">
- <di:waypoint x="1270" y="180" />
- <di:waypoint x="1320" y="180" />
+ <di:waypoint x="1340" y="180" />
+ <di:waypoint x="1390" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0zglfyw_di" bpmnElement="SequenceFlow_0zglfyw">
- <di:waypoint x="1230" y="140" />
- <di:waypoint x="1230" y="80" />
- <di:waypoint x="910" y="80" />
- <di:waypoint x="910" y="140" />
+ <di:waypoint x="1300" y="140" />
+ <di:waypoint x="1300" y="80" />
+ <di:waypoint x="980" y="80" />
+ <di:waypoint x="980" y="140" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0t4gmix_di" bpmnElement="SequenceFlow_0t4gmix">
- <di:waypoint x="810" y="180" />
- <di:waypoint x="860" y="180" />
+ <di:waypoint x="880" y="180" />
+ <di:waypoint x="930" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1tx9eou_di" bpmnElement="Task_1xqjkqx">
- <dc:Bounds x="1320" y="140" width="100" height="80" />
+ <dc:Bounds x="1390" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_16akt81_di" bpmnElement="SequenceFlow_16akt81">
- <di:waypoint x="1420" y="180" />
- <di:waypoint x="1482" y="180" />
+ <di:waypoint x="1490" y="180" />
+ <di:waypoint x="1552" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0vs5jgq_di" bpmnElement="CallActivity_0vs5jgq">
- <dc:Bounds x="360" y="460" width="100" height="80" />
+ <dc:Bounds x="410" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_12t6v71_di" bpmnElement="ScriptTask_12t6v71">
- <dc:Bounds x="490" y="460" width="100" height="80" />
+ <dc:Bounds x="580" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0bgvphs_di" bpmnElement="ScriptTask_0bgvphs">
- <dc:Bounds x="210" y="460" width="100" height="80" />
+ <dc:Bounds x="250" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateCatchEvent_00uke3g_di" bpmnElement="IntermediateCatchEvent_00uke3g">
- <dc:Bounds x="142" y="482" width="36" height="36" />
+ <dc:Bounds x="162" y="482" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="135" y="525" width="60" height="14" />
+ <dc:Bounds x="155" y="525" width="60" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_14o0fxe_di" bpmnElement="SequenceFlow_14o0fxe">
- <di:waypoint x="310" y="500" />
- <di:waypoint x="360" y="500" />
+ <di:waypoint x="350" y="500" />
+ <di:waypoint x="410" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0nwt0ci_di" bpmnElement="SequenceFlow_0nwt0ci">
- <di:waypoint x="460" y="500" />
- <di:waypoint x="490" y="500" />
+ <di:waypoint x="510" y="500" />
+ <di:waypoint x="580" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1iawj3m_di" bpmnElement="SequenceFlow_1iawj3m">
- <di:waypoint x="178" y="500" />
- <di:waypoint x="210" y="500" />
+ <di:waypoint x="198" y="500" />
+ <di:waypoint x="250" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0h3fsja_di" bpmnElement="Task_1jyj2vs">
- <dc:Bounds x="1010" y="460" width="100" height="80" />
+ <dc:Bounds x="1220" y="460" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ParallelGateway_06a2n9u_di" bpmnElement="ParallelGateway_06a2n9u">
- <dc:Bounds x="905" y="475" width="50" height="50" />
+ <dc:Bounds x="1105" y="475" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1tr3i9d_di" bpmnElement="SequenceFlow_1tr3i9d">
- <di:waypoint x="955" y="500" />
- <di:waypoint x="1010" y="500" />
+ <di:waypoint x="1155" y="500" />
+ <di:waypoint x="1220" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0aasemn_di" bpmnElement="SequenceFlow_0aasemn">
- <di:waypoint x="840" y="620" />
- <di:waypoint x="930" y="620" />
- <di:waypoint x="930" y="525" />
+ <di:waypoint x="1050" y="620" />
+ <di:waypoint x="1130" y="620" />
+ <di:waypoint x="1130" y="525" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_103oxyw_di" bpmnElement="SequenceFlow_103oxyw">
- <di:waypoint x="840" y="500" />
- <di:waypoint x="905" y="500" />
+ <di:waypoint x="1050" y="500" />
+ <di:waypoint x="1105" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_14rhmx9_di" bpmnElement="SequenceFlow_14rhmx9">
- <di:waypoint x="840" y="360" />
- <di:waypoint x="930" y="360" />
- <di:waypoint x="930" y="475" />
+ <di:waypoint x="1050" y="370" />
+ <di:waypoint x="1130" y="370" />
+ <di:waypoint x="1130" y="475" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ParallelGateway_05zg916_di" bpmnElement="ParallelGateway_05zg916">
- <dc:Bounds x="635" y="475" width="50" height="50" />
+ <dc:Bounds x="825" y="475" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0il5j01_di" bpmnElement="SequenceFlow_0il5j01">
- <di:waypoint x="660" y="525" />
- <di:waypoint x="660" y="620" />
- <di:waypoint x="740" y="620" />
+ <di:waypoint x="850" y="525" />
+ <di:waypoint x="850" y="620" />
+ <di:waypoint x="950" y="620" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0euwvgf_di" bpmnElement="SequenceFlow_0euwvgf">
- <di:waypoint x="685" y="500" />
- <di:waypoint x="740" y="500" />
+ <di:waypoint x="875" y="500" />
+ <di:waypoint x="950" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_05250mp_di" bpmnElement="SequenceFlow_05250mp">
- <di:waypoint x="660" y="475" />
- <di:waypoint x="660" y="360" />
- <di:waypoint x="740" y="360" />
+ <di:waypoint x="850" y="475" />
+ <di:waypoint x="850" y="370" />
+ <di:waypoint x="950" y="370" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1h3kdce_di" bpmnElement="SequenceFlow_1h3kdce">
- <di:waypoint x="590" y="500" />
- <di:waypoint x="635" y="500" />
+ <di:waypoint x="680" y="500" />
+ <di:waypoint x="725" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1tqg26p_di" bpmnElement="SequenceFlow_1tqg26p">
- <di:waypoint x="1410" y="360" />
- <di:waypoint x="1310" y="360" />
+ <di:waypoint x="1560" y="360" />
+ <di:waypoint x="1460" y="360" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1tey3hz_di" bpmnElement="SequenceFlow_1tey3hz">
- <di:waypoint x="1110" y="500" />
- <di:waypoint x="1235" y="500" />
+ <di:waypoint x="1320" y="500" />
+ <di:waypoint x="1385" y="500" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0abqxa1_di" bpmnElement="SequenceFlow_0abqxa1">
- <di:waypoint x="1460" y="460" />
- <di:waypoint x="1460" y="400" />
+ <di:waypoint x="1610" y="460" />
+ <di:waypoint x="1610" y="400" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0b52m39_di" bpmnElement="ExclusiveGateway_0b52m39" isMarkerVisible="true">
- <dc:Bounds x="1235" y="475" width="50" height="50" />
+ <dc:Bounds x="1385" y="475" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1218" y="463" width="85" height="14" />
+ <dc:Bounds x="1367" y="535" width="86" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_126j77n_di" bpmnElement="SequenceFlow_126j77n">
- <di:waypoint x="1285" y="500" />
- <di:waypoint x="1410" y="500" />
+ <di:waypoint x="1435" y="500" />
+ <di:waypoint x="1560" y="500" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1339" y="482" width="17" height="14" />
+ <dc:Bounds x="1489" y="482" width="17" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0p0cjhl_di" bpmnElement="EndEvent_0p0cjhl">
- <dc:Bounds x="1242" y="632" width="36" height="36" />
+ <dc:Bounds x="1392" y="632" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1nrfy6i_di" bpmnElement="SequenceFlow_1nrfy6i">
- <di:waypoint x="1260" y="525" />
- <di:waypoint x="1260" y="632" />
+ <di:waypoint x="1410" y="525" />
+ <di:waypoint x="1410" y="632" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1ezi1oi_di" bpmnElement="SequenceFlow_1ezi1oi">
- <di:waypoint x="1260" y="400" />
- <di:waypoint x="1260" y="475" />
+ <di:waypoint x="1410" y="400" />
+ <di:waypoint x="1410" y="475" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_015qbbq_di" bpmnElement="ExclusiveGateway_015qbbq" isMarkerVisible="true">
+ <dc:Bounds x="725" y="475" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0vfe8hp_di" bpmnElement="SequenceFlow_0vfe8hp">
+ <di:waypoint x="775" y="500" />
+ <di:waypoint x="825" y="500" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1e7iqkm_di" bpmnElement="SequenceFlow_1e7iqkm">
+ <di:waypoint x="750" y="525" />
+ <di:waypoint x="750" y="620" />
+ <di:waypoint x="300" y="620" />
+ <di:waypoint x="300" y="540" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn
index e9cbbb77cc..55adbe3698 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn
@@ -45,8 +45,8 @@ dcsi.preprocessSdncAllocateTnNssiRequest(execution)</bpmn:script>
<bpmn:extensionElements>
<camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+ <camunda:in source="msoRequestId" target="mso-request-id" />
+ <camunda:in source="sliceServiceInstanceId" target="mso-service-instance-id" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" />
<camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" />
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
index a800289aaa..94279b7fe8 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
@@ -55,8 +55,8 @@ runScript.preprocessSdncDeallocateTnNssiRequest(execution)</bpmn:script>
<bpmn:extensionElements>
<camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+ <camunda:in source="msoRequestId" target="mso-request-id" />
+ <camunda:in source="sliceServiceInstanceId" target="mso-service-instance-id" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" />
<camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" />
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java
index d78b7c3af0..1fae5ce06c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java
@@ -84,7 +84,7 @@ public class GenericCDSProcessingBB implements ControllerRunnable<BuildingBlockE
@Override
public void run(ControllerContext<BuildingBlockExecution> context) {
BuildingBlockExecution obj = context.getExecution();
- cdsDispather.constructExecutionServiceInputObject(obj);
- cdsDispather.sendRequestToCDSClient(obj);
+ cdsDispather.constructExecutionServiceInputObjectBB(obj);
+ cdsDispather.sendRequestToCDSClientBB(obj);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java
index 3b81d52703..fe6d9de199 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java
@@ -94,8 +94,8 @@ public class GenericPnfCDSControllerRunnableBB implements ControllerRunnable<Bui
@Override
public void run(ControllerContext<BuildingBlockExecution> controllerContext) {
BuildingBlockExecution buildingBlockExecution = controllerContext.getExecution();
- abstractCDSProcessingBBUtils.constructExecutionServiceInputObject(buildingBlockExecution);
- abstractCDSProcessingBBUtils.sendRequestToCDSClient(buildingBlockExecution);
+ abstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(buildingBlockExecution);
+ abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(buildingBlockExecution);
}
private AbstractCDSPropertiesBean prepareAndSetCdsPropertyBean(BuildingBlockExecution buildingBlockExecution) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
index 682a0471ee..2119ced951 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
@@ -29,6 +29,7 @@ import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulator;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
@@ -48,6 +49,9 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
private Set<String> vFModuleAction =
new HashSet<String>(Arrays.asList("VfModuleConfigAssign", "VfModuleConfigDeploy"));
+ private Set<String> pnfActions =
+ new HashSet<>(Arrays.asList("config-assign", "config-deploy", "PnfConfigAssign", "PnfConfigDeploy"));
+
@Override
public boolean shouldRunFor(String currentBBName, boolean isFirst, BuildingBlockExecution execution) {
@@ -95,9 +99,17 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
boolean skipVfModule = vfc.isSkipPostInstConf();
currentSequenceSkipCheck(execution, skipVfModule);
}
- }
+ } else if (currentBB.getBuildingBlock().getBpmnScope().equalsIgnoreCase("PNF")
+ && containsIgnoreCaseAction(currentBB, pnfActions)) {
+ PnfResourceCustomization pnfResourceCustomization =
+ catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(customizationUUID);
+ if (null != pnfResourceCustomization) {
+ boolean skipConfigPNF = pnfResourceCustomization.isSkipPostInstConf();
+ currentSequenceSkipCheck(execution, skipConfigPNF);
+ }
+ }
}
private boolean containsIgnoreCaseAction(ExecuteBuildingBlock currentBB, Set<String> actions) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java
index 24bbc78afb..e360dc7c42 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java
@@ -102,8 +102,8 @@ public class GenericCDSProcessingBBTest extends BaseTaskTest {
AbstractCDSPropertiesBean cdsBean = prepareCDSBean();
doReturn(cdsBean).when(generatePayloadForCds).buildCdsPropertiesBean(buildingBlockExecution);
- doNothing().when(cdsDispather).constructExecutionServiceInputObject(buildingBlockExecution);
- doNothing().when(cdsDispather).sendRequestToCDSClient(buildingBlockExecution);
+ doNothing().when(cdsDispather).constructExecutionServiceInputObjectBB(buildingBlockExecution);
+ doNothing().when(cdsDispather).sendRequestToCDSClientBB(buildingBlockExecution);
// when
Boolean isUnderstandable = controllerRunnable.understand(controllerContext);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
index fb162f857b..fdf4d36c89 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListenerTest.java
@@ -36,6 +36,7 @@ import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
@@ -47,9 +48,11 @@ public class SkipCDSBuildingBlockListenerTest {
private static final String VNF_SCOPE = "VNF";
private static final String VF_SCOPE = "VFModule";
+ private static final String PNF_SCOPE = "pnf";
private static final String TEST_MODELUUID = "123456789";
private static final String VNF_TEST_ACTION = "VnfConfigAssign";
private static final String VFModule_TEST_ACTION = "VfModuleConfigAssign";
+ private static final String PNFModule_TEST_ACTION = "config-assign";
private static final String MODELCUSTOMIZATIONUUID = "123456789";
private static final String BBNAME = "ControllerExecutionBB";
private static final boolean ISFIRST = true;
@@ -63,6 +66,7 @@ public class SkipCDSBuildingBlockListenerTest {
private BuildingBlockExecution buildingBlockExecution = new DelegateExecutionImpl(new DelegateExecutionFake());
private VnfResourceCustomization vnfCust = new VnfResourceCustomization();
private VfModuleCustomization vfCust = new VfModuleCustomization();
+ private PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
private BuildingBlock buildingBlock = new BuildingBlock();
@InjectMocks
@@ -166,6 +170,44 @@ public class SkipCDSBuildingBlockListenerTest {
}
+ @Test
+ public void testProcessForPNFToSkipCDSBB() {
+ // given
+ setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
+ pnfResourceCustomization = getPnfResourceCustomization(true);
+
+ when(catalogDbClient
+ .getPnfResourceCustomizationByModelCustomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
+ .thenReturn(pnfResourceCustomization);
+
+ // when
+ skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
+
+ // then
+ actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
+ assertEquals(1, actual);
+
+ }
+
+ @Test
+ public void testProcessForPNFNotToSkipCDSBB() {
+ // given
+ setBuildingBlockAndCurrentSequence(PNF_SCOPE, PNFModule_TEST_ACTION, 0);
+ pnfResourceCustomization = getPnfResourceCustomization(false);
+
+ when(catalogDbClient
+ .getPnfResourceCustomizationByModelCustomizationUUID(executeBuildingBlock.getBuildingBlock().getKey()))
+ .thenReturn(pnfResourceCustomization);
+
+ // when
+ skipCDSBuildingBlockListener.run(flowsToExecute, executeBuildingBlock, buildingBlockExecution);
+
+ // then
+ actual = buildingBlockExecution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
+ assertEquals(0, actual);
+
+ }
+
/**
* setting scope action in buildingBlock and BB current sequence in BuildingBlockExecution
*
@@ -199,4 +241,11 @@ public class SkipCDSBuildingBlockListenerTest {
return vfModuleCustomizations;
}
+ private PnfResourceCustomization getPnfResourceCustomization(boolean setSkippost) {
+ PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
+ pnfResourceCustomization.setModelCustomizationUUID(MODELCUSTOMIZATIONUUID);
+ pnfResourceCustomization.setSkipPostInstConf(setSkippost);
+ return pnfResourceCustomization;
+ }
+
}
diff --git a/docs/developer_info/Docker-Config_Understanding.rst b/docs/developer_info/Docker-Config_Understanding.rst
new file mode 100644
index 0000000000..e684c6c480
--- /dev/null
+++ b/docs/developer_info/Docker-Config_Understanding.rst
@@ -0,0 +1,364 @@
+.. 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.
+
+Docker-config
+=============
+
+In SO (Service Orchestration) every component running on docker engine and respective containers. here we can see how so is working with Dokcer.
+
+CA(Certificate Authority)
+=========================
+
+Certificate Authorities/ CAs, issue Digital Certificates. Digital Certificates are verifiable small data files that contain identity credentials to help websites, people, and devices represent their authentic online identity (authentic because the CA has verified the identity). CAs play a critical role in how the Internet operates and how transparent, trusted transactions can take place online. CAs issue millions of Digital Certificates each year, and these certificates are used to protect information, encrypt billions of transactions, and enable secure communication.
+
+CA(file)
+
+/so/packages/docker/src/main/docker/docker-files/ca-certificates/onap-ca.crt
+
+Example CA cirtifiacte:-
+
+-----BEGIN CERTIFICATE-----
+MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix
+EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD
+VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y
+aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy
+MDQxOTUwMTZaMIGHMQswCQYDVQQGEwJHQjETMBEGA1..29tZS1TdGF0ZTEU
+MBIGA1UEChMLQmVzdCBDQSBMdGQxNzA1BgNVBAsTLk..DEgUHVibGljIFBy
+aW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxFD..AMTC0Jlc3QgQ0Eg
+THRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCg..Tz2mr7SZiAMfQyu
+vBjM9OiJjRazXBZ1BjP5CE/Wm/Rr500PRK+Lh9x5eJ../ANBE0sTK0ZsDGM
+ak2m1g7oruI3dY3VHqIxFTz0Ta1d+NAjwnLe4nOb7/..k05ShhBrJGBKKxb
+8n104o/5p8HAsZPdzbFMIyNjJzBM2o5y5A13wiLitE..fyYkQzaxCw0Awzl
+kVHiIyCuaF4wj571pSzkv6sv+4IDMbT/XpCo8L6wTa..sh+etLD6FtTjYbb
+rvZ8RQM1tlKdoMHg2qxraAV++HNBYmNWs0duEdjUbJ..XI9TtnS4o1Ckj7P
+OfljiQIDAQABo4HnMIHkMB0GA1UdDgQWBBQ8urMCRL..5AkIp9NJHJw5TCB
+tAYDVR0jBIGsMIGpgBQ8urMCRLYYMHUKU5AkIp9NJH..aSBijCBhzELMAkG
+A1UEBhMCR0IxEzARBgNVBAgTClNvbWUtU3RhdGUxFD..AoTC0Jlc3QgQ0Eg
+THRkMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcm..ENlcnRpZmljYXRp
+b24gQXV0aG9yaXR5MRQwEgYDVQQDEwtCZXN0IENBIE..DAMBgNVHRMEBTAD
+AQH/MA0GCSqGSIb3DQEBBAUAA4IBAQC1uYBcsSncwA..DCsQer772C2ucpX
+xQUE/C0pWWm6gDkwd5D0DSMDJRqV/weoZ4wC6B73f5..bLhGYHaXJeSD6Kr
+XcoOwLdSaGmJYslLKZB3ZIDEp0wYTGhgteb6JFiTtn..sf2xdrYfPCiIB7g
+BMAV7Gzdc4VspS6ljrAhbiiawdBiQlQmsBeFz9JkF4..b3l8BoGN+qMa56Y
+It8una2gY4l2O//on88r5IWJlm1L0oA8e4fR2yrBHX..adsGeFKkyNrwGi/
+7vQMfXdGsRrXNGRGnX+vWDZ3/zWI0joDtCkNnqEpVn..HoX
+-----END CERTIFICATE-----
+
+
+Configurations:-
+================
+
+Every component has its own over-ride yaml file. We can over-ride the file according the Configurations and Dependencies required for Deploying.
+
+Over-ride yaml for api-handler
+==============================
+
+Path:- /docker-config/volumes/so/config/api-handler-infra/onapheat/override.yaml
+
+.. code-block:: bash
+
+ server:
+ port: 8080
+ tomcat:
+ max-threads: 50
+ ssl-enable: false
+
+ mso:
+ msoKey: 07a7159d3bf51a0e53be7a8f89699be7
+ logPath: logs
+ site-name: onapheat
+ adapters:
+ requestDb:
+ endpoint: http://request-db-adapter:8083
+ auth: Basic YnBlbDpwYXNzd29yZDEk
+ catalog:
+ db:
+ spring:
+ endpoint: http://catalog-db-adapter:8082
+ db:
+ auth: Basic YnBlbDpwYXNzd29yZDEk
+ config:
+ path: /src/main/resources/
+ infra:
+ default:
+ alacarte:
+ orchestrationUri: /mso/async/services/ALaCarteOrchestrator
+ recipeTimeout: 180
+ testApi: VNF_API
+ service:
+ macro:
+ default:
+ testApi: GR_API
+ camundaURL: http://bpmn-infra:8081
+ camundaAuth: AE2E9BE6EF9249085AF98689C4EE087736A5500629A72F35068FFB88813A023581DD6E765071F1C04075B36EA4213A
+ async:
+ core-pool-size: 50
+ max-pool-size: 50
+ queue-capacity: 500
+ sdc:
+ client:
+ auth: F3473596C526938329DF877495B494DC374D1C4198ED3AD305EA3ADCBBDA1862
+ activate:
+ instanceid: test
+ userid: cs0008
+ endpoint: http://c1.vm1.mso.simpledemo.onap.org:28090
+ tenant:
+ isolation:
+ retry:
+ count: 3
+ aai:
+ endpoint: https://aai.api.simpledemo.onap.org:8443
+ auth: 2630606608347B7124C244AB0FE34F6F
+ extApi:
+ endpoint: http://nbi.onap:8080/nbi/api/v3
+ so:
+ operational-environment:
+ dmaap:
+ username: testuser
+ password: VjR5NDcxSzA=
+ host: http://c1.vm1.mso.simpledemo.onap.org:28090
+ auth: 51EA5414022D7BE536E7516C4D1A6361416921849B72C0D6FC1C7F262FD9F2BBC2AD124190A332D9845A188AD80955567A4F975C84C221EEA8243BFD92FFE6896CDD1EA16ADD34E1E3D47D4A
+ publisher:
+ topic: com.att.ecomp.mso.operationalEnvironmentEvent
+
+ spring:
+ datasource:
+ hikari:
+ jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb
+ username: cataloguser
+ password: catalog123
+ driver-class-name: org.mariadb.jdbc.Driver
+ pool-name: catdb-pool
+ registerMbeans: true
+ jpa:
+ show-sql: true
+ hibernate:
+ dialect: org.hibernate.dialect.MySQL5Dialect
+ ddl-auto: validate
+ naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+ enable-lazy-load-no-trans: true
+ jersey:
+ type: filter
+
+ security:
+ usercredentials:
+ -
+ username: sitecontrol
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: SiteControl-Client
+ -
+ username: gui
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: GUI-Client
+ -
+ username: infraportal
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: InfraPortal-Client
+ -
+ username: InfraPortalClient
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: InfraPortal-Client
+ -
+ username: bpel
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: BPEL-Client
+ -
+ username: mso_admin
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: ACTUATOR
+
+ request:
+ datasource:
+ hikari:
+ jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb
+ username: requestuser
+ password: request123
+ driver-class-name: org.mariadb.jdbc.Driver
+ pool-name: reqdb-pool
+ registerMbeans: true
+ org:
+ onap:
+ so:
+ cloud-owner: CloudOwner
+ adapters:
+ network:
+ encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7
+
+
+
+Start the container
+=======================
+cd /home/root1/docker-config/
+
+CMD:-
+===
+
+sudo docker-compose up -d
+
+*Example Output:*
+
+root1@slave-node:~/docker-config$ sudo docker-compose up -d
+docker-config_mariadb_1 is up-to-date
+Starting docker-config_catalog-db-adapter_1 ... done
+Starting docker-config_request-db-adapter_1 ... done
+Starting docker-config_bpmn-infra_1 ... done
+Starting docker-config_vfc-adapter_1 ... done
+Starting docker-config_sdc-controller_1 ... done
+Starting docker-config_sdnc-adapter_1 ... done
+Starting docker-config_openstack-adapter_1 ... done
+Starting docker-config_api-handler-infra_1 ... done
+Starting docker-config_so-monitoring_1 ... done
+Starting docker-config_nssmf-adapter_1 ... done
+
+
+Example Output:
+===============
+
+docker ps
+
+*Example Output:*
+
+root1@slave-node:~/docker-config$ sudo docker ps
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+d930caf28508 nexus3.onap.org:10001/onap/so/openstack-adapter "/app/wait-for.sh -q…" 5 weeks ago Up 30 seconds 0.0.0.0:8087->8087/tcp docker-config_openstack-adapter_1
+599af283319e nexus3.onap.org:10001/onap/so/vfc-adapter "/app/wait-for.sh -q…" 5 weeks ago Up 30 seconds 0.0.0.0:8084->8084/tcp docker-config_vfc-adapter_1
+5549305c8dd6 nexus3.onap.org:10001/onap/so/api-handler-infra "/app/wait-for.sh -q…" 5 weeks ago Up 27 seconds 0.0.0.0:8080->8080/tcp docker-config_api-handler-infra_1
+59d3aa684ecb nexus3.onap.org:10001/onap/so/sdnc-adapter "/app/wait-for.sh -q…" 5 weeks ago Up 29 seconds 0.0.0.0:8086->8086/tcp docker-config_sdnc-adapter_1
+ade4cef97bd3 nexus3.onap.org:10001/onap/so/bpmn-infra "/app/wait-for.sh -q…" 5 weeks ago Up 29 seconds 0.0.0.0:8081->8081/tcp docker-config_bpmn-infra_1
+e9558560c4d7 nexus3.onap.org:10001/onap/so/sdc-controller "/app/wait-for.sh -q…" 5 weeks ago Up 25 seconds 0.0.0.0:8085->8085/tcp docker-config_sdc-controller_1
+ae27ec2f8b04 nexus3.onap.org:10001/onap/so/so-monitoring "/app/wait-for.sh -q…" 5 weeks ago Up 26 seconds 0.0.0.0:8088->8088/tcp docker-config_so-monitoring_1
+8d2c64d48f1a nexus3.onap.org:10001/onap/so/request-db-adapter "/app/wait-for.sh -q…" 5 weeks ago Up 32 seconds 0.0.0.0:8083->8083/tcp docker-config_request-db-adapter_1
+a126dd29c540 nexus3.onap.org:10001/mariadb:10.1.11 "/docker-entrypoint.…" 5 weeks ago Up 17 minutes 0.0.0.0:32768->3306/tcp docker-config_mariadb_1
+
+Inspect a docker image
+======================
+This command shows interesting information about the structure of the mso image. Note that an image is NOT a running container. It is the template that a container is created from.
+
+CMD:-
+=====
+sudo docker inspect onap/so/api-handler-infra
+
+
+Example Output:
+
+.. code-block:: bash
+
+
+ [
+ {
+ "Id": "sha256:2573165483e9ac87826da9c08984a9d0e1d93a90c681b22d9b4f90ed579350dc",
+ "RepoTags": [
+ "onap/so/api-handler-infra:1.3.0-SNAPSHOT",
+ "onap/so/api-handler-infra:1.3.0-SNAPSHOT-20190213T0846",
+ "onap/so/api-handler-infra:1.3.0-SNAPSHOT-latest",
+ "onap/so/api-handler-infra:latest"
+ ],
+ "RepoDigests": [],
+ "Parent": "sha256:66b508441811ab4ed9968f8702a0d0a697f517bbc10d8d9076e5b98ae4437344",
+ "Comment": "",
+ "Created": "2019-02-13T09:37:33.770342225Z",
+ "Container": "8be46c735d21935631130f9017c3747779aab26eab54a9149b1edde122f7576d",
+ "ContainerConfig": {
+ "Hostname": "ac4a12e21390",
+ "Domainname": "",
+ "User": "",
+ "AttachStdin": false,
+ "AttachStdout": false,
+ "AttachStderr": false,
+ "Tty": false,
+ "OpenStdin": false,
+ "StdinOnce": false,
+ "Env": [
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
+ "LANG=C.UTF-8",
+ "JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk",
+ "JAVA_VERSION=8u191",
+ "JAVA_ALPINE_VERSION=8.191.12-r0",
+ "HTTP_PROXY=",
+ "HTTPS_PROXY=",
+ "http_proxy=",
+ "https_proxy="
+ ],
+ "Cmd": [
+ "/bin/sh",
+ "-c",
+ "#(nop) ",
+ "CMD [\"/app/start-app.sh\"]"
+ ],
+ "ArgsEscaped": true,
+ "Image": "sha256:66b508441811ab4ed9968f8702a0d0a697f517bbc10d8d9076e5b98ae4437344",
+ "Volumes": {
+ "/app/ca-certificates": {},
+ "/app/config": {}
+ },
+ "WorkingDir": "/app",
+ "Entrypoint": null,
+ "OnBuild": [],
+ "Labels": {}
+ },
+ "DockerVersion": "17.05.0-ce",
+ "Author": "",
+ "Config": {
+ "Hostname": "ac4a12e21390",
+ "Domainname": "",
+ "User": "",
+ "AttachStdin": false,
+ "AttachStdout": false,
+ "AttachStderr": false,
+ "Tty": false,
+ "OpenStdin": false,
+ "StdinOnce": false,
+ "Env": [
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
+ "LANG=C.UTF-8",
+ "JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk",
+ "JAVA_VERSION=8u191",
+ "JAVA_ALPINE_VERSION=8.191.12-r0",
+ "HTTP_PROXY=",
+ "HTTPS_PROXY=",
+ "http_proxy=",
+ "https_proxy="
+ ],
+ "Cmd": [
+ "/app/start-app.sh"
+ ],
+ "ArgsEscaped": true,
+ "Image": "sha256:66b508441811ab4ed9968f8702a0d0a697f517bbc10d8d9076e5b98ae4437344",
+ "Volumes": {
+ "/app/ca-certificates": {},
+ "/app/config": {}
+ },
+ "WorkingDir": "/app",
+ "Entrypoint": null,
+ "OnBuild": [],
+ "Labels": {}
+ },
+ "Architecture": "amd64",
+ "Os": "linux",
+ "Size": 245926705,
+ "VirtualSize": 245926705,
+ "GraphDriver": {
+ "Data": null,
+ "Name": "aufs"
+ },
+ "RootFS": {
+ "Type": "layers",
+ "Layers": [
+ "sha256:503e53e365f34399c4d58d8f4e23c161106cfbce4400e3d0a0357967bad69390",
+ "sha256:744b4cd8cf79c70508aace3697b6c3b46bee2c14f1c14b6ff09fd0ba5735c6d4",
+ "sha256:4c6899b75fdbea2f44efe5a2f8d9f5319c1cf7e87151de0de1014aba6ce71244",
+ "sha256:2e076d24f6d1277456e33e58fc8adcfd69dfd9c025f61aa7b98d500e7195beb2",
+ "sha256:bb67f2d5f8196c22137a9e98dd4190339a65c839822d16954070eeb0b2a17aa2",
+ "sha256:afbbd0cc43999d5c5b0ff54dfd82365a3feb826e5c857d9b4a7cf378001cd4b3",
+ "sha256:1920a7ca0f8ae38a79a1339ce742aaf3d7a095922d96e37074df67cf031d5035",
+ "sha256:1261fbaef67c5be677dae1c0f50394587832ea9d8c7dc105df2f3db6dfb92a3a",
+ "sha256:a33d8ee5c18908807458ffe643184228c21d3c5d5c5df1251f0f7dfce512f7e8",
+ "sha256:80704fca12eddb4cc638cee105637266e04ab5706b4e285d4fc6cac990e96d63",
+ "sha256:55abe39073a47f29aedba790a92c351501f21b3628414fa49a073c010ee747d1",
+ "sha256:cc4136c2c52ad522bd492545d4dd18265676ca690aa755994adf64943b119b28",
+ "sha256:2163a1f989859fdb3af6e253b74094e92a0fc1ee59f5eb959971f94eb1f98094"
+ ]
+ }
+ }
+ ]
diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst
index a060da60b0..85e7010fcb 100644
--- a/docs/developer_info/developer_information.rst
+++ b/docs/developer_info/developer_information.rst
@@ -20,6 +20,7 @@ SO Developer Information
BPMN_Subprocess_Process_Flows.rst
BPMN_Project_Deployment_Strategy.rst
BPMN-INFRA_Workflow_Understanding.rst
+ Docker-Config_Understanding.rst
Mso_Openstack_Adapter.rst
Cxf_Logging.rst
instantiate/index.rst
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstances.java
index 3f05c79dad..b1486c9686 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstances.java
@@ -88,9 +88,9 @@ import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
@Component
-@Path("/onap/so/infra/onap3gppServiceInstances")
-@OpenAPIDefinition(info = @Info(title = "/onap/so/infra/onap3gppServiceInstances",
- description = "API Requests for 3GPP Service Instances"))
+@Path("/onap/so/infra/3gppservices")
+@OpenAPIDefinition(
+ info = @Info(title = "/onap/so/infra/3gppservices", description = "API Requests for 3GPP Service Instances"))
public class Onap3gppServiceInstances {
private static final Logger logger = LoggerFactory.getLogger(Onap3gppServiceInstances.class);
@@ -101,7 +101,7 @@ public class Onap3gppServiceInstances {
private static final String SAVE_TO_DB = "save instance to db";
- private static String uriPrefix = "/onap3gppServiceInstances/";
+ private static final String URI_PREFIX = "/3gppservices/";
@Autowired
private MsoRequest msoRequest;
@@ -140,7 +140,7 @@ public class Onap3gppServiceInstances {
@Context ContainerRequestContext requestContext) throws ApiException {
String requestId = requestHandlerUtils.getRequestId(requestContext);
return processServiceInstanceRequest(request, Action.createInstance, version, requestId, null,
- requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ requestHandlerUtils.getRequestUri(requestContext, URI_PREFIX));
}
/**
@@ -161,7 +161,7 @@ public class Onap3gppServiceInstances {
HashMap<String, String> instanceIdMap = new HashMap<>();
instanceIdMap.put("serviceInstanceId", request.getServiceInstanceID());
return updateServiceInstances(request, Action.updateInstance, version, requestId, instanceIdMap,
- requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ requestHandlerUtils.getRequestUri(requestContext, URI_PREFIX));
}
/**
@@ -183,7 +183,7 @@ public class Onap3gppServiceInstances {
HashMap<String, String> instanceIdMap = new HashMap<>();
instanceIdMap.put("serviceInstanceId", request.getServiceInstanceID());
return deleteServiceInstances(request, Action.deleteInstance, version, requestId, instanceIdMap,
- requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ requestHandlerUtils.getRequestUri(requestContext, URI_PREFIX));
}
/**
@@ -204,7 +204,7 @@ public class Onap3gppServiceInstances {
HashMap<String, String> instanceIdMap = new HashMap<>();
instanceIdMap.put("serviceInstanceId", request.getServiceInstanceID());
return activateOrDeactivateServiceInstances(request, Action.activateInstance, version, requestId, instanceIdMap,
- requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ requestHandlerUtils.getRequestUri(requestContext, URI_PREFIX));
}
/**
@@ -225,7 +225,7 @@ public class Onap3gppServiceInstances {
HashMap<String, String> instanceIdMap = new HashMap<>();
instanceIdMap.put("serviceInstanceId", request.getServiceInstanceID());
return activateOrDeactivateServiceInstances(request, Action.deactivateInstance, version, requestId,
- instanceIdMap, requestHandlerUtils.getRequestUri(requestContext, uriPrefix));
+ instanceIdMap, requestHandlerUtils.getRequestUri(requestContext, URI_PREFIX));
}
/**
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
index c3c92be013..95f00c3a39 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/Onap3gppServiceInstancesTest.java
@@ -55,9 +55,9 @@ import org.springframework.beans.factory.annotation.Autowired;
public class Onap3gppServiceInstancesTest extends BaseTest {
- private String onap3gppServicesUri = "/onap/so/infra/onap3gppServiceInstances/";
+ private static final String ONAP3GPPSERVICES_URI = "/onap/so/infra/3gppservices/";
- private final ObjectMapper mapper = new ObjectMapper();
+ private static final ObjectMapper MAPPER = new ObjectMapper();
@Autowired
private Onap3gppServiceInstances objUnderTest;
@@ -74,11 +74,11 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
wireMockServer.stubFor(get(urlPathEqualTo("/service/search/findFirstByModelNameOrderByModelVersionDesc"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
- .withBody(mapper.writeValueAsString(defaultService)).withStatus(HttpStatus.SC_OK)));
+ .withBody(MAPPER.writeValueAsString(defaultService)).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(get(urlPathEqualTo("/serviceRecipe/search/findFirstByServiceModelUUIDAndAction"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
- .withBody(mapper.writeValueAsString(serviceRecipe)).withStatus(HttpStatus.SC_OK)));
+ .withBody(MAPPER.writeValueAsString(serviceRecipe)).withStatus(HttpStatus.SC_OK)));
wireMockServer.stubFor(post(urlMatching(".*/infraActiveRequests/")).willReturn(aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).withStatus(HttpStatus.SC_OK)));
Mockito.doReturn(null).when(requestsDbClient).getInfraActiveRequestbyRequestId(Mockito.any());
@@ -107,7 +107,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void createServiceInstanceTest() throws IOException {
- String uri = onap3gppServicesUri + "v1/allocate";
+ String uri = ONAP3GPPSERVICES_URI + "v1/allocate";
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/commonNssmfTest")).willReturn(
aResponse().withHeader("Content-Type", "application/json").withBodyFile("Camunda/BPMN_response.json")
.withStatus(org.apache.http.HttpStatus.SC_ACCEPTED)));
@@ -123,7 +123,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void updateServiceInstanceTest() throws IOException {
- String uri = onap3gppServicesUri + "v1/modify";
+ String uri = ONAP3GPPSERVICES_URI + "v1/modify";
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/commonNssmfTest")).willReturn(
aResponse().withHeader("Content-Type", "application/json").withBodyFile("Camunda/BPMN_response.json")
.withStatus(org.apache.http.HttpStatus.SC_ACCEPTED)));
@@ -139,7 +139,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void deleteServiceInstanceTest() throws IOException {
- String uri = onap3gppServicesUri + "v1/deAllocate";
+ String uri = ONAP3GPPSERVICES_URI + "v1/deAllocate";
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/commonNssmfTest")).willReturn(
aResponse().withHeader("Content-Type", "application/json").withBodyFile("Camunda/BPMN_response.json")
.withStatus(org.apache.http.HttpStatus.SC_ACCEPTED)));
@@ -154,7 +154,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void activateServiceInstanceTest() throws IOException {
- String uri = onap3gppServicesUri + "v1/activate";
+ String uri = ONAP3GPPSERVICES_URI + "v1/activate";
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/commonNssmfTest")).willReturn(
aResponse().withHeader("Content-Type", "application/json").withBodyFile("Camunda/BPMN_response.json")
.withStatus(org.apache.http.HttpStatus.SC_ACCEPTED)));
@@ -169,7 +169,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void deActivateServiceInstance() throws IOException {
- String uri = onap3gppServicesUri + "v1/deActivate";
+ String uri = ONAP3GPPSERVICES_URI + "v1/deActivate";
wireMockServer.stubFor(post(urlPathEqualTo("/mso/async/services/commonNssmfTest")).willReturn(
aResponse().withHeader("Content-Type", "application/json").withBodyFile("Camunda/BPMN_response.json")
.withStatus(org.apache.http.HttpStatus.SC_ACCEPTED)));
@@ -185,7 +185,7 @@ public class Onap3gppServiceInstancesTest extends BaseTest {
@Test
public void getSliceSubnetCapabilitiesTest() throws IOException, ApiException {
String request = "{\"subnetTypes\":[\"AN\"]}";
- QuerySubnetCapability subnetCapabilityRequest = mapper.readValue(request, QuerySubnetCapability.class);
+ QuerySubnetCapability subnetCapabilityRequest = MAPPER.readValue(request, QuerySubnetCapability.class);
String expectedResponse =
"{\"AN\":{\"latency\":\"5\",\"maxNumberofUEs\":\"100\",\"maxThroughput\":\"150\",\"terminalDensity\":\"50\"}}";
Response response = objUnderTest.getSliceSubnetCapabilities(subnetCapabilityRequest, "v1");
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
index d26ce84505..2e4623d25d 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
@@ -83,7 +83,7 @@ public class PnfResourceCustomization implements Serializable {
private String blueprintVersion;
@Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
- private Boolean skipPostInstConf;
+ private boolean skipPostInstConf;
@Column(name = "CONTROLLER_ACTOR")
private String controllerActor;
@@ -219,11 +219,11 @@ public class PnfResourceCustomization implements Serializable {
this.blueprintVersion = blueprintVersion;
}
- public Boolean isSkipPostInstConf() {
+ public boolean isSkipPostInstConf() {
return skipPostInstConf;
}
- public void setSkipPostInstConf(Boolean skipPostInstConf) {
+ public void setSkipPostInstConf(boolean skipPostInstConf) {
this.skipPostInstConf = skipPostInstConf;
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/beans/BeansTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/beans/BeansTest.java
index f710890883..b39a85fb92 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/beans/BeansTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/beans/BeansTest.java
@@ -67,10 +67,10 @@ public class BeansTest {
}
private void test(String pojoPackage) {
- Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new NoPrimitivesRule())
- .with(new NoNestedClassRule()).with(new NoStaticExceptFinalRule())
- .with(new SerializableMustHaveSerialVersionUIDRule()).with(new HasToStringRule())
- .with(new EqualsAndHashCodeTester()).with(new NoPublicFieldsExceptStaticFinalRule())
+ Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new NoNestedClassRule())
+ .with(new NoStaticExceptFinalRule()).with(new SerializableMustHaveSerialVersionUIDRule())
+ .with(new HasToStringRule()).with(new EqualsAndHashCodeTester())
+ .with(new NoPublicFieldsExceptStaticFinalRule())
.with(new CustomSetterMustExistRule()
.exclude(allOf(hasAnnotationPropertyWithValue(Column.class, "updatable", equalTo(false)),
hasAnnotation(GeneratedValue.class)), hasAnnotation(Temporal.class)))
diff --git a/pom.xml b/pom.xml
index 0033815e14..f59702f05b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -962,7 +962,7 @@
<dependency>
<groupId>org.onap.aai.schema-service</groupId>
<artifactId>aai-schema</artifactId>
- <version>1.7.10-SNAPSHOT</version>
+ <version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
diff --git a/releases/1.7.4.yaml b/releases/1.7.4.yaml
new file mode 100644
index 0000000000..da2acb2988
--- /dev/null
+++ b/releases/1.7.4.yaml
@@ -0,0 +1,33 @@
+---
+distribution_type: 'container'
+container_release_tag: '1.7.4'
+project: 'so'
+log_dir: 'so-maven-docker-stage-master/488/'
+ref: '432a5fe384fe559ddb167d2a1ceb7916f5379a4d'
+containers:
+ - name: 'so/vnfm-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/catalog-db-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/request-db-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/openstack-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/sdnc-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/vfc-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/sdc-controller'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/bpmn-infra'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/so-monitoring'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/api-handler-infra'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/nssmf-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/mso-cnf-adapter'
+ version: '1.7.4-20201015T1406'
+ - name: 'so/so-oof-adapter'
+ version: '1.7.4-20201015T1406' \ No newline at end of file
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
index 5e5e51cee0..49118494cf 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
@@ -164,7 +164,7 @@ public class JobExecutorService {
final LocalDateTime currentDateTime = LocalDateTime.now();
final NsLcmOpOcc newNsLcmOpOcc = new NsLcmOpOcc().id(nsInstanceId).operation(NsLcmOpType.INSTANTIATE)
.operationState(OperationStateEnum.PROCESSING).stateEnteredTime(currentDateTime)
- .startTime(currentDateTime).nfvoNsInst(getNfvoNsInst(nsInstanceId)).isAutoInnovation(false)
+ .startTime(currentDateTime).nfvoNsInst(getNfvoNsInst(nsInstanceId)).isAutoInvocation(false)
.isCancelPending(false).operationParams(gson.toJson(instantiateNsRequest));
databaseServiceProvider.addNSLcmOpOcc(newNsLcmOpOcc);
logger.info("New NSLcmOpOcc created in database :\n{}", newNsLcmOpOcc);
@@ -209,7 +209,7 @@ public class JobExecutorService {
final LocalDateTime currentDateTime = LocalDateTime.now();
final NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc().id(nsInstanceId).operation(NsLcmOpType.TERMINATE)
.operationState(OperationStateEnum.PROCESSING).stateEnteredTime(currentDateTime)
- .startTime(currentDateTime).nfvoNsInst(getNfvoNsInst(nsInstanceId)).isAutoInnovation(false)
+ .startTime(currentDateTime).nfvoNsInst(getNfvoNsInst(nsInstanceId)).isAutoInvocation(false)
.isCancelPending(false).operationParams(gson.toJson(terminateNsRequest));
databaseServiceProvider.addNSLcmOpOcc(nsLcmOpOcc);
logger.info("New NSLcmOpOcc created in database :\n{}", nsLcmOpOcc);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/AbstractNetworkServiceTask.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/AbstractNetworkServiceTask.java
index f87a35f3ab..e94b3de81e 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/AbstractNetworkServiceTask.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/AbstractNetworkServiceTask.java
@@ -52,6 +52,16 @@ public abstract class AbstractNetworkServiceTask {
this.databaseServiceProvider = jobServiceProvider;
}
+ public void addJobStatus(final DelegateExecution execution, final JobStatusEnum jobStatus,
+ final String description) {
+ final NfvoJobStatus nfvoJobStatus =
+ new NfvoJobStatus().status(jobStatus).description(description).updatedTime(LocalDateTime.now());
+ logger.info("Adding NfvoJobStatus {}", nfvoJobStatus);
+ final NfvoJob nfvoJob = getNfvoJob(execution);
+ nfvoJob.nfvoJobStatus(nfvoJobStatus);
+ databaseServiceProvider.addJob(nfvoJob);
+ }
+
public void setJobStatus(final DelegateExecution execution, final JobStatusEnum jobStatus,
final String description) {
logger.info("Setting Job Status to {}", jobStatus);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/CreateInstantiateVnfTask.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/CreateInstantiateVnfTask.java
index fcebea59f2..600792acc0 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/CreateInstantiateVnfTask.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/CreateInstantiateVnfTask.java
@@ -69,7 +69,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
logger.info("request: {}", request);
- setJobStatus(execution, JobStatusEnum.IN_PROGRESS, "Checking if NF Instance record exists in database for "
+ addJobStatus(execution, JobStatusEnum.IN_PROGRESS, "Checking if NF Instance record exists in database for "
+ request.getNsInstId() + " and " + request.getVnfName());
if (!databaseServiceProvider.isNsInstExists(request.getNsInstId(), request.getVnfName())) {
abortOperation(execution,
@@ -85,7 +85,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
logger.info("request: {}", request);
- setJobStatus(execution, IN_PROGRESS, "Creating NF Instance record in database for " + request.getVnfName());
+ addJobStatus(execution, IN_PROGRESS, "Creating NF Instance record in database for " + request.getVnfName());
final Optional<NfvoNsInst> optional = databaseServiceProvider.getNfvoNsInst(request.getNsInstId());
@@ -110,7 +110,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
final CreateInstantiateRequest request =
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
- setJobStatus(execution, IN_PROGRESS, "Creating GenericVnf record in AAI for " + request.getVnfName());
+ addJobStatus(execution, IN_PROGRESS, "Creating GenericVnf record in AAI for " + request.getVnfName());
final String nfInstId = (String) execution.getVariable(NF_INST_ID_PARAM_NAME);
final String nsInstId = (String) execution.getVariable(NS_INSTANCE_ID_PARAM_NAME);
@@ -148,7 +148,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
logger.info("request: {}", request);
- setJobStatus(execution, IN_PROGRESS,
+ addJobStatus(execution, IN_PROGRESS,
"Invoking SOL003 adapter for creating and instantiating VNF: " + request.getVnfName());
final CreateVnfRequest vnfRequest = new CreateVnfRequest();
@@ -170,7 +170,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
logger.info("Vnf instantiation response: {}", vnfResponse);
execution.setVariable(CREATE_VNF_RESPONSE_PARAM_NAME, vnfResponse);
- setJobStatus(execution, IN_PROGRESS, "Successfully invoked SOL003 adapater creating and instantiating VNF: "
+ addJobStatus(execution, IN_PROGRESS, "Successfully invoked SOL003 adapater creating and instantiating VNF: "
+ request.getVnfName() + " CreaetVnfResponse Job Id: " + vnfResponse.getJobId());
logger.debug("Finished executing invokeCreateInstantiationRequest ...");
} catch (final Exception exception) {
@@ -187,7 +187,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
updateNfInstanceStatus(execution, State.INSTANTIATED);
final CreateInstantiateRequest request =
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
- setJobStatus(execution, FINISHED, "Successfully created and Instantiated VNF: " + request.getVnfName()
+ addJobStatus(execution, FINISHED, "Successfully created and Instantiated VNF: " + request.getVnfName()
+ " will set status to " + State.INSTANTIATED);
logger.info("Finished executing updateNfInstanceStatusToInstantiated ...");
@@ -200,7 +200,7 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
updateNfInstanceStatus(execution, State.FAILED);
final CreateInstantiateRequest request =
(CreateInstantiateRequest) execution.getVariable(CREATE_INSTANTIATE_REQUEST_PARAM_NAME);
- setJobStatus(execution, ERROR, "Failed to create and instantiate VNF: " + request.getVnfName()
+ addJobStatus(execution, ERROR, "Failed to create and instantiate VNF: " + request.getVnfName()
+ " will set status to " + State.FAILED);
logger.info("Finished executing updateNfInstanceStatusToInstantiated ...");
@@ -209,14 +209,11 @@ public class CreateInstantiateVnfTask extends AbstractNetworkServiceTask {
private void updateNfInstanceStatus(final DelegateExecution execution, final State vnfStatus) {
final String nfInstId = (String) execution.getVariable(NF_INST_ID_PARAM_NAME);
-
final Optional<NfvoNfInst> optional = databaseServiceProvider.getNfvoNfInst(nfInstId);
if (optional.isEmpty()) {
final String message = "Unable to find NfvoNfInst record in database using nfInstId: " + nfInstId;
logger.error(message);
-
abortOperation(execution, message);
-
}
final NfvoNfInst nfvoNfInst = optional.get();
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/TerminateVnfTask.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/TerminateVnfTask.java
index 15eee22dd2..049a6f38b0 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/TerminateVnfTask.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/TerminateVnfTask.java
@@ -19,6 +19,13 @@
*/
package org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.tasks;
+import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.DELETE_VNF_RESPONSE_PARAM_NAME;
+import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.NF_INST_ID_PARAM_NAME;
+import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.TERMINATE_VNF_VNFID_PARAM_NAME;
+import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.ERROR;
+import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.FINISHED;
+import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.IN_PROGRESS;
+import java.util.Optional;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.DeleteVnfResponse;
import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.aai.AaiServiceProvider;
@@ -31,13 +38,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.Optional;
-import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.NF_INST_ID_PARAM_NAME;
-import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.DELETE_VNF_RESPONSE_PARAM_NAME;
-import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.CamundaVariableNameConstants.TERMINATE_VNF_VNFID_PARAM_NAME;
-import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.ERROR;
-import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.FINISHED;
-import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.JobStatusEnum.IN_PROGRESS;
/**
* @author Andrew Lamb (andrew.a.lamb@est.tech)
@@ -63,7 +63,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
logger.info("vnfId: {}", vnfId);
execution.setVariable(NF_INST_ID_PARAM_NAME, vnfId);
- setJobStatus(execution, JobStatusEnum.IN_PROGRESS,
+ addJobStatus(execution, JobStatusEnum.IN_PROGRESS,
"Checking if VNF Instance with id: " + vnfId + " exists in database.");
if (!databaseServiceProvider.isNfInstExists(vnfId)) {
abortOperation(execution,
@@ -78,7 +78,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
try {
- setJobStatus(execution, IN_PROGRESS, "Invoking SOL003 adapter for terminating VNF with vnfId: " + vnfId);
+ addJobStatus(execution, IN_PROGRESS, "Invoking SOL003 adapter for terminating VNF with vnfId: " + vnfId);
final Optional<DeleteVnfResponse> optional = sol003AdapterServiceProvider.invokeTerminationRequest(vnfId);
@@ -92,7 +92,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
logger.info("Vnf delete response: {}", vnfResponse);
execution.setVariable(DELETE_VNF_RESPONSE_PARAM_NAME, vnfResponse);
- setJobStatus(execution, IN_PROGRESS, "Successfully invoked SOL003 adapter terminate VNF with vnfId: "
+ addJobStatus(execution, IN_PROGRESS, "Successfully invoked SOL003 adapter terminate VNF with vnfId: "
+ vnfId + " DeleteVnfResponse Job Id: " + vnfResponse.getJobId());
logger.debug("Finished executing invokeTerminateRequest ...");
} catch (final Exception exception) {
@@ -108,7 +108,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
try {
- setJobStatus(execution, IN_PROGRESS, "Deleting GenericVnf record from AAI for vnfId: " + vnfId);
+ addJobStatus(execution, IN_PROGRESS, "Deleting GenericVnf record from AAI for vnfId: " + vnfId);
aaiServiceProvider.deleteGenericVnf(vnfId);
} catch (final Exception exception) {
@@ -124,10 +124,10 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
logger.info("Executing deleteNfInstanceFromDb");
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
- setJobStatus(execution, IN_PROGRESS, "Deleting NF Instance record from Database for vnfId: " + vnfId);
+ addJobStatus(execution, IN_PROGRESS, "Deleting NF Instance record from Database for vnfId: " + vnfId);
databaseServiceProvider.deleteNfvoNfInst(vnfId);
- setJobStatus(execution, FINISHED, "Successfully finished terminating VNF with vnfId: " + vnfId);
+ addJobStatus(execution, FINISHED, "Successfully finished terminating VNF with vnfId: " + vnfId);
logger.info("Finished executing deleteNfInstanceFromDb ...");
}
@@ -136,7 +136,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
updateNfInstanceStatus(execution, State.TERMINATING);
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
- setJobStatus(execution, IN_PROGRESS,
+ addJobStatus(execution, IN_PROGRESS,
"Terminating VNF with vnfId: " + vnfId + " will set status to " + State.TERMINATING);
logger.info("Finished executing updateNfInstanceStatusToTerminating ...");
@@ -148,7 +148,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
updateNfInstanceStatus(execution, State.NOT_INSTANTIATED);
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
- setJobStatus(execution, IN_PROGRESS,
+ addJobStatus(execution, IN_PROGRESS,
"Successfully terminated VNF with vnfId: " + vnfId + " will set status to " + State.NOT_INSTANTIATED);
logger.info("Finished executing updateNfInstanceStatusToInstantiated ...");
@@ -160,7 +160,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
updateNfInstanceStatus(execution, State.FAILED);
final String vnfId = (String) execution.getVariable(TERMINATE_VNF_VNFID_PARAM_NAME);
- setJobStatus(execution, ERROR,
+ addJobStatus(execution, ERROR,
"Failed to terminate VNF with vnfId: " + vnfId + " will set status to " + State.FAILED);
logger.info("Finished executing updateNfInstanceStatusToFailed ...");
@@ -174,9 +174,7 @@ public class TerminateVnfTask extends AbstractNetworkServiceTask {
if (optional.isEmpty()) {
final String message = "Unable to find NfvoNfInst record in database using vnfId: " + vnfId;
logger.error(message);
-
abortOperation(execution, message);
-
}
final NfvoNfInst nfvoNfInst = optional.get();
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/CancelModeType.java
index dfb2b61978..627250535e 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/CancelModeType.java
@@ -1,8 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,23 +13,16 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+package org.onap.so.etsi.nfvo.ns.lcm.database.beans;
-package org.onap.so.adapters.nssmf.config;
-
-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();
- }
-
+/**
+ * @author Andrew Lamb (andrew.a.lamb@est.tech)
+ *
+ */
+public enum CancelModeType {
+ GRACEFUL, FORCEFUL;
}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
index 19fe969366..4846e5a361 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
@@ -62,8 +62,8 @@ public class NsLcmOpOcc {
@Column(name = "OPERATION", nullable = false)
private NsLcmOpType operation;
- @Column(name = "IS_AUTO_INNOVATION", nullable = false)
- private boolean isAutoInnovation;
+ @Column(name = "IS_AUTO_INVOCATION", nullable = false)
+ private boolean isAutoInvocation;
@Column(name = "OPERATION_PARAMS", columnDefinition = "LONGTEXT", nullable = false)
private String operationParams;
@@ -71,6 +71,10 @@ public class NsLcmOpOcc {
@Column(name = "IS_CANCEL_PENDING", nullable = false)
private boolean isCancelPending;
+ @Enumerated(EnumType.STRING)
+ @Column(name = "CANCEL_MODE")
+ private CancelModeType cancelMode;
+
public NsLcmOpOcc() {
this.id = UUID.randomUUID().toString();
}
@@ -153,16 +157,29 @@ public class NsLcmOpOcc {
return this;
}
- public boolean getIsAutoInnovation() {
- return isAutoInnovation;
+ public boolean getIsAutoInvocation() {
+ return isAutoInvocation;
+ }
+
+ public void setIsAutoInvocation(final boolean isAutoInvocation) {
+ this.isAutoInvocation = isAutoInvocation;
+ }
+
+ public NsLcmOpOcc isAutoInvocation(final boolean isAutoInvocation) {
+ this.isAutoInvocation = isAutoInvocation;
+ return this;
+ }
+
+ public CancelModeType getCancelMode() {
+ return cancelMode;
}
- public void setIsAutoInnovation(final boolean isAutoInnovation) {
- this.isAutoInnovation = isAutoInnovation;
+ public void setCancelMode(final CancelModeType cancelMode) {
+ this.cancelMode = cancelMode;
}
- public NsLcmOpOcc isAutoInnovation(final boolean isAutoInnovation) {
- this.isAutoInnovation = isAutoInnovation;
+ public NsLcmOpOcc cancelMode(final CancelModeType cancelMode) {
+ this.cancelMode = cancelMode;
return this;
}
@@ -203,16 +220,16 @@ public class NsLcmOpOcc {
&& Objects.equals(stateEnteredTime, that.stateEnteredTime) && Objects.equals(startTime, that.startTime)
&& (nfvoNsInst == null ? that.nfvoNsInst == null
: that.nfvoNsInst != null && Objects.equals(nfvoNsInst, that.nfvoNsInst))
- && Objects.equals(operation, that.operation) && Objects.equals(isAutoInnovation, that.isAutoInnovation)
+ && Objects.equals(operation, that.operation) && Objects.equals(isAutoInvocation, that.isAutoInvocation)
&& Objects.equals(operationParams, that.operationParams)
- && Objects.equals(isCancelPending, that.isCancelPending);
+ && Objects.equals(isCancelPending, that.isCancelPending) && Objects.equals(cancelMode, that.cancelMode);
}
@Override
public int hashCode() {
return Objects.hash(id, operationState, stateEnteredTime, startTime,
- nfvoNsInst != null ? nfvoNsInst.getNsInstId() : 0, operation, isAutoInnovation, operationParams,
- isCancelPending);
+ nfvoNsInst != null ? nfvoNsInst.getNsInstId() : 0, operation, isAutoInvocation, operationParams,
+ isCancelPending, cancelMode);
}
@Override
@@ -226,9 +243,10 @@ public class NsLcmOpOcc {
sb.append(" nfvoNsInst: ").append(nfvoNsInst != null ? toIndentedString(nfvoNsInst.getNsInstId()) : null)
.append("\n");
sb.append(" operation: ").append(toIndentedString(operation)).append("\n");
- sb.append(" isAutoInnovation: ").append(toIndentedString(isAutoInnovation)).append("\n");
+ sb.append(" isAutoInvocation: ").append(toIndentedString(isAutoInvocation)).append("\n");
sb.append(" operationParams: ").append(toIndentedString(operationParams)).append("\n");
sb.append(" isCancelPending: ").append(toIndentedString(isCancelPending)).append("\n");
+ sb.append(" cancelMode: ").append(toIndentedString(cancelMode)).append("\n");
sb.append("}");
return sb.toString();
}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql
index f41a8206e0..85a732b83e 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql
@@ -64,9 +64,10 @@ CREATE TABLE IF NOT EXISTS `NS_LCM_OP_OCCS` (
`START_TIME` DATETIME DEFAULT NULL,
`NS_INST_ID` varchar(255) NOT NULL,
`OPERATION` varchar(255) NOT NULL,
- `IS_AUTO_INNOVATION` varchar(255) NOT NULL,
+ `IS_AUTO_INVOCATION` varchar(255) NOT NULL,
`OPERATION_PARAMS` longtext NOT NULL,
`IS_CANCEL_PENDING` varchar(255) NOT NULL,
+ `CANCEL_MODE` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`),
FOREIGN KEY (NS_INST_ID)
REFERENCES NS_INST(NS_INST_ID)
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java
index 8070036791..fcf7f9c373 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java
@@ -164,7 +164,7 @@ public class DatabaseServiceProviderTest {
databaseServiceProvider.saveNfvoNsInst(nsInst);
final NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc().nfvoNsInst(nsInst).operationState(OperationStateEnum.PROCESSING)
- .isCancelPending(false).isAutoInnovation(false).operation(NsLcmOpType.INSTANTIATE)
+ .isCancelPending(false).isAutoInvocation(false).operation(NsLcmOpType.INSTANTIATE)
.startTime(CURRENT_DATE_TIME).stateEnteredTime(CURRENT_DATE_TIME).operationParams("");
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/lifecycle/NsLcmOperationOccurrenceManager.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/lifecycle/NsLcmOperationOccurrenceManager.java
new file mode 100644
index 0000000000..8a5cee6d75
--- /dev/null
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/lifecycle/NsLcmOperationOccurrenceManager.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.etsi.nfvo.ns.lcm.lifecycle;
+
+import static org.slf4j.LoggerFactory.getLogger;
+import org.onap.so.etsi.nfvo.ns.lcm.EtsiSoNsLcmManagerUrlProvider;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
+import org.onap.so.etsi.nfvo.ns.lcm.database.service.DatabaseServiceProvider;
+import org.onap.so.etsi.nfvo.ns.lcm.model.NsInstancesNsInstanceLinksSelf;
+import org.onap.so.etsi.nfvo.ns.lcm.model.NsLcmOpOccsNsLcmOpOcc;
+import org.onap.so.etsi.nfvo.ns.lcm.model.NsLcmOpOccsNsLcmOpOccLinks;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Optional;
+
+/**
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ * @author Andrew Lamb (andrew.a.lamb@est.tech)
+ *
+ */
+@Service
+public class NsLcmOperationOccurrenceManager {
+
+ private static final Logger logger = getLogger(NsLcmOperationOccurrenceManager.class);
+
+ private final DatabaseServiceProvider databaseServiceProvider;
+ private final EtsiSoNsLcmManagerUrlProvider etsiSoNsLcmManagerUrlProvider;
+
+ @Autowired
+ public NsLcmOperationOccurrenceManager(final DatabaseServiceProvider databaseServiceProvider,
+ final EtsiSoNsLcmManagerUrlProvider etsiSoNsLcmManagerUrlProvider) {
+ this.databaseServiceProvider = databaseServiceProvider;
+ this.etsiSoNsLcmManagerUrlProvider = etsiSoNsLcmManagerUrlProvider;
+ }
+
+ public Optional<NsLcmOpOccsNsLcmOpOcc> getNsLcmOperationOccurrence(final String nsLcmOpOccId) {
+ logger.info("Getting NS LCM Operation Occurrence Operation for id: {}", nsLcmOpOccId);
+ final Optional<NsLcmOpOcc> optionalNsLcmOpOcc = databaseServiceProvider.getNsLcmOpOcc(nsLcmOpOccId);
+
+ if (optionalNsLcmOpOcc.isEmpty()) {
+ logger.info("No NS LCM Operation Occurrence found for id: {}", nsLcmOpOccId);
+ return Optional.empty();
+ }
+
+ logger.info("Found NS LCM Operation Occurrence for id: {}", nsLcmOpOccId);
+ final NsLcmOpOcc nsLcmOpOcc = optionalNsLcmOpOcc.get();
+ final NsLcmOpOccsNsLcmOpOcc nsLcmOpOccsNsLcmOpOcc = convertToNsLcmOpOccsNsLcmOpOcc(nsLcmOpOcc);
+ return Optional.of(nsLcmOpOccsNsLcmOpOcc);
+ }
+
+ private NsLcmOpOccsNsLcmOpOcc convertToNsLcmOpOccsNsLcmOpOcc(final NsLcmOpOcc nsLcmOpOcc) {
+ logger.info("Converting Database NsLcmOpOcc to API NsLcmOpOcc... ");
+ final NsLcmOpOccsNsLcmOpOcc nsLcmOpOccsNsLcmOpOcc =
+ new NsLcmOpOccsNsLcmOpOcc().id(nsLcmOpOcc.getId()).statusEnteredTime(nsLcmOpOcc.getStateEnteredTime())
+ .startTime(nsLcmOpOcc.getStartTime()).isAutomaticInvocation(nsLcmOpOcc.getIsAutoInvocation())
+ .isCancelPending(nsLcmOpOcc.getIsCancelPending());
+
+ if (nsLcmOpOcc.getNfvoNsInst() != null) {
+ nsLcmOpOccsNsLcmOpOcc.setNsInstanceId(nsLcmOpOcc.getNfvoNsInst().getNsInstId());
+ }
+
+ if (nsLcmOpOcc.getOperationState() != null) {
+ nsLcmOpOccsNsLcmOpOcc.setOperationState(
+ NsLcmOpOccsNsLcmOpOcc.OperationStateEnum.fromValue(nsLcmOpOcc.getOperationState().toString()));
+ }
+
+ if (nsLcmOpOcc.getOperation() != null) {
+ nsLcmOpOccsNsLcmOpOcc.setLcmOperationType(
+ NsLcmOpOccsNsLcmOpOcc.LcmOperationTypeEnum.fromValue(nsLcmOpOcc.getOperation().toString()));
+ }
+
+ if (nsLcmOpOcc.getOperationParams() != null) {
+ nsLcmOpOccsNsLcmOpOcc.setOperationParams(nsLcmOpOcc.getOperationParams());
+ }
+
+ if (nsLcmOpOcc.getCancelMode() != null) {
+ nsLcmOpOccsNsLcmOpOcc.setCancelMode(
+ NsLcmOpOccsNsLcmOpOcc.CancelModeEnum.fromValue(nsLcmOpOcc.getCancelMode().toString()));
+ }
+
+ nsLcmOpOccsNsLcmOpOcc.setLinks(generateLinks(nsLcmOpOcc));
+
+ logger.info("Database NsLcmOpOcc converted to API NsLcmOpOcc successfully... {}", nsLcmOpOccsNsLcmOpOcc);
+ return nsLcmOpOccsNsLcmOpOcc;
+ }
+
+ private NsLcmOpOccsNsLcmOpOccLinks generateLinks(final NsLcmOpOcc nsLcmOpOcc) {
+ logger.info("Generating links...");
+ final String nsLcmOpOccId = nsLcmOpOcc.getId();
+ final NsInstancesNsInstanceLinksSelf linksSelfNsLcmOpOcc = new NsInstancesNsInstanceLinksSelf()
+ .href(etsiSoNsLcmManagerUrlProvider.getNsLcmOpOccUri(nsLcmOpOccId).toString());
+ final NsLcmOpOccsNsLcmOpOccLinks links = new NsLcmOpOccsNsLcmOpOccLinks().self(linksSelfNsLcmOpOcc);
+
+ if (nsLcmOpOcc.getNfvoNsInst() != null) {
+ final String nsInstId = nsLcmOpOcc.getNfvoNsInst().getNsInstId();
+ final NsInstancesNsInstanceLinksSelf linksSelfNsInst = new NsInstancesNsInstanceLinksSelf()
+ .href(etsiSoNsLcmManagerUrlProvider.getCreatedNsResourceUri(nsInstId).toString());
+ links.setNsInstance(linksSelfNsInst);
+ }
+
+ return links;
+ }
+
+}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesController.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesController.java
index ec79ce6329..207f0ff387 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesController.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesController.java
@@ -22,20 +22,25 @@ package org.onap.so.etsi.nfvo.ns.lcm.rest;
import static org.onap.so.etsi.nfvo.ns.lcm.Constants.NS_LIFE_CYCLE_MANAGEMENT_BASE_URL;
import static org.slf4j.LoggerFactory.getLogger;
import javax.ws.rs.core.MediaType;
+import org.onap.so.etsi.nfvo.ns.lcm.lifecycle.NsLcmOperationOccurrenceManager;
+import org.onap.so.etsi.nfvo.ns.lcm.model.InlineResponse400;
import org.onap.so.etsi.nfvo.ns.lcm.model.NsLcmOpOccsNsLcmOpOcc;
import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
+import java.util.Optional;
/**
* Controller for handling NS lifecycle management operation occurrence requests see clause 6.4.9 and 6.4.10 in
* https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.07.01_60/gs_NFV-SOL005v020701p.pdf
*
* @author Waqas Ikram (waqas.ikram@est.tech)
+ * @author Andrew Lamb (andrew.a.lamb@est.tech)
*
*/
@Controller
@@ -43,6 +48,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
public class NsLcmOperationOccurrencesController {
private static final Logger logger = getLogger(NsLcmOperationOccurrencesController.class);
+ private final NsLcmOperationOccurrenceManager nsLcmOperationOccurrenceManager;
+
+ @Autowired
+ public NsLcmOperationOccurrencesController(final NsLcmOperationOccurrenceManager nsLcmOperationOccurrenceManager) {
+ this.nsLcmOperationOccurrenceManager = nsLcmOperationOccurrenceManager;
+ }
/**
* The GET method to retrieve status information about a NS lifecycle management operation occurrence by reading an
@@ -57,7 +68,18 @@ public class NsLcmOperationOccurrencesController {
produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public ResponseEntity<?> getOperationStatus(@PathVariable("nsLcmOpOccId") final String nsLcmOpOccId) {
logger.info("Received request to retrieve operation status for nsLcmOpOccId: {}", nsLcmOpOccId);
- return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).body("Operation is not supported yet");
+ final Optional<NsLcmOpOccsNsLcmOpOcc> optionalNsLcmOpOccs =
+ nsLcmOperationOccurrenceManager.getNsLcmOperationOccurrence(nsLcmOpOccId);
+
+ if (optionalNsLcmOpOccs.isPresent()) {
+ final NsLcmOpOccsNsLcmOpOcc nsLcmOpOcc = optionalNsLcmOpOccs.get();
+ logger.info("Sending back NsLcmOpOcc: {}", nsLcmOpOcc);
+ return ResponseEntity.ok().body(nsLcmOpOcc);
+ }
+
+ final String errorMessage = "Unable to retrieve operation occurrence status for nsLcmOpOccId: " + nsLcmOpOccId;
+ logger.error(errorMessage);
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new InlineResponse400().detail(errorMessage));
}
}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesControllerTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesControllerTest.java
index 9eace927d6..c5862569f2 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesControllerTest.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLcmOperationOccurrencesControllerTest.java
@@ -20,13 +20,26 @@
package org.onap.so.etsi.nfvo.ns.lcm.rest;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import java.time.LocalDateTime;
+import java.util.Optional;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.so.etsi.nfvo.ns.lcm.Constants;
-import org.onap.so.etsi.nfvo.ns.lcm.JSON;
import org.onap.so.etsi.nfvo.ns.lcm.TestApplication;
+import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.GsonProvider;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNsInst;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpType;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.OperationStateEnum;
+import org.onap.so.etsi.nfvo.ns.lcm.database.beans.State;
+import org.onap.so.etsi.nfvo.ns.lcm.database.service.DatabaseServiceProvider;
+import org.onap.so.etsi.nfvo.ns.lcm.model.InlineResponse400;
+import org.onap.so.etsi.nfvo.ns.lcm.model.NsLcmOpOccsNsLcmOpOcc;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.client.RestTemplateBuilder;
@@ -42,32 +55,75 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.google.gson.Gson;
/**
- *
* @author Waqas Ikram (waqas.ikram@est.tech)
+ * @author Andrew Lamb (andrew.a.lamb@est.tech)
+ *
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class NsLcmOperationOccurrencesControllerTest {
+
+ private static final String NS_LCM_OP_OCCS = "/ns_lcm_op_occs/";
+
@LocalServerPort
private int port;
+
+ @Autowired
+ private DatabaseServiceProvider databaseServiceProvider;
+
+ @Autowired
+ private GsonProvider gsonProvider;
+
private TestRestTemplate testRestTemplate;
@Before
public void setUp() {
- final Gson gson = JSON.createGson().create();
+ final Gson gson = gsonProvider.getGson();
testRestTemplate = new TestRestTemplate(
new RestTemplateBuilder().additionalMessageConverters(new GsonHttpMessageConverter(gson)));
}
@Test
- public void testGetOperationStatusS_ValidNsLcmOpOccId() {
- final String baseUrl = getNsLcmBaseUrl() + "/ns_lcm_op_occs/" + UUID.randomUUID().toString();
+ public void testGetOperationStatus_validNsLcmOpOccId_returnsNsLcmOpOcc() {
+ final String nsLcmOpOccId = addDummyNsLcmOpOccToDatabase();
+ final String baseUrl = getNsLcmBaseUrl() + NS_LCM_OP_OCCS + nsLcmOpOccId;
final HttpEntity<?> request = new HttpEntity<>(new HttpHeaders());
- final ResponseEntity<Void> responseEntity =
- testRestTemplate.exchange(baseUrl, HttpMethod.GET, request, Void.class);
- assertEquals(HttpStatus.NOT_IMPLEMENTED, responseEntity.getStatusCode());
+ final ResponseEntity<NsLcmOpOccsNsLcmOpOcc> responseEntity =
+ testRestTemplate.exchange(baseUrl, HttpMethod.GET, request, NsLcmOpOccsNsLcmOpOcc.class);
+ assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
+ assertTrue(responseEntity.hasBody());
+ assertNotNull(responseEntity.getBody());
+ }
+
+ @Test
+ public void testGetOperationStatus_nsLcmOpOccIdNotFound_returnsInlineResponse400() {
+ final String nsLcmOpOccId = UUID.randomUUID().toString();
+ final Optional<NsLcmOpOcc> optionalNsLcmOpOcc = databaseServiceProvider.getNsLcmOpOcc(nsLcmOpOccId);
+ assertTrue(optionalNsLcmOpOcc.isEmpty());
+ final String baseUrl = getNsLcmBaseUrl() + NS_LCM_OP_OCCS + nsLcmOpOccId;
+ final HttpEntity<?> request = new HttpEntity<>(new HttpHeaders());
+ final ResponseEntity<InlineResponse400> responseEntity =
+ testRestTemplate.exchange(baseUrl, HttpMethod.GET, request, InlineResponse400.class);
+ assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
+ assertTrue(responseEntity.hasBody());
+ assertNotNull(responseEntity.getBody());
+ }
+
+ private String addDummyNsLcmOpOccToDatabase() {
+ final LocalDateTime currentDateTime = LocalDateTime.now();
+
+ final NfvoNsInst nsInst = new NfvoNsInst().name("name").nsdId("id").status(State.NOT_INSTANTIATED)
+ .nsdInvariantId("id").statusUpdatedTime(currentDateTime);
+ databaseServiceProvider.saveNfvoNsInst(nsInst);
+
+ final NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc().nfvoNsInst(nsInst).operationState(OperationStateEnum.PROCESSING)
+ .isCancelPending(false).isAutoInvocation(false).operation(NsLcmOpType.INSTANTIATE)
+ .startTime(currentDateTime).stateEnteredTime(currentDateTime).operationParams("");
+ databaseServiceProvider.addNSLcmOpOcc(nsLcmOpOcc);
+
+ return nsLcmOpOcc.getId();
}
private String getNsLcmBaseUrl() {
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml
index 44acda20a4..6f2b4d26c5 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml
@@ -29,11 +29,13 @@ spring:
pool-name: ns-lcm-nfvo-pool
registerMbeans: true
jpa:
+ generate-ddl: true
hibernate:
- ddl-auto: none
+ ddl-auto: create
logging:
level:
org.reflections.Reflections: ERROR
+
etsi-catalog-manager:
base:
- endpoint: http://modeling-etsicatalog.onap:8806/api \ No newline at end of file
+ endpoint: http://modeling-etsicatalog.onap:8806/api
diff --git a/version.properties b/version.properties
index e783874dbf..058fdc4c92 100644
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=1
minor=7
-patch=3
+patch=4
base_version=${major}.${minor}.${patch}