Michael Pasternak has posted comments on this change.
Change subject: API: [RFE] Add PM Proxy Preferences
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 2791: </xs:complexType>
Line 2792:
Line 2793: <xs:element name="pm_proxy" type="PmProxy"/>
Line 2794: <xs:complexType name="PmProxy">
Line 2795: <xs:sequence>
iiuc you should be adding <type/> element here that will reflect PmProxyType
Line 2796: <xs:element name="propietary" type="xs:string" minOccurs="0"
maxOccurs="1"/>
Line 2797: </xs:sequence>
Line 2798: </xs:complexType>
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResource.java
Line 573: version.getUsages().getUsages().add(usage.value());
Line 574: }
Line 575: }
Line 576: }
Line 577:
this is ^ incorrect, you should be adding PmProxyTypes element here and
injecting all PmProxyType values in it
Line 578:
Line 579: @Override
Line 580: public CapabiliyResource getCapabilitiesSubResource(String id) {
Line 581: return new BackendCapabilityResource(id, this);
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/HostValidator.java
Line 9: public class HostValidator implements Validator<Host> {
Line 10:
Line 11: @Override
Line 12: public void validateEnums(Host host) {
Line 13: if (host.isSetType()) {
host.type is irrelevant to this context, (it's RHEVH/RHEVM), see my comment
in api.xsd, after you will add <type/> element to the <pm_proxy>, fetch it from
there and validate here.
Line 14: validateEnum(PmProxyType.class, host.getType(), true);
Line 15: }
Line 16: }
....................................................
File
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
Line 199: model.setOptions(map(entity.getPmOptionsMap(), null));
Line 200: }
Line 201: if (entity.getPmProxyPreferences() != null) {
Line 202: PmProxies pmProxies = (model.getPmProxies() != null)
? model.getPmProxies() : new PmProxies();
Line 203: pmProxies.getPmProxy().clear();
what the point for having template of PmProxies if you clearing it (the List).
Line 204: String[] proxies =
StringUtils.split(entity.getPmProxyPreferences(), ",");
Line 205: for (String proxy : proxies) {
Line 206: PmProxy pmProxy = new PmProxy();
Line 207: pmProxy.setPropietary(proxy);
--
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: 3
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