use of com.sequenceiq.cloudbreak.cloud.model.PlatformRegions in project cloudbreak by hortonworks.
the class PlatformParameterV1Controller method getPlatforms.
@Override
public Map<String, Object> getPlatforms(Boolean extended) {
PlatformVariants pv = cloudParameterService.getPlatformVariants();
PlatformDisks diskTypes = cloudParameterService.getDiskTypes();
PlatformRegions regions = cloudParameterService.getRegions();
PlatformVirtualMachines vmtypes = new PlatformVirtualMachines();
PlatformOrchestrators orchestrators = cloudParameterService.getOrchestrators();
Map<Platform, PlatformParameters> platformParameters = cloudParameterService.getPlatformParameters();
SpecialParameters specialParameters = cloudParameterService.getSpecialParameters();
Map<String, Object> map = new HashMap<>();
map.put("variants", conversionService.convert(pv, PlatformVariantsJson.class));
map.put("disks", conversionService.convert(diskTypes, PlatformDisksJson.class));
map.put("regions", conversionService.convert(regions, PlatformRegionsJson.class));
map.put("virtualMachines", conversionService.convert(vmtypes, PlatformVirtualMachinesJson.class));
map.put("orchestrators", conversionService.convert(orchestrators, PlatformOrchestratorsJson.class));
map.put("tagspecifications", conversionService.convert(platformParameters, TagSpecificationsJson.class));
Map<String, Boolean> globalParameters = conversionService.convert(specialParameters, Map.class);
Map<String, Map<String, Boolean>> platformSpecificParameters = conversionService.convert(platformParameters, Map.class);
SpecialParametersJson specialParametersJson = new SpecialParametersJson();
specialParametersJson.setSpecialParameters(globalParameters);
specialParametersJson.setPlatformSpecificSpecialParameters(platformSpecificParameters);
map.put("specialParameters", specialParametersJson);
return map;
}
use of com.sequenceiq.cloudbreak.cloud.model.PlatformRegions in project cloudbreak by hortonworks.
the class PlatformParameterV1Controller method getRegionRByType.
@Override
public Collection<String> getRegionRByType(String type) {
PlatformRegions pv = cloudParameterService.getRegions();
Collection<String> regions = conversionService.convert(pv, PlatformRegionsJson.class).getRegions().get(type.toUpperCase());
return regions == null ? new ArrayList<>() : regions;
}
use of com.sequenceiq.cloudbreak.cloud.model.PlatformRegions in project cloudbreak by hortonworks.
the class PlatformParameterV1Controller method getRegionAvByType.
@Override
public Map<String, Collection<String>> getRegionAvByType(String type) {
PlatformRegions pv = cloudParameterService.getRegions();
Map<String, Collection<String>> azs = conversionService.convert(pv, PlatformRegionsJson.class).getAvailabilityZones().get(type.toUpperCase());
return azs == null ? new HashMap<>() : azs;
}
Aggregations