Add support for Router/Bridge port DTOs.

Deprecate Interior/Exterior* port types and replace them with
Router/Bridge DTOs.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Add helper methods to get DHCP data

Add methods to get DHCP host entry given mac and IP.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Add fake port group fields for rule

Rule accepts port group dst and src so that the integration work
can go on without getting API errors.  This is intentional as
this feature will be implemented soon.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
CLI: use the unified ports API

Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>
Add support for port to get back port group membership

Implement the client side for the feature to return port group
membership given a port.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Add new methods to add rule and route

Add methods to add rule and route that require no chaining.

Signed-off-by: Ryu Ishimoto <ryu@midokkura.com>
Fix _ensure_application()

Previously, the first time _ensure_application() was called, if
the mido-api was down then the self.app.get() request would fail
with a socket error. The next time _ensure_application() was
called, self.app is already set so it does nothing. Instead after
_ensure_application passes the subsequent request will
fail because self.dto is still empty.
This commit just resets self.app to None if get() fails.
Note:
_ensure_application() wouldn't fail twice in the real world
since the first time (uncaught socket error) would crash the
plugin, however in the debugger the previous behaviour
was very confusing since the error would shift somewhere
else after the first call.
Add methods to link and create port.

Add methods useful to remove need for chaining.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Added add_host_interface_port in api.py

Signed-off-by: Rossella Sblendido <rossella@midokura.com>
Add add_bridge_port method

Add add_bridge_port that does not require chaining of calls to
create a bridge port.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Corrected typo
Fix the bug in route add

Fix the route add method to set the proper DTO fields.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Add MidoApiConnectionRefused exception.

Throw and catch a MidoApiConnectionRefused exception insead of
a socket error. _ensure_application() will now raise a
MidoApiConnectionRefused exception as well. We could have Neutron
catch this if an api call fails, so that neutron doesn't crash if
an api call is made while the midonet-api is down.
Reraise exception if other socket error

If a socket error occurs besides econnrefused, just reraise it.
Fixed typos in rule creation and add_host_interface
Add port group src/dst support for rules.

Make port group src and dst to be settable to match the most
recent API.

Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Set correct ObjectRef for port group src and dst

Signed-off-by: Rossella Sblendido <rossella@midokura.com>
Merge pull request #67 from midokura/new_port_types

New port types