Search in sources :

Example 1 with SecurityAccessRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest in project cloudbreak by hortonworks.

the class EnvironmentApiConverterTest method createSecurityAccessRequest.

private SecurityAccessRequest createSecurityAccessRequest() {
    SecurityAccessRequest securityAccessRequest = new SecurityAccessRequest();
    securityAccessRequest.setCidr("1.1.1.1/16");
    securityAccessRequest.setDefaultSecurityGroupId("default-security-group");
    securityAccessRequest.setSecurityGroupIdForKnox("knox-security-group");
    return securityAccessRequest;
}
Also used : SecurityAccessRequest(com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest)

Example 2 with SecurityAccessRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest in project cloudbreak by hortonworks.

the class EnvironmentChangeSecurityAccessAction method cloneSecurityAccessRequest.

private SecurityAccessRequest cloneSecurityAccessRequest(SecurityAccessRequest securityAccess) {
    SecurityAccessRequest securityAccessRequest = new SecurityAccessRequest();
    securityAccessRequest.setDefaultSecurityGroupId(securityAccess.getDefaultSecurityGroupId());
    securityAccessRequest.setSecurityGroupIdForKnox(securityAccess.getSecurityGroupIdForKnox());
    securityAccessRequest.setCidr(securityAccess.getCidr());
    return securityAccessRequest;
}
Also used : SecurityAccessRequest(com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest)

Example 3 with SecurityAccessRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest in project cloudbreak by hortonworks.

the class EnvironmentChangeSecurityAccessAction method action.

@Override
public EnvironmentTestDto action(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient environmentClient) throws Exception {
    EnvironmentEditRequest request = new EnvironmentEditRequest();
    SecurityAccessRequest securityAccess = testDto.getRequest().getSecurityAccess();
    SecurityAccessRequest clone = cloneSecurityAccessRequest(securityAccess);
    request.setSecurityAccess(clone);
    testDto.setResponse(environmentClient.getDefaultClient().environmentV1Endpoint().editByCrn(testDto.getResponse().getCrn(), request));
    Log.when(LOGGER, "Environment edit authentication action posted");
    return testDto;
}
Also used : SecurityAccessRequest(com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest) EnvironmentEditRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentEditRequest)

Example 4 with SecurityAccessRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest in project cloudbreak by hortonworks.

the class EnvironmentTestDto method withDefaultSecurityGroup.

public EnvironmentTestDto withDefaultSecurityGroup(String securityGroup) {
    if (getRequest().getSecurityAccess() == null) {
        getRequest().setSecurityAccess(new SecurityAccessRequest());
    }
    getRequest().getSecurityAccess().setDefaultSecurityGroupId(securityGroup);
    getRequest().getSecurityAccess().setSecurityGroupIdForKnox(securityGroup);
    return this;
}
Also used : SecurityAccessRequest(com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest)

Example 5 with SecurityAccessRequest

use of com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest in project cloudbreak by hortonworks.

the class GcpCloudProvider method environment.

@Override
public EnvironmentTestDto environment(EnvironmentTestDto environment) {
    SecurityAccessRequest securityAccessRequest = new SecurityAccessRequest();
    EnvironmentTestDto result = super.environment(environment);
    if (StringUtils.isNotBlank(gcpProperties.getSecurityAccess().getDefaultSecurityGroup())) {
        securityAccessRequest.setDefaultSecurityGroupId(gcpProperties.getSecurityAccess().getDefaultSecurityGroup());
        result.withSecurityAccess(securityAccessRequest);
    }
    if (StringUtils.isNotBlank(gcpProperties.getSecurityAccess().getKnoxSecurityGroup())) {
        securityAccessRequest.setSecurityGroupIdForKnox(gcpProperties.getSecurityAccess().getKnoxSecurityGroup());
        result.withSecurityAccess(securityAccessRequest);
    }
    return result;
}
Also used : EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) SecurityAccessRequest(com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest)

Aggregations

SecurityAccessRequest (com.sequenceiq.environment.api.v1.environment.model.request.SecurityAccessRequest)5 EnvironmentEditRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentEditRequest)1 EnvironmentTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto)1