summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
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]"
+ }
+ ]
}