midokura/python-midonetclient — pull request #163 by tomohikokimura (2014-05-15 06:01:13+00:00)
Title: [RFC] Adds Vtep and VtepBinding to Python Client / CLI.

NOTE FOR THIS RFC:
This implements VxLanPort as a single attribute with ObjectRef, which
requires VxLan ports to be top level objects. VxLan ports being a top
level objects means that it will show up as a candidate for completion
for, say, "list". To hide VxLan port from completion, added changes
to CollectionByType, etc, but those work only for list at the moment,
and not for "add", etc.

- Adds Vtep and VtepBinding, wrapper classes for corresponding Midonet
API DTOs.
- At the moment, all it can do is:
1) to create a VTEP,
2) list VTEPS,
3) add a VTEP binding.
- Also implemented CLI.

Sample code fragment:

# Create a new VTEP
# vtep_management_ip/port are assumed to contain right values.
vtep = mc.add_vtep().name('My VTEP').management_ip(vtep_management_ip).management_port(vtep_management_port).tunnel_zone_id(tunnel_zone_id').create()

# Add a new VTEP binding.
# bridge_id is assumed to contain a correct Mido bridge ID.
vtep_binding = vtep.add_binding().port_name('in1').network_id(bridge_id).create()

Sample CLI inputs:
create vtep management-ip 119.15.112.22 management-port 6633 tunnel-zone-id 7458850d-1bb3-4a0c-9cb9-2db37a178d04 name 'my cli vtep'
vtep management-ip 119.15.112.22 add binding port-name in1 vlan-id 127 network-id 9fdab92a-07ff-4616-95f4-ce53cc3f2d3f
bridge bridge0 list vxlan-port
> port port0 device bridge0 management-ip 119.15.112.22 vni 4277600

Not implemented yet:
- Allowing the specification of management address as IP-ADDR:PORT.
Eg. "management-address 119.15.112.22:6633"
- Allowing a tunnel-zone-reference for VTEP creation.
- Similarly allowing a bridge reference for network ID?

Fix MN-1586

#