Search in sources :

Example 26 with Platform

use of com.sequenceiq.cloudbreak.cloud.model.Platform in project cloudbreak by hortonworks.

the class PlatformImagesToPlatformImagesJsonConverter method convert.

@Override
public PlatformImagesJson convert(PlatformImages source) {
    PlatformImagesJson json = new PlatformImagesJson();
    Map<String, Map<String, String>> images = new HashMap<>();
    for (Entry<Platform, Collection<CustomImage>> platformCollectionEntry : source.getImages().entrySet()) {
        Map<String, String> tmp = new HashMap<>();
        for (CustomImage customImage : platformCollectionEntry.getValue()) {
            tmp.put(customImage.value(), customImage.getImage());
        }
        images.put(platformCollectionEntry.getKey().value(), tmp);
    }
    Map<String, String> regex = new HashMap<>();
    for (Entry<Platform, String> platformStringEntry : source.getRegex().entrySet()) {
        regex.put(platformStringEntry.getKey().value(), platformStringEntry.getValue());
    }
    json.setImages(images);
    json.setImagesRegex(regex);
    return json;
}
Also used : Platform(com.sequenceiq.cloudbreak.cloud.model.Platform) HashMap(java.util.HashMap) PlatformImagesJson(com.sequenceiq.cloudbreak.api.model.PlatformImagesJson) CustomImage(com.sequenceiq.cloudbreak.cloud.model.CustomImage) Collection(java.util.Collection) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

Platform (com.sequenceiq.cloudbreak.cloud.model.Platform)26 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)7 ResourceBuilderContext (com.sequenceiq.cloudbreak.cloud.template.context.ResourceBuilderContext)7 Map (java.util.Map)7 PlatformDisks (com.sequenceiq.cloudbreak.cloud.model.PlatformDisks)6 HashMap (java.util.HashMap)6 CloudVmTypes (com.sequenceiq.cloudbreak.cloud.model.CloudVmTypes)5 Collection (java.util.Collection)5 PlatformParameters (com.sequenceiq.cloudbreak.cloud.PlatformParameters)4 CloudResourceStatus (com.sequenceiq.cloudbreak.cloud.model.CloudResourceStatus)4 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)4 Set (java.util.Set)4 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)3 Maps.newHashMap (com.google.common.collect.Maps.newHashMap)2 SpecialParameters (com.sequenceiq.cloudbreak.api.model.SpecialParameters)2 SpecialParametersJson (com.sequenceiq.cloudbreak.api.model.SpecialParametersJson)2 DiskType (com.sequenceiq.cloudbreak.cloud.model.DiskType)2 DiskTypes (com.sequenceiq.cloudbreak.cloud.model.DiskTypes)2 PlatformOrchestrators (com.sequenceiq.cloudbreak.cloud.model.PlatformOrchestrators)2 Region (com.sequenceiq.cloudbreak.cloud.model.Region)2