use of com.sequenceiq.cloudbreak.cloud.model.network.NetworkSubnetRequest in project cloudbreak by hortonworks.
the class AzureSubnetRequestProvider method getSubnetRequest.
private SubnetRequest getSubnetRequest(String region, NetworkSubnetRequest networkSubnetRequest) {
SubnetRequest subnetRequest = new SubnetRequest();
subnetRequest.setPublicSubnetCidr(networkSubnetRequest.getCidr());
subnetRequest.setType(networkSubnetRequest.getType());
subnetRequest.setAvailabilityZone(region);
return subnetRequest;
}
use of com.sequenceiq.cloudbreak.cloud.model.network.NetworkSubnetRequest in project cloudbreak by hortonworks.
the class AzureSubnetRequestProvider method provide.
public List<SubnetRequest> provide(String region, List<NetworkSubnetRequest> publicSubnets, List<NetworkSubnetRequest> privateSubnets, boolean privateSubnetEnabled) {
List<SubnetRequest> subnets = new ArrayList<>();
int index = 0;
for (int i = 0; i < publicSubnets.size(); i++) {
NetworkSubnetRequest networkSubnetRequest = publicSubnets.get(i);
SubnetRequest subnetRequest = getSubnetRequest(region, networkSubnetRequest);
subnetRequest.setSubnetGroup(i % publicSubnets.size());
subnetRequest.setIndex(index++);
subnets.add(subnetRequest);
}
if (privateSubnetEnabled) {
for (int i = 0; i < privateSubnets.size(); i++) {
NetworkSubnetRequest networkSubnetRequest = privateSubnets.get(i);
SubnetRequest subnetRequest = getSubnetRequest(region, networkSubnetRequest);
subnetRequest.setSubnetGroup(i % publicSubnets.size());
subnetRequest.setIndex(index++);
subnets.add(subnetRequest);
}
}
return subnets;
}
Aggregations