This developer documentation isoutdated, but provides historical context.

It isnotuser documentation and should not be treated as such.

Documentation is available here.

Networking Api

Using oVirt Networking API

The following are request samples of the host networking api.

Add network to a network interface with DHCP boot protocol

POST to /api/hosts/{host:id}/nics/{nic:id}/networkattachments

  `   ` `   ` `     ` `       `          ``DHCP``  `       ` `     ` `   ` ` `

Remove a network from a network interface

DELETE to /api/hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}

Change boot protocol of a network configured on a network interface

PUT to /api/hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}

  `   ` `     ` `       ``static` `       ` `         ``true`          

10.0.0.15

           `<netmask>`255.255.255.0`</netmask>`  `         `<gateway>`10.0.0.254`</gateway> `       `</ipv4> `     `</ipv4s> `   `</ip_configuration> ` `</network_attachment>

Add a vlan network to a network interface

POST to /api/hosts/{host:id}/nics/{nic:id}/networkattachments

  `   ` ` `

Where nic:id represents a nic or a bond and the network id refers to a vlan network. Many requests could be followed with a different vlan networks to the same base interface.

Sync network on a network interface

PUT to /api/hosts/{host:id}/nics/{nic:id}/networkattachments/{networkattachment:id}

  `   ``true` ` `

Where networkattachment:id is associated with the out-of-sync network. Sync network can be achieved also via the setup nics, using the same override_configuration element.

Create a bond device

POST to /api/hosts/{host:id}/nics Where slaves can be identified either by id or by name (as long as they are nics).

  `   ``bond0` `   ` `     `         `       `         `       ` `       ` `     ` `     ` `       ` `       ` `     ` `   ` ` `

Delete bond device

DELETE to /api/hosts/{host:id}/nics/{nic:id} where nic:id represents the bond device. Any network attachment configured on the bond will be removed.

Adding a slave to a bond and change bonding options

PUT to /api/hosts/{host:id}/nics/{nic:id}

  `   ``bond0` `   ` `     ` `       ` `     ` `     ` `       ` `       ` `       ` `     ` `   ` ` `

Where nic:id represents an existing bonding device.

Move a network from one network interface to another

Shares the same semantics as setupNetorks, except instead of specifying the network element, a network attachments should be provided. PUT to /api/hosts/{host:id}/networkattachments/{networkattachment:id}

     ``   ` `

Or by POST to /api/hosts/{host:id}/setupnetworks

  `     ` `         ` `     `  ``  

Create bond and configure networks

Configuration prior to the request:

   eth0 ---- network aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
   eth1 ---- network bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb

Desired configuration after the request:

   eth0 ---|             |-- network aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
           +--- bond0 ---+
   eth1 ---|             |-- network bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb

POST to /api/hosts/{host:id}/setupnetworks

  `   ` `     ` `       ``bond0` `       ` `         ` `           ` `           ` `           ` `         ` `         ` `           ` `             ``eth0` `           `</host_nic> `           ` `             ``eth1` `           `</host_nic> `         `</slaves> `       `</link_aggregation> `     `</host_nic> `   `</bonds> `   ` `     ` `       ` `       ` `         ``bond0` `       `</host_nic> `     `</network_attachment> `     ` `       ` `       ` `         ``bond0` `       `</host_nic> `     `</network_attachment> `   `</network_attachments>  `</action>`  

Break bond and configure its networks among its slaves

Configuration prior to the request:

   eth0 ---|             |-- network aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
           +--- bond0 ---+
   eth1 ---|             |-- network bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb

Desired configuration after the request:

   eth0 ---- network aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
   eth1 ---- network bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb

POST to /api/hosts/{host:id}/setupnetworks

  `     ` `       ` `         ` `         ` `           ``eth0` `         `</host_nic> `       `</network_attachment> `       ` `         ` `         ` `           ``eth1` `         `</host_nic> `       `</network_attachment> `     `</network_attachments> `     ` `       ` `         ``bond0` `       `</host_nic>      ``   `</action>`  

or alternatively use the network attachment id:

  `     ` `       ` `         ` `           ``eth0` `         `</host_nic> `       `</network_attachment> `       ` `         ` `           ``eth1` `         `</host_nic> `       `</network_attachment> `     `</network_attachments> `     ` `       ` `         ``bond0` `       `</host_nic>      ``  ` `</action>

Removing networks from a host

POST to /api/hosts/{host:id}/setupnetworks

  `   ` `     ` `     ` `     ` `   ` ` `