Michael Pasternak has posted comments on this change. Change subject: restapi: #839205 Display Host Hooks ......................................................................
Patch Set 2: I would prefer that you didn't submit this (3 inline comments) .................................................... File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostHooksResource.java Line 27: @Override Line 28: @GET Line 29: public Hooks list() { Line 30: VdcQueryReturnValue result = Line 31: runQuery(VdcQueryType.GetVdsHooksById2, please use getEntity() instead of runQuery() Line 32: new GetVdsHooksByIdParameters(asGuid(hostId))); Line 33: HashMap<String, HashMap<String, HashMap<String, String>>> hooksMap = Line 34: (HashMap<String, HashMap<String, HashMap<String, String>>>) result.getReturnValue(); Line 35: Hooks hooks = mappingLocator.getMapper(HashMap.class, Hooks.class).map(hooksMap, null); Line 32: new GetVdsHooksByIdParameters(asGuid(hostId))); Line 33: HashMap<String, HashMap<String, HashMap<String, String>>> hooksMap = Line 34: (HashMap<String, HashMap<String, HashMap<String, String>>>) result.getReturnValue(); Line 35: Hooks hooks = mappingLocator.getMapper(HashMap.class, Hooks.class).map(hooksMap, null); Line 36: return hooks; please move mapping logic to the mapCollection() also use addLinks(populate()) on the way (future use). Line 37: } Line 38: Line 39: @Override Line 40: @Path("{id}") .................................................... File backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendHostHooksResourceTest.java Line 7: import org.ovirt.engine.api.model.Hooks; Line 8: import org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters; Line 9: import org.ovirt.engine.core.common.queries.VdcQueryType; Line 10: Line 11: public class BackendHostHooksResourceTest extends AbstractBackendResourceTest<Hook, HashMap<String, HashMap<String, HashMap<String, String>>>> { please also implement BackendHostHookResourceTest Line 12: Line 13: BackendHostHooksResource resource = new BackendHostHooksResource(GUIDS[0].toString()); Line 14: Line 15: static final String ON_VM_START_EVENT = "on_vm_start_event"; -- To view, visit http://gerrit.ovirt.org/9478 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38a3d38cc52d5ec77f55fe7db4d5e47b09568ca7 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ori Liel <ol...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Ori Liel <ol...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches