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);
}
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);
}
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);
}
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));
}
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));
}
Aggregations