use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeBricksActionParameters in project ovirt-engine by oVirt.
the class BackendGlusterBricksResource method add.
@Override
public Response add(GlusterBricks bricks) {
for (GlusterBrick brick : bricks.getGlusterBricks()) {
validateParameters(brick, "serverId", "brickDir");
}
List<GlusterBrickEntity> brickEntities = mapBricks(asGuid(getVolumeId()), bricks);
int replicaCount = ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, REPLICA_COUNT, 0, 0);
int stripeCount = ParametersHelper.getIntegerParameter(httpHeaders, uriInfo, STRIPE_COUNT, 0, 0);
return performCreationMultiple(ActionType.AddBricksToGlusterVolume, new GlusterVolumeBricksActionParameters(asGuid(getVolumeId()), brickEntities, replicaCount, stripeCount, isForce()), new QueryIdResolver<>(QueryType.GetGlusterBrickById, IdQueryParameters.class));
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeBricksActionParameters in project ovirt-engine by oVirt.
the class VolumeBrickListModel method onAddBricksInternal.
private void onAddBricksInternal() {
cancelConfirmation();
VolumeBrickModel volumeBrickModel = (VolumeBrickModel) getWindow();
GlusterVolumeEntity volumeEntity = getEntity();
ArrayList<GlusterBrickEntity> brickList = new ArrayList<>();
for (Object model : volumeBrickModel.getBricks().getItems()) {
GlusterBrickEntity brickEntity = (GlusterBrickEntity) ((EntityModel) model).getEntity();
brickEntity.setVolumeId(volumeEntity.getId());
brickList.add(brickEntity);
}
volumeBrickModel.startProgress();
GlusterVolumeBricksActionParameters parameter = new GlusterVolumeBricksActionParameters(volumeEntity.getId(), brickList, volumeBrickModel.getReplicaCountValue(), volumeBrickModel.getStripeCountValue(), volumeBrickModel.getForce().getEntity());
Frontend.getInstance().runAction(ActionType.AddBricksToGlusterVolume, parameter, result -> {
VolumeBrickListModel localModel = (VolumeBrickListModel) result.getState();
localModel.postOnAddBricks(result.getReturnValue());
}, this);
}
Aggregations