use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class StackV2Controller method putReinstall.
@Override
public Response putReinstall(String name, ReinstallRequestV2 reinstallRequestV2) {
IdentityUser user = authenticatedUserService.getCbUser();
reinstallRequestV2.setAccount(user.getAccount());
Stack stack = stackService.getPublicStack(name, user);
UpdateClusterJson updateClusterJson = conversionService.convert(reinstallRequestV2, UpdateClusterJson.class);
return clusterCommonController.put(stack.getId(), updateClusterJson);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class TemplateController method getPrivates.
@Override
public Set<TemplateResponse> getPrivates() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<Template> templates = templateService.retrievePrivateTemplates(user);
return convert(templates);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class TemplateController method getPublic.
@Override
public TemplateResponse getPublic(@PathVariable String name) {
IdentityUser user = authenticatedUserService.getCbUser();
Template template = templateService.getPublicTemplate(name, user);
return convert(template);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class TemplateController method getPublics.
@Override
public Set<TemplateResponse> getPublics() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<Template> templates = templateService.retrieveAccountTemplates(user);
return convert(templates);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class StackRequestToBlueprintPreparationObjectConverter method convert.
@Override
public BlueprintPreparationObject convert(StackV2Request source) {
try {
IdentityUser identityUser = userDetailsService.getDetails(source.getOwner(), UserFilterField.USERID);
FlexSubscription flexSubscription = getFlexSubscription(source);
String smartsenseSubscriptionId = getSmartsenseSubscriptionId(source, flexSubscription);
KerberosConfig kerberosConfig = getKerberosConfig(source);
LdapConfig ldapConfig = getLdapConfig(source, identityUser);
FileSystemConfigurationView fileSystemConfigurationView = getFileSystemConfigurationView(source);
Set<RDSConfig> rdsConfigs = getRdsConfigs(source, identityUser);
Blueprint blueprint = getBlueprint(source, identityUser);
BlueprintStackInfo blueprintStackInfo = stackInfoService.blueprintStackInfo(blueprint.getBlueprintText());
Set<HostgroupView> hostgroupViews = getHostgroupViews(source);
BlueprintView blueprintView = new BlueprintView(blueprint.getBlueprintText(), blueprintStackInfo.getVersion(), blueprintStackInfo.getType());
GeneralClusterConfigs generalClusterConfigs = generalClusterConfigsProvider.generalClusterConfigs(source, identityUser);
return BlueprintPreparationObject.Builder.builder().withFlexSubscription(flexSubscription).withRdsConfigs(rdsConfigs).withHostgroupViews(hostgroupViews).withBlueprintView(blueprintView).withStackRepoDetailsHdpVersion(blueprintStackInfo.getVersion()).withFileSystemConfigurationView(fileSystemConfigurationView).withGeneralClusterConfigs(generalClusterConfigs).withSmartSenseSubscriptionId(smartsenseSubscriptionId).withLdapConfig(ldapConfig).withKerberosConfig(kerberosConfig).build();
} catch (BlueprintProcessingException e) {
throw new CloudbreakServiceException(e.getMessage(), e);
} catch (IOException e) {
throw new CloudbreakServiceException(e.getMessage(), e);
}
}
Aggregations