Search in sources :

Example 1 with StorageDomainParametersBase

use of org.ovirt.engine.core.common.action.StorageDomainParametersBase in project ovirt-engine by oVirt.

the class StorageListModel method updateOvfs.

private void updateOvfs() {
    StorageDomain storage = getSelectedItem();
    if (storage != null) {
        StorageDomainParametersBase params = new StorageDomainParametersBase(storage.getId());
        Frontend.getInstance().runAction(ActionType.UpdateOvfStoreForStorageDomain, params, null, this);
    }
    cancel();
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase)

Example 2 with StorageDomainParametersBase

use of org.ovirt.engine.core.common.action.StorageDomainParametersBase in project ovirt-engine by oVirt.

the class BackendStorageDomainResource method remove.

@Override
public Response remove() {
    boolean destroy = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, DESTROY, true, false);
    get();
    if (destroy) {
        StorageDomainParametersBase parameters = new StorageDomainParametersBase(guid);
        return performAction(ActionType.ForceRemoveStorageDomain, parameters);
    } else {
        String host = ParametersHelper.getParameter(httpHeaders, uriInfo, HOST);
        if (host == null) {
            Fault fault = new Fault();
            fault.setReason("host parameter is missing");
            throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity(fault).build());
        }
        boolean format = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, FORMAT, true, false);
        Guid hostId = getHostId(host);
        RemoveStorageDomainParameters parameters = new RemoveStorageDomainParameters(guid);
        parameters.setVdsId(hostId);
        parameters.setDoFormat(format);
        return performAction(ActionType.RemoveStorageDomain, parameters);
    }
}
Also used : RemoveStorageDomainParameters(org.ovirt.engine.core.common.action.RemoveStorageDomainParameters) WebApplicationException(javax.ws.rs.WebApplicationException) Fault(org.ovirt.engine.api.model.Fault) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase) Guid(org.ovirt.engine.core.compat.Guid)

Example 3 with StorageDomainParametersBase

use of org.ovirt.engine.core.common.action.StorageDomainParametersBase in project ovirt-engine by oVirt.

the class DeactivateStorageDomainWithOvfUpdateCommand method createUpdateOvfStoreParams.

private StorageDomainParametersBase createUpdateOvfStoreParams() {
    StorageDomainParametersBase params = new StorageDomainParametersBase(getStorageDomainId());
    params.setParentCommand(getActionType());
    params.setParentParameters(getParameters());
    params.setEndProcedure(EndProcedure.COMMAND_MANAGED);
    return params;
}
Also used : StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase)

Example 4 with StorageDomainParametersBase

use of org.ovirt.engine.core.common.action.StorageDomainParametersBase in project ovirt-engine by oVirt.

the class StorageListModel method onDestroy.

private void onDestroy() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.validate()) {
        return;
    }
    StorageDomain storageDomain = getSelectedItem();
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.ForceRemoveStorageDomain, new ArrayList<>(Arrays.asList(new ActionParametersBase[] { new StorageDomainParametersBase(storageDomain.getId()) })), result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase)

Aggregations

StorageDomainParametersBase (org.ovirt.engine.core.common.action.StorageDomainParametersBase)4 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 Fault (org.ovirt.engine.api.model.Fault)1 RemoveStorageDomainParameters (org.ovirt.engine.core.common.action.RemoveStorageDomainParameters)1 Guid (org.ovirt.engine.core.compat.Guid)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1