use of org.ovirt.engine.api.restapi.resource.BrickStatisticalQuery in project ovirt-engine by oVirt.
the class BackendGlusterBrickResource method getStatisticsResource.
@Override
public StatisticsResource getStatisticsResource() {
EntityIdResolver<Guid> resolver = new QueryIdResolver<Guid>(QueryType.GetGlusterBrickById, IdQueryParameters.class) {
@Override
public GlusterBrickEntity lookupEntity(Guid id) throws BackendFailureException {
GlusterBrickEntity brickEntity = getEntity(GlusterBrickEntity.class, QueryType.GetGlusterBrickById, new IdQueryParameters(id), null, true);
GlusterVolumeEntity volumeEntity = getEntity(GlusterVolumeEntity.class, QueryType.GetGlusterVolumeById, new IdQueryParameters(brickEntity.getVolumeId()), null, true);
GlusterVolumeAdvancedDetails detailsEntity = getEntity(GlusterVolumeAdvancedDetails.class, QueryType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsParameters(volumeEntity.getClusterId(), volumeEntity.getId(), brickEntity.getId(), true), null, true);
brickEntity.setBrickDetails(detailsEntity.getBrickDetails().get(0));
return brickEntity;
}
};
BrickStatisticalQuery query = new BrickStatisticalQuery(resolver, newModel(id));
return inject(new BackendStatisticsResource<>(GlusterBrickEntity.class, guid, query));
}
Aggregations