Maor Lipchuk has submitted this change and it was merged.
Change subject: restapi: Validate dest when importing VM
......................................................................
restapi: Validate dest when importing VM
When importing a VM it is mandatory to specify the destination
storage domain. The RESTAPI doesn't currently validate this, and thus
the request is accepted and eventually it generates a NPE since
AbstractBackendStorageDomainContentResource#getDestStorageDomainId is
counting on the storage id.
This patch changes the RESTAPI so that it validates that the id or name
of the destination storage domain has been provided. If it isn't provided it
will generate the following error response:
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<fault>
<reason>Incomplete parameters</reason>
<detail>Action [storageDomain.id|name] required for
doImport</detail>
</fault>
The patch should keep backward compatibility since before it, we got an
NPE, and now it is being replaced with an informative message.
Change-Id: Id9f0e743de7260b0a838b1da2bd94ac48b28d6be
Bug-Url:
https://bugzilla.redhat.com/1081173
Signed-off-by: MAor Lipchuk <mlipchuk(a)redhat.com>
---
M
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainVmResource.java
M
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainVmResourceTest.java
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Juan Hernandez: Looks good to me, but someone else must approve
Allon Mureinik: Looks good to me, approved
Maor Lipchuk: Verified
--
To view, visit
http://gerrit.ovirt.org/26960
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id9f0e743de7260b0a838b1da2bd94ac48b28d6be
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Michael Pasternak <mishka8520(a)yahoo.com>
Gerrit-Reviewer: Ori Liel <oliel(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server