Search in sources :

Example 11 with InternalOnly

use of com.sequenceiq.authorization.annotation.InternalOnly in project cloudbreak by hortonworks.

the class DatabaseServerV4Controller method updateClusterCrn.

@Override
@InternalOnly
public void updateClusterCrn(String environmentCrn, String currentClusterCrn, String newClusterCrn, @InitiatorUserCrn String initiatorUserCrn) {
    DatabaseServerConfig databaseServerConfig = databaseServerConfigService.findByEnvironmentCrnAndClusterCrn(environmentCrn, currentClusterCrn).orElseThrow(() -> new NotFoundException(String.format("No %s found with cluster CRN '%s' in environment '%s'", DatabaseServerConfig.class.getSimpleName(), currentClusterCrn, environmentCrn)));
    databaseServerConfig.setClusterCrn(newClusterCrn);
    databaseServerConfigService.update(databaseServerConfig);
}
Also used : DatabaseServerConfig(com.sequenceiq.redbeams.domain.DatabaseServerConfig) NotFoundException(com.sequenceiq.redbeams.exception.NotFoundException) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Aggregations

InternalOnly (com.sequenceiq.authorization.annotation.InternalOnly)11 NameOrCrn (com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn)2 InternalUpgradeSettings (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings)2 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)2 AuthorizeForAutoscaleV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.response.AuthorizeForAutoscaleV4Response)1 ImageCatalogV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageCatalogV4Response)1 AutoscaleRecommendation (com.sequenceiq.cloudbreak.cloud.model.AutoscaleRecommendation)1 Images (com.sequenceiq.cloudbreak.cloud.model.catalog.Images)1 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)1 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)1 Recipe (com.sequenceiq.cloudbreak.domain.Recipe)1 Consumption (com.sequenceiq.consumption.domain.Consumption)1 ConsumptionCreationDto (com.sequenceiq.consumption.dto.ConsumptionCreationDto)1 DatabaseServerConfig (com.sequenceiq.redbeams.domain.DatabaseServerConfig)1 NotFoundException (com.sequenceiq.redbeams.exception.NotFoundException)1 HashSet (java.util.HashSet)1