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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations