Eli Mesika has posted comments on this change.

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


Patch Set 10:

(2 comments)

https://gerrit.ovirt.org/#/c/40997/10/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd:

Line 2035:           </xs:appinfo>
Line 2036:         </xs:annotation>
Line 2037:       </xs:element>
Line 2038:     </xs:sequence>
Line 2039:   </xs:complexType>
> Before merging consider moving this complex type definition to the place wh
The previous host_states is also for capabilities and since this is a status 
and mine is external status, I think it is nice to get them together 

If need to move, maybe move both in the context of other patch ???
Line 2040: 
Line 2041:   <xs:element name="host_protocols" type="HostProtocols"/>
Line 2042: 
Line 2043:   <xs:complexType name="HostProtocols">


https://gerrit.ovirt.org/#/c/40997/10/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java:

Line 202:         model.setStatus(StatusUtils.create(status));
Line 203:         if (entity.getExternalStatus() != null) {
Line 204:             EntityExternalStatus entityExternalStatus = 
map(entity.getExternalStatus(), null);
Line 205:             Status hostStatus = new Status();
Line 206:             hostStatus.setState(entity.getExternalStatus().name());
> Use "value()" instead of "name()", otherwise the value returned by the REST
I have no value() for that (have only getValue() that gives me an int ...)

I had already handled the case mismatch ....

see
https://gerrit.ovirt.org/#/c/40997/10/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/HostValidator.java
Line 207:             model.setExternalStatus(hostStatus);
Line 208:         }
Line 209:         if (status == HostStatus.NON_OPERATIONAL) {
Line 210:             
model.getStatus().setDetail(entity.getNonOperationalReason().name().toLowerCase());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I833f8e607fac7107e9352a547b3e36cbf9000f01
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to