Search in sources :

Example 26 with Credential

use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.

the class CredentialController method getPublic.

@Override
public CredentialResponse getPublic(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Credential credentials = credentialService.getPublicCredential(name, user);
    return convert(credentials);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Credential(com.sequenceiq.cloudbreak.domain.Credential)

Example 27 with Credential

use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.

the class CredentialController method getPrivates.

@Override
public Set<CredentialResponse> getPrivates() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<Credential> credentials = credentialService.retrievePrivateCredentials(user);
    return convertCredentials(credentials);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Credential(com.sequenceiq.cloudbreak.domain.Credential)

Example 28 with Credential

use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.

the class CredentialController method createCredential.

private CredentialResponse createCredential(IdentityUser user, CredentialRequest credentialRequest, boolean publicInAccount) {
    Credential credential = convert(credentialRequest, publicInAccount);
    credential = credentialService.create(user, credential);
    return convert(credential);
}
Also used : Credential(com.sequenceiq.cloudbreak.domain.Credential)

Example 29 with Credential

use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.

the class CredentialController method getPrivate.

@Override
public CredentialResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Credential credentials = credentialService.getPrivateCredential(name, user);
    return convert(credentials);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Credential(com.sequenceiq.cloudbreak.domain.Credential)

Example 30 with Credential

use of com.sequenceiq.cloudbreak.domain.Credential in project cloudbreak by hortonworks.

the class DefaultStackHostServiceTypeTest method stack.

private Stack stack(Status stackStatus, Status clusterStatus) {
    Credential gcpCredential = new Credential();
    Stack stack = new Stack();
    stack.setName("simplestack");
    stack.setStackStatus(new StackStatus(stack, stackStatus, "", DetailedStackStatus.UNKNOWN));
    stack.setCredential(gcpCredential);
    stack.setId(1L);
    Cluster cluster = new Cluster();
    cluster.setStatus(clusterStatus);
    cluster.setId(1L);
    stack.setCluster(cluster);
    return stack;
}
Also used : Credential(com.sequenceiq.cloudbreak.domain.Credential) DetailedStackStatus(com.sequenceiq.cloudbreak.api.model.DetailedStackStatus) StackStatus(com.sequenceiq.cloudbreak.domain.StackStatus) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Aggregations

Credential (com.sequenceiq.cloudbreak.domain.Credential)44 Test (org.junit.Test)14 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)8 AccessDeniedException (org.springframework.security.access.AccessDeniedException)8 Json (com.sequenceiq.cloudbreak.domain.json.Json)7 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)6 Template (com.sequenceiq.cloudbreak.domain.Template)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 FileSystemConfiguration (com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration)3 FileSystemScriptConfig (com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig)3 CloudVmTypes (com.sequenceiq.cloudbreak.cloud.model.CloudVmTypes)3 Transactional (javax.transaction.Transactional)3 Maps.newHashMap (com.google.common.collect.Maps.newHashMap)2 GcsFileSystemConfiguration (com.sequenceiq.cloudbreak.api.model.GcsFileSystemConfiguration)2 ExtendedCloudCredential (com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential)2 Platform (com.sequenceiq.cloudbreak.cloud.model.Platform)2 PlatformDisks (com.sequenceiq.cloudbreak.cloud.model.PlatformDisks)2 VmTypeMeta (com.sequenceiq.cloudbreak.cloud.model.VmTypeMeta)2 VolumeParameterConfig (com.sequenceiq.cloudbreak.cloud.model.VolumeParameterConfig)2 RecipeScript (com.sequenceiq.cloudbreak.common.model.recipe.RecipeScript)2