use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceGroupV4Base in project cloudbreak by hortonworks.
the class SdxService method getInstanceGroupNamesBySdxDetails.
public Set<String> getInstanceGroupNamesBySdxDetails(SdxClusterShape clusterShape, String runtimeVersion, String cloudPlatform) {
if (clusterShape == null || StringUtils.isAnyBlank(runtimeVersion, cloudPlatform)) {
throw new BadRequestException("The following query params needs to be filled for this request: clusterShape, runtimeVersion, cloudPlatform");
}
Set<String> result = new HashSet<>();
StackV4Request stackV4Request = cdpConfigService.getConfigForKey(new CDPConfigKey(CloudPlatform.valueOf(cloudPlatform), clusterShape, runtimeVersion));
if (stackV4Request != null && CollectionUtils.isNotEmpty(stackV4Request.getInstanceGroups())) {
result = stackV4Request.getInstanceGroups().stream().map(InstanceGroupV4Base::getName).collect(Collectors.toSet());
}
return result;
}
Aggregations