aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-11-07 18:30:09 -0500
committerRob Daugherty <rd472p@att.com>2018-11-07 20:45:00 -0500
commiteec3403e1439f536a2aaf89474a6d4b1ca08df29 (patch)
tree9f86c14d0a4bc5e5ebc8f519ad452502451ba5e7 /bpmn/MSOCommonBPMN
parent61affc6311906aee71b16ee8632c1e7468cd1990 (diff)
parent29641940921b96ed1367958c14e6da2be6577575 (diff)
11/7: merge casablanca to master
Commit: dbb53cabbff772880134699eb81dee775d7df8df Subject: Send correct resourceModuleName Issue: SO-1178 Commit: d3759e15184562647ea83b92cf02140fc705cb0d by ss835w Subject: Update Regex Logic to take into account new scale out URI... Issue: SO-117 Commit: 5dadc2c5790c961a74085d3d10b6f5aec6b7ba30 Subject: Fix msb url in homing cloudsite Issue: SO-1180 Commit: 9a9b0fa23afe8d46171fe95f1090de5a7f701d3d Subject: Updated Reference data for AutoScaleOut Issue: SO-1174 Commit: 3178cad6c756140b18eb658277598e3e2d2d3dcf Subject: ConfigurationParameter is empty for scaleout Issue: SO-1083 Commit: 402bf528e9a796f6ce31ad36c16316c2b31acc48 Subject: Added Null check for gtConfigurationParameter Issue: SO-1179 Commit: fb6ab40a64e74876ba1f08c4d3bdb6a040c21b94 Subject: Bug fixes November 5th Issue: SO-1188 Commit: ce37ae979311ed4e55150426d477db262773beb0 Subject: Removed slashes and added catch block Issue: SO-1183 Commit: 16aa0b6cc42c7287fc080c81451e301c0acc14cf Subject: removed retry from rainy day table Issue: SO-1185 Commit: 2073a3b4c20965252c7f3a0c1aea8e4407e876fa Subject: Fixing scaleOut workflow looping issue Issue: SO-1182 Commit: 5ca364a5e975877244ee51796602043a4b078a23 Subject: Make homingBB optinal and fix homing process Issue: SO-1168 Commit: 1c554c3332ccf6be4e576e9159bbb0f901197379 Subject: bug fixing with reading dmaap message Issue: SO-1191 Change-Id: Id747bc05b791787f304316396bc5fcd20d350b6f Issue-ID: SO-1190 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy16
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java3
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml31
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json8
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json9
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json8
8 files changed, 53 insertions, 46 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
index bb557a8285..a43a2b1f89 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
@@ -131,7 +131,7 @@ class AllottedResourceUtils {
String[] split = arLink.split("/service-instance/")
String[] splitB = split[1].split("/allotted-resources/")
String siId = splitB[0]
- msoLogger.trace(" Exit getARLinkbyId - parentServiceInstanceId:" + siId )
+ msoLogger.trace(" Exit getPSIFmARLink - parentServiceInstanceId:" + siId )
return siId
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
index 2e937ed134..ee93f3a445 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
@@ -18,13 +18,11 @@
* ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.common.scripts
+
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.onap.so.bpmn.common.scripts.AaiUtil
-import org.onap.so.bpmn.common.scripts.ExceptionUtil
-
import org.onap.so.bpmn.core.domain.InventoryType
import org.onap.so.bpmn.core.domain.Resource
import org.onap.so.bpmn.core.domain.ResourceType
@@ -246,7 +244,7 @@ class OofHoming extends AbstractServiceTaskProcessor {
resource.getHomingSolution().setCloudOwner(cloudOwner)
resource.getHomingSolution().setCloudRegionId(cloudRegionId)
- CloudSite cloudSite = new CloudSite();
+ CloudSite cloudSite = new CloudSite()
cloudSite.setId(cloudRegionId)
cloudSite.setRegionId(cloudRegionId)
String orchestrator = execution.getVariable("orchestrator")
@@ -254,10 +252,18 @@ class OofHoming extends AbstractServiceTaskProcessor {
cloudSite.setOrchestrator(orchestrator)
}
- CloudIdentity cloudIdentity = new CloudIdentity();
- cloudIdentity.setId(cloudRegionId);
- cloudIdentity.setIdentityUrl("/api/multicloud /v1/" + cloudOwner + "/" + cloudRegionId + "/infra_workload")
- cloudSite.setIdentityService(cloudIdentity);
+ CloudIdentity cloudIdentity = new CloudIdentity()
+ cloudIdentity.setId(cloudRegionId)
+ // Get MSB Url
+ String msbHost = oofUtils.getMsbHost(execution)
+ String multicloudApiEndpoint = UrnPropertiesReader
+ .getVariable("mso.multicloud.api.endpoint", execution,
+ "/api/multicloud-titaniumcloud/v1")
+ cloudIdentity.setIdentityUrl(msbHost + multicloudApiEndpoint
+ + "/" + cloudOwner + "/" +
+ cloudRegionId + "/infra_workload")
+
+ cloudSite.setIdentityService(cloudIdentity)
// Set cloudsite in catalog DB here
oofUtils.createCloudSiteCatalogDb(cloudSite)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index b9bc1c7c00..46ecc7bbe6 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -158,6 +158,8 @@ class OofUtils {
utils.log("DEBUG", "Allotted Resource: " + resource.toString(),
isDebugEnabled)
def serviceResourceId = resource.getResourceId()
+ def toscaNodeType = resource.getToscaNodeType()
+ def resourceModuleName = toscaNodeType.substring(toscaNodeType.lastIndexOf(".") + 1)
def resourceModelInvariantId = resource.getModelInfo().getModelInvariantUuid()
def resourceModelVersionId = resource.getModelInfo().getModelUuid()
def resourceModelName = resource.getModelInfo().getModelName()
@@ -173,7 +175,7 @@ class OofUtils {
String demand =
" {\n" +
- " \"resourceModuleName\": \"${resourceModelName}\",\n" +
+ " \"resourceModuleName\": \"${resourceModuleName}\",\n" +
" \"serviceResourceId\": \"${serviceResourceId}\",\n" +
" \"tenantId\": \"${tenantId}\",\n" +
" \"resourceModelInfo\": {\n" +
@@ -199,6 +201,8 @@ class OofUtils {
utils.log("DEBUG", "VNF Resource: " + vnfResource.toString(),
isDebugEnabled)
ModelInfo vnfResourceModelInfo = vnfResource.getModelInfo()
+ def toscaNodeType = vnfResource.getToscaNodeType()
+ def resourceModuleName = toscaNodeType.substring(toscaNodeType.lastIndexOf(".") + 1)
def serviceResourceId = vnfResource.getResourceId()
def resourceModelInvariantId = vnfResourceModelInfo.getModelInvariantUuid()
def resourceModelName = vnfResourceModelInfo.getModelName()
@@ -211,7 +215,7 @@ class OofUtils {
String placementDemand =
" {\n" +
- " \"resourceModuleName\": \"${resourceModelName}\",\n" +
+ " \"resourceModuleName\": \"${resourceModuleName}\",\n" +
" \"serviceResourceId\": \"${serviceResourceId}\",\n" +
" \"tenantId\": \"${tenantId}\",\n" +
" \"resourceModelInfo\": {\n" +
@@ -519,4 +523,12 @@ class OofUtils {
exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from CatalogDB.")
}
}
+
+ String getMsbHost(DelegateExecution execution) {
+ msbHost = UrnPropertiesReader.getVariable("mso.msb.host", execution, "msb-iag.onap")
+
+ Integer msbPort = UrnPropertiesReader.getVariable("mso.msb.port", execution, "80").toInteger()
+
+ return UriBuilder.fromPath("").host(msbHost).port(msbPort).scheme("http").build().toString()
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index 0f52c96d0e..1e77c35ee3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -337,6 +337,9 @@ public class BBInputSetupMapperLayer {
context.setRequestParameters(this.mapRequestParameters(requestDetails.getRequestParameters()));
context.setUserParams(this.mapNameValueUserParams(requestDetails.getRequestParameters()));
}
+ if (requestDetails.getConfigurationParameters() != null) {
+ context.setConfigurationParameters(requestDetails.getConfigurationParameters());
+ }
return context;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml b/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
deleted file mode 100644
index 33c8cb1ac0..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ============LICENSE_START=======================================================
- ONAP SO
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<process-application
- xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <process-archive name="MSOCommonBPMN">
- <properties>
- <property name="isDeleteUponUndeploy">false</property>
- <property name="isScanForProcessDefinitions">true</property>
- </properties>
- </process-archive>
-
-</process-application>
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
index 926bf2ccb7..5eb9a26901 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
@@ -27,7 +27,13 @@
"skip": "ignore"
}
]
- }
+ },
+ "configurationParameters": [
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
},
"orchContext": {
"is-rollback-enabled": false
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
index dfc6d4f555..906903e0b2 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
@@ -25,6 +25,11 @@
"skip": "ignore"
}
]
- }
-
+ },
+ "configurationParameters": [
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
index 7386828d27..9afbdd9150 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
@@ -23,6 +23,12 @@
}
]
- }
+ },
+ "configurationParameters": [
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
}