Juan Hernandez 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> > The previous host_states is also for capabilities and since this is a statu Ok, agree, that should be part of a different 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()); > I have no value() for that (have only getValue() that gives me an int ...) Should be: hostStatus.setState(entityExternalStatus.value()); In general the idea is that you can't take values of backend enums and put them into RESTAPI objects, because then changing the backend will inadvertently change the RESTAPI, breaking backwards compatibility. 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
