| 1 |
# Copyright (c) 2015 OpenStack Foundation |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 12 |
# implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
|
| 16 |
from neutron_lib.db import model_base |
| 17 |
import sqlalchemy as sa |
| 18 |
|
| 19 |
|
| 20 |
class PhysicalLocators(model_base.BASEV2): |
| 21 |
__tablename__ = 'physical_locators' |
| 22 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 23 |
dst_ip = sa.Column(sa.String(64), nullable=True) |
| 24 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 25 |
primary_key=True) |
| 26 |
|
| 27 |
|
| 28 |
class PhysicalSwitches(model_base.BASEV2): |
| 29 |
__tablename__ = 'physical_switches' |
| 30 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 31 |
name = sa.Column(sa.String(255), nullable=True) |
| 32 |
tunnel_ip = sa.Column(sa.String(64), nullable=True) |
| 33 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 34 |
primary_key=True) |
| 35 |
switch_fault_status = sa.Column(sa.String(length=32), nullable=True) |
| 36 |
|
| 37 |
|
| 38 |
class PhysicalPorts(model_base.BASEV2): |
| 39 |
__tablename__ = 'physical_ports' |
| 40 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 41 |
name = sa.Column(sa.String(255), nullable=True) |
| 42 |
physical_switch_id = sa.Column(sa.String(36), nullable=True) |
| 43 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 44 |
primary_key=True) |
| 45 |
port_fault_status = sa.Column(sa.String(length=32), nullable=True) |
| 46 |
|
| 47 |
|
| 48 |
class LogicalSwitches(model_base.BASEV2): |
| 49 |
__tablename__ = 'logical_switches' |
| 50 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 51 |
name = sa.Column(sa.String(255), nullable=True) |
| 52 |
key = sa.Column(sa.Integer, nullable=True) |
| 53 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 54 |
primary_key=True) |
| 55 |
|
| 56 |
|
| 57 |
class UcastMacsLocals(model_base.BASEV2): |
| 58 |
__tablename__ = 'ucast_macs_locals' |
| 59 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 60 |
mac = sa.Column(sa.String(32), nullable=True) |
| 61 |
logical_switch_id = sa.Column(sa.String(36), nullable=True) |
| 62 |
physical_locator_id = sa.Column(sa.String(36), nullable=True) |
| 63 |
ip_address = sa.Column(sa.String(64), nullable=True) |
| 64 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 65 |
primary_key=True) |
| 66 |
|
| 67 |
|
| 68 |
class UcastMacsRemotes(model_base.BASEV2): |
| 69 |
__tablename__ = 'ucast_macs_remotes' |
| 70 |
uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 71 |
mac = sa.Column(sa.String(32), nullable=True) |
| 72 |
logical_switch_id = sa.Column(sa.String(36), nullable=True) |
| 73 |
physical_locator_id = sa.Column(sa.String(36), nullable=True) |
| 74 |
ip_address = sa.Column(sa.String(64), nullable=True) |
| 75 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 76 |
primary_key=True) |
| 77 |
|
| 78 |
|
| 79 |
class VlanBindings(model_base.BASEV2): |
| 80 |
__tablename__ = 'vlan_bindings' |
| 81 |
port_uuid = sa.Column(sa.String(36), nullable=False, primary_key=True) |
| 82 |
vlan = sa.Column(sa.Integer, nullable=False, primary_key=True) |
| 83 |
logical_switch_uuid = sa.Column(sa.String(36), nullable=False, |
| 84 |
primary_key=True) |
| 85 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False, |
| 86 |
primary_key=True) |
| 87 |
|
| 88 |
|
| 89 |
class PendingUcastMacsRemote(model_base.BASEV2, model_base.HasId): |
| 90 |
__tablename__ = 'pending_ucast_macs_remotes' |
| 91 |
uuid = sa.Column(sa.String(36), nullable=True) |
| 92 |
mac = sa.Column(sa.String(32), nullable=False) |
| 93 |
logical_switch_uuid = sa.Column(sa.String(36), nullable=False) |
| 94 |
locator_uuid = sa.Column(sa.String(36), nullable=True) |
| 95 |
dst_ip = sa.Column(sa.String(64)) |
| 96 |
vm_ip = sa.Column(sa.String(64)) |
| 97 |
ovsdb_identifier = sa.Column(sa.String(64), nullable=False) |
| 98 |
operation = sa.Column(sa.String(8), nullable=False) |
| 99 |
timestamp = sa.Column(sa.DateTime, nullable=False) |