Michael Pasternak has posted comments on this change.
Change subject: restapi : Missing opertions for snapshots in RESTAPI(#867339)
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(9 inline comments)
please describe these signatures in RSDL meta file.
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotResource.java
Line 69: }
Line 70:
Line 71: @Override
Line 72: public Response undo(Action action) {
Line 73: action.setAsync(false);
why this action has to be sync?
Line 74: RestoreAllSnapshotsParameters restoreParams = new
RestoreAllSnapshotsParameters(parentId, guid);
Line 75: Response response = doAction(VdcActionType.RestoreAllSnapshots,
Line 76: restoreParams,
Line 77: action,
Line 74: RestoreAllSnapshotsParameters restoreParams = new
RestoreAllSnapshotsParameters(parentId, guid);
Line 75: Response response = doAction(VdcActionType.RestoreAllSnapshots,
Line 76: restoreParams,
Line 77: action,
Line 78: PollingType.JOB);
you should be using this signature [1], ^ this one is used to explicitly
defining PollingType (not relevant in this case).
[1] doAction(final VdcActionType task, final VdcActionParametersBase params,
final Action action)
Line 79: return response;
Line 80: }
Line 81:
Line 82: @Override
Line 80: }
Line 81:
Line 82: @Override
Line 83: public Response commit(Action action) {
Line 84: action.setAsync(false);
why this action has to be sync?
Line 85: RestoreAllSnapshotsParameters restoreParams = new
RestoreAllSnapshotsParameters(parentId, guid);
Line 86: Response response = doAction(VdcActionType.RestoreAllSnapshots,
Line 87: restoreParams,
Line 88: action,
Line 85: RestoreAllSnapshotsParameters restoreParams = new
RestoreAllSnapshotsParameters(parentId, guid);
Line 86: Response response = doAction(VdcActionType.RestoreAllSnapshots,
Line 87: restoreParams,
Line 88: action,
Line 89: PollingType.JOB);
you should be using this signature [1], ^ this one is used to explicitly
defining PollingType (not relevant in this case).
[1] doAction(final VdcActionType task, final VdcActionParametersBase params,
final Action action)
Line 90: return response;
Line 91: }
Line 92:
Line 93: @Override
Line 91: }
Line 92:
Line 93: @Override
Line 94: public Response preview(Action action) {
Line 95: action.setAsync(false);
why this action has to be sync?
Line 96: TryBackToAllSnapshotsOfVmParameters tryBackParams = new
TryBackToAllSnapshotsOfVmParameters(parentId, guid);
Line 97: Response response =
doAction(VdcActionType.TryBackToAllSnapshotsOfVm,
Line 98: tryBackParams,
Line 99: action,
Line 96: TryBackToAllSnapshotsOfVmParameters tryBackParams = new
TryBackToAllSnapshotsOfVmParameters(parentId, guid);
Line 97: Response response =
doAction(VdcActionType.TryBackToAllSnapshotsOfVm,
Line 98: tryBackParams,
Line 99: action,
Line 100: PollingType.JOB);
you should be using this signature [1], ^ this one is used to explicitly
defining PollingType (not relevant in this case).
[1] doAction(final VdcActionType task, final VdcActionParametersBase params,
final Action action)
Line 101: return response;
Line 102: }
Line 103:
Line 104: @Override
....................................................
File
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotResourceTest.java
Line 91: public void testPreview() {
Line 92: setUriInfo(setUpBasicUriExpectations());
Line 93: setUpTryBackExpectations();
Line 94: control.replay();
Line 95: resource.preview(new Action());
what about verifying ActionResponse?
Line 96: }
Line 97:
Line 98: @Test
Line 99: public void testUndo() {
Line 99: public void testUndo() {
Line 100: setUriInfo(setUpBasicUriExpectations());
Line 101: setUpRestoreExpectations();
Line 102: control.replay();
Line 103: resource.undo(new Action());
what about verifying ActionResponse?
Line 104: }
Line 105:
Line 106: @Test
Line 107: public void testCommit() {
Line 107: public void testCommit() {
Line 108: setUriInfo(setUpBasicUriExpectations());
Line 109: setUpRestoreExpectations();
Line 110: control.replay();
Line 111: resource.commit(new Action());
what about verifying ActionResponse?
Line 112: }
Line 113:
Line 114: protected UriInfo setUpTryBackExpectations() {
Line 115: return setUpActionExpectations(
--
To view, visit http://gerrit.ovirt.org/11163
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If2bbf6ba2c3f71230d3fdd98ca60c0c3d0f902fb
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches