Ori Liel has posted comments on this change.

Change subject: REST API: Adding external status to API
......................................................................


Patch Set 4:

(4 comments)

https://gerrit.ovirt.org/#/c/42137/4//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2015-06-14 00:49:00 +0300
Line 6: 
Line 7: REST API: Adding external status to API
Line 8: 
Line 9: This patch adds handling the external_status field from the external
Can you describe a bit more? From looking at the code I see that this patch 
adds external status for storage-domains, but you don't mention that in the 
commit message.
Line 10: event API call
Line 11: 
Line 12: Change-Id: I4d748b1123c4dafc7776d79097eec8e94793bf1d
Line 13: Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1231274


https://gerrit.ovirt.org/#/c/42137/4/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendEventsResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendEventsResource.java:

Line 76:                     
ExternalStatusMapper.map(EntityExternalStatus.fromValue(
Line 77:                             
event.getHost().getExternalStatus().getState()), null));
Line 78:         }
Line 79:         else if (isStorageDomainExternalStateDefined) {
Line 80:             parameters = new AddExternalEventParameters(map(event),
consider extracting the code which creates the parameters object to a method, 
so that add() method stays short and readable.
Line 81:                     
ExternalStatusMapper.map(EntityExternalStatus.fromValue(
Line 82:                             
event.getStorageDomain().getExternalStatus().getState()), null));
Line 83:         }
Line 84:         else{


https://gerrit.ovirt.org/#/c/42137/4/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/StorageDomainMapper.java
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/StorageDomainMapper.java:

Line 143:             StorageDomainStatus status = map(entity.getStatus(), 
null);
Line 144:             model.setStatus(status==null ? null : 
StatusUtils.create(status));
Line 145:         }
Line 146:         if (entity.getExternalStatus() != null) {
Line 147:             // Reuse enum mappings fro HostMapper
The comment says you're reusing HostMapper, but there's no reference to 
HostMapper here.
Line 148:             EntityExternalStatus entityExternalStatus = 
ExternalStatusMapper.map(entity.getExternalStatus(), null);
Line 149:             Status hostStatus = new Status();
Line 150:             hostStatus.setState(entityExternalStatus.value());
Line 151:             model.setExternalStatus(hostStatus);


Line 145:         }
Line 146:         if (entity.getExternalStatus() != null) {
Line 147:             // Reuse enum mappings fro HostMapper
Line 148:             EntityExternalStatus entityExternalStatus = 
ExternalStatusMapper.map(entity.getExternalStatus(), null);
Line 149:             Status hostStatus = new Status();
Why call it host-status?
Line 150:             hostStatus.setState(entityExternalStatus.value());
Line 151:             model.setExternalStatus(hostStatus);
Line 152:         }
Line 153:         model.setStorage(new Storage());


-- 
To view, visit https://gerrit.ovirt.org/42137
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d748b1123c4dafc7776d79097eec8e94793bf1d
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to