Search in sources :

Example 1 with VmTypeMetaJson

use of com.sequenceiq.cloudbreak.api.model.VmTypeMetaJson in project cloudbreak by hortonworks.

the class VmTypeToVmTypeJsonConverter method convert.

@Override
public VmTypeJson convert(VmType source) {
    VmTypeJson vmTypeJson = new VmTypeJson();
    if (source != null) {
        List<VolumeParameterConfigJson> configs = new ArrayList<>();
        convertVolumeConfig(configs, source.getMetaData().getAutoAttachedConfig());
        convertVolumeConfig(configs, source.getMetaData().getEphemeralConfig());
        convertVolumeConfig(configs, source.getMetaData().getMagneticConfig());
        convertVolumeConfig(configs, source.getMetaData().getSsdConfig());
        convertVolumeConfig(configs, source.getMetaData().getSt1Config());
        VmTypeMetaJson vmTypeMetaJson = new VmTypeMetaJson();
        vmTypeMetaJson.setProperties(source.getMetaData().getProperties());
        vmTypeMetaJson.setConfigs(configs);
        vmTypeJson.setVmTypeMetaJson(vmTypeMetaJson);
        vmTypeJson.setValue(source.value());
    }
    return vmTypeJson;
}
Also used : VmTypeMetaJson(com.sequenceiq.cloudbreak.api.model.VmTypeMetaJson) VolumeParameterConfigJson(com.sequenceiq.cloudbreak.api.model.VolumeParameterConfigJson) ArrayList(java.util.ArrayList) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson)

Aggregations

VmTypeJson (com.sequenceiq.cloudbreak.api.model.VmTypeJson)1 VmTypeMetaJson (com.sequenceiq.cloudbreak.api.model.VmTypeMetaJson)1 VolumeParameterConfigJson (com.sequenceiq.cloudbreak.api.model.VolumeParameterConfigJson)1 ArrayList (java.util.ArrayList)1