Search in sources :

Example 1 with InternalOnly

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

the class ConsumptionInternalV1Controller method scheduleStorageConsumptionCollection.

@Override
@InternalOnly
public void scheduleStorageConsumptionCollection(@AccountId String accountId, @Valid @NotNull StorageConsumptionRequest request) {
    ConsumptionCreationDto consumptionCreationDto = consumptionApiConverter.initCreationDtoForStorage(request);
    consumptionService.create(consumptionCreationDto);
}
Also used : ConsumptionCreationDto(com.sequenceiq.consumption.dto.ConsumptionCreationDto) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Example 2 with InternalOnly

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

the class BlueprintV4Controller method postInternal.

@Override
@InternalOnly
public BlueprintV4Response postInternal(@AccountId String accountId, Long workspaceId, @Valid BlueprintV4Request request) {
    Blueprint toSave = blueprintV4RequestToBlueprintConverter.convert(request);
    Blueprint blueprint = blueprintService.createWithInternalUser(toSave, restRequestThreadLocalService.getRequestedWorkspaceId(), accountId);
    notify(ResourceEvent.BLUEPRINT_CREATED);
    return blueprintToBlueprintV4ResponseConverter.convert(blueprint);
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Example 3 with InternalOnly

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

the class AutoscaleV4Controller method getRecommendation.

@Override
@InternalOnly
public AutoscaleRecommendationV4Response getRecommendation(@TenantAwareParam String crn) {
    Stack stack = stackService.getByCrn(crn);
    String blueprintName = stack.getCluster().getBlueprint().getName();
    Long workspaceId = stack.getWorkspace().getId();
    AutoscaleRecommendation autoscaleRecommendation = blueprintService.getAutoscaleRecommendation(workspaceId, blueprintName);
    return autoscaleRecommendationToAutoscaleRecommendationV4ResponseConverter.convert(autoscaleRecommendation);
}
Also used : AutoscaleRecommendation(com.sequenceiq.cloudbreak.cloud.model.AutoscaleRecommendation) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Example 4 with InternalOnly

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

the class DistroXUpgradeV1Controller method upgradeClusterByCrnInternal.

@Override
@InternalOnly
public DistroXUpgradeV1Response upgradeClusterByCrnInternal(@ResourceCrn String clusterCrn, @Valid DistroXUpgradeV1Request distroxUpgradeRequest, @InitiatorUserCrn String initiatorUserCrn) {
    NameOrCrn nameOrCrn = NameOrCrn.ofCrn(clusterCrn);
    boolean dataHubRuntimeUpgradeEnabled = upgradeAvailabilityService.isRuntimeUpgradeEnabledByUserCrn(initiatorUserCrn);
    boolean dataHubOsUpgradeEntitled = upgradeAvailabilityService.isOsUpgradeEnabledByUserCrn(initiatorUserCrn);
    return upgradeCluster(clusterCrn, distroxUpgradeRequest, nameOrCrn, new InternalUpgradeSettings(true, dataHubRuntimeUpgradeEnabled, dataHubOsUpgradeEntitled));
}
Also used : InternalUpgradeSettings(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings) NameOrCrn(com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Example 5 with InternalOnly

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

the class DistroXUpgradeV1Controller method upgradeClusterByNameInternal.

@Override
@InternalOnly
public DistroXUpgradeV1Response upgradeClusterByNameInternal(@ResourceName String clusterName, @Valid DistroXUpgradeV1Request distroxUpgradeRequest, @InitiatorUserCrn String initiatorUserCrn) {
    NameOrCrn nameOrCrn = NameOrCrn.ofName(clusterName);
    boolean dataHubRuntimeUpgradeEnabled = upgradeAvailabilityService.isRuntimeUpgradeEnabledByUserCrn(initiatorUserCrn);
    boolean dataHubOsUpgradeEntitled = upgradeAvailabilityService.isOsUpgradeEnabledByUserCrn(initiatorUserCrn);
    return upgradeCluster(clusterName, distroxUpgradeRequest, nameOrCrn, new InternalUpgradeSettings(true, dataHubRuntimeUpgradeEnabled, dataHubOsUpgradeEntitled));
}
Also used : InternalUpgradeSettings(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings) NameOrCrn(com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn) 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