use of com.sequenceiq.cloudbreak.cloud.NetworkConnector in project cloudbreak by hortonworks.
the class SubnetChooserService method chooseSubnetForPrivateEndpoint.
public List<CloudSubnet> chooseSubnetForPrivateEndpoint(Collection<CloudSubnet> subnetMetas, DBStack dbStack, boolean existingNetwork) {
NetworkConnector networkConnector = cloudPlatformConnectors.get(new CloudPlatformVariant(dbStack.getCloudPlatform(), dbStack.getPlatformVariant())).networkConnector();
List<CloudSubnet> suitableCloudSubnets = networkConnector.chooseSubnetsForPrivateEndpoint(subnetMetas, existingNetwork).getResult();
LOGGER.debug("Subnets suitable for private endpoint: {}", suitableCloudSubnets);
return suitableCloudSubnets;
}
use of com.sequenceiq.cloudbreak.cloud.NetworkConnector in project cloudbreak by hortonworks.
the class SubnetChooserService method chooseSubnets.
public List<CloudSubnet> chooseSubnets(List<CloudSubnet> subnetMetas, CloudPlatform cloudPlatform, DBStack dbStack) {
NetworkConnector networkConnector = cloudPlatformConnectors.get(new CloudPlatformVariant(dbStack.getCloudPlatform(), dbStack.getPlatformVariant())).networkConnector();
SubnetSelectionParameters build = SubnetSelectionParameters.builder().withHa(dbStack.isHa()).withPreferPrivateIfExist().build();
SubnetSelectionResult subnetSelectionResult = networkConnector.chooseSubnets(subnetMetas, build);
if (subnetSelectionResult.hasError()) {
throw new BadRequestException(subnetSelectionResult.getErrorMessage());
}
return subnetSelectionResult.getResult();
}
use of com.sequenceiq.cloudbreak.cloud.NetworkConnector in project cloudbreak by hortonworks.
the class EnvironmentNetworkService method createCloudNetwork.
public BaseNetwork createCloudNetwork(EnvironmentDto environment, BaseNetwork baseNetwork) {
NetworkConnector networkConnector = getNetworkConnector(environment.getCloudPlatform());
NetworkCreationRequest networkCreationRequest = networkCreationRequestFactory.create(environment);
EnvironmentNetworkConverter converter = environmentNetworkConverterMap.get(getCloudPlatform(environment));
CreatedCloudNetwork createdCloudNetwork = networkConnector.createNetworkWithSubnets(networkCreationRequest);
return converter.setCreatedCloudNetwork(baseNetwork, createdCloudNetwork);
}
use of com.sequenceiq.cloudbreak.cloud.NetworkConnector in project cloudbreak by hortonworks.
the class EnvironmentNetworkService method getNetworkCidr.
public NetworkCidr getNetworkCidr(Network network, String cloudPlatform, Credential credential) {
if (network == null) {
LOGGER.info("Could not fetch network cidr from {}, because the network is null", cloudPlatform);
return null;
}
NetworkConnector networkConnector = getNetworkConnector(cloudPlatform);
CloudCredential cloudCredential = credentialToCloudCredentialConverter.convert(credential);
return networkConnector.getNetworkCidr(network, cloudCredential);
}
use of com.sequenceiq.cloudbreak.cloud.NetworkConnector in project cloudbreak by hortonworks.
the class EnvironmentNetworkService method createProviderSpecificNetworkResources.
public void createProviderSpecificNetworkResources(EnvironmentDto environment, BaseNetwork baseNetwork) {
NetworkConnector networkConnector = getNetworkConnector(environment.getCloudPlatform());
NetworkResourcesCreationRequest networkResourcesCreationRequest = networkCreationRequestFactory.createProviderSpecificNetworkResources(environment, baseNetwork);
networkConnector.createProviderSpecificNetworkResources(networkResourcesCreationRequest);
}
Aggregations