Bug 1802844 - rest api setupnetworks: assignment_method should be inside ip_address_assignment
Summary: rest api setupnetworks: assignment_method should be inside ip_address_assignment
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.3.7
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ovirt-4.4.5
: ---
Assignee: Ori Liel
QA Contact: Raul Aghayev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-14 03:19 UTC by Germano Veit Michel
Modified: 2023-03-24 17:01 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.4.5.5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-14 11:39:53 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:1169 0 None None None 2021-04-14 11:41:00 UTC
oVirt gerrit 113231 0 master MERGED Fix doc bug in host.setup-networks 2021-02-18 19:25:28 UTC

Description Germano Veit Michel 2020-02-14 03:19:58 UTC
Description of problem:

From what I can tell the engine will only accept assignment_method if its inside 
ip_address_assignment, not in ip_address_assignments.

And it makes more sense, as one can have different assignment_method if configuring IPv4 and IPV6 at the same time, for example.

Version-Release number of selected component (if applicable):
rhvm-4.3.6.7-0.1.el7.noarch
ovirt-engine-api-explorer-0.0.4-1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Navigate to /ovirt-engine/apidoc/#/services/host/methods/setup_networks

Actual results:

      <ip_address_assignments>
        <assignment_method>static</assignment_method>
        <ip_address_assignment>
          <ip>
            <address>192.168.122.10</address>
            <netmask>255.255.255.0</netmask>
          </ip>
        </ip_address_assignment>
      </ip_address_assignments>

Expected results:

      <ip_address_assignments>
        <ip_address_assignment>
          <assignment_method>static</assignment_method>
          <ip>
            <address>192.168.122.10</address>
            <netmask>255.255.255.0</netmask>
          </ip>
        </ip_address_assignment>
      </ip_address_assignments>

Additional info:

# /usr/bin/curl -k --header 'Accept: application/json' -u admin@internal:redhat --request 'POST' --header 'Content-Type: application/xml' --data "
> <action>
>   <modified_network_attachments> 
>     <network_attachment>
>       <network>
>           <name>san-1</name>
>       </network>
>       <host_nic>
>           <name>eth1</name>
>       </host_nic>
>       <ip_address_assignments>
>           <assignment_method>static</assignment_method>
>         <ip_address_assignment>
>           <ip>
>             <address>2::1</address>
>             <netmask>64</netmask>
>             <version>v6</version>
>           </ip>                
>         </ip_address_assignment>
>       </ip_address_assignments>
>     </network_attachment>
>   </modified_network_attachments>
> </action>                        
> " https://engine.kvm/ovirt-engine/api/hosts/a381fd69-cc2a-42c4-9040-f51a10c8945c/setupnetworks
{
  "detail" : "For correct usage, see: https://engine.kvm/ovirt-engine/apidoc#services/host/methods/setup_networks",
  "reason" : "Request syntactically incorrect."


# /usr/bin/curl -k --header 'Accept: application/json' -u admin@internal:redhat --request 'POST' --header 'Content-Type: application/xml' --data "
> <action>
>   <modified_network_attachments> 
>     <network_attachment>
>       <network>
>           <name>san-1</name>
>       </network>
>       <host_nic>
>           <name>eth1</name>
>       </host_nic>
>       <ip_address_assignments>
>         <ip_address_assignment>
>           <assignment_method>static</assignment_method>
>           <ip>
>             <address>2::1</address>
>             <netmask>64</netmask>
>             <version>v6</version>
>           </ip>                
>         </ip_address_assignment>
>       </ip_address_assignments>
>     </network_attachment>
>   </modified_network_attachments>
> </action>                        
> " https://engine.kvm/ovirt-engine/api/hosts/a381fd69-cc2a-42c4-9040-f51a10c8945c/setupnetworks
{
  "job" : {
    "href" : "/ovirt-engine/api/jobs/c268c8bd-5f78-4d00-b39a-9acac62ddc01",
    "id" : "c268c8bd-5f78-4d00-b39a-9acac62ddc01"
  },
  "modified_network_attachments" : {
    "network_attachment" : [ {
      "ip_address_assignments" : {
        "ip_address_assignment" : [ {
          "assignment_method" : "static",
          "ip" : {
            "address" : "2::1",
            "netmask" : "64",
            "version" : "v6"
          }
        } ]
      },
      "host_nic" : {
        "name" : "eth1"
      },
      "network" : {
        "name" : "san-1"
      }
    } ]
  },
  "status" : "complete"
}

Comment 3 Raul Aghayev 2021-03-17 13:22:52 UTC
Verified on ovirt-engine-4.4.5.9-0.1.el8ev.noarch

Comment 8 errata-xmlrpc 2021-04-14 11:39:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: RHV Manager (ovirt-engine) 4.4.z [ovirt-4.4.5] security, bug fix, enhancement), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1169


Note You need to log in before you can comment on or make changes to this bug.