Hi All,
After digging into the port mirroring feature I suggest a different
modeling of it in the API.
The current modeling is to add to vnic a boolean property of
port-mirroring, e.g.
api/vms/{vm-id}/nics
<nics>
<nic>
...
<network href="/api/networks/{network-id}"
id="{network-id}"/>
<port-mirroring> true </port mirroring>
</nic>
</VM>
This modeling imply 2 limitations:
1. The vnic must be connected to the network it wants to monitor
2. the nic can mirror only a single network
Both of the above limitations are correct to the current implementation.
Going forward we might want to introduce the above functionalities and
the above modeling won't hold.
Instead of the above I suggest to change the port-mirroring property to
a list of networks.
<nics>
<nic>
...
<network href="/api/networks/{network-id}"
id="{network-id}"/>
<port-mirroring>
<network href="/api/networks/{network-id}"
id="{network-id}"/>
....
</port mirroring>
</nic>
</VM>
In this version we'll validate that the network under port-mirroring is
equal to the network the vnic is connected to, in future versions we can
remove this validation without changing the API.
Thanks, Livnat