use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper in project cloudbreak by hortonworks.
the class LoadBalancerConfigConverter method buildGcpConfig.
private TargetGroupConfigDbWrapper buildGcpConfig(GcpLoadBalancerMetadataView gcpMetadata, TargetGroup targetGroup) {
Set<Integer> trafficPorts = getTrafficPorts(targetGroup);
TargetGroupConfigDbWrapper targetGroupConfigDbWrapper = new TargetGroupConfigDbWrapper();
GcpTargetGroupConfigDb gcpTargetGroupConfigDb = new GcpTargetGroupConfigDb();
for (Integer port : trafficPorts) {
GcpLoadBalancerNamesDb namesDb = new GcpLoadBalancerNamesDb();
namesDb.setInstanceGroupName(gcpMetadata.getInstanceGroupByPort(port));
namesDb.setBackendServiceName(gcpMetadata.getBackendServiceByPort(port));
gcpTargetGroupConfigDb.addPortNameMapping(port, namesDb);
}
targetGroupConfigDbWrapper.setGcpConfig(gcpTargetGroupConfigDb);
return targetGroupConfigDbWrapper;
}
use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper in project cloudbreak by hortonworks.
the class LoadBalancerToLoadBalancerResponseConverterTest method creatGcpTargetGroups.
private Set<TargetGroup> creatGcpTargetGroups() {
GcpTargetGroupConfigDb gcpTargetGroupConfigDb = new GcpTargetGroupConfigDb();
GcpLoadBalancerNamesDb gcpLoadBalancerNamesDb = new GcpLoadBalancerNamesDb();
gcpLoadBalancerNamesDb.setBackendServiceName(GCP_BACKEND_SERVICE_NAME);
gcpLoadBalancerNamesDb.setInstanceGroupName(GCP_INSTANCE_GROUP_NAME);
gcpTargetGroupConfigDb.addPortNameMapping(PORT, gcpLoadBalancerNamesDb);
TargetGroupConfigDbWrapper targetGroupConfigDbWrapper = new TargetGroupConfigDbWrapper();
targetGroupConfigDbWrapper.setGcpConfig(gcpTargetGroupConfigDb);
TargetGroup targetGroup = new TargetGroup();
targetGroup.setProviderConfig(targetGroupConfigDbWrapper);
return Set.of(targetGroup);
}
use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper in project cloudbreak by hortonworks.
the class LoadBalancerToLoadBalancerResponseConverterTest method createAzureTargetGroups.
private Set<TargetGroup> createAzureTargetGroups() {
AzureTargetGroupConfigDb azureTargetGroupConfigDb = new AzureTargetGroupConfigDb();
azureTargetGroupConfigDb.setPortAvailabilitySetMapping(Map.of(PORT, List.of(AZURE_AS_NAME)));
TargetGroupConfigDbWrapper targetGroupConfigDbWrapper = new TargetGroupConfigDbWrapper();
targetGroupConfigDbWrapper.setAzureConfig(azureTargetGroupConfigDb);
TargetGroup targetGroup = new TargetGroup();
targetGroup.setProviderConfig(targetGroupConfigDbWrapper);
return Set.of(targetGroup);
}
Aggregations