use of com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson in project cloudbreak by hortonworks.
the class AmbariRepoDetailsToAmbariRepoDetailsRequestConverter method convert.
@Override
public AmbariRepoDetailsJson convert(AmbariRepo source) {
AmbariRepoDetailsJson ambariRepoDetailsJson = new AmbariRepoDetailsJson();
ambariRepoDetailsJson.setBaseUrl(source.getBaseUrl());
ambariRepoDetailsJson.setGpgKeyUrl(source.getGpgKeyUrl());
ambariRepoDetailsJson.setVersion(source.getVersion());
return ambariRepoDetailsJson;
}
use of com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson in project cloudbreak by hortonworks.
the class ClusterCreationSetupService method determineAmbariRepoConfig.
private ClusterComponent determineAmbariRepoConfig(Optional<Component> stackAmbariRepoConfig, AmbariRepoDetailsJson ambariRepoDetailsJson, Optional<Component> stackImageComponent, Cluster cluster) throws IOException {
Json json;
if (!stackAmbariRepoConfig.isPresent()) {
AmbariRepo ambariRepo = ambariRepoDetailsJson != null ? conversionService.convert(ambariRepoDetailsJson, AmbariRepo.class) : defaultAmbariRepoService.getDefault(getOsType(stackImageComponent));
if (ambariRepo == null) {
throw new BadRequestException(String.format("Couldn't determine Ambari repo for the stack: %s", cluster.getStack().getName()));
}
json = new Json(ambariRepo);
} else {
json = stackAmbariRepoConfig.get().getAttributes();
}
return new ClusterComponent(ComponentType.AMBARI_REPO_DETAILS, json, cluster);
}
use of com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson in project cloudbreak by hortonworks.
the class AmbariRepoToAmbariRepoDetailsJsonConverter method convert.
@Override
public AmbariRepoDetailsJson convert(AmbariRepo source) {
AmbariRepoDetailsJson ambariRepoDetailsJson = new AmbariRepoDetailsJson();
ambariRepoDetailsJson.setVersion(source.getVersion());
ambariRepoDetailsJson.setBaseUrl(source.getBaseUrl());
ambariRepoDetailsJson.setGpgKeyUrl(source.getGpgKeyUrl());
return ambariRepoDetailsJson;
}
use of com.sequenceiq.cloudbreak.api.model.AmbariRepoDetailsJson in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverter method convertComponentConfig.
private void convertComponentConfig(ClusterResponse response, Cluster source) {
try {
AmbariRepo ambariRepo = componentConfigProvider.getAmbariRepo(source.getComponents());
if (ambariRepo != null) {
AmbariRepoDetailsJson ambariRepoDetailsJson = getConversionService().convert(ambariRepo, AmbariRepoDetailsJson.class);
response.setAmbariRepoDetailsJson(ambariRepoDetailsJson);
}
StackRepoDetails stackRepoDetails = componentConfigProvider.getStackRepo(source.getComponents());
if (stackRepoDetails != null) {
AmbariStackDetailsResponse ambariRepoDetailsJson = getConversionService().convert(stackRepoDetails, AmbariStackDetailsResponse.class);
response.setAmbariStackDetails(ambariRepoDetailsJson);
}
} catch (RuntimeException e) {
LOGGER.error("Failed to convert dynamic component.", e);
}
}
Aggregations