Search in sources :

Example 1 with SecurityGroup

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

the class TestUtil method securityGroup.

public static SecurityGroup securityGroup(long id) {
    SecurityGroup sg = new SecurityGroup();
    sg.setId(id);
    sg.setName("security-group");
    sg.setPublicInAccount(true);
    sg.setSecurityRules(new HashSet<>());
    sg.setStatus(ResourceStatus.DEFAULT);
    return sg;
}
Also used : SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup)

Example 2 with SecurityGroup

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

the class SecurityGroupController method getPublic.

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

Example 3 with SecurityGroup

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

the class SecurityGroupController method getPublics.

@Override
public Set<SecurityGroupResponse> getPublics() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<SecurityGroup> securityGroups = securityGroupService.retrieveAccountSecurityGroups(user);
    return convert(securityGroups);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup)

Example 4 with SecurityGroup

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

the class SecurityGroupController method getPrivates.

@Override
public Set<SecurityGroupResponse> getPrivates() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<SecurityGroup> securityGroups = securityGroupService.retrievePrivateSecurityGroups(user);
    return convert(securityGroups);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup)

Example 5 with SecurityGroup

use of com.sequenceiq.cloudbreak.domain.SecurityGroup 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)

Aggregations

SecurityGroup (com.sequenceiq.cloudbreak.domain.SecurityGroup)16 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)4 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)2 InstanceGroup (com.sequenceiq.cloudbreak.domain.InstanceGroup)2 SecurityRule (com.sequenceiq.cloudbreak.domain.SecurityRule)2 Template (com.sequenceiq.cloudbreak.domain.Template)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 InstanceGroupParameterResponse (com.sequenceiq.cloudbreak.cloud.model.InstanceGroupParameterResponse)1 Json (com.sequenceiq.cloudbreak.domain.json.Json)1 Test (org.junit.Test)1 TypeDescriptor (org.springframework.core.convert.TypeDescriptor)1 AccessDeniedException (org.springframework.security.access.AccessDeniedException)1