Search in sources :

Example 1 with GlusterVolumeAdvancedDetailsParameters

use of org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters 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));
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterVolumeAdvancedDetails(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails) GlusterVolumeAdvancedDetailsParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters) BrickStatisticalQuery(org.ovirt.engine.api.restapi.resource.BrickStatisticalQuery) Guid(org.ovirt.engine.core.compat.Guid)

Example 2 with GlusterVolumeAdvancedDetailsParameters

use of org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters in project ovirt-engine by oVirt.

the class BackendGlusterBricksResource method populateAdvancedDetails.

protected GlusterBrick populateAdvancedDetails(GlusterBrick model, GlusterBrickEntity entity) {
    GlusterVolumeEntity volumeEntity = getEntity(GlusterVolumeEntity.class, QueryType.GetGlusterVolumeById, new IdQueryParameters(entity.getVolumeId()), null, true);
    GlusterVolumeAdvancedDetails detailsEntity = getEntity(GlusterVolumeAdvancedDetails.class, QueryType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsParameters(volumeEntity.getClusterId(), volumeEntity.getId(), entity.getId(), true), null, true);
    model = getMapper(GlusterVolumeAdvancedDetails.class, GlusterBrick.class).map(detailsEntity, model);
    return model;
}
Also used : IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterVolumeAdvancedDetails(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails) GlusterVolumeAdvancedDetailsParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters)

Example 3 with GlusterVolumeAdvancedDetailsParameters

use of org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getClusterGlusterServices.

public void getClusterGlusterServices(AsyncQuery<GlusterVolumeAdvancedDetails> aQuery, Guid clusterId) {
    aQuery.converterCallback = new CastingConverter<>();
    // Passing empty values for Volume and Brick to get the services of all the volumes/hosts in the cluster
    GlusterVolumeAdvancedDetailsParameters parameters = // $NON-NLS-1$ //$NON-NLS-2$
    new GlusterVolumeAdvancedDetailsParameters(clusterId, null, null, false);
    Frontend.getInstance().runQuery(QueryType.GetGlusterVolumeAdvancedDetails, parameters, aQuery);
}
Also used : GlusterVolumeAdvancedDetailsParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters)

Example 4 with GlusterVolumeAdvancedDetailsParameters

use of org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getGlusterVolumeBrickDetails.

public void getGlusterVolumeBrickDetails(AsyncQuery aQuery, Guid clusterId, Guid volumeId, Guid brickId) {
    GlusterVolumeAdvancedDetailsParameters parameters = new GlusterVolumeAdvancedDetailsParameters(clusterId, volumeId, brickId, true);
    Frontend.getInstance().runQuery(QueryType.GetGlusterVolumeAdvancedDetails, parameters, aQuery);
}
Also used : GlusterVolumeAdvancedDetailsParameters(org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters)

Aggregations

GlusterVolumeAdvancedDetailsParameters (org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters)4 GlusterVolumeAdvancedDetails (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 BrickStatisticalQuery (org.ovirt.engine.api.restapi.resource.BrickStatisticalQuery)1 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)1 Guid (org.ovirt.engine.core.compat.Guid)1