Juan Hernandez has uploaded a new change for review.
Change subject: restapi: Validate dest when importing template
......................................................................
restapi: Validate dest when importing template
When importing a template 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. 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>
Change-Id: I2cf2d94514b159c34f19a7f0377fcb2a9afd1c19
Bug-Url: https://bugzilla.redhat.com/1081173
Signed-off-by: Juan Hernandez <[email protected]>
---
M
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/26127/1
diff --git
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
index 201ce65..c0800ee 100644
---
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
+++
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainTemplateResource.java
@@ -39,7 +39,7 @@
@Override
public Response doImport(Action action) {
- validateParameters(action, "cluster.id|name");
+ validateParameters(action, "cluster.id|name", "storageDomain.id|name");
Guid destStorageDomainId = getDestStorageDomainId(action);
--
To view, visit http://gerrit.ovirt.org/26127
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cf2d94514b159c34f19a7f0377fcb2a9afd1c19
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches