scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals
scheduler.get.schedules=/v1/ChangeManagement/schedules/scheduleDetails/
+scheduler.basic.auth=
mso.dme2.client.read.timeout=${MSO_DME2_CLIENT_READ_TIMEOUT}
mso.dme2.server.url=${MSO_DME2_SERVER_URL}
mso.dme2.enabled=${MSO_DME2_ENABLED}
-scheduler.basic.auth=
+scheduler.basic.auth=${SCHEDULER_BASIC_AUTH}
package org.onap.vid.client;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.onap.vid.client.UnirestPatchKt.patched;
+
import io.joshworks.restclient.http.HttpResponse;
import io.joshworks.restclient.http.JsonNode;
import io.joshworks.restclient.http.RestClient;
import io.joshworks.restclient.http.exceptions.RestClientException;
import io.joshworks.restclient.http.mapper.ObjectMapper;
import io.joshworks.restclient.request.GetRequest;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.util.Map;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.vid.properties.VidProperties;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.*;
-import java.security.cert.CertificateException;
-import java.util.Map;
-
public class SyncRestClient implements SyncRestClientInterface {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SyncRestClient.class);
private static final String[] SUPPORTED_SSL_VERSIONS = {"TLSv1", "TLSv1.2"};
private <T> HttpResponse<T> callWithRetryOverHttpThrows(String url, HttpRequest<T> httpRequest) throws IOException {
try {
- return httpRequest.apply(url);
+ return patched(httpRequest.apply(url));
} catch (RestClientException e) {
if (causedBySslHandshakeError(e)) {
logger.warn(EELFLoggerDelegate.debugLogger, "SSL Handshake problem occured. Will try to retry over Http.", e);
- return httpRequest.apply(url.replaceFirst(HTTPS_SCHEMA, HTTP_SCHEMA));
+ return patched(httpRequest.apply(url.replaceFirst(HTTPS_SCHEMA, HTTP_SCHEMA)));
}
throw e;
}
@Override
public <T> T readValue(String value, Class<T> aClass) {
try {
- return objectMapper.readValue(value, aClass);
+ return isEmpty(value) ? null : objectMapper.readValue(value, aClass);
} catch (IOException e) {
throw new SyncRestClientException("IOException while reading value", e);
}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.client
+
+import io.joshworks.restclient.http.Headers
+import io.joshworks.restclient.http.HttpResponse
+import org.apache.http.HttpVersion
+import org.apache.http.message.BasicHttpResponse
+import java.io.InputStream
+
+/// Patch NPE in joshworks's Unirest HttpResponse::getBody when getRawBody is null
+fun <T> patched(httpResponse: HttpResponse<T>) =
+ if (willGetBodyTriggerNPE(httpResponse)) HttpResponsePatch(httpResponse) else httpResponse
+
+private fun <T> willGetBodyTriggerNPE(httpResponse: HttpResponse<T>) =
+ httpResponse.rawBody == null || httpResponse.rawBody.available() == 0
+
+private val dummyHttpResponse = BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "ok")
+
+/**
+ * This class inherits HttpResponse to have compatible interface,
+ * but implementation is done through delegation to another
+ * instance.
+ * For that, it's enough to pass dummy values to HttpResponse's
+ * constructor, as parent HttpResponse methods won't be used,
+ * only overridden.
+ */
+private class HttpResponsePatch<T>(private val delegatee: HttpResponse<T>) : HttpResponse<T>(
+ dummyHttpResponse, null, null
+) {
+ override fun getBody(): T? = if (willGetBodyTriggerNPE(delegatee)) null else delegatee.body
+ override fun getHeaders(): Headers? = delegatee.headers
+ override fun getStatus() = delegatee.status
+ override fun isSuccessful() = delegatee.isSuccessful
+ override fun getStatusText(): String? = delegatee.statusText
+ override fun getRawBody(): InputStream? = delegatee.rawBody
+}
package org.onap.vid.controller;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.module.kotlin.KotlinModule;
import io.joshworks.restclient.http.mapper.ObjectMapper;
+import java.io.File;
+import java.io.IOException;
+import javax.servlet.ServletContext;
import org.onap.portalsdk.core.util.SystemProperties;
-import org.onap.vid.aai.*;
+import org.onap.vid.aai.AaiClient;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.aai.AaiOverTLSClient;
+import org.onap.vid.aai.AaiOverTLSClientInterface;
+import org.onap.vid.aai.AaiOverTLSPropertySupplier;
+import org.onap.vid.aai.AaiResponseTranslator;
+import org.onap.vid.aai.PombaClientImpl;
+import org.onap.vid.aai.PombaClientInterface;
+import org.onap.vid.aai.PombaRestInterface;
import org.onap.vid.aai.model.PortDetailsTranslator;
-import org.onap.vid.aai.util.*;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.onap.vid.aai.util.CacheProvider;
+import org.onap.vid.aai.util.HttpsAuthClient;
+import org.onap.vid.aai.util.SSLContextProvider;
+import org.onap.vid.aai.util.ServiceInstanceStandardQuery;
+import org.onap.vid.aai.util.ServletRequestHelper;
+import org.onap.vid.aai.util.SystemPropertyHelper;
import org.onap.vid.asdc.AsdcClient;
import org.onap.vid.asdc.parser.ToscaParserImpl2;
import org.onap.vid.asdc.parser.VidNotionsBuilder;
import org.onap.vid.properties.AsdcClientConfiguration;
import org.onap.vid.scheduler.SchedulerService;
import org.onap.vid.scheduler.SchedulerServiceImpl;
-import org.onap.vid.services.*;
+import org.onap.vid.services.AAIServiceTree;
+import org.onap.vid.services.AAITreeNodeBuilder;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.AaiServiceImpl;
+import org.onap.vid.services.ChangeManagementService;
+import org.onap.vid.services.PombaService;
+import org.onap.vid.services.PombaServiceImpl;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import javax.servlet.ServletContext;
-import java.io.File;
-import java.io.IOException;
-
@EnableSwagger2
@Configuration
public class WebConfig {
@Override
public <T> T readValue(String s, Class<T> aClass) {
try {
- return objectMapper.readValue(s, aClass);
+ return isEmpty(s) ? null : objectMapper.readValue(s, aClass);
} catch (IOException e) {
throw new RuntimeException(e);
}
package org.onap.vid.model;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
/**
* Created by Oren on 7/4/17.
*/
+
+@JsonIgnoreProperties(ignoreUnknown = true)
public class Subscriber {
@JsonProperty("global-customer-id")
@JsonProperty("resource-version")
public String resourceVersion;
-
-
-
-
}
@Override
public MsoResponseWrapper2 deactivateAndCloudDelete(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId, RequestDetails requestDetails) {
String path = getDeactivateAndCloudDeletePath(serviceInstanceId, vnfInstanceId, vfModuleInstanceId);
- return new MsoResponseWrapper2<>(msoClientInterface.post(path, new RequestDetailsWrapper<>(requestDetails), RequestReferencesContainer.class));
+ return new MsoResponseWrapper2<>(msoClientInterface.post(path, requestDetails, RequestReferencesContainer.class));
}
@Override
public MsoResponseWrapper2 activateFabricConfiguration(String serviceInstanceId, RequestDetails requestDetails) {
String path = getActivateFabricConfigurationPath(serviceInstanceId);
- return new MsoResponseWrapper2<>(msoClientInterface.post(path, new RequestDetailsWrapper<>(requestDetails), RequestReferencesContainer.class));
+ return new MsoResponseWrapper2<>(msoClientInterface.post(path, requestDetails, RequestReferencesContainer.class));
}
@Override
<T> HttpResponse<T> get(String path, Class<T> responseClass);
- <T> HttpResponse<T> post(String path, RequestDetailsWrapper<?> requestDetailsWrapper,
- Class<T> responseClass);
+ <T> HttpResponse<T> post(String path, RequestDetailsWrapper<?> requestDetailsWrapper, Class<T> responseClass);
+
+ <T> HttpResponse<T> post(String path, RequestDetails requestDetails, Class<T> responseClass);
}
* 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.
package org.onap.vid.mso;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import io.joshworks.restclient.http.HttpResponse;
+import org.apache.commons.lang3.exception.ExceptionUtils;
-import java.util.Objects;
public class MsoUtil {
+ final static ObjectMapper objectMapper = new ObjectMapper();
+
private MsoUtil() {
}
return new MsoResponseWrapper(status, response);
}
- public static <T> MsoResponseWrapper wrapResponse(HttpResponse<T> httpResponse) {
+ public static <T> MsoResponseWrapper wrapResponse(HttpResponse<T> httpResponse) {
MsoResponseWrapper msoResponseWrapper = new MsoResponseWrapper();
msoResponseWrapper.setStatus(httpResponse.getStatus());
if (httpResponse.getRawBody() != null) {
- msoResponseWrapper.setEntity(Objects.toString(httpResponse.getBody()));
+ try {
+ T body = httpResponse.getBody();
+ String entityStr = body instanceof String ? (String) body : objectMapper.writeValueAsString(httpResponse.getBody());
+ msoResponseWrapper.setEntity(entityStr);
+ }
+ catch(JsonProcessingException e)
+ {
+ ExceptionUtils.rethrow(e);
+ }
}
return msoResponseWrapper;
}
return client.post(path, commonHeaders, requestDetailsWrapper, responseClass);
}
+ @Override
+ public <T> HttpResponse<T> post(String endpoint, RequestDetails requestDetails, Class<T> responseClass) {
+ String path = baseUrl + endpoint;
+
+ return client.post(path, commonHeaders, requestDetails, responseClass);
+ }
+
public HttpResponse<SOWorkflowList> getWorkflowListByModelId(String endpoint){
String path = baseUrl + endpoint;
//list vfmodules ids in AAI that belong to that vnf instance
var modulesAaiIds = _.filter(newVNFName.relatedTo, function(item){
- return item["node-type"] === "vf-module";
- }).map(function(item){
- return item.id;
- });
+ return item["node-type"] === "vf-module";
+ }).map(function(item){
+ return item.id;
+ });
_.forEach(newVNFName.vfModules, function (mdl, key) {
mdl.scale = false; //defaults to not scale unless user changes it
var extractVNFModel = function (csarVNF, sdcService, selectionVNF) {
/**
- @param selectionVNF A vnf *instance* selected in "available VNF" drop-down box
- @param csarVNF A VNF *MODEL* that has an invariantUuid same as selectionVNF (might be
- a different version; i.e. selectionVNF.modelVersionId <> csarVNF.uuid)
- @param sdcService The Service *MODEL* which has the related VNF `csarVNF`.
+ @param selectionVNF A vnf *instance* selected in "available VNF" drop-down box
+ @param csarVNF A VNF *MODEL* that has an invariantUuid same as selectionVNF (might be
+ a different version; i.e. selectionVNF.modelVersionId <> csarVNF.uuid)
+ @param sdcService The Service *MODEL* which has the related VNF `csarVNF`.
*/
var versionCsarData = {
vnfInstanceId: "",
};
- /***converting objects to scheduler format (taken from IST) - was altered for Scale out support ***/
- function extractChangeManagementCallbackDataStr(changeManagement) {
- console.log(changeManagement);
- var result = {};
- result.requestType = changeManagement.workflow;
- var workflowType = changeManagement.workflow;
- result.requestDetails = [];
- _.forEach(changeManagement.vnfNames, function (vnf) {
-
- try{
- var requestInfoData ={};
- var requestParametersData ={};
- var moduleToScale = _.find(vnf.vfModules, {"scale": true});
- 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
- }
- }else if(workflowType=="Replace"){
- requestParametersData = {
- rebuildVolumeGroups: vnf.availableVersions[0].requestParameters.usePreload
- }
- }else if(workflowType=="VNF In Place Software Update"){
- var payloadObj = {
- 'existing_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Existing software version').value,
- 'new_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'New software version').value,
- 'operations_timeout':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Operations timeout').value
- };
- requestParametersData = {
+ /***converting objects to scheduler format (taken from IST) - was altered for Scale out support ***/
+ function extractChangeManagementCallbackDataStr(changeManagement) {
+ console.log(changeManagement);
+ var result = {};
+ result.requestType = changeManagement.workflow;
+ var workflowType = changeManagement.workflow;
+ result.requestDetails = [];
+ _.forEach(changeManagement.vnfNames, function (vnf) {
+
+ try{
+ var requestInfoData ={};
+ var requestParametersData ={};
+ var moduleToScale = _.find(vnf.vfModules, {"scale": true});
+ 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
+ }
+ }else if(workflowType=="Replace"){
+ requestParametersData = {
+ rebuildVolumeGroups: vnf.availableVersions[0].requestParameters.usePreload
+ }
+ }else if(workflowType=="VNF In Place Software Update"){
+ var payloadObj = {
+ 'existing_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Existing software version').value,
+ 'new_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'New software version').value,
+ 'operations_timeout':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Operations timeout').value
+ };
+ requestParametersData = {
+ payload: JSON.stringify(payloadObj)
+ }
+ }else if(workflowType=="VNF Config Update"){
+ requestParametersData = {
+ payload: vm.getInternalWorkFlowParameter("VNF Config Update", "FILE", "Attach configuration file").value
+ }
+ }else if(workflowType=="VNF Scale Out"){
+ if(!moduleToScale) return null;
+
+ if(moduleToScale.userParams) {
+ requestParametersData = {
+ userParams: moduleToScale.userParams
+ //,usePreload: true
+ }
+ }else{
+ requestParametersData = {
+ userParams: []
+ //,usePreload: false
+ }
+ }
+ }
+ $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: workflowType '+ workflowType);
+ $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: requestParametersData '+ requestParametersData);
+
+ }else if(workflowType=="VNF In Place Software Update"){
+ var payloadObj = {
+ 'existing_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Existing software version').value,
+ 'new_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'New software version').value,
+ 'operations_timeout':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Operations timeout').value
+ };
+ requestParametersData = {
payload: JSON.stringify(payloadObj)
- }
- }else if(workflowType=="VNF Config Update"){
- requestParametersData = {
- payload: vm.getInternalWorkFlowParameter("VNF Config Update", "FILE", "Attach configuration file").value
- }
- }else if(workflowType=="VNF Scale Out"){
- if(!moduleToScale) return null;
-
- if(moduleToScale.userParams) {
- requestParametersData = {
- userParams: moduleToScale.userParams
- //,usePreload: true
- }
- }else{
- requestParametersData = {
- userParams: []
- //,usePreload: false
- }
- }
- }
- $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: workflowType '+ workflowType);
- $log.info('SchedulerWidgetCtrl:extractChangeManagementCallbackDataStr info:: requestParametersData '+ requestParametersData);
-
- }else if(workflowType=="VNF In Place Software Update"){
- var payloadObj = {
- 'existing_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Existing software version').value,
- 'new_software_version':vm.getInternalWorkFlowParameter(workflowType, 'text', 'New software version').value,
- 'operations_timeout':vm.getInternalWorkFlowParameter(workflowType, 'text', 'Operations timeout').value
- };
- requestParametersData = {
- payload: JSON.stringify(payloadObj)
- }
- }else if(workflowType=="VNF Config Update"){
- requestParametersData = {
- payload: vm.getInternalWorkFlowParameter("VNF Config Update", "FILE", "Attach configuration file").value
- }
- }
-
- var data;
- if(workflowType=="VNF Scale Out") {
- data = {
- vnfName: vnf.name,
- vnfInstanceId: vnf.id,
- modelInfo: {
- modelType: 'vfModule',
- modelInvariantId: moduleToScale.invariantUuid,
- modelName: moduleToScale.modelCustomizationName,
- modelVersion: moduleToScale.version,
- modelCustomizationName: moduleToScale.modelCustomizationName,
- modelCustomizationId: moduleToScale.customizationUuid,
- modelVersionId: moduleToScale.uuid
- },
- cloudConfiguration: vnf.cloudConfiguration,
- requestInfo: requestInfoData,
- relatedInstanceList: [],
- requestParameters:requestParametersData,
- configurationParameters: JSON.parse(vm.getInternalWorkFlowParameter("VNF Scale Out", "text", "Configuration Parameters").value)
- };
- requestInfoData.instanceName = vnf.name + "_" + (moduleToScale.currentCount + 1);
- }else{
- data = {
- vnfName: vnf.name,
- vnfInstanceId: vnf.id,
- modelInfo: {
- modelType: 'vnf',
- modelInvariantId: vnf.properties['model-invariant-id'],
- modelVersionId: vnf.modelVersionId,
- modelName: vnf.properties['vnf-name'],
- modelVersion: vnf.version,
- modelCustomizationName: vnf.properties['model-customization-name'],
- modelCustomizationId: vnf.properties['model-customization-id']
- },
- cloudConfiguration: vnf.cloudConfiguration,
- requestInfo: requestInfoData,
- relatedInstanceList: [],
- requestParameters:requestParametersData
- };
- }
+ }
+ }else if(workflowType=="VNF Config Update"){
+ requestParametersData = {
+ payload: vm.getInternalWorkFlowParameter("VNF Config Update", "FILE", "Attach configuration file").value
+ }
+ }
- var serviceInstanceId = '';
- _.forEach(vnf['service-instance-node'], function (instanceNode) {
- if(instanceNode['node-type'] === 'service-instance'){
- serviceInstanceId = instanceNode.properties['service-instance-id'];
- }
- });
-
- if (vnf.availableVersions && vnf.availableVersions.length!=0){
- _.forEach(vnf.availableVersions[0].relatedInstanceList, function (related) {
- var rel = related.relatedInstance;
- var relatedInstance = {
- instanceId: serviceInstanceId,
- modelInfo: {
- modelType: rel.modelInfo.modelType,
- modelInvariantId: rel.modelInfo.modelInvariantId,
- modelVersionId: rel.modelInfo.modelVersionId,
- modelName: rel.modelInfo.modelName,
- modelVersion: rel.modelInfo.modelVersion,
- modelCustomizationName: rel.modelInfo.modelCustomizationName,
- modelCustomizationId: rel.modelInfo.modelCustomizationId
- }
- };
- if (rel.vnfInstanceId)
- relatedInstance.instanceId = rel.vnfInstanceId;
-
- data.relatedInstanceList.push({relatedInstance: relatedInstance});
- });
+ var data;
if(workflowType=="VNF Scale Out") {
- //push vnf to related as well as the service instance
- var relatedInstance = {
- instanceId: vnf.id,
+ data = {
+ vnfName: vnf.name,
+ vnfInstanceId: vnf.id,
modelInfo: {
- modelCustomizationId: vnf.availableVersions[0].modelInfo.modelCustomizationId,
- modelCustomizationName: vnf.availableVersions[0].modelInfo.modelCustomizationName,
- modelInvariantId: vnf.availableVersions[0].modelInfo.modelInvariantId,
- modelName: vnf.availableVersions[0].modelInfo.modelName,
- modelType: vnf.availableVersions[0].modelInfo.modelType,
- modelVersion: vnf.availableVersions[0].modelInfo.modelVersion,
- modelVersionId: vnf.availableVersions[0].modelInfo.modelVersionId
- }
+ modelType: 'vfModule',
+ modelInvariantId: moduleToScale.invariantUuid,
+ modelName: moduleToScale.modelCustomizationName,
+ modelVersion: moduleToScale.version,
+ modelCustomizationName: moduleToScale.modelCustomizationName,
+ modelCustomizationId: moduleToScale.customizationUuid,
+ modelVersionId: moduleToScale.uuid
+ },
+ cloudConfiguration: vnf.cloudConfiguration,
+ requestInfo: requestInfoData,
+ relatedInstanceList: [],
+ requestParameters:requestParametersData,
+ configurationParameters: JSON.parse(vm.getInternalWorkFlowParameter("VNF Scale Out", "text", "Configuration Parameters").value)
+ };
+ requestInfoData.instanceName = vnf.name + "_" + (moduleToScale.currentCount + 1);
+ }else{
+ data = {
+ vnfName: vnf.name,
+ vnfInstanceId: vnf.id,
+ modelInfo: {
+ modelType: 'vnf',
+ modelInvariantId: vnf.properties['model-invariant-id'],
+ modelVersionId: vnf.modelVersionId,
+ modelName: vnf.properties['vnf-name'],
+ modelVersion: vnf.version,
+ modelCustomizationName: vnf.properties['model-customization-name'],
+ modelCustomizationId: vnf.properties['model-customization-id']
+ },
+ cloudConfiguration: vnf.cloudConfiguration,
+ requestInfo: requestInfoData,
+ relatedInstanceList: [],
+ requestParameters:requestParametersData
};
- data.relatedInstanceList.push({relatedInstance: relatedInstance});
}
+
+ var serviceInstanceId = '';
+ _.forEach(vnf['service-instance-node'], function (instanceNode) {
+ if(instanceNode['node-type'] === 'service-instance'){
+ serviceInstanceId = instanceNode.properties['service-instance-id'];
+ }
+ });
+
+ if (vnf.availableVersions && vnf.availableVersions.length!=0){
+ _.forEach(vnf.availableVersions[0].relatedInstanceList, function (related) {
+ var rel = related.relatedInstance;
+ var relatedInstance = {
+ instanceId: serviceInstanceId,
+ modelInfo: {
+ modelType: rel.modelInfo.modelType,
+ modelInvariantId: rel.modelInfo.modelInvariantId,
+ modelVersionId: rel.modelInfo.modelVersionId,
+ modelName: rel.modelInfo.modelName,
+ modelVersion: rel.modelInfo.modelVersion,
+ modelCustomizationName: rel.modelInfo.modelCustomizationName,
+ modelCustomizationId: rel.modelInfo.modelCustomizationId
+ }
+ };
+ if (rel.vnfInstanceId)
+ relatedInstance.instanceId = rel.vnfInstanceId;
+
+ data.relatedInstanceList.push({relatedInstance: relatedInstance});
+ });
+ if(workflowType=="VNF Scale Out") {
+ //push vnf to related as well as the service instance
+ var relatedInstance = {
+ instanceId: vnf.id,
+ modelInfo: {
+ modelCustomizationId: vnf.availableVersions[0].modelInfo.modelCustomizationId,
+ modelCustomizationName: vnf.availableVersions[0].modelInfo.modelCustomizationName,
+ modelInvariantId: vnf.availableVersions[0].modelInfo.modelInvariantId,
+ modelName: vnf.availableVersions[0].modelInfo.modelName,
+ modelType: vnf.availableVersions[0].modelInfo.modelType,
+ modelVersion: vnf.availableVersions[0].modelInfo.modelVersion,
+ modelVersionId: vnf.availableVersions[0].modelInfo.modelVersionId
+ }
+ };
+ data.relatedInstanceList.push({relatedInstance: relatedInstance});
+ }
+ }
+ }catch(err){
+ $log.error('SchedulerCtrl::extractChangeManagementCallbackDataStr error: ' + err);
+ vm.errorMsg = err;
}
- }catch(err){
- $log.error('SchedulerCtrl::extractChangeManagementCallbackDataStr error: ' + err);
- vm.errorMsg = err;
- }
- result.requestDetails.push(data);
- });
- return JSON.stringify(result);
- }
+ result.requestDetails.push(data);
+ });
+ return JSON.stringify(result);
+ }
- function getWorkflowParametersFromForm() {
+ function getWorkflowParametersFromForm() {
let workflowParameters =
{requestDetails:{
cloudConfiguration:{},
let parameters = vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow);
parameters.forEach((parameter)=>{
let inputField = document.getElementById('so-workflow-parameter-'+parameter.soFieldName);
- workflowParameters.requestDetails.requestParameters.userParams[0][parameter.soFieldName]=inputField.value;
- });
+ workflowParameters.requestDetails.requestParameters.userParams[0][parameter.soFieldName]=inputField.value;
+ });
return workflowParameters;
}
vm.openModal = function () {
if(vm.hasScheduler) { //scheduling supported
vm.scheduleWorkflow();
- } else {
+ } else {
//no scheduling support
vm.executeWorkflow();
}
};
- vm.scheduleWorkflow = function () {
+ vm.scheduleWorkflow = function () {
$scope.widgetParameter = ""; // needed by the scheduler?
// properties needed by the scheduler so it knows whether to show
const nodeType = vnfsData[i]['node-type'];
if (nodeType === "generic-vnf") {
if (_.find(vnfsData[i]['related-to'], function (node) {
- return node['node-type'] === 'vserver'
- }) !== undefined) {
+ return node['node-type'] === 'vserver'
+ }) !== undefined) {
vm.vnfs.push(vnfsData[i]);
}
} else if (nodeType === "service-instance") {
var versions = [];
_.forEach(vm.vnfs, function (vnf) {
if (vnf.properties['nf-role'] === vm.changeManagement['vnfType']
- && vnf.properties["model-invariant-id"]
- && vnf.properties["model-version-id"]) {
+ && vnf.properties["model-invariant-id"]
+ && vnf.properties["model-version-id"]) {
vm.serviceInstancesToGetVersions.push({
"model-invariant-id": vnf.properties["model-invariant-id"],
"model-version-id": vnf.properties["model-version-id"]
};
vm.loadWorkFlows = function () {
- vm.localWorkflowsParameters = new Map();
- vm.remoteWorkflowsParameters = new Map();
+ vm.localWorkflowsParameters = new Map();
+ vm.remoteWorkflowsParameters = new Map();
if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_HANDLE_SO_WORKFLOWS)) {
- return vm.loadRemoteWorkFlows()
- .then(function () {
- vm.workflows = vm.remoteWorkflows.map(item => item.name);
- }).then(function () {
- vm.loadRemoteWorkFlowsParameters();
- });
- }else{
- return vm.loadLocalWorkFlows()
- .then(vm.loadLocalWorkFlowsParameters)
- .then(function () {
- vm.workflows = vm.localWorkflows;
- })
- }
+ return vm.loadRemoteWorkFlows()
+ .then(function () {
+ vm.workflows = vm.remoteWorkflows.map(item => item.name);
+ }).then(function () {
+ vm.loadRemoteWorkFlowsParameters();
+ });
+ }else{
+ return vm.loadLocalWorkFlows()
+ .then(vm.loadLocalWorkFlowsParameters)
+ .then(function () {
+ vm.workflows = vm.localWorkflows;
+ })
+ }
};
vm.loadLocalWorkFlows = function () {
- return changeManagementService.getWorkflows(vm.changeManagement.vnfNames)
- .then(function (response) {
- vm.localWorkflows = response.data.workflows || [];
- }).catch(function (error) {
- $log.error(error);
- vm.errorMsg = error;
- });
+ return changeManagementService.getWorkflows(vm.changeManagement.vnfNames)
+ .then(function (response) {
+ vm.localWorkflows = response.data.workflows || [];
+ }).catch(function (error) {
+ $log.error(error);
+ vm.errorMsg = error;
+ });
};
vm.loadRemoteWorkFlows = function () {
- let vnfModelIDs = vm.changeManagement.vnfNames.map(vnfName => vnfName.modelVersionId);
- return changeManagementService.getSOWorkflows(vnfModelIDs)
- .then(function (response) {
- vm.remoteWorkflows = response.data || [];
- }).catch(function (error) {
- $log.error(error);
- vm.errorMsg = error;
- });
+ let vnfModelIDs = vm.changeManagement.vnfNames.map(vnfName => vnfName.modelVersionId);
+ return changeManagementService.getSOWorkflows(vnfModelIDs)
+ .then(function (response) {
+ vm.remoteWorkflows = response.data || [];
+ }).catch(function (error) {
+ $log.error(error);
+ vm.errorMsg = error;
+ });
};
vm.loadLocalWorkFlowsParameters = function () {
- vm.localWorkflows.forEach(function(workflow) {
- vm.loadLocalWorkFlowParameters(workflow);
- });
+ vm.localWorkflows.forEach(function(workflow) {
+ vm.loadLocalWorkFlowParameters(workflow);
+ });
};
vm.loadLocalWorkFlowParameters = function (workflow) {
- changeManagementService.getLocalWorkflowParameter(workflow)
- .then(function (response) {
- vm.localWorkflowsParameters.set(workflow, response.data.parameterDefinitions);
- })
- .catch(function (error) {
- $log.error(error);
- vm.errorMsg = error;
- });
+ changeManagementService.getLocalWorkflowParameter(workflow)
+ .then(function (response) {
+ vm.localWorkflowsParameters.set(workflow, response.data.parameterDefinitions);
+ })
+ .catch(function (error) {
+ $log.error(error);
+ vm.errorMsg = error;
+ });
};
vm.loadRemoteWorkFlowsParameters = function () {
- vm.remoteWorkflows.forEach(function(workflow) {
- if (workflow.source ==='SDC' || workflow.source === 'sdc' ){
- vm.loadRemoteWorkFlowParameters(workflow);
- } else {
- vm.loadLocalWorkFlowParameters(workflow.name);
- }
- });
+ vm.remoteWorkflows.forEach(function(workflow) {
+ if (workflow.source ==='SDC' || workflow.source === 'sdc' ){
+ vm.loadRemoteWorkFlowParameters(workflow);
+ } else {
+ vm.loadLocalWorkFlowParameters(workflow.name);
+ }
+ });
};
vm.loadRemoteWorkFlowParameters = function (workflow) {
return param.soPayloadLocation === "userParams"
})
.forEach(function (param) {
- let workflowParams = vm.repackAttributes(param);
- if (param.validation.length > 0) {
- let validation = param.validation[0];
- if ('maxLength' in validation) {
- workflowParams.maxLength = validation.maxLength;
- }
- if ('allowableChars' in validation) {
- workflowParams.pattern = validation.allowableChars;
+ let workflowParams = vm.repackAttributes(param);
+ if (param.validation.length > 0) {
+ let validation = param.validation[0];
+ if ('maxLength' in validation) {
+ workflowParams.maxLength = validation.maxLength;
+ }
+ if ('allowableChars' in validation) {
+ workflowParams.pattern = validation.allowableChars;
+ }
}
- }
- workflowParams.type = param.inputType;
+ workflowParams.type = param.inputType;
- parameters.push(workflowParams);
- }
- );
+ parameters.push(workflowParams);
+ }
+ );
vm.remoteWorkflowsParameters.set(workflow.name, parameters);
};
};
vm.getRemoteWorkFlowParameters = function (workflow) {
- if (workflow && vm.remoteWorkflowsParameters.has(workflow)) {
- return vm.remoteWorkflowsParameters.get(workflow)
- }
- return [];
+ if (workflow && vm.remoteWorkflowsParameters.has(workflow)) {
+ return vm.remoteWorkflowsParameters.get(workflow)
+ }
+ return [];
};
+ vm.hasPatternError = function(form, itemName){
+ return form[itemName].$error.pattern;
+ }
+
+ vm.hasAsyncFnError = function(form, itemName){
+ return form[itemName].$error.validateAsyncFn;
+ }
+
+ vm.getIdFor = function(type, id, name){
+ return "internal-workflow-parameter-" + type + "-" + id + "-" + (name ? name.split(' ').join('-').toLowerCase() : "");
+ }
+
vm.getInternalWorkFlowParameters = function (workflow, type) {
if (workflow && vm.localWorkflowsParameters.has(workflow) && vm.localWorkflowsParameters.get(workflow).filter(parameter => parameter.type==type) != []) {
- return vm.localWorkflowsParameters.get(workflow).filter(parameter => parameter.type==type)
- }
- return [];
+ return vm.localWorkflowsParameters.get(workflow).filter(parameter => parameter.type==type);
+ }
+ return [];
};
vm.getInternalWorkFlowParameter = function (workflow, type, parameterName) {
if (workflow && vm.localWorkflowsParameters.has(workflow) && vm.localWorkflowsParameters.get(workflow).filter(parameter => parameter.type==type) != []) {
return vm.localWorkflowsParameters.get(workflow).filter(parameter => parameter.type==type).filter(parameter => parameter.name === parameterName)[0]
- }
+ }
};
vm.getRemoteWorkflowSource = (workflow) => {
init();
}
-})();
+})();
\ No newline at end of file
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.
<div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getInternalWorkFlowParameters(vm.changeManagement.workflow, 'FILE')">
<label class="control-label">{{item.name}}</label>
<div class="file-wrapper">
- <input id="internal-workflow-parameter-file-{{item.id}}" class="file-input" type="file" ngf-select ng-model="item.value" ngf-validate-async-fn="vm.uploadConfigFile($file)" name="configUpdateFile" accept="{{item.acceptableFileType}}" ngf-pattern="{{item.acceptableFileType}}" ng-required="{{item.required}}"/>
- <label id="internal-workflow-parameter-file-{{item.id}}-label" class="file-input-label">{{item.value&&item.value.name||"Select File"}} </label>
- <label for="internal-workflow-parameter-file-{{item.id}}"><span class="icon-browse"></span></label>
+ <input id="{{vm.getIdFor('file',item.id,item.name)}}" ng-change="vm.onChange(item)" class="file-input" type="file" ngf-select ng-model="item.value" ngf-validate-async-fn="vm.uploadConfigFile($file)" ng-attr-name="{{'internal-workflow-parameter-file-name-' + item.id}}" accept="{{item.acceptableFileType}}" ngf-pattern="{{item.acceptableFileType}}" ng-required="{{item.required}}"/>
+ <label id="{{vm.getIdFor('file',item.id,item.name)}}-label" class="file-input-label">{{item.value&&item.value.name||"Select File"}} </label>
+ <label ng-attr-for="{{vm.getIdFor('file',item.id,item.name)}}"><span class="icon-browse"></span></label>
</div>
- <label id="errorLabel" class="icon-alert error" ng-if="item.value.$error.pattern">{{item.msgOnPatternError}}</label>
- <label id="errorContentLabel" class="icon-alert error" ng-if="item.value.$error.validateAsyncFn">{{item.msgOnContentError}}</label>
+ <label id="errorLabel" class="icon-alert error" ng-if="vm.hasPatternError(newChangeManagement, 'internal-workflow-parameter-file-name-' + item.id)">{{item.msgOnPatternError}}</label>
+ <label id="errorContentLabel" class="icon-alert error" ng-if="vm.hasAsyncFnError(newChangeManagement, 'internal-workflow-parameter-file-name-' + item.id)">{{item.msgOnContentError}}</label>
</div>
<div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getInternalWorkFlowParameters(vm.changeManagement.workflow, 'text')">
- <label for="internal-workflow-parameter-text-{{item.id}}" class="control-label">{{item.name}}</label>
- <input ng-model="item.value" type="text" id="internal-workflow-parameter-text-{{item.id}}" pattern="{{item.pattern}}" ng-required="{{item.required}}">
+ <label ng-attr-for="{{vm.getIdFor('text',item.id,item.name)}}" class="control-label">{{item.name}}</label>
+ <input ng-model="item.value" type="text" id="{{vm.getIdFor('text',item.id,item.name)}}" pattern="{{item.pattern}}" ng-required="{{item.required}}">
</div>
<div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow)">
- <label for="so-workflow-parameter-{{item.id}}" class="control-label">{{item.name}}</label>
- <input ng-model="item.value" type="text" id="so-workflow-parameter-{{item.id}}" pattern="{{item.pattern}}" maxlength="{{item.maxLength}}" ng-required="{{item.required}}" soFieldName="{{item.soFieldName}}">
+ <label for="so-workflow-parameter-{{item.id}}" class="control-label">{{item.name}}</label>
+ <input ng-model="item.value" type="text" id="so-workflow-parameter-{{item.id}}" pattern="{{item.pattern}}" maxlength="{{item.maxLength}}" ng-required="{{item.required}}" soFieldName="{{item.soFieldName}}">
</div>
</div>
</div>
</div>
</div>
-
</div>
<div class="modal-footer">
</div>
<div class="pull-right">
<button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
- <button ng-if="!vm.isScaleOut() || (vm.isScaleOut() && vm.wizardStep === 2)" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">{{vm.hasScheduler ? "Schedule" : "Confirm"}}</button>
- <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>
+ <button ng-if="!vm.isScaleOut() || (vm.isScaleOut() && vm.wizardStep === 2) || vm.hasScheduler" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">{{vm.hasScheduler ? "Schedule" : "Confirm"}}</button>
+ <button ng-if="(vm.isScaleOut() && vm.wizardStep === 1) && !vm.hasScheduler" ng-click="vm.nextStep();" type="button" id="next" name="next" class="btn btn-primary" data-ng-disabled="newChangeManagement.$invalid">Next</button>
<button ng-if="isShowErrorReport() && vm.errorMsg!==''" ng-click="showReportWindow()" type="button" class="btn btn-danger" >Create report</button>
</div>
</div>
-</form>
+</form>
\ No newline at end of file
<li ng-repeat="pnf in pnfs" ui-tree-node>\r
<div ui-tree-handle class="tree-node tree-node-content">\r
PNF: {{pnf}}\r
-\r
- <a class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag\r
+ <a ng-if="isMacro()===false" class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag\r
ng-click="dissociatePnf(pnf)" style="margin-right: 8px;">\r
<span>Dissociate</span>\r
</a>\r
MsoResponseWrapper2 responseWrapped = new MsoResponseWrapper2<>(expectedResponse);
- given(msoInterface.post(eq(path), any(org.onap.vid.changeManagement.RequestDetailsWrapper.class), eq(RequestReferencesContainer.class))).willReturn(expectedResponse);
+ given(msoInterface.post(eq(path), any(RequestDetails.class), eq(RequestReferencesContainer.class))).willReturn(expectedResponse);
// when
MsoResponseWrapper2 response = msoBusinessLogic.deactivateAndCloudDelete(serviceInstanceId, vnfInstanceId, vfModuleInstanceId, requestDetails);
MsoResponseWrapper2 responseWrapped = new MsoResponseWrapper2<>(expectedResponse);
- given(msoInterface.post(eq(path), any(org.onap.vid.changeManagement.RequestDetailsWrapper.class), eq(RequestReferencesContainer.class))).willReturn(expectedResponse);
+ given(msoInterface.post(eq(path), any(RequestDetails.class), eq(RequestReferencesContainer.class))).willReturn(expectedResponse);
// when
MsoResponseWrapper2 response = msoBusinessLogic.activateFabricConfiguration(serviceInstanceId, requestDetails);
void testInPlaceSoftwareUpdateRequest() throws Exception {
- doReturn(new HttpResponse<>(any(), RequestReferencesContainer.class, any())).when(restClientUnderTest).post(anyString(), any(), any());
+ doReturn(new HttpResponse<>(any(), RequestReferencesContainer.class, any())).when(restClientUnderTest).post(anyString(), any(RequestDetailsWrapper.class), any());
URL requestJsonUrl = this.getClass().getResource("/services/change_management_software_update_request.json");
ChangeManagementRequest changeManagementRequest = objectMapper.readValue(requestJsonUrl, ChangeManagementRequest.class);
--- /dev/null
+package org.onap.simulator.presetGenerator.presets.scheduler;
+
+import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset;
+import org.springframework.http.HttpMethod;
+
+public class PresetDeleteSchedulerChangeManagement extends BasePreset {
+
+ @Override
+ public HttpMethod getReqMethod() {
+ return HttpMethod.DELETE;
+ }
+
+ @Override
+ public String getReqPath() {
+ return getRootPath() + "/83aec7bf-602f-49eb-9788-bbc33ac550d9";
+ }
+
+ @Override
+ protected String getRootPath() {
+ return "/scheduler/v1/ChangeManagement/schedules";
+ }
+
+ @Override
+ public int getResponseCode() { return 204; }
+
+}
public static final String newModalFromVNFVersionInputId = "fromVNFVersion";
public static final String newModalVNFNameInputId = "vnfName";
public static final String newModalWorkFlowInputId = "workflow";
- public static final String newModalConfigUpdateInputId = "config-update-input";
+ public static final String newModalConfigUpdateInputId = "internal-workflow-parameter-file-5-attach-configuration-file";
public static final String newModalTargetVersionInputsClass = "vnf-versions-select-as-text";
public static final String newModalSubscriberText = "CRAIG/ROBERTS";
public static final String newModalServiceTypeText = "vRichardson";
FLAG_1908_RESUME_MACRO_SERVICE,
FLAG_1908_RELEASE_TENANT_ISOLATION,
FLAG_1908_VNF_FC_NEW_INSTANTIATION_UI,
+ FLAG_HANDLE_SO_WORKFLOWS
;
public boolean isActive() {
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
import org.onap.sdc.ci.tests.datatypes.UserCredentials;
import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.onap.simulator.presetGenerator.presets.scheduler.PresetDeleteSchedulerChangeManagement;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebElement;
private void openAndFill1stScreen(String vnfName, String vnfTargetVersion, String workflow) {
String subscriberId = VNF_DATA_WITH_IN_PLACE.subscriberId;
+ String subscriberName = VNF_DATA_WITH_IN_PLACE.subscriberName;
String serviceType = VNF_DATA_WITH_IN_PLACE.serviceType;
String vnfType = VNF_DATA_WITH_IN_PLACE.vnfType;
String vnfSourceVersion = VNF_DATA_WITH_IN_PLACE.vnfSourceVersion;
ChangeManagementPage.openNewChangeManagementModal();
Wait.angularHttpRequestsLoaded();
+ SelectOption.waitForOptionInSelect(subscriberName, "subscriberName");
ChangeManagementPage.selectSubscriberById(subscriberId);
Wait.angularHttpRequestsLoaded();
SelectOption.byIdAndVisibleText(Constants.ChangeManagement.newModalServiceTypeInputId, serviceType);
static final int vnfZrdm3amdns02test2Id = 11822;
static final int vnfHarrisonKrisId = 12822;
static String subscriberId = "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb";
+ static String subscriberName = "Emanuel";
static String serviceType = "vRichardson";
static String vnfType = "vMobileDNS";
static String vnfSourceVersion = "1.0";
, "changeManagement/service-design-and-creation.json"
, "changeManagement/mso_get_manual_task.json"
, "changeManagement/mso_post_manual_task.json"
+ , "changeManagement/mso_get_change_managements_scaleout.json"
);
SimulatorApi.registerExpectationFromPreset(new PresetAAIGetSubscribersGet(),SimulatorApi.RegistrationStrategy.APPEND);
@Test
public void clickOnScheduledJob_SuccessfulMessageAppear() {
+
+ SimulatorApi.registerExpectationFromPreset(new PresetDeleteSchedulerChangeManagement(),SimulatorApi.RegistrationStrategy.APPEND);
+
ChangeManagementPage.openChangeManagementPage();
-// Wait.angularHttpRequestsLoaded();
GeneralUIUtils.ultimateWait();
clickAndAssertOnCancelButton(SCHEDULED_ID);
updateSimulatorWithParametersOfScheduledJod("get_scheduler_details_short_with_after_cancel" +
boolean isNotDisplayed = GeneralUIUtils.waitForElementInVisibilityByTestId("icon-status-" + scheduledId, 5);
Assert.assertTrue(isNotDisplayed);
}
+
public void updateSimulatorWithParametersOfScheduledJod(String jasonFile){
SimulatorApi.registerExpectation(
new String[] {"changeManagement/"+jasonFile},
);
}
+ @FeatureTogglingTest(value = Features.FLAG_HANDLE_SO_WORKFLOWS, flagActive = false)
@Test
public void testWorkflowVNFInPlaceSoftwareUpdateNotInWorkflowsListWhenNotExpected() {
+
List<String> workflows = getListOfWorkflowsFor("Harrison Kris");
assertThat(workflows, not(hasItem(VNF_DATA_WITH_IN_PLACE.workflowName)));
}
+ @FeatureTogglingTest(value = Features.FLAG_HANDLE_SO_WORKFLOWS, flagActive = false)
@Test
public void testWorkflowVNFInPlaceSoftwareUpdateInWorkflowsListWhenExpected() {
List<String> workflows = getListOfWorkflowsFor(VNF_DATA_WITH_IN_PLACE.vnfName);
@Test
public void testWorkflowVNFInPlaceSoftwareUpdateShows3Fields() {
+
openAndFill1stScreenWithWorkflowVNFInPlaceSoftwareUpdate();
List<String> idsWithoutMatchingElement =
Stream.of(
- "operations-timeout",
- "existing-software-version",
- "new-software-version")
+ "internal-workflow-parameter-text-2-operations-timeout",
+ "internal-workflow-parameter-text-3-existing-software-version",
+ "internal-workflow-parameter-text-4-new-software-version")
.filter(id -> Get.byId(id) == null)
.collect(Collectors.toList());
assertThat("all three special VNFInPlace fields should appear", idsWithoutMatchingElement, is(empty()));
}
private void fillVNFInPlace3Fields(String operationsTimeout, String existingSwVersion, String newSwVersion) {
- Get.byId("operations-timeout").clear();
- Get.byId("existing-software-version").clear();
- Get.byId("new-software-version").clear();
+ Get.byId("internal-workflow-parameter-text-2-operations-timeout").clear();
+ Get.byId("internal-workflow-parameter-text-3-existing-software-version").clear();
+ Get.byId("internal-workflow-parameter-text-4-new-software-version").clear();
- Get.byId("operations-timeout").sendKeys(operationsTimeout);
- Get.byId("existing-software-version").sendKeys(existingSwVersion);
- Get.byId("new-software-version").sendKeys(newSwVersion);
+ Get.byId("internal-workflow-parameter-text-2-operations-timeout").sendKeys(operationsTimeout);
+ Get.byId("internal-workflow-parameter-text-3-existing-software-version").sendKeys(existingSwVersion);
+ Get.byId("internal-workflow-parameter-text-4-new-software-version").sendKeys(newSwVersion);
}
private List<String> getListOfWorkflowsFor(String vnfName) {
ChangeManagementPage.openChangeManagementPage();
Click.byId(Constants.ChangeManagement.dashboardFinishedTabId);
Assert.assertThat(Get.byClassAndText("vnf-name","Unlocked instance"),is(notNullValue()));
-
}
-
-
-
-
@Test
public void testMainDashboardTableContent () {
ChangeManagementPage.openChangeManagementPage();
//TODO: After scheduler will be ready than we will examine if the content is valid.
}
-
@Test
public void testOnlyOneModalIsOpen() throws Exception {
--- /dev/null
+{
+ "simulatorRequest": {
+ "method": "GET",
+ "path": "/mso/orchestrationRequests/v.",
+ "queryParams": {
+ "filter": "action:EQUALS:scaleOut"
+ }
+ },
+ "simulatorResponse": {
+ "responseCode": 200,
+ "body": {
+ "requestList": [
+ {
+ "request": {
+ "requestId":"2a22aff4-620f-44b6-92a1-8a41be396d96\n\n",
+ "requestScope":"vfModule",
+ "requestStatus":{
+ "percentProgress":100.0,
+ "requestState":"IN_PROGRESS",
+ "statusMessage":"Scale-Out Is In Progress",
+ "finishTime":"Fri, 08 Sep 2017 19:34:33 GMT"
+ },
+ "requestType":"scaleOut",
+ "startTime":"Fri, 08 Sep 2017 19:34:32 GMT",
+ "instanceReferences":{
+ "serviceInstanceId":"6dd0f8de-93c7-48a2-914b-1a8d58e0eb48",
+ "vnfInstanceId":"7c00cc1e-6425-4fc3-afc3-0289db288d4c",
+ "requestorId":"ds828e"
+ }
+ }
+ },
+ {
+ "request": {
+ "requestId": "2d6502bf-c488-4903-817e-2ed2c644dcf4",
+ "requestScope": "vfModule",
+ "requestStatus": {
+ "percentProgress": 100.0,
+ "requestState": "COMPLETE",
+ "statusMessage": "Completed successfully",
+ "finishTime": "Thu, 09 Nov 2017 10:58:14 GMT"
+ },
+ "requestType": "scaleOut",
+ "startTime": "Thu, 09 Nov 2017 10:58:14 GMT",
+ "instanceReferences": {
+ "serviceInstanceId": "54ba3628-9ee5-4b32-8a2a-3abf001bed4e",
+ "vnfInstanceId": "b8d99523-1e83-4fd1-b42f-849361ef7024",
+ "requestorId": "az2016"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file