Maor Lipchuk has uploaded a new change for review.

Change subject: restapi: Vaidate if the Host exists when calling unregistered 
query
......................................................................

restapi: Vaidate if the Host exists when calling unregistered query

Adding a validation to check if the host id exists in the setup, once
the user will call unregisteredstoragedomainsdiscover from the REST.

Change-Id: I840c7243161e284f7ae183efd16c3f79a75b07cc
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/57/37257/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
index 2717e09..c7641bb 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java
@@ -283,6 +283,8 @@
     public Response unregisteredStorageDomainsDiscover(Action action) {
         validateParameters(action, "iscsi.address");
 
+        // Validate if the Host exists.
+        getEntity();
         List<StorageServerConnections> storageServerConnections = new 
ArrayList<>();
         for (String iscsiTarget : action.getIscsiTargets()) {
             StorageServerConnections connectionDetails = 
getInitializedConnectionIscsiDetails(action);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I840c7243161e284f7ae183efd16c3f79a75b07cc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to