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 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: I2cf2d94514b159c34f19a7f0377fcb2a9afd1c19
Bug-Url: https://bugzilla.redhat.com/1081173
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
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@redhat.com>