deb build system
[opencloud-plugin.git] / opencloud_models_v2.py
1 from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, PickleType
2 from sqlalchemy.schema import UniqueConstraint
3
4 from neutron.db.models_v2 import model_base
5
6 class PortForwarding(model_base.BASEV2):
7     """Ports to be forwarded through NAT """
8     __tablename__ = 'opencloud_port_forwarding'
9
10     port_id = Column(String(36),
11                      ForeignKey('ports.id', ondelete="CASCADE"),
12                      primary_key=True)
13     forward_ports = Column(PickleType)
14
15     def __init__(self, port_id, forward_ports):
16         self.port_id = port_id
17         self.forward_ports = forward_ports
18
19     def __repr__(self):
20         return "<PortForwarding(%s,%s)>" % (self.port_id, self.forward_ports)
21