use of org.apache.cloudstack.response.VolumeMetricsResponse in project cloudstack by apache.
the class MetricsServiceImpl method listVolumeMetrics.
@Override
public List<VolumeMetricsResponse> listVolumeMetrics(List<VolumeResponse> volumeResponses) {
final List<VolumeMetricsResponse> metricsResponses = new ArrayList<>();
for (final VolumeResponse volumeResponse : volumeResponses) {
VolumeMetricsResponse metricsResponse = new VolumeMetricsResponse();
try {
BeanUtils.copyProperties(metricsResponse, volumeResponse);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate volume metrics response");
}
metricsResponse.setDiskSizeGB(volumeResponse.getSize());
metricsResponse.setStorageType(volumeResponse.getStorageType(), volumeResponse.getVolumeType());
metricsResponses.add(metricsResponse);
}
return metricsResponses;
}
Aggregations