use of org.ovirt.engine.core.common.action.RemoveStorageDomainParameters 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);
}
}
Aggregations