use of com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.VolumeParameterConfigV4Response in project cloudbreak by hortonworks.
the class VmTypeToVmTypeV4ResponseConverter method convert.
public VmTypeV4Response convert(VmType source) {
VmTypeV4Response vmTypeV4Response = new VmTypeV4Response();
List<VolumeParameterConfigV4Response> 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);
vmTypeV4Response.setVmTypeMetaJson(vmTypeMetaJson);
vmTypeV4Response.setValue(source.value());
return vmTypeV4Response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.VolumeParameterConfigV4Response in project cloudbreak by hortonworks.
the class VmTypeToVmTypeV4ResponseConverter method convertVolumeConfig.
private void convertVolumeConfig(Collection<VolumeParameterConfigV4Response> configs, VolumeParameterConfig source) {
if (source != null) {
VolumeParameterConfigV4Response config = new VolumeParameterConfigV4Response();
config.setMaximumNumber(source.maximumNumber());
config.setMaximumSize(source.maximumSize());
config.setMinimumNumber(source.minimumNumber());
config.setMinimumSize(source.minimumSize());
config.setVolumeParameterType(source.volumeParameterType().name());
configs.add(config);
}
}
Aggregations