Liron Ar has posted comments on this change. Change subject: restapi: add support to regenerate ids when adding vm from configuration ......................................................................
Patch Set 2: (4 comments) @Juan the ovf used in that scenario already contains id information, the regenerate matrix parameters tell the engine to ignore those id's and generate new ones - that's why "force" won't suit here, even if the vm doesn't exist we might want to generate new ids and not use the old ones (which basically doesn't mean "force") - therefore it was decided together with michael to use the "regenerate" parameter (if you have other naming suggestion, i'd happily rename it :) ) .................................................... File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendResource.java Line 215: } Line 216: Line 217: protected boolean isRegenerate() { Line 218: return getBooleanMatrixConstraint(REGENERATE_CONSTRAINT); Line 219: } I added it to where we add matrix parameters (same as force was added here) so it could be used by others as well. If you want i'll move it, but IMO it can be left here so all constraints will be together and we won't keep adding constraints. Line 220: Line 221: protected void badRequest(String message) { Line 222: throw new WebFaultException(null, message, Response.Status.BAD_REQUEST); Line 223: } .................................................... File backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmsResourceTest.java Line 635: } Line 636: Line 637: @Test Line 638: public void testAddFromConfigurationWithRegenerateTrue() throws Exception { Line 639: setUriInfo(setUpGetMatrixConstraintsExpectations(BackendHostResource.REGENERATE_CONSTRAINT, Copy-Paste error, Done. Line 640: true, Line 641: "true", Line 642: setUpBasicUriExpectations(), Line 643: false)); Line 679: verifyModel((VM) response.getEntity(), 2); Line 680: } Line 681: Line 682: @Test Line 683: public void testAddFromConfiguration() throws Exception { IIRC that wasn't possible because when executing using the command it's being set to false by default, while when using the test infrastructure it doesn't. Line 684: setUriInfo(setUpGetMatrixConstraintsExpectations(BackendHostResource.REGENERATE_CONSTRAINT, Line 685: false, Line 686: "false", Line 687: setUpBasicUriExpectations(), Line 704: returnedVM); Line 705: setUpCreationExpectations(VdcActionType.ImportVmFromConfiguration, Line 706: ImportVmParameters.class, Line 707: new String[] { "Vm", "VdsGroupId", "ImportAsNewEntity"}, Line 708: new Object[] { returnedVM, Guid.createGuidFromString(model.getCluster().getId()), false}, right now it'll always be passed from the code, so i've edited it here as well. Line 709: true, Line 710: true, Line 711: GUIDS[2], Line 712: VdcQueryType.GetVmByVmId, -- To view, visit http://gerrit.ovirt.org/22207 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ccf0f61b58ad49aa50d1efe3aa0b9a8bd31da70 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Juana Garcia <garciajuan...@gmail.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches