Laszlo Hornyak has posted comments on this change. Change subject: engine: watchdog - restapi support ......................................................................
Patch Set 36: (10 inline comments) .................................................... File backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/LinkHelper.java Line 319: TYPES.put(VersionCaps.class, map); Line 320: Line 321: map = new ParentToCollectionMap(WatchDog.class, DevicesResource.class, VM.class); Line 322: map.add(WatchDog.class, ReadOnlyDeviceResource.class, Template.class); Line 323: TYPES.put(WatchDog.class, map); Done Line 324: } Line 325: Line 326: /** Line 327: * Obtain the relative path to a top-level collection .................................................... File backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogResource.java Line 2: Line 3: import org.ovirt.engine.api.model.WatchDog; Line 4: import org.ovirt.engine.api.model.WatchDogs; Line 5: Line 6: public interface WatchdogResource extends DevicesResource<WatchDog, WatchDogs>{ thanks for noting in time Line 7: Line 8: .................................................... File backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogsResource.java Line 11: import org.jboss.resteasy.annotations.providers.jaxb.Formatted; Line 12: import org.ovirt.engine.api.model.WatchDog; Line 13: import org.ovirt.engine.api.model.WatchDogs; Line 14: Line 15: @Path("/watchdogs") Done Line 16: @Produces({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML}) Line 17: public interface WatchdogsResource extends DevicesResource<WatchDog, WatchDogs>{ Line 18: @POST Line 19: @Formatted .................................................... File backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml Line 352: request: Line 353: body: Line 354: parameterType: WatchDog Line 355: signatures: Line 356: - mandatoryArguments: {watchdog.action: 'xs:string', watchdog.model: 'xs:string'} so you want the same thing here as in the resources? Line 357: optionalArguments: {} Line 358: urlparams: Line 359: headers: Line 360: Content-Type: {value: application/xml|json, required: true} .................................................... File backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendBaseTest.java Line 20: import javax.ws.rs.core.UriInfo; Line 21: Line 22: import org.easymock.IAnswer; Line 23: import org.easymock.IMocksControl; Line 24: import org.easymock.EasyMock; right, checked and it works, the org.easymock.classextension.EasyMock is deprecated, look at its source code. undoing it for you. Line 25: import org.jboss.resteasy.specimpl.MultivaluedMapImpl; Line 26: import org.junit.After; Line 27: import org.junit.Assert; Line 28: import org.junit.Before; .................................................... File backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendWatchdogsResourceTest.java Line 46: Line 47: @Override Line 48: /** Line 49: * This method needed to be overridden, because the superclass is creating 3 returned VmWatchdog Line 50: * There can only be 1 or 0. if this is just a suggestion then I'd leave this to those who want to do it Line 51: */ Line 52: protected void setUpQueryExpectations(String query, Object failure) throws Exception { Line 53: VdcQueryReturnValue queryResult = control.createMock(VdcQueryReturnValue.class); Line 54: SearchParameters params = new SearchParameters(prefix + query, searchType); .................................................... File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/WatchdogMapper.java Line 9: public class WatchdogMapper { Line 10: @Mapping(from = WatchDog.class, to = VmWatchdog.class) Line 11: public static VmWatchdog map(WatchDog model, VmWatchdog template) { Line 12: VmWatchdog entity = template == null ? new VmWatchdog() : template; Line 13: entity.setAction( VmWatchdogAction.getByName(model.getAction())); Done Line 14: entity.setId(new Guid(model.getId())); Line 15: entity.setModel( VmWatchdogType.getByName(model.getModel())); Line 16: return entity; Line 17: } Line 11: public static VmWatchdog map(WatchDog model, VmWatchdog template) { Line 12: VmWatchdog entity = template == null ? new VmWatchdog() : template; Line 13: entity.setAction( VmWatchdogAction.getByName(model.getAction())); Line 14: entity.setId(new Guid(model.getId())); Line 15: entity.setModel( VmWatchdogType.getByName(model.getModel())); Done Line 16: return entity; Line 17: } Line 18: @Mapping(from = VmWatchdog.class, to = WatchDog.class) Line 19: public static WatchDog map(VmWatchdog entity, WatchDog template) { Line 17: } Line 18: @Mapping(from = VmWatchdog.class, to = WatchDog.class) Line 19: public static WatchDog map(VmWatchdog entity, WatchDog template) { Line 20: WatchDog model = template == null ? new WatchDog() : template; Line 21: model.setAction(entity.getAction() == null ? null : entity.getAction().name().toLowerCase()); Done Line 22: model.setId(entity.getId().toString()); Line 23: model.setModel(entity.getModel() == null ? null : entity.getModel().name()); Line 24: Line 25: return model; Line 19: public static WatchDog map(VmWatchdog entity, WatchDog template) { Line 20: WatchDog model = template == null ? new WatchDog() : template; Line 21: model.setAction(entity.getAction() == null ? null : entity.getAction().name().toLowerCase()); Line 22: model.setId(entity.getId().toString()); Line 23: model.setModel(entity.getModel() == null ? null : entity.getModel().name()); Done Line 24: Line 25: return model; Line 26: } -- To view, visit http://gerrit.ovirt.org/13060 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief5b20ecf2221faf900cadfeafe4c71607a9eca3 Gerrit-PatchSet: 36 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches