use of com.sequenceiq.cloudbreak.domain.stack.Stack in project cloudbreak by hortonworks.
the class TargetedUpscaleSupportServiceTest method getStack.
private Stack getStack() {
Stack stack = new Stack();
stack.setResourceCrn(DATAHUB_CRN);
return stack;
}
use of com.sequenceiq.cloudbreak.domain.stack.Stack in project cloudbreak by hortonworks.
the class ClusterToClusterV4ResponseConverter method convert.
public ClusterV4Response convert(Cluster source) {
ClusterV4Response clusterResponse = new ClusterV4Response();
clusterResponse.setId(source.getId());
clusterResponse.setName(source.getName());
Stack stack = source.getStack();
clusterResponse.setStatus(stack.getStatus());
clusterResponse.setStatusReason(stack.getStatusReason());
setUptime(source, clusterResponse);
clusterResponse.setDescription(source.getDescription() == null ? "" : source.getDescription());
String managerAddress = stackUtil.extractClusterManagerAddress(stack);
Map<String, Collection<ClusterExposedServiceV4Response>> clusterExposedServicesForTopologies = serviceEndpointCollector.prepareClusterExposedServices(source, managerAddress);
clusterResponse.setExposedServices(clusterExposedServicesForTopologies);
convertCustomQueue(source, clusterResponse);
convertNullableProperties(source, clusterResponse);
convertContainerConfig(source, clusterResponse);
clusterResponse.setCreationFinished(source.getCreationFinished());
decorateResponseWithProxyConfig(source, clusterResponse);
clusterResponse.setCloudStorage(getCloudStorage(source));
clusterResponse.setCm(ClusterToClouderaManagerV4ResponseConverter.convert(source));
clusterResponse.setDatabases(source.getRdsConfigs().stream().filter(rds -> ResourceStatus.USER_MANAGED.equals(rds.getStatus())).map(rds -> rdsConfigToDatabaseV4ResponseConverter.convert(rds)).collect(Collectors.toList()));
clusterResponse.setWorkspace(workspaceToWorkspaceResourceV4ResponseConverter.convert(source.getWorkspace()));
clusterResponse.setBlueprint(getIfNotNull(source.getBlueprint(), blueprintToBlueprintV4ResponseConverter::convert));
clusterResponse.setExtendedBlueprintText(getExtendedBlueprintText(source));
convertDpSecrets(source, clusterResponse);
clusterResponse.setServerIp(stackUtil.extractClusterManagerIp(stack));
clusterResponse.setServerFqdn(source.getFqdn());
clusterResponse.setServerUrl(serviceEndpointCollector.getManagerServerUrl(source, managerAddress));
clusterResponse.setCustomConfigurationsName(getIfNotNull(source.getCustomConfigurations(), configurations -> configurations.getName()));
clusterResponse.setCustomConfigurationsCrn(getIfNotNull(source.getCustomConfigurations(), configurations -> configurations.getCrn()));
clusterResponse.setDatabaseServerCrn(source.getDatabaseServerCrn());
clusterResponse.setRangerRazEnabled(source.isRangerRazEnabled());
clusterResponse.setCertExpirationState(source.getCertExpirationState());
return clusterResponse;
}
use of com.sequenceiq.cloudbreak.domain.stack.Stack in project cloudbreak by hortonworks.
the class ClusterBootstrapper method reBootstrapMachines.
public void reBootstrapMachines(Long stackId) throws CloudbreakException {
Stack stack = stackService.getByIdWithListsInTransaction(stackId);
LOGGER.info("ReBootstrapMachines for stack [{}] [{}]", stack.getName(), stack.getResourceCrn());
reBootstrapOnHost(stack);
}
use of com.sequenceiq.cloudbreak.domain.stack.Stack in project cloudbreak by hortonworks.
the class ClusterBootstrapper method bootstrapMachines.
public void bootstrapMachines(Long stackId) throws CloudbreakException {
Stack stack = stackService.getByIdWithListsInTransaction(stackId);
bootstrapOnHost(stack);
}
use of com.sequenceiq.cloudbreak.domain.stack.Stack in project cloudbreak by hortonworks.
the class ClusterServiceRunner method redeployGatewayCertificate.
public void redeployGatewayCertificate(Long stackId) {
Stack stack = stackService.getByIdWithListsInTransaction(stackId);
Long clusterId = stack.getCluster().getId();
Cluster cluster = clusterService.findOneWithLists(clusterId).orElseThrow(NotFoundException.notFound("Cluster", clusterId));
hostRunner.redeployGatewayCertificate(stack, cluster);
}
Aggregations