use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.network.GcpNetworkParameters in project cloudbreak by hortonworks.
the class FreeIpaGcpNetworkProvider method network.
@Override
public NetworkRequest network(EnvironmentDto environment, boolean multiAzRequired) {
NetworkRequest networkRequest = new NetworkRequest();
NetworkDto network = environment.getNetwork();
GcpParams gcpParams = network.getGcp();
GcpNetworkParameters gcpNetworkParameters = new GcpNetworkParameters();
gcpNetworkParameters.setNetworkId(gcpParams.getNetworkId());
gcpNetworkParameters.setNoFirewallRules(gcpParams.getNoFirewallRules());
gcpNetworkParameters.setNoPublicIp(gcpParams.getNoPublicIp());
gcpNetworkParameters.setSharedProjectId(gcpParams.getSharedProjectId());
gcpNetworkParameters.setSubnetId(network.getSubnetIds().iterator().next());
networkRequest.setGcp(gcpNetworkParameters);
networkRequest.setNetworkCidrs(collectNetworkCidrs(network));
return networkRequest;
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.network.GcpNetworkParameters in project cloudbreak by hortonworks.
the class FreeIpaTestDto method withNetwork.
private FreeIpaTestDto withNetwork(NetworkV4TestDto network) {
NetworkV4Request request = network.getRequest();
NetworkRequest networkRequest = new NetworkRequest();
if (request.getAws() != null) {
AwsNetworkParameters params = new AwsNetworkParameters();
if (!getCloudProvider().isMultiAZ()) {
params.setSubnetId(request.getAws().getSubnetId());
}
params.setVpcId(request.getAws().getVpcId());
networkRequest.setAws(params);
} else if (request.getMock() != null) {
MockNetworkParameters parameters = new MockNetworkParameters();
parameters.setSubnetId(request.getMock().getSubnetId());
parameters.setVpcId(request.getMock().getVpcId());
parameters.setInternetGatewayId(request.getMock().getInternetGatewayId());
networkRequest.setMock(parameters);
} else if (request.getGcp() != null) {
GcpNetworkParameters gcp = new GcpNetworkParameters();
gcp.setNetworkId(request.getGcp().getNetworkId());
if (!getCloudProvider().isMultiAZ()) {
gcp.setSubnetId(request.getGcp().getSubnetId());
}
gcp.setNoFirewallRules(request.getGcp().getNoFirewallRules());
gcp.setNoPublicIp(request.getGcp().getNoPublicIp());
gcp.setSharedProjectId(request.getGcp().getSharedProjectId());
networkRequest.setGcp(gcp);
} else if (request.getAzure() != null) {
AzureNetworkParameters azure = new AzureNetworkParameters();
azure.setNetworkId(request.getAzure().getNetworkId());
azure.setNoPublicIp(request.getAzure().getNoPublicIp());
azure.setSubnetId(request.getAzure().getSubnetId());
azure.setResourceGroupName(request.getAzure().getResourceGroupName());
networkRequest.setAzure(azure);
}
getRequest().setNetwork(networkRequest);
return this;
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.network.GcpNetworkParameters in project cloudbreak by hortonworks.
the class GcpCloudProvider method networkRequest.
@Override
public NetworkRequest networkRequest(FreeIpaTestDto dto) {
NetworkRequest networkRequest = new NetworkRequest();
GcpNetworkParameters networkParameters = new GcpNetworkParameters();
networkParameters.setSubnetId(getSubnetId());
networkParameters.setNetworkId(getNetworkId());
networkParameters.setNoPublicIp(getNoPublicIp());
networkParameters.setNoFirewallRules(getNoFirewallRules());
networkParameters.setSharedProjectId(getSharedProjectId());
networkRequest.setGcp(networkParameters);
return networkRequest;
}
Aggregations