use of com.sequenceiq.cloudbreak.domain.Blueprint in project cloudbreak by hortonworks.
the class BlueprintController method getPrivates.
@Override
public Set<BlueprintResponse> getPrivates() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<Blueprint> blueprints = blueprintService.retrievePrivateBlueprints(user);
return getBlueprintResponses(user, blueprints);
}
use of com.sequenceiq.cloudbreak.domain.Blueprint in project cloudbreak by hortonworks.
the class BlueprintController method createBlueprint.
private BlueprintResponse createBlueprint(IdentityUser user, BlueprintRequest blueprintRequest, boolean publicInAccount) {
Blueprint blueprint = conversionService.convert(blueprintRequest, Blueprint.class);
blueprint.setPublicInAccount(publicInAccount);
blueprint = blueprintService.create(user, blueprint, blueprintRequest.getProperties());
notify(user, ResourceEvent.BLUEPRINT_CREATED);
return conversionService.convert(blueprint, BlueprintResponse.class);
}
use of com.sequenceiq.cloudbreak.domain.Blueprint in project cloudbreak by hortonworks.
the class BlueprintController method getPublic.
@Override
public BlueprintResponse getPublic(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
Blueprint blueprint = blueprintService.getPublicBlueprint(name, user);
return conversionService.convert(blueprint, BlueprintResponse.class);
}
use of com.sequenceiq.cloudbreak.domain.Blueprint in project cloudbreak by hortonworks.
the class BlueprintController method getPrivate.
@Override
public BlueprintResponse getPrivate(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
Blueprint blueprint = blueprintService.getPrivateBlueprint(name, user);
return conversionService.convert(blueprint, BlueprintResponse.class);
}
use of com.sequenceiq.cloudbreak.domain.Blueprint in project cloudbreak by hortonworks.
the class ClusterCreationSetupService method prepare.
public Cluster prepare(ClusterRequest request, Stack stack, Blueprint blueprint, IdentityUser user) throws Exception {
String stackName = stack.getName();
long start = System.currentTimeMillis();
Cluster cluster = conversionService.convert(request, Cluster.class);
cluster.setStack(stack);
LOGGER.info("Cluster conversion took {} ms for stack {}", System.currentTimeMillis() - start, stackName);
start = System.currentTimeMillis();
cluster = clusterDecorator.decorate(cluster, request, blueprint, user, stack);
LOGGER.info("Cluster object decorated in {} ms for stack {}", System.currentTimeMillis() - start, stackName);
start = System.currentTimeMillis();
List<ClusterComponent> components = new ArrayList<>();
Set<Component> allComponent = componentConfigProvider.getAllComponentsByStackIdAndType(stack.getId(), Sets.newHashSet(ComponentType.AMBARI_REPO_DETAILS, ComponentType.HDP_REPO_DETAILS, ComponentType.IMAGE));
Optional<Component> stackAmbariRepoConfig = allComponent.stream().filter(c -> c.getComponentType().equals(ComponentType.AMBARI_REPO_DETAILS) && c.getName().equalsIgnoreCase(ComponentType.AMBARI_REPO_DETAILS.name())).findAny();
Optional<Component> stackHdpRepoConfig = allComponent.stream().filter(c -> c.getComponentType().equals(ComponentType.HDP_REPO_DETAILS) && c.getName().equalsIgnoreCase(ComponentType.HDP_REPO_DETAILS.name())).findAny();
Optional<Component> stackImageComponent = allComponent.stream().filter(c -> c.getComponentType().equals(ComponentType.IMAGE) && c.getName().equalsIgnoreCase(ComponentType.IMAGE.name())).findAny();
ClusterComponent ambariRepoConfig = determineAmbariRepoConfig(stackAmbariRepoConfig, request.getAmbariRepoDetailsJson(), stackImageComponent, cluster);
components.add(ambariRepoConfig);
ClusterComponent hdpRepoConfig = determineHDPRepoConfig(blueprint, stack.getId(), stackHdpRepoConfig, request, cluster, user, stackImageComponent);
components.add(hdpRepoConfig);
checkVDFFile(ambariRepoConfig, hdpRepoConfig, stackName);
LOGGER.info("Cluster components saved in {} ms for stack {}", System.currentTimeMillis() - start, stackName);
start = System.currentTimeMillis();
Cluster savedCluster = clusterService.create(user, stack, cluster, components);
LOGGER.info("Cluster object creation took {} ms for stack {}", System.currentTimeMillis() - start, stackName);
return savedCluster;
}
Aggregations