Michael Pasternak has posted comments on this change.

Change subject: core: Added RegisterDiskCommand and GetUnregisteredDisksQuery
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)

Chris,

looks good!, but i have few comments for api part:

1. what about BackendStorageDomainDiskResource.get() afaics
it's should be handled the same way BackendStorageDomainDisksResource.list() is

2. in /rsdl_metadata.yaml please add new 'unregistered' (matrix) urlparam for 
the get/list URLs.

3. i didn't wrote any tests for the /BackendStorageDomainDisksResourceTest, 
you'll have to implement them (use BackendHostNicsResourceTest as ref.).

4. couple of inline comments

thanks.

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainDisksResource.java
Line 51:             // First we need to query the backend to fill in all the 
information about the disk from the VDSM.
Line 52:             // We don't just use the information from the Disk object 
because it's missing a few things like creation
Line 53:             // date and last modified date.
Line 54:             GetUnregisteredDiskQueryParameters getDiskParams = new 
GetUnregisteredDiskQueryParameters(
Line 55:                     Guid.createGuidFromString(disk.getId()), 
storageDomainId);
please use asGuid() instead of Guid.createGuidFromString(), - it will format 
bad-request-400 if id is not convertible in to UUID.
Line 56:             VdcQueryReturnValue populateReturn = 
runQuery(VdcQueryType.GetUnregisteredDisk, getDiskParams);
Line 57:             if (populateReturn.getSucceeded()) {
Line 58:                 DiskImage unregisteredDisk = (DiskImage) 
populateReturn.getReturnValue();
Line 59:                 RegisterDiskParameters registerDiskParams = new 
RegisterDiskParameters(unregisteredDisk);


Line 52:             // We don't just use the information from the Disk object 
because it's missing a few things like creation
Line 53:             // date and last modified date.
Line 54:             GetUnregisteredDiskQueryParameters getDiskParams = new 
GetUnregisteredDiskQueryParameters(
Line 55:                     Guid.createGuidFromString(disk.getId()), 
storageDomainId);
Line 56:             VdcQueryReturnValue populateReturn = 
runQuery(VdcQueryType.GetUnregisteredDisk, getDiskParams);
please re-use doGetEntity() instead of runQuery() by adding new signature of 
doGetEntity() (without mapping to public class).
Line 57:             if (populateReturn.getSucceeded()) {
Line 58:                 DiskImage unregisteredDisk = (DiskImage) 
populateReturn.getReturnValue();
Line 59:                 RegisterDiskParameters registerDiskParams = new 
RegisterDiskParameters(unregisteredDisk);
Line 60:                 return performCreate(VdcActionType.RegisterDisk, 
registerDiskParams, ID_RESOLVER);


--
To view, visit http://gerrit.ovirt.org/11783
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I82de498fd9a8e25ed9e1dc5776f2fdf0c35b46da
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Chris Morrissey <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to