Juan Hernandez has posted comments on this change. Change subject: restapi: Add support for Network Attachements. ......................................................................
Patch Set 23: (2 comments) https://gerrit.ovirt.org/#/c/32775/23/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd File backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd: Line 3985: </xs:extension> Line 3986: </xs:complexContent> Line 3987: </xs:complexType> Line 3988: Line 3989: <xs:element name="ip_configuration" type="IpConfiguration"/> > needinfo: I don't know how to do that. In 'IPv4' complex type there's 'prim If I understand correctly you have several IP addresses associated to a network interface, and one of them is the "primary". I'm not sure what "primary" means in this context (please explain), but it looks like it isn't a property of the "IP address" concept, rather a relationship between something and the IP address. In that case I'd suggest to model it explicitly: <network_attachment> ... <ips> <ip address="a".../> <ip address="b".../> ... </ips> ... <primary_ip_address>a</primary_ip_address> </network_attachment> Also, if possible, try to avoid using (or adding) the "gateway") element of the IP complex type, as that isn't a property of the IP address concept either. Line 3990: Line 3991: <xs:complexType name="IpConfiguration"> Line 3992: <xs:sequence> Line 3993: <xs:element ref="ipv4s" minOccurs="0" maxOccurs="1"> https://gerrit.ovirt.org/#/c/32775/23/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostNicNetworkAttachmentsResource.java File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostNicNetworkAttachmentsResource.java: Line 53: Line 54: if (!nicId.equals(hostNicGuid)) { Line 55: //TODO MM: add message. Line 56: return Response.status(Response.Status.BAD_REQUEST).build(); Line 57: } > POSTing to …/networkattachments creates new binding of network to nic. Ther Ok, understood. Why do we need to post two those two locations? Is it a real need or just a convenience? Line 58: } else { Line 59: HostNIC hostNIC = new HostNIC(); Line 60: hostNIC.setId(nicId.toString()); Line 61: attachment.setHostNic(hostNIC); -- To view, visit https://gerrit.ovirt.org/32775 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6ac91eea1000f7fdf6105777343a1ac1c77368d Gerrit-PatchSet: 23 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches