use of com.sequenceiq.cloudbreak.api.model.VolumeParameterConfigJson in project cloudbreak by hortonworks.
the class VmTypeToVmTypeJsonConverter method convertVolumeConfig.
private void convertVolumeConfig(Collection<VolumeParameterConfigJson> configs, VolumeParameterConfig source) {
if (source != null) {
VolumeParameterConfigJson config = new VolumeParameterConfigJson();
config.setMaximumNumber(source.maximumNumber());
config.setMaximumSize(source.maximumSize());
config.setMinimumNumber(source.minimumNumber());
config.setMinimumSize(source.minimumSize());
config.setVolumeParameterType(source.volumeParameterType().name());
configs.add(config);
}
}
use of com.sequenceiq.cloudbreak.api.model.VolumeParameterConfigJson 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;
}
Aggregations