Search in sources :

Example 81 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class RecipeController method getPublic.

@Override
public RecipeResponse getPublic(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Recipe recipe = recipeService.getPublicRecipe(name, user);
    return conversionService.convert(recipe, RecipeResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Recipe(com.sequenceiq.cloudbreak.domain.Recipe)

Example 82 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class RecipeController method getPrivate.

@Override
public RecipeResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Recipe recipe = recipeService.getPrivateRecipe(name, user);
    return conversionService.convert(recipe, RecipeResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Recipe(com.sequenceiq.cloudbreak.domain.Recipe)

Example 83 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class SecurityGroupController method getPrivate.

@Override
public SecurityGroupResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    SecurityGroup securityGroup = securityGroupService.getPrivateSecurityGroup(name, user);
    return convert(securityGroup);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup)

Example 84 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class ClusterV1Controller method post.

@Override
public ClusterResponse post(Long stackId, ClusterRequest request) throws Exception {
    IdentityUser user = authenticatedUserService.getCbUser();
    Stack stack = stackService.getByIdWithLists(stackId);
    clusterCreationSetupService.validate(request, stack, user);
    Cluster cluster = clusterCreationSetupService.prepare(request, stack, user);
    return conversionService.convert(cluster, ClusterResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Example 85 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class ClusterV1Controller method getPrivate.

@Override
public ClusterResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Stack stack = stackService.getPrivateStack(name, user);
    ClusterResponse cluster = clusterService.retrieveClusterForCurrentUser(stack.getId(), ClusterResponse.class);
    String clusterJson = clusterService.getClusterJson(stack.getAmbariIp(), stack.getId());
    return clusterService.getClusterResponse(cluster, clusterJson);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) ClusterResponse(com.sequenceiq.cloudbreak.api.model.ClusterResponse) AutoscaleClusterResponse(com.sequenceiq.cloudbreak.api.model.AutoscaleClusterResponse) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Aggregations

IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)133 Test (org.junit.Test)14 Stack (com.sequenceiq.cloudbreak.domain.Stack)13 UserFilterField (com.sequenceiq.cloudbreak.common.service.user.UserFilterField)9 Async (org.springframework.scheduling.annotation.Async)9 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)8 Credential (com.sequenceiq.cloudbreak.domain.Credential)8 FlexSubscription (com.sequenceiq.cloudbreak.domain.FlexSubscription)8 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)7 LdapConfig (com.sequenceiq.cloudbreak.domain.LdapConfig)7 ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)7 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)6 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)6 Before (org.junit.Before)6 TestingAuthenticationToken (org.springframework.security.authentication.TestingAuthenticationToken)6 UpdateStackJson (com.sequenceiq.cloudbreak.api.model.UpdateStackJson)5 Template (com.sequenceiq.cloudbreak.domain.Template)5 ConstraintTemplate (com.sequenceiq.cloudbreak.domain.ConstraintTemplate)4 Network (com.sequenceiq.cloudbreak.domain.Network)4 Recipe (com.sequenceiq.cloudbreak.domain.Recipe)4