Michael Pasternak has posted comments on this change.

Change subject: API: [RFE] Add PM Proxy Preferences
......................................................................


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

(5 inline comments)

please implement mapping tests for your use-case

....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/PmProxyType.java
Line 23:                 return CLUSTER;
Line 24:             } else if (v.equals("dc")) {
Line 25:                 return DC;
Line 26:             } else {
Line 27:                 return valueOf(v.toUpperCase());
if 'v' is not a member of enum why return it in upper case?
Line 28:             }
Line 29:         } catch (IllegalArgumentException e) {
Line 30:             return null;
Line 31:         }


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 2068:   <xs:element name="pm_proxy_types" type="PmProxyTypes"/>
Line 2069: 
Line 2070:   <xs:complexType name="PmProxyTypes">
Line 2071:     <xs:sequence>
Line 2072:       <xs:element name="pm_proxy_type" type="xs:string" 
minOccurs="0" maxOccurs="unbounded">
i'd call it <type> as you already on context of PmProxy
Line 2073:         <xs:annotation>
Line 2074:           <xs:appinfo>
Line 2075:             <jaxb:property name="PmProxyTypes"/>
Line 2076:           </xs:appinfo>


Line 2799: 
Line 2800:   <xs:element name="pm_proxies" type="PmProxies"/>
Line 2801:   <xs:complexType name="PmProxies">
Line 2802:     <xs:sequence>
Line 2803:       <xs:element name="pm_proxy" type="PmProxy" minOccurs="0" 
maxOccurs="unbounded">
user ref to refer the element, e.g:

<xs:element ref="pm_proxy" minOccurs="0" maxOccurs="unbounded"/>
Line 2804:        <xs:annotation>
Line 2805:           <xs:appinfo>
Line 2806:             <jaxbroperty name="PmProxies"/>
Line 2807:           </xs:appinfo>


Line 2811:   </xs:complexType>
Line 2812: 
Line 2813:   <xs:element name="pm_proxy" type="PmProxy"/>
Line 2814:   <xs:complexType name="PmProxy">
Line 2815:    <xs:sequence>
should you have <type> element/attribute here to define the PmProxyType?
Line 2816:      <xs:element name="propietary" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
Line 2817:    </xs:sequence>
Line 2818:   </xs:complexType>


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/HostValidator.java
Line 13:     public void validateEnums(Host host) {
Line 14:         if (host.isSetPowerManagement()) {
Line 15:             if (host.getPowerManagement().isSetPmProxies()) {
Line 16:                 for (PmProxy proxy : 
host.getPowerManagement().getPmProxies().getPmProxy()) {
Line 17:                     validateEnum(PmProxyType.class, 
proxy.getPropietary(), true);
iiuc "propietary" is a string and enum that you have added is PmProxyType,
so you should be adding it to <pm_proxy> and validating it here.
Line 18:                 }
Line 19:             }
Line 20:         }
Line 21:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If906312ecf028a5db1c9726a407a1643b6c000b7
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[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