midokura/python-midonetclient — pull request #164 by tomohikokimura (2014-05-16 01:55:00+00:00)
Title: Adds Vtep and VtepBinding to Python Client / CLI.

This implementation makes CLI handle a VxLan port as one of normal
ports.

- 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:
midonet> 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
midonet> bridge bridge0 list port
port port0 device bridge0 state up
port port1 device bridge0 state up vlan -1 management-ip 119.15.112.22 vni 6692687

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