Alissa Bonas has posted comments on this change.

Change subject: restapi: add storage server connections resource
......................................................................


Patch Set 28: (9 inline comments)

....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/StorageServerConnectionQueryParametersBase.java
Line 20:     }
Line 21: 
Line 22:     /**
Line 23:      * Used by REST because AbstractBackendResource has id member
Line 24:      * that is always assumed to be Guid
this is a part in REST infrastructure where I have no control - it loads 
constructor in reflection and searches for ctor with Guid.
Line 25:      *
Line 26:      * @param serverConnectionId
Line 27:      */
Line 28:     public StorageServerConnectionQueryParametersBase(Guid 
serverConnectionId) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageServerConnectionResource.java
Line 29:     }
Line 30: 
Line 31:     @Override
Line 32:     public Storage update(Storage connection) {
Line 33:         validateParameters(connection, "host.id|name");
since the backend patch was merged today - adding this handling to this patch 
as well.
Line 34:         validateEnums(Storage.class, connection);
Line 35:         return performUpdate(connection,
Line 36:                 new 
QueryIdResolver<String>(VdcQueryType.GetStorageServerConnectionById,
Line 37:                         
StorageServerConnectionQueryParametersBase.class),


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageServerConnectionsResource.java
Line 45:         StorageConnections collection = new StorageConnections();
Line 46:         for 
(org.ovirt.engine.core.common.businessentities.StorageServerConnections entity 
: entities) {
Line 47:             Storage connection = map(entity);
Line 48:             if (connection != null) {
Line 49:                 
collection.getStorageConnections().add(addLinks(connection));
I added addLinks as you noticed was missing, what other comment do you mean?
Line 50:             }
Line 51:         }
Line 52:         return collection;
Line 53:     }


Line 53:     }
Line 54: 
Line 55:     @Override
Line 56:     public Response add(Storage storage) {
Line 57:         validateParameters(storage, "address", "type", "host.id|name");
will handle it in next patchset.
Line 58:         // map to backend object
Line 59:         StorageServerConnections storageConnection =
Line 60:                 getMapper(Storage.class, 
StorageServerConnections.class).map(storage, null);
Line 61:         Guid hostId = getHostId(storage.getHost());


Line 78:                 getAddParams(storageConnection, hostId),
Line 79:                 ENTITY_RETRIEVER);
Line 80:     }
Line 81: 
Line 82:     private Guid getHostId(Host host) {
moved it a bit in hierarchy of abstract classes so it can be reused here.
Line 83:         // presence of host ID or name already validated
Line 84:         return host.isSetId()
Line 85:                 ? new Guid(host.getId())
Line 86:                 : host.isSetName()


Line 96:         return params;
Line 97:     }
Line 98: 
Line 99:     @Override
Line 100:     public Response remove(@PathParam("id") String id, Host host) {
which annotation to remove? pathparam? override? and why remove it?
Line 101:         validateParameters(host, "id|name");
Line 102:         this.host = host;
Line 103:         return super.remove(id);
Line 104:     }


....................................................
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/StorageDomainMapper.java
Line 148:         return model;
Line 149:     }
Line 150: 
Line 151:     @Mapping(from = Storage.class, to = 
StorageServerConnections.class)
Line 152:     public static StorageServerConnections map(Storage model, 
StorageServerConnections template) {
Done
Line 153:         StorageServerConnections entity = template != null ? template 
: new StorageServerConnections();
Line 154:         org.ovirt.engine.core.common.businessentities.StorageType 
storageType = null;
Line 155:         if (model.getType() != null) {
Line 156:            storageType = 
map(StorageType.fromValue(model.getType()),null);


Line 224:     }
Line 225: 
Line 226:     @Mapping(from = 
org.ovirt.engine.core.common.businessentities.StorageServerConnections.class,
Line 227:             to = org.ovirt.engine.api.model.Storage.class)
Line 228:     public static Storage map(StorageServerConnections entity, 
Storage template) {
Done
Line 229:         Storage model = template != null ? template : new Storage();
Line 230:         model.setId(entity.getid());
Line 231:         model.setType(map(entity.getstorage_type(), null));
Line 232:         if (entity.getstorage_type() == 
org.ovirt.engine.core.common.businessentities.StorageType.ISCSI) {


....................................................
Commit Message
Line 20: 6. Add ability to get a specific connection by its id.
Line 21: Url is the same as item 4.
Line 22: 7. REST unitests
Line 23: Feature page:
Line 24: www.ovirt.org/Features/Manage_Storage_Connections
done for both items you mentioned
Line 25: 
Line 26: Change-Id: If6bc32ead098390723825872f6fb292097d52835


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If6bc32ead098390723825872f6fb292097d52835
Gerrit-PatchSet: 28
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to