Remove some unused DB modles and apis
Change-Id: If03beaecf596f4cb1b02f6059f6db2b9e88d913e
This commit is contained in:
parent
97c00a3ebb
commit
0da0159c38
@ -330,19 +330,6 @@ def delete_neutron_nsx_router_mapping(session, neutron_id):
|
|||||||
session, nsx_models.NeutronNsxRouterMapping, neutron_id)
|
session, nsx_models.NeutronNsxRouterMapping, neutron_id)
|
||||||
|
|
||||||
|
|
||||||
def unset_default_network_gateways(session):
|
|
||||||
with session.begin(subtransactions=True):
|
|
||||||
session.query(nsx_models.NetworkGateway).update(
|
|
||||||
{nsx_models.NetworkGateway.default: False})
|
|
||||||
|
|
||||||
|
|
||||||
def set_default_network_gateway(session, gw_id):
|
|
||||||
with session.begin(subtransactions=True):
|
|
||||||
gw = (session.query(nsx_models.NetworkGateway).
|
|
||||||
filter_by(id=gw_id).one())
|
|
||||||
gw['default'] = True
|
|
||||||
|
|
||||||
|
|
||||||
def set_multiprovider_network(session, network_id):
|
def set_multiprovider_network(session, network_id):
|
||||||
with session.begin(subtransactions=True):
|
with session.begin(subtransactions=True):
|
||||||
multiprovider_network = nsx_models.MultiProviderNetworks(
|
multiprovider_network = nsx_models.MultiProviderNetworks(
|
||||||
@ -402,29 +389,6 @@ def delete_qos_policy_profile_mapping(session, qos_policy_id):
|
|||||||
filter_by(qos_policy_id=qos_policy_id).delete())
|
filter_by(qos_policy_id=qos_policy_id).delete())
|
||||||
|
|
||||||
|
|
||||||
# NSXv3 Port Mirror Sessions DB methods.
|
|
||||||
def add_port_mirror_session_mapping(session, tf_id, pm_session_id):
|
|
||||||
with session.begin(subtransactions=True):
|
|
||||||
mapping = nsx_models.NsxPortMirrorSessionMapping(
|
|
||||||
tap_flow_id=tf_id,
|
|
||||||
port_mirror_session_id=pm_session_id)
|
|
||||||
session.add(mapping)
|
|
||||||
return mapping
|
|
||||||
|
|
||||||
|
|
||||||
def get_port_mirror_session_mapping(session, tf_id):
|
|
||||||
try:
|
|
||||||
return (session.query(nsx_models.NsxPortMirrorSessionMapping).
|
|
||||||
filter_by(tap_flow_id=tf_id).one())
|
|
||||||
except exc.NoResultFound:
|
|
||||||
raise nsx_exc.NsxPortMirrorSessionMappingNotFound(tf=tf_id)
|
|
||||||
|
|
||||||
|
|
||||||
def delete_port_mirror_session_mapping(session, tf_id):
|
|
||||||
return (session.query(nsx_models.NsxPortMirrorSessionMapping).
|
|
||||||
filter_by(tap_flow_id=tf_id).delete())
|
|
||||||
|
|
||||||
|
|
||||||
@db_api.CONTEXT_WRITER
|
@db_api.CONTEXT_WRITER
|
||||||
def save_sg_mappings(context, sg_id, nsgroup_id, section_id):
|
def save_sg_mappings(context, sg_id, nsgroup_id, section_id):
|
||||||
context.session.add(
|
context.session.add(
|
||||||
|
@ -217,6 +217,7 @@ class NetworkConnection(model_base.BASEV2, model_base.HasProject,
|
|||||||
|
|
||||||
|
|
||||||
class NetworkGatewayDeviceReference(model_base.BASEV2, models.TimestampMixin):
|
class NetworkGatewayDeviceReference(model_base.BASEV2, models.TimestampMixin):
|
||||||
|
# This table is no longer in use
|
||||||
id = sa.Column(sa.String(36), primary_key=True)
|
id = sa.Column(sa.String(36), primary_key=True)
|
||||||
network_gateway_id = sa.Column(sa.String(36),
|
network_gateway_id = sa.Column(sa.String(36),
|
||||||
sa.ForeignKey('networkgateways.id',
|
sa.ForeignKey('networkgateways.id',
|
||||||
@ -227,6 +228,7 @@ class NetworkGatewayDeviceReference(model_base.BASEV2, models.TimestampMixin):
|
|||||||
|
|
||||||
class NetworkGatewayDevice(model_base.BASEV2, model_base.HasId,
|
class NetworkGatewayDevice(model_base.BASEV2, model_base.HasId,
|
||||||
model_base.HasProject, models.TimestampMixin):
|
model_base.HasProject, models.TimestampMixin):
|
||||||
|
# This table is no longer in use
|
||||||
nsx_id = sa.Column(sa.String(36))
|
nsx_id = sa.Column(sa.String(36))
|
||||||
# Optional name for the gateway device
|
# Optional name for the gateway device
|
||||||
name = sa.Column(sa.String(255))
|
name = sa.Column(sa.String(255))
|
||||||
@ -242,6 +244,7 @@ class NetworkGatewayDevice(model_base.BASEV2, model_base.HasId,
|
|||||||
class NetworkGateway(model_base.BASEV2, model_base.HasId,
|
class NetworkGateway(model_base.BASEV2, model_base.HasId,
|
||||||
model_base.HasProject, models.TimestampMixin):
|
model_base.HasProject, models.TimestampMixin):
|
||||||
"""Defines the data model for a network gateway."""
|
"""Defines the data model for a network gateway."""
|
||||||
|
# This table is no longer in use
|
||||||
name = sa.Column(sa.String(255))
|
name = sa.Column(sa.String(255))
|
||||||
default = sa.Column(sa.Boolean())
|
default = sa.Column(sa.Boolean())
|
||||||
devices = orm.relationship(NetworkGatewayDeviceReference,
|
devices = orm.relationship(NetworkGatewayDeviceReference,
|
||||||
@ -317,6 +320,7 @@ class QosPolicySwitchProfile(model_base.BASEV2, models.TimestampMixin):
|
|||||||
|
|
||||||
class NsxPortMirrorSessionMapping(model_base.BASEV2):
|
class NsxPortMirrorSessionMapping(model_base.BASEV2):
|
||||||
"""Define a mapping between Tap Flow and PortMirrorSession object."""
|
"""Define a mapping between Tap Flow and PortMirrorSession object."""
|
||||||
|
# This table is no longer in use
|
||||||
__tablename__ = 'nsx_port_mirror_session_mappings'
|
__tablename__ = 'nsx_port_mirror_session_mappings'
|
||||||
tap_flow_id = sa.Column(sa.String(36),
|
tap_flow_id = sa.Column(sa.String(36),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user