Ori Liel has posted comments on this change.

Change subject: restapi - #755579: Return proper http status for errors
......................................................................


Patch Set 2: (22 inline comments)

I'm looking into the usage of the properties file, and what it would mean to 
move it to 'common' project as well. 

Your other comments (order of imports and suck) were implemented

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
Line 36: import org.ovirt.engine.core.common.businessentities.VolumeFormat;
Line 37: import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
Line 38: import org.ovirt.engine.core.common.errors.VdcBLLException;
Line 39: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 40: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 41: import org.ovirt.engine.core.common.queries.DiskImageList;
Line 42: import 
org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters;
Line 43: import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
Line 44: import org.ovirt.engine.core.common.queries.VdcQueryType;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmTemplateCommand.java
Line 17: import org.ovirt.engine.core.common.businessentities.DiskImage;
Line 18: import org.ovirt.engine.core.common.businessentities.StorageDomainType;
Line 19: import org.ovirt.engine.core.common.errors.VdcBLLException;
Line 20: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 21: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 22: import org.ovirt.engine.core.common.utils.Pair;
Line 23: import org.ovirt.engine.core.compat.Guid;
Line 24: import org.ovirt.engine.core.compat.KeyValuePairCompat;
Line 25: import org.ovirt.engine.core.utils.transaction.TransactionMethod;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
Line 21: import org.ovirt.engine.core.common.businessentities.VdsStatic;
Line 22: import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity;
Line 23: import org.ovirt.engine.core.common.constants.gluster.GlusterConstants;
Line 24: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 25: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 26: import org.ovirt.engine.core.common.utils.Pair;
Line 27: import org.ovirt.engine.core.dao.VdsStaticDAO;
Line 28: import org.ovirt.engine.core.dao.gluster.GlusterBrickDao;
Line 29: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java
Line 33: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 34: import org.ovirt.engine.core.common.utils.Pair;
Line 35: import org.ovirt.engine.core.compat.Guid;
Line 36: import org.ovirt.engine.core.dao.DiskDao;
Line 37: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 38: import org.ovirt.engine.core.dao.DiskImageDAO;
Line 39: import org.ovirt.engine.core.dao.StorageDomainDAO;
Line 40: import org.ovirt.engine.core.utils.collections.MultiValueMapUtils;
Line 41: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java
Line 17: import org.ovirt.engine.core.common.businessentities.network.Network;
Line 18: import 
org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol;
Line 19: import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
Line 20: import org.ovirt.engine.core.common.utils.ValidationUtils;
Line 21: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 22: import org.ovirt.engine.core.dal.dbbroker.DbFacade;
Line 23: import org.ovirt.engine.core.utils.NetworkUtils;
Line 24: 
Line 25: public class SetupNetworksHelper {


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
Line 33: import 
org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType;
Line 34: import org.ovirt.engine.core.common.errors.VdcBLLException;
Line 35: import org.ovirt.engine.core.common.errors.VdcBllErrors;
Line 36: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 37: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 38: import org.ovirt.engine.core.common.utils.Pair;
Line 39: import org.ovirt.engine.core.compat.Guid;
Line 40: import org.ovirt.engine.core.compat.NGuid;
Line 41: import org.ovirt.engine.core.dao.SnapshotDao;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStoragePoolWithStoragesCommand.java
Line 23: import org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap;
Line 24: import org.ovirt.engine.core.common.errors.VdcBLLException;
Line 25: import org.ovirt.engine.core.common.errors.VdcBllErrors;
Line 26: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 27: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 28: import org.ovirt.engine.core.common.utils.Pair;
Line 29: import 
org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters;
Line 30: import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
Line 31: import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStorageServerConnectionCommand.java
Line 15: import org.ovirt.engine.core.common.errors.VdcBllErrors;
Line 16: import org.ovirt.engine.core.common.errors.VdcFault;
Line 17: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 18: import org.ovirt.engine.core.common.utils.Pair;
Line 19: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 20: import org.ovirt.engine.core.common.validation.NfsMountPointConstraint;
Line 21: import org.ovirt.engine.core.common.validation.group.CreateEntity;
Line 22: import org.ovirt.engine.core.compat.Guid;
Line 23: import org.ovirt.engine.core.dal.dbbroker.DbFacade;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java
Line 17: import org.ovirt.engine.core.common.businessentities.VDS;
Line 18: import org.ovirt.engine.core.common.businessentities.StorageDomain;
Line 19: import org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap;
Line 20: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 21: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 22: import org.ovirt.engine.core.common.utils.Pair;
Line 23: import 
org.ovirt.engine.core.common.vdscommands.DeactivateStorageDomainVDSCommandParameters;
Line 24: import 
org.ovirt.engine.core.common.vdscommands.DisconnectStoragePoolVDSCommandParameters;
Line 25: import 
org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/FenceVdsManualyCommand.java
Line 24: import org.ovirt.engine.core.common.businessentities.VDSStatus;
Line 25: import org.ovirt.engine.core.common.businessentities.VdsSpmStatus;
Line 26: import org.ovirt.engine.core.common.businessentities.StoragePool;
Line 27: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 28: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 29: import org.ovirt.engine.core.common.utils.Pair;
Line 30: import 
org.ovirt.engine.core.common.vdscommands.FenceSpmStorageVDSCommandParameters;
Line 31: import 
org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters;
Line 32: import 
org.ovirt.engine.core.common.vdscommands.SpmStatusVDSCommandParameters;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
Line 13: import 
org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus;
Line 14: import 
org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
Line 15: import org.ovirt.engine.core.common.businessentities.StorageDomainType;
Line 16: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 17: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 18: import org.ovirt.engine.core.common.utils.Pair;
Line 19: import 
org.ovirt.engine.core.common.vdscommands.DetachStorageDomainVDSCommandParameters;
Line 20: import 
org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters;
Line 21: import org.ovirt.engine.core.common.vdscommands.VDSCommandType;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStoragePoolCommand.java
Line 28: import org.ovirt.engine.core.common.businessentities.StoragePool;
Line 29: import org.ovirt.engine.core.common.businessentities.network.Network;
Line 30: import org.ovirt.engine.core.common.errors.VdcBLLException;
Line 31: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 32: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 33: import org.ovirt.engine.core.common.utils.Pair;
Line 34: import 
org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters;
Line 35: import 
org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters;
Line 36: import org.ovirt.engine.core.common.vdscommands.VDSCommandType;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
Line 27: import org.ovirt.engine.core.common.businessentities.VmStatic;
Line 28: import org.ovirt.engine.core.common.businessentities.network.Network;
Line 29: import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
Line 30: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 31: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 32: import 
org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters;
Line 33: import org.ovirt.engine.core.common.queries.VdcQueryType;
Line 34: import org.ovirt.engine.core.common.utils.Pair;
Line 35: import org.ovirt.engine.core.common.utils.VmDeviceType;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
Line 26: import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
Line 27: import org.ovirt.engine.core.common.locks.LockingGroup;
Line 28: import org.ovirt.engine.core.common.utils.Pair;
Line 29: import org.ovirt.engine.core.compat.Guid;
Line 30: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Done
Line 31: import org.ovirt.engine.core.utils.transaction.TransactionMethod;
Line 32: import org.ovirt.engine.core.utils.transaction.TransactionSupport;
Line 33: 
Line 34: @NonTransactiveCommandAttribute


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/ErrorType.java
Line 1: package org.ovirt.engine.core.common.errors;
Line 2: 
Line 3: public enum ErrorType {
Line 4: 
Line 5:     /*
Done
Line 6:      * Client passed invalid parameters in the request. For example - a 
necessary parameter is missing (null), bad ID
Line 7:      * supplied (e.g: moving disk to a different storage-domain - ID of 
the storage-domain is wrong or malformed), some
Line 8:      * combination of parameters is not supported, a list which is 
expected to include at least one element is empty,
Line 9:      * client tried to update a non-updatable property, and things 
like: an export domain was given where a data domain


Line 10:      * is expected, etc. This request would never be legal.
Line 11:      */
Line 12:     BAD_PARAMETERS,
Line 13: 
Line 14:     /*
Done
Line 15:      * Client made a request which is not applicable in the current 
status of the engine. The same request, under
Line 16:      * different circumstances, would be applicable. For example, a 
client wants to start a VM which is already running.
Line 17:      * In other circumstances (VM down) this request would be 
applicable.
Line 18:      */


Line 17:      * In other circumstances (VM down) this request would be 
applicable.
Line 18:      */
Line 19:     CONFLICT,
Line 20: 
Line 21:     /*
Done
Line 22:      * Client parameters directly violate a constraint. For example, 
setting VM memory of 500GB would violate the
Line 23:      * constraint of maximum VM memory (even if the maximum is 
configurable in Vdc_Options table, we consider it a
Line 24:      * constraint violation). This is different from CONFLICT, because 
(taking vdc_options as a given) under no
Line 25:      * circumstances would it be ok to give a VM 500GB memory.


Line 29:     INCOMPATIBLE_VERSION,
Line 30: 
Line 31:     INTERNAL_ERROR,
Line 32: 
Line 33:     NOT_SUPPORTED,
Done
Line 34: 
Line 35:     /*
Line 36:      * Client failed to authenticate.
Line 37:      */


Line 31:     INTERNAL_ERROR,
Line 32: 
Line 33:     NOT_SUPPORTED,
Line 34: 
Line 35:     /*
Done
Line 36:      * Client failed to authenticate.
Line 37:      */
Line 38:     NO_AUTHENTICATION,
Line 39: 


Line 36:      * Client failed to authenticate.
Line 37:      */
Line 38:     NO_AUTHENTICATION,
Line 39: 
Line 40:     /*
Done
Line 41:      * Client lacks permission to perform this operation (after 
authentication).
Line 42:      */
Line 43:     NO_PERMISSION,
Line 44: 


Line 41:      * Client lacks permission to perform this operation (after 
authentication).
Line 42:      */
Line 43:     NO_PERMISSION,
Line 44: 
Line 45:     /*
Done
Line 46:      * An illegal state in the server does not enable the request to 
be executed. This means internal data corruption
Line 47:      * had occured.
Line 48:      */
Line 49:     DATA_CORRUPTION,


....................................................
File backend/manager/modules/restapi/interface/definition/pom.xml
Line 84:         </executions>
Line 85:       </plugin>
Line 86: 
Line 87:     </plugins>
Line 88:     <pluginManagement>
Thanks for the heads-up, this should not be here (added automatically by 
eclipse and it seems like I accidentally 'git add'-ed it)
Line 89:        <plugins>
Line 90:                <!--This plugin's configuration is used to store 
Eclipse m2e settings only. It has no influence on the Maven build itself.-->
Line 91:                <plugin>
Line 92:                        <groupId>org.eclipse.m2e</groupId>


--
To view, visit http://gerrit.ovirt.org/14498
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I395e4b303eda174360ece709ddd7de6b1e3ce93f
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to