use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.UserNamePasswordV4Request in project cloudbreak by hortonworks.
the class ClusterCommonService method put.
public FlowIdentifier put(String crn, UpdateClusterV4Request updateJson) {
Stack stack = stackService.getByCrnWithLists(crn);
Long stackId = stack.getId();
MDCBuilder.buildMdcContext(stack);
UserNamePasswordV4Request userNamePasswordJson = updateJson.getUserNamePassword();
FlowIdentifier flowIdentifier;
if (userNamePasswordJson != null) {
flowIdentifier = clusterManagerUserNamePasswordChange(stack, userNamePasswordJson);
} else if (updateJson.getStatus() != null) {
LOGGER.debug("Cluster status update request received. Stack id: {}, status: {} ", stackId, updateJson.getStatus());
flowIdentifier = clusterOperationService.updateStatus(stackId, updateJson.getStatus());
} else if (updateJson.getBlueprintName() != null && updateJson.getHostgroups() != null && stack.getCluster().isCreateFailed()) {
LOGGER.debug("Cluster rebuild request received. Stack id: {}", stackId);
try {
flowIdentifier = recreateCluster(stack, updateJson);
} catch (TransactionExecutionException e) {
throw new TransactionRuntimeExecutionException(e);
}
} else if (updateJson.getHostGroupAdjustment() != null) {
environmentService.checkEnvironmentStatus(stack, EnvironmentStatus.upscalable());
flowIdentifier = clusterHostgroupAdjustmentChange(stackId, updateJson, stack);
} else {
LOGGER.info("Invalid cluster update request received. Stack id: {}", stackId);
throw new BadRequestException("Invalid update cluster request!");
}
return flowIdentifier;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.UserNamePasswordV4Request in project cloudbreak by hortonworks.
the class StackOperations method putPassword.
public FlowIdentifier putPassword(@NotNull NameOrCrn nameOrCrn, Long workspaceId, @Valid UserNamePasswordV4Request userNamePasswordJson) {
Stack stack = nameOrCrn.hasName() ? stackService.getByNameInWorkspace(nameOrCrn.getName(), workspaceId) : stackService.getNotTerminatedByCrnInWorkspace(nameOrCrn.getCrn(), workspaceId);
UpdateClusterV4Request updateClusterJson = userNamePasswordV4RequestToUpdateClusterV4RequestConverter.convert(userNamePasswordJson);
return clusterCommonService.put(stack.getResourceCrn(), updateClusterJson);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.UserNamePasswordV4Request in project cloudbreak by hortonworks.
the class UserNamePasswordV4RequestToUpdateClusterV4RequestConverter method convert.
public UpdateClusterV4Request convert(UserNamePasswordV4Request source) {
UpdateClusterV4Request updateStackJson = new UpdateClusterV4Request();
updateStackJson.setUserNamePassword(source);
return updateStackJson;
}
Aggregations