Adding network driver interface
Definition of network driver interface. Also removed the floating_ip attributes of VIP because they are not needed at this point. Also renamed net_port_id to just port_id and subnet_id to network_id just to be a little bit more generically clear. Change-Id: Ic82cb2ab25fbba7dc8caa875552f4caeafb0e4af Implements: bp/network-driver-interface
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# Copyright 2014 Rackspace
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""update vip
|
||||
|
||||
Revision ID: 14892634e228
|
||||
Revises: 13500e2e978d
|
||||
Create Date: 2015-01-10 00:53:57.798213
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '14892634e228'
|
||||
down_revision = '13500e2e978d'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table(u'vip') as batch_op:
|
||||
batch_op.alter_column(u'subnet_id', new_column_name=u'network_id',
|
||||
existing_type=sa.String(36))
|
||||
batch_op.alter_column(u'net_port_id', new_column_name=u'port_id',
|
||||
existing_type=sa.String(36))
|
||||
batch_op.drop_column(u'floating_ip_id')
|
||||
batch_op.drop_column(u'floating_ip_network_id')
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table(u'vip') as batch_op:
|
||||
batch_op.add_column(sa.Column(u'floating_ip_network_id',
|
||||
sa.String(36), nullable=True))
|
||||
batch_op.add_column(sa.Column(u'floating_ip_id', sa.String(36),
|
||||
nullable=True))
|
||||
batch_op.alter_column(u'port_id', new_column_name=u'net_port_id',
|
||||
existing_type=sa.String(36))
|
||||
batch_op.alter_column(u'network_id', new_column_name=u'subnet_id',
|
||||
existing_type=sa.String(36))
|
||||
@@ -227,10 +227,8 @@ class Vip(base_models.BASE):
|
||||
name="fk_vip_load_balancer_id"),
|
||||
nullable=False, primary_key=True)
|
||||
ip_address = sa.Column(sa.String(36), nullable=True)
|
||||
net_port_id = sa.Column(sa.String(36), nullable=True)
|
||||
subnet_id = sa.Column(sa.String(36), nullable=True)
|
||||
floating_ip_id = sa.Column(sa.String(36), nullable=True)
|
||||
floating_ip_network_id = sa.Column(sa.String(36), nullable=True)
|
||||
port_id = sa.Column(sa.String(36), nullable=True)
|
||||
network_id = sa.Column(sa.String(36), nullable=True)
|
||||
load_balancer = orm.relationship("LoadBalancer", uselist=False,
|
||||
backref=orm.backref("vip", uselist=False,
|
||||
cascade="delete"))
|
||||
|
||||
Reference in New Issue
Block a user