Search in sources :

Example 1 with VolumeParameterConfigResponse

use of com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse in project cloudbreak by hortonworks.

the class VmTypeToVmTypeV1ResponseConverter method convert.

public VmTypeResponse convert(VmType source) {
    VmTypeResponse vmTypeResponse = new VmTypeResponse();
    List<VolumeParameterConfigResponse> 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);
    vmTypeResponse.setVmTypeMetaJson(vmTypeMetaJson);
    vmTypeResponse.setValue(source.value());
    return vmTypeResponse;
}
Also used : VmTypeResponse(com.sequenceiq.environment.api.v1.platformresource.model.VmTypeResponse) VolumeParameterConfigResponse(com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse) VmTypeMetaJson(com.sequenceiq.environment.api.v1.platformresource.model.VmTypeMetaJson) ArrayList(java.util.ArrayList)

Example 2 with VolumeParameterConfigResponse

use of com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse in project cloudbreak by hortonworks.

the class VmTypeToVmTypeV1ResponseConverter method convertVolumeConfig.

private void convertVolumeConfig(Collection<VolumeParameterConfigResponse> configs, VolumeParameterConfig source) {
    if (source != null) {
        VolumeParameterConfigResponse config = new VolumeParameterConfigResponse();
        config.setMaximumNumber(source.maximumNumber());
        config.setMaximumSize(source.maximumSize());
        config.setMinimumNumber(source.minimumNumber());
        config.setMinimumSize(source.minimumSize());
        config.setVolumeParameterType(source.volumeParameterType().name());
        configs.add(config);
    }
}
Also used : VolumeParameterConfigResponse(com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse)

Aggregations

VolumeParameterConfigResponse (com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse)2 VmTypeMetaJson (com.sequenceiq.environment.api.v1.platformresource.model.VmTypeMetaJson)1 VmTypeResponse (com.sequenceiq.environment.api.v1.platformresource.model.VmTypeResponse)1 ArrayList (java.util.ArrayList)1