Search in sources :

Example 11 with EnvironmentLoadBalancerDto

use of com.sequenceiq.environment.environment.dto.EnvironmentLoadBalancerDto in project cloudbreak by hortonworks.

the class EnvironmentController method updateEnvironmentLoadBalancersByName.

@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.EDIT_ENVIRONMENT)
public FlowIdentifier updateEnvironmentLoadBalancersByName(@ResourceName String envName, @NotNull EnvironmentLoadBalancerUpdateRequest request) {
    String accountId = ThreadBasedUserCrnProvider.getAccountId();
    EnvironmentDto environmentDto = environmentService.getByNameAndAccountId(envName, accountId);
    EnvironmentLoadBalancerDto environmentLoadBalancerDto = environmentApiConverter.initLoadBalancerDto(request);
    return environmentLoadBalancerService.updateLoadBalancerInEnvironmentAndStacks(environmentDto, environmentLoadBalancerDto);
}
Also used : EnvironmentLoadBalancerDto(com.sequenceiq.environment.environment.dto.EnvironmentLoadBalancerDto) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CheckPermissionByResourceName(com.sequenceiq.authorization.annotation.CheckPermissionByResourceName)

Aggregations

EnvironmentLoadBalancerDto (com.sequenceiq.environment.environment.dto.EnvironmentLoadBalancerDto)11 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)10 Test (org.junit.jupiter.api.Test)5 LoadBalancerUpdateEvent (com.sequenceiq.environment.environment.flow.loadbalancer.event.LoadBalancerUpdateEvent)4 EnvironmentStatus (com.sequenceiq.environment.environment.EnvironmentStatus)3 Environment (com.sequenceiq.environment.environment.domain.Environment)3 Map (java.util.Map)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 ResourceEvent (com.sequenceiq.cloudbreak.event.ResourceEvent)2 LoadBalancerUpdateFailedEvent (com.sequenceiq.environment.environment.flow.loadbalancer.event.LoadBalancerUpdateFailedEvent)2 CommonContext (com.sequenceiq.flow.core.CommonContext)2 Bean (org.springframework.context.annotation.Bean)2 CheckPermissionByResourceCrn (com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn)1 CheckPermissionByResourceName (com.sequenceiq.authorization.annotation.CheckPermissionByResourceName)1 CloudSubnet (com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)1 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 NotFoundException (com.sequenceiq.cloudbreak.common.exception.NotFoundException)1 PublicEndpointAccessGateway (com.sequenceiq.common.api.type.PublicEndpointAccessGateway)1 EnvironmentLoadBalancerUpdateRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentLoadBalancerUpdateRequest)1 LoadBalancerUpdateHandlerSelectors (com.sequenceiq.environment.environment.flow.loadbalancer.event.LoadBalancerUpdateHandlerSelectors)1