Search in sources :

Example 1 with VmTypeMetaJson

use of com.sequenceiq.environment.api.v1.platformresource.model.VmTypeMetaJson 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 VmTypeMetaJson

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

the class SdxRecommendationServiceTest method createVmTypeMetaJson.

private VmTypeMetaJson createVmTypeMetaJson(Integer cpu, Float memory) {
    VmTypeMetaJson vmTypeMetaJson = new VmTypeMetaJson();
    Map<String, Object> properties = new HashMap<>();
    properties.put("Cpu", cpu);
    properties.put("Memory", memory);
    vmTypeMetaJson.setProperties(properties);
    return vmTypeMetaJson;
}
Also used : VmTypeMetaJson(com.sequenceiq.environment.api.v1.platformresource.model.VmTypeMetaJson) HashMap(java.util.HashMap) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString)

Aggregations

VmTypeMetaJson (com.sequenceiq.environment.api.v1.platformresource.model.VmTypeMetaJson)2 VmTypeResponse (com.sequenceiq.environment.api.v1.platformresource.model.VmTypeResponse)1 VolumeParameterConfigResponse (com.sequenceiq.environment.api.v1.platformresource.model.VolumeParameterConfigResponse)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1