diff options
Diffstat (limited to 'vid-app-common/src/main')
24 files changed, 328 insertions, 120 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java index 8e47bbae5..c43779df1 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java @@ -440,6 +440,8 @@ public class AaiClient implements AaiClientInterface { } protected Stream<ModelVer> toModelVerStream(ModelVersions modelVersions) { + if (modelVersions == null) + return null; if (modelVersions == null) return null; @@ -454,7 +456,6 @@ public class AaiClient implements AaiClientInterface { } protected ModelVer maxModelVer(Stream<ModelVer> modelVerStream) { - if (modelVerStream == null) return null; diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java index 01b005c4b..6bd98fff6 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java @@ -20,10 +20,13 @@ package org.onap.vid.controller; +import static org.onap.vid.utils.KotlinUtilsKt.JACKSON_OBJECT_MAPPER; + +import java.util.List; +import java.util.UUID; +import javax.servlet.http.HttpServletRequest; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.vid.exceptions.AccessDeniedException; -import org.onap.vid.exceptions.OperationNotAllowedException; -import org.onap.vid.model.ExceptionResponse; import org.onap.vid.model.JobAuditStatus; import org.onap.vid.model.ServiceInfo; import org.onap.vid.model.serviceInstantiation.ServiceInstantiation; @@ -34,16 +37,14 @@ import org.onap.vid.services.AsyncInstantiationBusinessLogic; import org.onap.vid.services.AuditService; import org.onap.vid.utils.SystemPropertiesWrapper; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.togglz.core.manager.FeatureManager; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.UUID; - -import static org.onap.vid.utils.KotlinUtilsKt.JACKSON_OBJECT_MAPPER; -import static org.springframework.http.HttpStatus.METHOD_NOT_ALLOWED; - @RestController @RequestMapping(AsyncInstantiationController.ASYNC_INSTANTIATION) @@ -69,12 +70,6 @@ public class AsyncInstantiationController extends VidRestrictedBaseController { this.systemPropertiesWrapper = systemPropertiesWrapper; } - @ExceptionHandler(OperationNotAllowedException.class) - @ResponseStatus(value=METHOD_NOT_ALLOWED) - public ExceptionResponse illegalStateExceptionHandler(Exception e) { - return ControllersUtils.handleException(e, LOGGER); - } - /** * Gets the new services status. * @param request the request diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/CommandUtils.java b/vid-app-common/src/main/java/org/onap/vid/job/command/CommandUtils.java index 0fe7255c4..2b6b57ade 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/CommandUtils.java +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/CommandUtils.java @@ -21,8 +21,10 @@ package org.onap.vid.job.command; import org.apache.commons.lang3.StringUtils; +import org.onap.vid.aai.model.ModelVer; import org.onap.vid.asdc.AsdcCatalogException; import org.onap.vid.model.ServiceModel; +import org.onap.vid.services.AaiService; import org.onap.vid.services.VidService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,18 +33,16 @@ import org.springframework.stereotype.Component; public class CommandUtils { private final VidService vidService; + private final AaiService aaiService; @Autowired - public CommandUtils(VidService vidService) { + public CommandUtils(VidService vidService, AaiService aaiService) { this.vidService = vidService; + this.aaiService = aaiService; } public boolean isVfModuleBaseModule(String serviceModelUuid, String vfModuleModelUUID) throws AsdcCatalogException{ - ServiceModel serviceModel = vidService.getService(serviceModelUuid); - - if (serviceModel==null) { - throw new AsdcCatalogException("Failed to retrieve model with uuid "+serviceModelUuid +" from SDC"); - } + ServiceModel serviceModel = getServiceModel(serviceModelUuid); if (serviceModel.getVfModules() == null) { throw createAsdcCatalogVfModuleModelUUIDNotFoundException(serviceModelUuid, vfModuleModelUUID); @@ -58,6 +58,23 @@ public class CommandUtils { .getBaseModule(); } + public ServiceModel getServiceModel(String serviceModelUuid) throws AsdcCatalogException{ + ServiceModel serviceModel = vidService.getService(serviceModelUuid); + + if (serviceModel==null) { + throw new AsdcCatalogException("Failed to retrieve model with uuid "+serviceModelUuid +" from SDC"); + } + + return serviceModel; + } + + public String getNewestModelUuid(String serviceModelInvariantId) + { + ModelVer serviceModelLatestVersion = aaiService.getNewestModelVersionByInvariantId(serviceModelInvariantId); + + return serviceModelLatestVersion.getModelVersionId(); + } + private AsdcCatalogException createAsdcCatalogVfModuleModelUUIDNotFoundException(String serviceModelUuid, String vfModuleModelUUID) { return new AsdcCatalogException("Failed to find vfModuleModelUUID: " + vfModuleModelUUID + "in model with uuid: " + serviceModelUuid); diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt index 0e9ab7b7a..2c50e03cd 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt @@ -222,11 +222,16 @@ abstract class ResourceCommand( else -> InternalState.IN_PROGRESS } + InternalState.REPLACE_MYSELF -> when (jobStatus) { + JobStatus.IN_PROGRESS -> InternalState.REPLACE_MYSELF + else -> InternalState.IN_PROGRESS + } + InternalState.IN_PROGRESS -> { when { jobStatus != JobStatus.COMPLETED -> InternalState.IN_PROGRESS isDescendantHasAction(Action.Create) -> InternalState.CREATING_CHILDREN - isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN + isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN else -> InternalState.TERMINAL } } @@ -284,7 +289,7 @@ abstract class ResourceCommand( isNeedToResumeMySelf() -> InternalState.RESUME_MYSELF isNeedToReplaceMySelf() -> InternalState.REPLACE_MYSELF isDescendantHasAction(phase) -> InternalState.CREATING_CHILDREN - isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN + isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN else -> InternalState.TERMINAL } else -> throw IllegalStateException("state $internalState is not supported yet") diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt index af52fa049..276b00e6f 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt @@ -5,9 +5,10 @@ import org.onap.vid.job.Job import org.onap.vid.job.JobAdapter import org.onap.vid.job.JobCommand import org.onap.vid.job.JobsBrokerService -import org.onap.vid.model.Action +import org.onap.vid.model.* import org.onap.vid.model.serviceInstantiation.VfModule import org.onap.vid.mso.RestMsoImplementation +import org.onap.vid.mso.model.ModelInfo import org.onap.vid.services.AsyncInstantiationBusinessLogic import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -16,6 +17,8 @@ import org.springframework.http.HttpMethod import org.springframework.stereotype.Component import java.util.* +typealias ToscaVfm = org.onap.vid.model.VfModule + @Component @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) class VfmoduleCommand @Autowired constructor( @@ -45,7 +48,7 @@ class VfmoduleCommand @Autowired constructor( val vnfInstanceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.VNF_INSTANCE_ID) val vgInstaceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.VG_INSTANCE_ID) - val instantiatePath = asyncInstantiationBL.getVfmoduleInstantiationPath(serviceInstanceId, vnfInstanceId) + val instantiatePath = asyncInstantiationBL.getVfmoduleInstantiationPath(serviceInstanceId, vnfInstanceId) val requestDetailsWrapper = msoRequestBuilder.generateVfModuleInstantiationRequest( request as VfModule, @@ -75,14 +78,16 @@ class VfmoduleCommand @Autowired constructor( return false } - private fun planReplaceMyselfRestCall(commandParentData: CommandParentData, request: JobAdapter.AsyncJobRequest, userId: String, testApi: String?): MsoRestCallPlan { + private fun planReplaceMyselfRestCall3(commandParentData: CommandParentData, request: JobAdapter.AsyncJobRequest, userId: String, testApi: String?): MsoRestCallPlan { val serviceInstanceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.SERVICE_INSTANCE_ID) val serviceModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.SERVICE_MODEL_INFO) val vnfModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.VNF_MODEL_INFO) val vnfInstanceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.VNF_INSTANCE_ID) val replacePath = asyncInstantiationBL.getVfModuleReplacePath(serviceInstanceId, vnfInstanceId, getRequest().instanceId) - val requestDetailsWrapper = msoRequestBuilder.generateVfModuleInstantiationRequest( + amendModelInfoWithNewestModel(serviceModelInfo, vnfModelInfo, (request as VfModule).modelInfo) + + val requestDetailsWrapper = msoRequestBuilder.generateVfModuleInstantiationRequest( request as VfModule, serviceModelInfo, serviceInstanceId,vnfModelInfo, vnfInstanceId,null,userId, testApi) val actionDescription = "replace vfmodule ${request.instanceId}" @@ -90,9 +95,142 @@ class VfmoduleCommand @Autowired constructor( return MsoRestCallPlan(HttpMethod.POST, replacePath, Optional.of(requestDetailsWrapper), Optional.of(userId), actionDescription) } + private fun planReplaceMyselfRestCall(commandParentData: CommandParentData): MsoRestCallPlan { + + val newestModel = fetchNewestServiceModel() + + val serviceInstanceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.SERVICE_INSTANCE_ID) + val vnfInstanceId = commandParentData.getInstanceId(CommandParentData.CommandDataKey.VNF_INSTANCE_ID) + + val (serviceModelInfo, vnfModelInfo, vfmModelInfo) = newestSelector(newestModel, commandParentData); + + val originalRequestWithNewestVfmModelInfo = getRequest().cloneWith(vfmModelInfo) + + val requestDetailsWrapper = msoRequestBuilder.generateVfModuleInstantiationRequest( + originalRequestWithNewestVfmModelInfo, serviceModelInfo, serviceInstanceId, + vnfModelInfo, vnfInstanceId, null, sharedData.userId, sharedData.testApi) + + + val replacePath = asyncInstantiationBL.getVfModuleReplacePath(serviceInstanceId, vnfInstanceId, getRequest().instanceId) + + return MsoRestCallPlan(HttpMethod.POST, replacePath, Optional.of(requestDetailsWrapper), Optional.of(sharedData.userId), + "replace vfmodule ${getRequest().instanceId}") + } + + data class ModelsInfoTriplet(val serviceModelInfo: ModelInfo, val vnfModelInfo: ModelInfo, val vfmModelInfo: ModelInfo) + + private fun newestSelector(newestModel: ServiceModel, commandParentData: CommandParentData): ModelsInfoTriplet { + val serviceModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.SERVICE_MODEL_INFO) + val vfmModelInfo = getRequest().modelInfo + val vnfModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.VNF_MODEL_INFO) + + val newestServiceModelInfo = newestServiceModelInfo(newestModel) + val newestVfmModelInfo = newestVfmModelInfo(newestModel) + val newestVnfModelInfo = newestVnfModelInfo(newestModel, commandParentData) + + return if (newestServiceModelInfo == null || newestVfmModelInfo == null || newestVnfModelInfo == null) { + ModelsInfoTriplet(serviceModelInfo, vnfModelInfo, vfmModelInfo) + } else { + ModelsInfoTriplet(newestServiceModelInfo, newestVnfModelInfo, newestVfmModelInfo) + } + } + + private fun newestServiceModelInfo(newestModel: ServiceModel) = toModelInfo(newestModel.service) + + private fun newestVfmModelInfo(newestModel: ServiceModel): ModelInfo? { + val vfmModelInfo = getRequest().modelInfo + val newestVfm = selectVfm(newestModel, vfmModelInfo) + return toModelInfo(newestVfm) + } + + private fun newestVnfModelInfo(newestModel: ServiceModel, commandParentData: CommandParentData): ModelInfo? { + val vnfModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.VNF_MODEL_INFO) + val newestVnf = selectVnf(newestModel, vnfModelInfo) + return toModelInfo(newestVnf) + } + + private fun selectVfm(newestModel: ServiceModel, modelInfo: ModelInfo) = newestModel.vfModules[modelInfo.modelCustomizationId] + + private fun selectVnf(newestModel: ServiceModel, modelInfo: ModelInfo) = newestModel.vnfs[modelInfo.modelCustomizationId] + + private fun toModelInfo(toBeConverted: VNF?): ModelInfo? = toBeConverted?.let { toModelInfo(it, "vnf") } + + private fun toModelInfo(toBeConverted: ToscaVfm?): ModelInfo? = toBeConverted?.let { toModelInfo(it, "vfModule") } + + private fun toModelInfo(toBeConverted: MinimalNode, modelType: String): ModelInfo { + val targetModelInfo = ModelInfo() + + targetModelInfo.modelType = modelType + targetModelInfo.modelName = toBeConverted.name + targetModelInfo.modelNameVersionId = null + targetModelInfo.modelVersion = toBeConverted.version + targetModelInfo.modelVersionId = toBeConverted.uuid + targetModelInfo.modelInvariantId = toBeConverted.invariantUuid + + targetModelInfo.modelCustomizationId = when (toBeConverted) { + is VNF -> toBeConverted.customizationUuid + is ToscaVfm -> toBeConverted.customizationUuid + else -> throw IllegalArgumentException() + } + + targetModelInfo.modelCustomizationName = when (toBeConverted) { + is VNF -> toBeConverted.modelCustomizationName + is ToscaVfm -> toBeConverted.modelCustomizationName + else -> throw IllegalArgumentException() + } + + return targetModelInfo + } + + private fun toModelInfo(toBeConverted: Service?): ModelInfo? { + + if (toBeConverted == null) + return null + + val targetModelInfo = ModelInfo() + + targetModelInfo.modelVersionId = toBeConverted.uuid + targetModelInfo.modelInvariantId = toBeConverted.invariantUuid + targetModelInfo.modelVersion = toBeConverted.version + //targetModelInfo.modelCustomizationId = toBeConverted.customizationUuid + //targetModelInfo.modelCustomizationName = toBeConverted.modelCustomizationName + targetModelInfo.modelType = "service" + targetModelInfo.modelName = toBeConverted.name + + return targetModelInfo + } + + private fun amendModelInfoWithNewestModel(serviceModelInfo: ModelInfo, vnfModelInfo: ModelInfo, vfmModelInfo: ModelInfo) { + val newestModel = fetchNewestServiceModel() + val newestService = newestModel.service + + val newestVfm = newestModel.vfModules[vfmModelInfo.modelCustomizationId] + val newestVnf = newestModel.vnfs[vnfModelInfo.modelCustomizationId] + + if (!(newestService == null || newestVnf == null || newestVfm == null)) { + + serviceModelInfo.modelName = newestService.name + serviceModelInfo.modelVersionId = newestService.uuid + serviceModelInfo.modelVersion = newestService.version + + vnfModelInfo.modelName = newestVnf.name + vnfModelInfo.modelVersionId = newestVnf.uuid + vnfModelInfo.modelVersion = newestVnf.version + vnfModelInfo.modelCustomizationId = newestVnf.customizationUuid + vnfModelInfo.modelCustomizationName = newestVnf.modelCustomizationName + + vfmModelInfo.modelName = newestVfm.name + vfmModelInfo.modelVersionId = newestVfm.uuid + vfmModelInfo.modelVersion = newestVfm.version + vfmModelInfo.modelCustomizationId = newestVfm.customizationUuid + vfmModelInfo.modelCustomizationName = newestVfm.modelCustomizationName + } + } + + override fun replaceMyself(): Job.JobStatus { try { - val replaceMyselfCommand = planReplaceMyselfRestCall(commandParentData, sharedData.request, sharedData.userId, sharedData.testApi ) + val replaceMyselfCommand = planReplaceMyselfRestCall(commandParentData) return executeAndHandleMsoInstanceRequest(replaceMyselfCommand) } catch (exception: Exception) { LOGGER.error("Failed to replace instanceId ${getRequest().instanceId} ", exception) @@ -101,6 +239,14 @@ class VfmoduleCommand @Autowired constructor( } override fun isNeedToReplaceMySelf(): Boolean { - return getActionType() == Action.Replace + return getActionType() == Action.Upgrade + } + + private fun fetchNewestServiceModel(): ServiceModel { + val serviceModelInfo = commandParentData.getModelInfo(CommandParentData.CommandDataKey.SERVICE_MODEL_INFO) + var modelNewestUuid = commandUtils.getNewestModelUuid(serviceModelInfo.modelInvariantId); + var serviceNewestModel = commandUtils.getServiceModel(modelNewestUuid); + + return serviceNewestModel; } } diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Action.java b/vid-app-common/src/main/java/org/onap/vid/model/Action.java index c0d4fae6a..930f97073 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/Action.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/Action.java @@ -25,7 +25,7 @@ public enum Action { Delete(ServiceInfo.ServiceAction.DELETE), None(ServiceInfo.ServiceAction.UPDATE), Resume(ServiceInfo.ServiceAction.RESUME), - Replace(ServiceInfo.ServiceAction.REPLACE); + Upgrade(ServiceInfo.ServiceAction.UPGRADE); private final ServiceInfo.ServiceAction serviceAction; Action(ServiceInfo.ServiceAction serviceAction){ diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java index 70f7b5aa2..219b4893c 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java @@ -55,6 +55,7 @@ public class CategoryParameterOption extends DomainVo { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "CATEGORY_OPT_DB_ID") + @Override public Long getId() { return id; } diff --git a/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java b/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java index 645934530..012db5a31 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java @@ -24,6 +24,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.TimeZone; import java.util.UUID; import javax.persistence.Column; @@ -100,7 +101,7 @@ public class JobAuditStatus extends VidBaseEntity { return null; } - DateFormat format = new SimpleDateFormat(defaultFormat); + DateFormat format = new SimpleDateFormat(defaultFormat, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); Date date = null ; try { diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java index 1e1e6c2a7..85c83eb98 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java @@ -22,18 +22,25 @@ package org.onap.vid.model; import com.fasterxml.jackson.annotation.JsonProperty; -import org.hibernate.annotations.DynamicUpdate; -import org.hibernate.annotations.SelectBeforeUpdate; -import org.hibernate.annotations.Type; -import org.onap.portalsdk.core.domain.support.DomainVo; -import org.onap.vid.job.Job; - -import javax.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.Objects; import java.util.Set; import java.util.UUID; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; +import org.hibernate.annotations.DynamicUpdate; +import org.hibernate.annotations.SelectBeforeUpdate; +import org.hibernate.annotations.Type; +import org.onap.portalsdk.core.domain.support.DomainVo; +import org.onap.vid.job.Job; /* The following 2 annotations let hibernate to update only fields that actually have been changed. @@ -51,7 +58,7 @@ public class ServiceInfo extends DomainVo { DELETE, UPDATE, RESUME, - REPLACE + UPGRADE } private UUID jobId; diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java index 926dc3cdc..75658f2b1 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java @@ -65,7 +65,7 @@ public abstract class BaseResource implements JobAdapter.AsyncJobRequest { .put("Update_Delete", Action.Delete) .put("None_Delete", Action.Delete) .put("Resume", Action.Resume) - .put("Replace", Action.Replace) + .put("Upgrade", Action.Upgrade) .build(); diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java index 97b23af20..233850d58 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java @@ -20,18 +20,17 @@ package org.onap.vid.model.serviceInstantiation; +import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.onap.vid.job.JobAdapter; -import org.onap.vid.job.JobType; -import org.onap.vid.mso.model.ModelInfo; - import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; - -import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; +import org.onap.vid.job.JobAdapter; +import org.onap.vid.job.JobType; +import org.onap.vid.mso.model.ModelInfo; /** * The Class VfModule. @@ -91,4 +90,25 @@ public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest public JobType getJobType() { return JobType.VfmoduleInstantiation; } + + public VfModule cloneWith(ModelInfo modelInfo) { + return new VfModule( + modelInfo, + this.getInstanceName(), + this.getVolumeGroupInstanceName(), + this.getAction().toString(), + this.getLcpCloudRegionId(), + this.getLcpCloudRegionId(), + this.getTenantId(), + this.getInstanceParams(), + this.getSupplementaryParams(), + this.isRollbackOnFailure(), + this.isUsePreload(), + this.getInstanceId(), + this.getTrackById(), + this.getIsFailed(), + this.getStatusMessage() + ); + + } }
\ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java index 4d0d4ee74..3d980dce8 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java @@ -140,7 +140,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) { logInvocationInDebug("createSvcInstance"); - String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE); + String endpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); return msoClientInterface.createSvcInstance(msoRequest, endpoint); } @@ -260,7 +260,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { logInvocationInDebug("deleteSvcInstance"); String endpoint; - endpoint = validateEndpointPath(MsoProperties.MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE); + endpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); if (shouldUnassignService(serviceStatus)){ logger.debug(EELFLoggerDelegate.debugLogger, "unassign service"); String svcEndpoint = endpoint + "/" + serviceInstanceId + "/unassign"; @@ -470,7 +470,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { String methodName = "activateServiceInstance"; logInvocationInDebug(methodName); try { - String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE); + String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); String activateServicePath = serviceEndpoint + "/" + serviceInstanceId + ACTIVATE; RestObject<String> restObjStr = new RestObject<>(); @@ -534,7 +534,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { @Override public String getActivateFabricConfigurationPath(String serviceInstanceId) { - String path = validateEndpointPath(MsoProperties.MSO_REST_API_SERVICE_INSTANCE_CREATE); + String path = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); path += "/" + serviceInstanceId + ACTIVATE_FABRIC_CONFIGURATION; return path; @@ -684,7 +684,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { logInvocationInDebug("setServiceInstanceStatus"); String methodName = "setServiceInstanceStatus"; try { - String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE); + String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); String endpoint = serviceEndpoint + "/" + serviceInstanceId; String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE); @@ -822,7 +822,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) { logInvocationInDebug("removeRelationshipFromServiceInstance"); - String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE); + String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); String removeRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/removeRelationships"; return msoClientInterface.removeRelationshipFromServiceInstance(requestDetails, removeRelationshipsPath); @@ -832,7 +832,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) { logInvocationInDebug("addRelationshipToServiceInstance"); - String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE); + String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE); String addRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/addRelationships"; return msoClientInterface.addRelationshipToServiceInstance(requestDetails, addRelationshipsPath); diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java index 4e6258c16..81566aae1 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java @@ -69,10 +69,7 @@ public class MsoProperties extends SystemProperties { public static final String MSO_REST_API_E2E_SVC_INSTANCE = "mso.restapi.svc.e2einstance"; // /e2eServiceInstances/v3 /** The Constant MSO_REST_API_SVC_INSTANCE. */ - public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2 - - /** The Constant MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE. */ - public static final String MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance.deleteAndUnassign"; + public static final String MSO_RESTAPI_SERVICE_INSTANCE = "mso.restapi.service.instance"; // /serviceInstances/v2 /** The Constant MSO_REST_API_VNF_INSTANCE. */ public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; @@ -120,9 +117,6 @@ public class MsoProperties extends SystemProperties { /** The Constant MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS */ public static final String MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS = "mso.restapi.operationalEnvironment.cloudResourcesRequests.status"; - /** The Constant MSO_REST_API_SERVICE_INSTANCE_CREATE */ - public static final String MSO_REST_API_SERVICE_INSTANCE_CREATE = "mso.restapi.serviceInstanceCreate"; - /** The Constant MSO_REST_API_SERVICE_INSTANCE_ASSIGN */ public static final String MSO_REST_API_SERVICE_INSTANCE_ASSIGN = "mso.restapi.serviceInstanceAssign"; diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java index cc6d6123d..4b8a974e3 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java @@ -20,6 +20,8 @@ */ package org.onap.vid.mso.rest; +import static org.onap.vid.utils.Logging.ONAP_REQUEST_ID_HEADER_KEY; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import io.joshworks.restclient.http.HttpResponse; @@ -177,7 +179,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf logger.debug(EELFLoggerDelegate.debugLogger, methodName + START); String path = baseUrl + endpoint; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); return MsoUtil.wrapResponse(response); } @@ -221,7 +223,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf public HttpResponseWithRequestInfo<String> getOrchestrationRequest(String endpoint, boolean warpException) { String path = baseUrl + endpoint; - HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class); + HttpResponse<String> response = client.get(path, getHeaders(), new HashMap<>(), String.class); return new HttpResponseWithRequestInfo<>(response, path, HttpMethod.GET); } @@ -229,7 +231,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf public MsoResponseWrapper getOrchestrationRequest(String endpoint) { String path = baseUrl + endpoint; - HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class); + HttpResponse<String> response = client.get(path, getHeaders(), new HashMap<>(), String.class); return MsoUtil.wrapResponse(response); } @@ -241,7 +243,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf try { String path = baseUrl + endpoint; - HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class); + HttpResponse<String> response = client.get(path, getHeaders(), new HashMap<>(), String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); @@ -261,7 +263,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf try { String path = baseUrl + endpoint; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); @@ -302,7 +304,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change configuration active status, path =[" + path + "]"); - HttpResponse<String> response = client.post(path, commonHeaders, request, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), request, String.class); return MsoUtil.wrapResponse(response); } catch (Exception e) { logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); @@ -320,7 +322,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf String path = baseUrl + endpoint; logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change port configuration status, path =[" + path + "]"); - HttpResponse<String> response = client.post(path, commonHeaders, request, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), request, String.class); return MsoUtil.wrapResponse(response); } catch (Exception e) { logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); @@ -332,7 +334,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf @Override public MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint) { String path = baseUrl + endpoint; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); return MsoUtil.wrapResponse2(response, RequestReferencesContainer.class); } @@ -345,7 +347,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper(); requestDetailsWrapper.requestDetails = new MsoRequestDetails(request); - HttpResponse<String> response = client.post(path, commonHeaders, requestDetailsWrapper, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetailsWrapper, String.class); MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(response); int status = msoResponseWrapperObject.getStatus(); if (status == 202) { @@ -386,7 +388,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper(); requestDetailsWrapper.requestDetails = new MsoRequestDetails(request); - HttpResponse<String> response = client.put(path, commonHeaders, requestDetailsWrapper, String.class); + HttpResponse<String> response = client.put(path, getHeaders(), requestDetailsWrapper, String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); @@ -406,7 +408,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start "); try { String path = baseUrl + endpoint; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w =" + w.getResponse()); return w; @@ -426,7 +428,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf try { logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Remove relationship from service instance, path =[" + endpoint + "]"); String path = baseUrl + endpoint; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); return MsoUtil.wrapResponse(response); } catch (Exception e) { logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); @@ -444,7 +446,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Add relationship to service instance, path =[" + addRelationshipsPath + "]"); String path = baseUrl + addRelationshipsPath; - HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), requestDetails, String.class); return MsoUtil.wrapResponse(response); } catch (Exception e) { logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); @@ -458,7 +460,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf String path = baseUrl + invokeWorkflowsPath; Map<String, String> finalHeader = new HashMap<>(); - finalHeader.putAll(commonHeaders); + finalHeader.putAll(getHeaders()); finalHeader.putAll(extraHeaders); RequestDetailsWrapper<WorkflowRequestDetail> requestDetailsWrapper = new RequestDetailsWrapper<>(workflowRequestDetail); @@ -470,36 +472,36 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf @Override public <T> HttpResponse<T> get(String endpoint, Class<T> responseClass) { String path = baseUrl + endpoint; - return client.get(path, commonHeaders, new HashMap<>(), responseClass); + return client.get(path, getHeaders(), new HashMap<>(), responseClass); } @Override public <T> HttpResponse<T> post(String endpoint, RequestDetailsWrapper<?> requestDetailsWrapper, Class<T> responseClass) { String path = baseUrl + endpoint; - return client.post(path, commonHeaders, requestDetailsWrapper, responseClass); + return client.post(path, getHeaders(), 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); + return client.post(path, getHeaders(), requestDetails, responseClass); } public HttpResponse<SOWorkflowList> getWorkflowListByModelId(String endpoint){ String path = baseUrl + endpoint; - return client.get(path, commonHeaders, Maps.newHashMap(), SOWorkflowList.class); + return client.get(path, getHeaders(), Maps.newHashMap(), SOWorkflowList.class); } - private MsoResponseWrapper createInstance(Object request, String path) { + protected MsoResponseWrapper createInstance(Object request, String path) { String methodName = "createInstance"; logger.debug(methodName + START); try { - HttpResponse<String> response = client.post(path, commonHeaders, request, String.class); + HttpResponse<String> response = client.post(path, getHeaders(), request, String.class); return MsoUtil.wrapResponse(response); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); @@ -523,7 +525,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf try { logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Delete, path =[" + path + "]"); - HttpResponse<String> response = client.delete(path, commonHeaders, request, String.class); + HttpResponse<String> response = client.delete(path, getHeaders(), request, String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse()); @@ -537,6 +539,15 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf } + private Map<String, String> getHeaders() { + Map<String, String> map = new HashMap<>(); + map.putAll(commonHeaders); + String requestIdValue = Logging.extractOrGenerateRequestId(); + map.put(SystemProperties.ECOMP_REQUEST_ID, requestIdValue); + map.put(ONAP_REQUEST_ID_HEADER_KEY, requestIdValue); + return map; + } + private Map<String, String> initCommonHeaders() { String username = systemProperties.getProperty(MsoProperties.MSO_USER_NAME); String password = systemProperties.getProperty(MsoProperties.MSO_PASSWORD); @@ -552,7 +563,6 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf map.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); map.put(X_FROM_APP_ID, systemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)); - map.put(SystemProperties.ECOMP_REQUEST_ID, Logging.extractOrGenerateRequestId()); map.put(X_ONAP_PARTNER_NAME, "VID"); return ImmutableMap.copyOf(map); } diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java index d7b3ac602..c77eb8230 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogicImpl.java @@ -247,13 +247,13 @@ public class AsyncInstantiationBusinessLogicImpl implements //in case pause flag is true - use assign , else - use create. return MsoBusinessLogicImpl.validateEndpointPath( serviceInstantiationRequest.isPause() ? - MsoProperties.MSO_REST_API_SERVICE_INSTANCE_ASSIGN : MsoProperties.MSO_REST_API_SERVICE_INSTANCE_CREATE + MsoProperties.MSO_REST_API_SERVICE_INSTANCE_ASSIGN : MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE ); } @Override public String getServiceDeletionPath(String serviceInstanceId) { - return MsoBusinessLogicImpl.validateEndpointPath( MsoProperties.MSO_DELETE_OR_UNASSIGN_REST_API_SVC_INSTANCE) + "/" + serviceInstanceId; + return MsoBusinessLogicImpl.validateEndpointPath( MsoProperties.MSO_RESTAPI_SERVICE_INSTANCE) + "/" + serviceInstanceId; } @Override diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js index 01b8e8acf..0c6d1d74f 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js @@ -262,6 +262,7 @@ appDS2 FLAG_VF_MODULE_RESUME_STATUS_CREATE: "FLAG_VF_MODULE_RESUME_STATUS_CREATE", FLAG_1908_RELEASE_TENANT_ISOLATION: "FLAG_1908_RELEASE_TENANT_ISOLATION", FLAG_FLASH_REPLACE_VF_MODULE: "FLAG_FLASH_REPLACE_VF_MODULE", + FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT: "FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT", } }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js index 7fa312ed9..b3afcd864 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js @@ -225,12 +225,20 @@ };
$scope.allowTransferToNewScreenAndShowButton = function (){
- if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_REPLACE_VF_MODULE)) {
- return $scope.isPermitted && !($scope.isMacro());
+ if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT)) {
+ return $scope.isPermitted;
}
return false;
};
+ $scope.navigateToNewEditViewScreen = function(){
+ window.location.href = 'serviceModels.htm#/servicePlanning/EDIT?' +
+ 'serviceModelId=' + _.get($scope, 'service.model.service.uuid') +
+ '&subscriberId=' + $location.search().subscriberId +
+ '&serviceType=' + $location.search().serviceType +
+ '&serviceInstanceId=' + $location.search().serviceInstanceId;
+ };
+
$scope.deleteService = function (serviceObject, serviceOrchestrationStatus) {
var serviceInstance = serviceObject.object;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js index 3403cc2af..b83774889 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js @@ -81,7 +81,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log // $scope.deleteServiceInstance();
// $scope.generateInvalidUrl405();
}, 100);
- }
+ };
$scope.autoGetSubDetails = function() {
/*
@@ -93,7 +93,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log // $scope.deleteServiceInstance();
// $scope.generateInvalidUrl405();
}, 100);
- }
+ };
$scope.autoPopulateViewEdit = function() {
/*
@@ -105,7 +105,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log // $scope.deleteServiceInstance();
// $scope.generateInvalidUrl405();
}, 100);
- }
+ };
$scope.refreshSubs = function() {
/*
@@ -117,7 +117,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log // $scope.deleteServiceInstance();
// $scope.generateInvalidUrl405();
}, 100);
- }
+ };
$scope.autoStartQueryTest = function() {
/*
@@ -127,7 +127,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log $timeout(function() {
// $scope.queryServiceInstance();
}, 100);
- }
+ };
$scope.queryServiceInstance = function() {
/*
@@ -136,7 +136,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log $scope.$broadcast(COMPONENT.QUERY_SERVICE_INSTANCE, {
serviceInstanceId: COMPONENT.SERVICE_INSTANCE_ID_1
});
- }
+ };
$scope.getSubscribers = function() {
/*
@@ -146,7 +146,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : FIELD.ID.AAI_GET_SUBSCRIBERS,
requestDetails : createServiceRequestDetails
});
- }
+ };
$scope.getSubDetails = function() {
/*
@@ -156,7 +156,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : FIELD.ID.AAI_SUB_DETAILS,
requestDetails : createServiceRequestDetails
});
- }
+ };
$scope.getComponentList = function() {
/*
@@ -166,7 +166,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : FIELD.ID.AAI_SUB_VIEWEDIT,
requestDetails : createServiceRequestDetails
});
- }
+ };
$scope.refreshSubscribers = function() {
@@ -177,7 +177,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : FIELD.ID.AAI_REFRESH_SUBSCRIBERS,
requestDetails : createServiceRequestDetails
});
- }
+ };
$scope.deleteServiceInstance = function() {
/*
@@ -187,21 +187,21 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : COMPONENT.MSO_DELETE_SVC_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1,
requestDetails : deleteServiceRequestDetails
});
- }
+ };
$scope.createNetworkInstance = function() {
$scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
url : COMPONENT.MSO_CREATE_NW_INSTANCE,
requestDetails : createNetworkRequestDetails
});
- }
+ };
$scope.deleteNetworkInstance = function() {
$scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
url : COMPONENT.MSO_CREATE_NW_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1 + COMPONENT.FORWARD_SLASH + COMPONENT.NETWORKS + COMPONENT.FORWARD_SLASH + COMPONENT.DELETE_INSTANCE_ID_1,
requestDetails : deleteNetworkRequestDetails
});
- }
+ };
$scope.generateError = function(testName) {
// Clone example request object
@@ -211,7 +211,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
requestDetails : request
});
- }
+ };
$scope.generateInvalidUrl404 = function() {
var properties = UtilityService.getProperties(properties);
@@ -227,14 +227,14 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log properties.msoDefaultBaseUrl = $scope.baseUrl;
UtilityService.setProperties(properties);
$scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
- }
+ };
$scope.generateInvalidUrl405 = function() {
$scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
url : COMPONENT.INVALID_STRING_MSO_CREATE_SVC_INSTANCE,
requestDetails : createServiceRequestDetails
});
- }
+ };
/*
* Test data objects:
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js index 5b8cb7445..bf4941f28 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js @@ -397,7 +397,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService, $compile element.find("input, select").bind("change.namespace2", function() {
callback(this, scope);
});
- }
+ };
control.getList = function(expectedId) {
var parameterList = new Array();
@@ -411,7 +411,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService, $compile parameterList.push({id: key, value: value});
});
return parameterList;
- }
+ };
control.getRequiredFields = function() {
var requiredFields = "";
@@ -433,10 +433,10 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService, $compile } else {
return requiredFields + " and " + count + " other fields";
}
- }
+ };
}
}
-}
+};
appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService", "$compile",
parameterBlockDirective ]);
@@ -469,7 +469,7 @@ appDS2.directive('onlyIntegers', function () { }
});
}
- }
+ };
});
appDS2.directive('onlyFloat', function () {
@@ -487,5 +487,5 @@ appDS2.directive('onlyFloat', function () { }
});
}
- }
+ };
});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/popupWindowDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/popupWindowDirective.js index 1ca32034c..a26744d38 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/popupWindowDirective.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/popupWindowDirective.js @@ -64,7 +64,7 @@ var popupWindowDirective = function($log, $window) { scrollPosition = {
x : $window.pageXOffset,
y : $window.pageYOffset
- }
+ };
$window.scrollTo(0, 0);
element.css("display", "table");
element.prev().css("display", "block");
@@ -74,7 +74,7 @@ var popupWindowDirective = function($log, $window) { $window.scrollTo(scrollPosition.x, scrollPosition.y);
}
});
- }
+ };
return {
restrict : "EA",
@@ -83,6 +83,6 @@ var popupWindowDirective = function($log, $window) { link : link,
template : '<table style="display: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-collapse: collapse; margin: 0; padding: 0"> <tr><td align="center" style="vertical-align: top; padding: 10px"><div style="display: inline-block; padding: 5px; background-color: white" ng-transclude></div></td></tr></table>'
};
-}
+};
appDS2.directive("popupWindow", [ "$log", "$window", popupWindowDirective ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js index 2f60d65dc..8294597bd 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js @@ -127,7 +127,7 @@ var progressBarDirective = function() { */
element.html("");
}
- }
+ };
return {
restrict : "EA",
@@ -153,7 +153,7 @@ var progressBarDirective = function() { control.reset = function() {
previousValue = 0;
updateProgress(element, attrs, 0);
- }
+ };
attrs.$observe("value", function(valueString) {
updateProgress(element, attrs, valueString);
@@ -167,7 +167,7 @@ var progressBarDirective = function() { }
});
}
- }
-}
+ };
+};
appDS2.directive("progressBar", progressBarDirective);
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 3f4a94ee0..de0ec4026 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 @@ -24,7 +24,7 @@ <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">×</span> <div ng-if="vm.errorMsg!==''"><font color='red'>{{vm.errorMsg.message}}</font></div> </div> -<form class="form-create" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate> +<form class="form-create" data-tests-id="newChangeManagementForm" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate> <div class="modal-body step1" ng-show="vm.wizardStep === 1" > <div class="form-group"> <label class="control-label">Subscriber</label> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html index 1d8b39c80..194df6e4d 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html @@ -25,7 +25,7 @@ <div class="header"> <span id="change-management-headline">VNF Changes</span> <span class="separator"></span> - <div class="button-container" ng-click="vm.createNewChange()"> + <div data-tests-id="create-new-change-management" class="button-container" ng-click="vm.createNewChange()"> <div class="icon-svg" id="change-management-new-button"> <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 55.47337 55.63023"><path class="icon-filling" d="M27.7367.07843A27.73669,27.73669,0,1,0,55.4734,27.81512,27.73757,27.73757,0,0,0,27.7367.07843ZM40.18824,29.6178H29.53938V40.26666a1.80267,1.80267,0,0,1-3.60535,0V29.6178H15.28516a1.80267,1.80267,0,0,1,0-3.60535H25.934V15.36359a1.80267,1.80267,0,0,1,3.60535,0V26.01245H40.18824a1.80267,1.80267,0,1,1,0,3.60535Z"/></svg> </div> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm index f80f924b3..6399065f8 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm @@ -41,7 +41,9 @@ <h1 class="heading1" style="margin-top: 20px;">{{isPermitted ? "View/Edit" : "View"}} Service Instance</h1>
<a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();"><span
class="glyphicon glyphicon-refresh"></span></a>
-
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ data-tests-id="show-new-screen" ng-if="allowTransferToNewScreenAndShowButton()"
+ ng-click="navigateToNewEditViewScreen()" style="margin-right: 8px;">More actions</a>
<br>
<center>
|