Search in sources :

Example 1 with ExternalSubnetParameters

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

the class BackendOpenStackSubnetResource method remove.

@Override
public Response remove() {
    ExternalSubnet subnet = lookupSubnetById(id);
    if (subnet != null) {
        ExternalSubnetParameters parameters = new ExternalSubnetParameters();
        parameters.setSubnet(subnet);
        return performAction(ActionType.RemoveSubnetFromProvider, parameters);
    }
    throw new WebApplicationException(Response.Status.NOT_FOUND);
}
Also used : ExternalSubnet(org.ovirt.engine.core.common.businessentities.network.ExternalSubnet) WebApplicationException(javax.ws.rs.WebApplicationException) ExternalSubnetParameters(org.ovirt.engine.core.common.action.ExternalSubnetParameters)

Example 2 with ExternalSubnetParameters

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

the class RemoveExternalSubnetModel method onRemove.

private void onRemove() {
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (ExternalSubnet subnet : getSubnets()) {
        ActionParametersBase parameters = new ExternalSubnetParameters(subnet);
        list.add(parameters);
    }
    startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveSubnetFromProvider, list, false, result -> {
        stopProgress();
        sourceListModel.getSearchCommand().execute();
        cancel();
    }, null);
}
Also used : ExternalSubnet(org.ovirt.engine.core.common.businessentities.network.ExternalSubnet) ArrayList(java.util.ArrayList) ExternalSubnetParameters(org.ovirt.engine.core.common.action.ExternalSubnetParameters) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ExternalSubnetParameters (org.ovirt.engine.core.common.action.ExternalSubnetParameters)2 ExternalSubnet (org.ovirt.engine.core.common.businessentities.network.ExternalSubnet)2 ArrayList (java.util.ArrayList)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1