use of com.sequenceiq.distrox.api.v1.distrox.model.network.aws.AwsNetworkV1Parameters in project cloudbreak by hortonworks.
the class NetworkV1ToNetworkV4Converter method convertToAwsNetworkV1Parameters.
private AwsNetworkV1Parameters convertToAwsNetworkV1Parameters(AwsNetworkV4Parameters source) {
AwsNetworkV1Parameters response = new AwsNetworkV1Parameters();
response.setSubnetId(source.getSubnetId());
return response;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.network.aws.AwsNetworkV1Parameters in project cloudbreak by hortonworks.
the class DistroXV1RequestToStackV4RequestConverter method getNetwork.
NetworkV4Request getNetwork(NetworkV1Request networkRequest, DetailedEnvironmentResponse environment, Set<InstanceGroupV1Request> instanceGroupRequests) {
Set<String> subnetIds = new HashSet<>();
if (instanceGroupRequests != null) {
subnetIds.addAll(instanceGroupRequests.stream().map(ig -> Optional.ofNullable(ig.getNetwork()).map(InstanceGroupNetworkV1Base::getAws).map(InstanceGroupAwsNetworkV1Parameters::getSubnetIds).orElseGet(ArrayList::new)).flatMap(Collection::stream).collect(Collectors.toSet()));
}
if (subnetIds.size() == 1) {
String subnetId = subnetIds.stream().findFirst().get();
LOGGER.info("Update the global subnet id to {}, because it is configured in instance group level as the new way", subnetId);
if (networkRequest == null) {
networkRequest = new NetworkV1Request();
}
if (networkRequest.getAws() == null) {
networkRequest.setAws(new AwsNetworkV1Parameters());
}
networkRequest.getAws().setSubnetId(subnetId);
} else {
LOGGER.info("Use the legacy way to configure the global network.");
}
NetworkV4Request network = getIfNotNull(new ImmutablePair<>(networkRequest, environment), networkConverter::convertToNetworkV4Request);
validateSubnetIds(network, environment);
return network;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.network.aws.AwsNetworkV1Parameters in project cloudbreak by hortonworks.
the class AwsCloudProvider method distroXNetworkParameters.
private AwsNetworkV1Parameters distroXNetworkParameters() {
AwsNetworkV1Parameters params = new AwsNetworkV1Parameters();
params.setSubnetId(getSubnetId());
return params;
}
Aggregations