summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkoblosz <sandra.koblosz@nokia.com>2018-09-16 23:23:29 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2018-09-24 12:18:37 +0200
commit81514934814195389ed1cea1266ac305751bcddb (patch)
tree848102381514706e1dfd8438b9674f974d87a66b
parente40ad0f69d7e1241dbb0fd17412067353c44eb85 (diff)
Changed VF creation to new MSO scaleout API
Change-Id: Ie3cf99adc9a441d03bd31884ea46c94e9b62db74 Issue-ID: VID-248 Signed-off-by: Koblosz, Sandra (koblosz) <sandra.koblosz@nokia.com>
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties2
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java41
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js24
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html6
-rw-r--r--vid-app-common/src/test/resources/WEB-INF/conf/system.properties2
-rw-r--r--vid-app-common/src/test/resources/mso.properties2
-rw-r--r--vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json1
-rw-r--r--vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json1
9 files changed, 62 insertions, 19 deletions
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
index dc9eb43a..34ae55f6 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
@@ -166,7 +166,7 @@ mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInsta
mso.restapi.vnf.instance=/serviceInstances/v6/<service_instance_id>/vnfs
mso.restapi.vnf.changemanagement.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
mso.restapi.network.instance=/serviceInstances/v6/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.vf.module.instance=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
mso.restapi.volume.group.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
mso.restapi.get.orc.req=/orchestrationRequests/v6
mso.restapi.get.orc.reqs=/orchestrationRequests/v6?
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
index 5596de03..9445b732 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
@@ -109,7 +109,7 @@ mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInsta
mso.restapi.vnf.instance=/onap/so/infra/serviceInstances/v6/<service_instance_id>/vnfs
mso.restapi.vnf.changemanagement.instance=/onap/so/infra/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
mso.restapi.network.instance=/onap/so/infra/serviceInstances/v6/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/onap/so/infra/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.vf.module.instance=/onap/so/infra/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
mso.restapi.volume.group.instance=/onap/so/infra/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
mso.restapi.get.orc.req=/onap/so/infra/orchestrationRequests/v6
mso.restapi.get.orc.reqs=/onap/so/infra/orchestrationRequests/v6?
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
index df691484..9d198add 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
@@ -26,6 +26,7 @@ import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.onap.vid.domain.mso.*;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -41,7 +42,8 @@ import java.util.Map;
"relatedModelList",
"requestInfo",
"subscriberInfo",
- "requestParameters"
+ "requestParameters",
+ "configurationParameters"
})
public class RequestDetails{
@@ -71,6 +73,9 @@ public class RequestDetails{
@JsonProperty("requestParameters")
private RequestParameters requestParameters;
+ @JsonProperty("configurationParameters")
+ protected List<Map<String, String>> configurationParameters = new ArrayList<>();
+
/** The additional properties. */
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@@ -198,12 +203,31 @@ public class RequestDetails{
this.additionalProperties.put(name, value);
}
+ @JsonProperty("configurationParameters")
+ public List<Map<String, String>> getConfigurationParameters() {
+ return configurationParameters;
+ }
+
+ @JsonProperty("configurationParameters")
+ public void setConfigurationParameters(List<Map<String, String>> configurationParameters) {
+ this.configurationParameters = configurationParameters;
+ }
+
/* (non-Javadoc)
* @see org.onap.vid.domain.mso.RequestDetails#hashCode()
*/
@Override
public int hashCode() {
- return new HashCodeBuilder().append(cloudConfiguration).append(modelInfo).append(relatedInstanceList).append(requestInfo).append(getRequestParameters()).append(subscriberInfo).append(additionalProperties).toHashCode();
+ return new HashCodeBuilder()
+ .append(cloudConfiguration)
+ .append(modelInfo)
+ .append(relatedInstanceList)
+ .append(requestInfo)
+ .append(getRequestParameters())
+ .append(subscriberInfo)
+ .append(additionalProperties)
+ .append(configurationParameters.hashCode())
+ .toHashCode();
}
/* (non-Javadoc)
@@ -214,11 +238,20 @@ public class RequestDetails{
if (other == this) {
return true;
}
- if ((other instanceof RequestDetails) == false) {
+ if (!(other instanceof RequestDetails)) {
return false;
}
RequestDetails rhs = ((RequestDetails) other);
- return new EqualsBuilder().append(cloudConfiguration, rhs.cloudConfiguration).append(modelInfo, rhs.modelInfo).append(relatedInstanceList, rhs.relatedInstanceList).append(requestInfo, rhs.requestInfo).append(getRequestParameters(), rhs.getRequestParameters()).append(subscriberInfo, rhs.subscriberInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
+ return new EqualsBuilder()
+ .append(cloudConfiguration, rhs.cloudConfiguration)
+ .append(modelInfo, rhs.modelInfo)
+ .append(relatedInstanceList, rhs.relatedInstanceList)
+ .append(requestInfo, rhs.requestInfo)
+ .append(getRequestParameters(), rhs.getRequestParameters())
+ .append(subscriberInfo, rhs.subscriberInfo)
+ .append(additionalProperties, rhs.additionalProperties)
+ .append(configurationParameters, rhs.configurationParameters)
+ .isEquals();
}
public RequestParameters getRequestParameters() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index c55092e4..fca5a7c7 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -10,7 +10,7 @@
vm.hasScheduler = !!VIDCONFIGURATION.SCHEDULER_PORTAL_URL;
vm.configUpdatePatternError = "Invalid file type. Please select a file with a CSV extension.";
vm.configUpdateContentError = "Invalid file structure.";
-
+
vm.wizardStep = 1;
vm.nextStep = function(){
vm.wizardStep++;
@@ -193,9 +193,10 @@
var result = {};
result.requestType = changeManagement.workflow;
var workflowType = changeManagement.workflow;
+ var configurationParameters = changeManagement.configurationParameters;
result.requestDetails = [];
_.forEach(changeManagement.vnfNames, function (vnf) {
-
+
try{
var requestInfoData ={};
var requestParametersData ={};
@@ -203,13 +204,13 @@
return !item.scale;
});
if (vnf.availableVersions && vnf.availableVersions.length!=0){
-
+
requestInfoData ={
source: vnf.availableVersions[0].requestInfo.source,
suppressRollback: vnf.availableVersions[0].requestInfo.suppressRollback,
requestorId: vnf.availableVersions[0].requestInfo.requestorId
}
-
+
if(workflowType=='Update'){
requestParametersData = {
usePreload: vnf.availableVersions[0].requestParameters.usePreload
@@ -278,7 +279,8 @@
cloudConfiguration: vnf.cloudConfiguration,
requestInfo: requestInfoData,
relatedInstanceList: [],
- requestParameters:requestParametersData
+ requestParameters:requestParametersData,
+ configurationParameters: JSON.parse(configurationParameters)
};
requestInfoData.instanceName = vnf.name + "_" + (moduleToScale.currentCount + 1);
}else{
@@ -297,7 +299,8 @@
cloudConfiguration: vnf.cloudConfiguration,
requestInfo: requestInfoData,
relatedInstanceList: [],
- requestParameters:requestParametersData
+ requestParameters:requestParametersData,
+ configurationParameters: []
};
}
@@ -352,7 +355,6 @@
});
return JSON.stringify(result);
}
-
vm.openModal = function () {
if(vm.hasScheduler) { //scheduling supported
$scope.widgetParameter = ""; // needed by the scheduler?
@@ -370,7 +372,7 @@
widgetData: vm.changeManagement,
widgetParameter: $scope.widgetParameter
};
-
+
window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
} else {
//no scheduling support
@@ -380,7 +382,9 @@
if(vm.changeManagement.workflow==="VNF Scale Out") {
dataToSo = JSON.parse(dataToSo);
dataToSo = {requestDetails: dataToSo.requestDetails[0]};
- changeManagementService.postChangeManagementScaleOutNow(dataToSo, vm.changeManagement.vnfNames[0]["service-instance-node"][0].properties["service-instance-id"], vm.changeManagement.vnfNames[0].id);
+ changeManagementService.postChangeManagementScaleOutNow(dataToSo,
+ vm.changeManagement.vnfNames[0]["service-instance-node"][0].properties["service-instance-id"],
+ vm.changeManagement.vnfNames[0].id);
}else{
//TODO: foreach
var vnfName = vm.changeManagement.vnfNames[0].name;
@@ -649,7 +653,7 @@
vm.isConfigUpdate = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate;
}
-
+
vm.isScaleOut = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfScaleOut;
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index ec1d4cde..21f9c5d3 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -58,6 +58,10 @@
<option value="" disabled>Select workflow</option>
</select>
</div>
+ <div class="form-group" ng-if="vm.isScaleOut()">
+ <label class="control-label">Configuration Parameters</label>
+ <input type="text" name="configurationParameters" ng-model="vm.changeManagement.configurationParameters" id="configuration-parameters" required>
+ </div>
<div class="form-group" ng-if="vm.isConfigUpdate()">
<label class="control-label">Attach configuration file</label>
<div class="file-wrapper">
@@ -143,4 +147,4 @@
<button ng-if="vm.isScaleOut() && vm.wizardStep === 1" ng-click="vm.nextStep();" type="button" id="next" name="next" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Next</button>
</div>
</div>
-</form>
+</form> \ No newline at end of file
diff --git a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
index 689f55e5..bf0f8262 100644
--- a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
+++ b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
@@ -154,7 +154,7 @@ mso.restapi.svc.instance=/serviceInstances/v5
mso.restapi.vnf.instance=/serviceInstances/v5/<service_instance_id>/vnfs
mso.restapi.vnf.changemanagement.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
mso.restapi.network.instance=/serviceInstances/v5/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.vf.module.instance=/serviceInstantiation/v7/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
mso.restapi.volume.group.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
mso.restapi.get.orc.req=/orchestrationRequests/v5
mso.restapi.get.orc.reqs=/orchestrationRequests/v5?
diff --git a/vid-app-common/src/test/resources/mso.properties b/vid-app-common/src/test/resources/mso.properties
index fcd20bd7..d021ffde 100644
--- a/vid-app-common/src/test/resources/mso.properties
+++ b/vid-app-common/src/test/resources/mso.properties
@@ -6,7 +6,7 @@ mso.password.x=OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz
mso.restapi.svc.instance=/serviceInstances/v3
mso.restapi.vnf.instance=/serviceInstances/v3/<service_instance_id>/vnfs
mso.restapi.network.instance=/serviceInstances/v3/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.vf.module.instance=/serviceInstantiation/v7/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
mso.restapi.volume.group.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
mso.restapi.get.orc.req=/orchestrationRequests/v3
diff --git a/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json b/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json
index 400a55f9..75474109 100644
--- a/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json
+++ b/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json
@@ -5,6 +5,7 @@
"source": "VID",
"requestorId": "<userId>"
},
+ "configurationParameters" : [ ],
"relatedInstanceList": [
{
"relatedInstance": {
diff --git a/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json b/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json
index b9ff1512..c50a66c1 100644
--- a/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json
+++ b/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json
@@ -5,6 +5,7 @@
"source": "VID",
"requestorId": "<userId>"
},
+ "configurationParameters" : [ ],
"requestParameters": {
"operationalEnvironmentType": "VNF"
}