Juan Hernandez has posted comments on this change. Change subject: restapi: Add support for Network Attachements. ......................................................................
Patch Set 27: (10 comments) https://gerrit.ovirt.org/#/c/32775/27/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd File backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd: Line 3993: <xs:element name="boot_protocol" type="xs:string" minOccurs="0" maxOccurs="1"/> Line 3994: <xs:element ref="ips" minOccurs="0" maxOccurs="1"> Line 3995: <xs:annotation> Line 3996: <xs:appinfo> Line 3997: <jaxb:property name="IPv4Configuration"/> Try to avoid differences between element names and Java property names. Currently this will result in a Java property named "IPv4Configuration", and that will be used by the server and also by the Java SDK. But the Python SDK will still use "ips", as it isn't aware of the "jaxb:property" annotation. The result will likely a new bug in the Python SDK. To avoid that use "IPs" for the Java property. Line 3998: </xs:appinfo> Line 3999: </xs:annotation> Line 4000: </xs:element> Line 4001: </xs:sequence> https://gerrit.ovirt.org/#/c/32775/27/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml File backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml: Line 2636: urlparams: Line 2637: max: {context: matrix, type: 'xs:int', value: 'max results', required: false} Line 2638: - name: /hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}|rel=get Line 2639: description: get the details of the specified network attachment of the network interface Line 2640: request: Remove this "request:" line. Line 2641: - name: /hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}|rel=delete Line 2642: description: delete the specified network attachment from the network interface Line 2643: request: Line 2644: urlparams: Line 2641: - name: /hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}|rel=delete Line 2642: description: delete the specified network attachment from the network interface Line 2643: request: Line 2644: urlparams: Line 2645: async: {context: matrix, type: 'xs:boolean', value: true|false, required: false} Remove the "async" parameter, and thus the empty "urlparams" and "request". The "async" parameter is now implicitly added to all the relevant operations, so having it here generates a duplicate. Line 2646: - name: /hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}|rel=update Line 2647: description: update the specified network attachment on the network interface Line 2648: request: Line 2649: body: Line 2649: body: Line 2650: parameterType: NetworkAttachment Line 2651: signatures: Line 2652: - optionalArguments: Line 2653: network_attachment.ip_configuration.ipv4s.boot_protocol: 'xs:string' Replace "ipv4s" with "ips", as that is what is used in the XML schema. If possible avoid quotes around "xs:..." Line 2654: network_attachment.ip_configuration.ipv4s.ipv4--COLLECTION: Line 2655: ipv4.address: 'xs:string' Line 2656: ipv4.netmask: 'xs:string' Line 2657: ipv4.gateway: 'xs:string' Line 2675: ipv4.gateway: 'xs:string' Line 2676: network_attachment.properties.property--COLLECTION: Line 2677: property.name: 'xs:string' Line 2678: property.value: 'xs:string' Line 2679: network_attachment.override_configuration: 'xs:boolean' Not sure if the YAML processor will handle well this indenting, should be two spaces per level, not four. Remember to avoid quotes around "xs:..." Line 2680: - name: /hosts/{host:id}/networkattachments|rel=get Line 2681: description: get the list of network attachments of the host Line 2682: request: Line 2683: urlparams: Line 2683: urlparams: Line 2684: max: {context: matrix, type: 'xs:int', value: 'max results', required: false} Line 2685: - name: /hosts/{host:id}/networkattachments/{networkattachment:id}|rel=get Line 2686: description: get the details of the specified network attachment of the host Line 2687: request: Remove this empty "request". Line 2688: - name: /hosts/{host:id}/networkattachments/{networkattachment:id}|rel=delete Line 2689: description: delete the specified network attachment from the host Line 2690: request: Line 2691: urlparams: Line 2688: - name: /hosts/{host:id}/networkattachments/{networkattachment:id}|rel=delete Line 2689: description: delete the specified network attachment from the host Line 2690: request: Line 2691: urlparams: Line 2692: async: {context: matrix, type: 'xs:boolean', value: true|false, required: false} Remove the "async" parameter (and thus the empty "urlparams" and "request"). Line 2693: - name: /hosts/{host:id}/networkattachments/{networkattachment:id}|rel=update Line 2694: description: update the specified network attachment on the host Line 2695: request: Line 2696: body: Line 2706: ipv4.gateway: 'xs:string' Line 2707: network_attachment.properties.property--COLLECTION: Line 2708: property.name: 'xs:string' Line 2709: property.value: 'xs:string' Line 2710: network_attachment.override_configuration: 'xs:boolean' Fix indentation (two spaces per level) and avoid quotes around "xs:...". Line 2711: - name: /hosts/{host:id}/networkattachments|rel=add Line 2712: description: add a new network attachment to the host Line 2713: request: Line 2714: body: Line 2726: ipv4.gateway: 'xs:string' Line 2727: network_attachment.properties.property--COLLECTION: Line 2728: property.name: 'xs:string' Line 2729: property.value: 'xs:string' Line 2730: network_attachment.override_configuration: 'xs:boolean' Fix indentation (two spaces) and avoid quotes around "xs:..." Line 2731: - name: /hosts/{host:id}/permissions|rel=get Line 2732: description: get the list of permissions for the host Line 2733: request: Line 2734: body: https://gerrit.ovirt.org/#/c/32775/27/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NetworkAttachmentMapper.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NetworkAttachmentMapper.java: Line 57: } Line 58: } Line 59: Line 60: if (!ipv4configuration.getIPs().isEmpty()) { Line 61: IP ip = ipv4configuration.getIPs().get(0); Don't we use the rest of the IP addresses provided by the user? If so why do we allow multiple IP adresses and not just one? Line 62: Line 63: if (ip.isSetAddress()) { Line 64: entity.getIpConfiguration().setAddress(ip.getAddress()); Line 65: } -- 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: 27 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