Ejemplo n.º 1
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('portsecuritybindings')
    op.drop_table('networksecuritybindings')
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'servicetypes',
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'id', sa.String(36), nullable=False),
        sa.Column(u'name', sa.String(255), nullable=True),
        sa.Column(u'description', sa.String(255), nullable=True),
        sa.Column(u'default', sa.Boolean(),
                  autoincrement=False, nullable=False),
        sa.Column(u'num_instances', sa.Integer(),
                  autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(
        u'servicedefinitions',
        sa.Column(u'id', sa.String(36), nullable=False),
        sa.Column(u'service_class', sa.String(length=255),
                  nullable=False),
        sa.Column(u'plugin', sa.String(255), nullable=True),
        sa.Column(u'driver', sa.String(255), nullable=True),
        sa.Column(u'service_type_id', sa.String(36),
                  nullable=False),
        sa.ForeignKeyConstraint(['service_type_id'], [u'servicetypes.id'],
                                name=u'servicedefinitions_ibfk_1'),
        sa.PrimaryKeyConstraint(u'id', u'service_class', u'service_type_id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'networkdhcpagentbindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id')
    )
    op.create_table(
        'routerl3agentbindings',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('router_id', sa.String(length=36), nullable=True),
        sa.Column('l3_agent_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['l3_agent_id'], ['agents.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
Ejemplo n.º 4
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('portsecuritybindings')
    op.drop_table('networksecuritybindings')
Ejemplo n.º 5
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'servicetypes',
        sa.Column(u'tenant_id', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'id', mysql.VARCHAR(length=36), nullable=False),
        sa.Column(u'name', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'description', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'default', mysql.TINYINT(display_width=1),
                  autoincrement=False, nullable=False),
        sa.Column(u'num_instances', mysql.INTEGER(display_width=11),
                  autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(
        u'servicedefinitions',
        sa.Column(u'id', mysql.VARCHAR(length=36), nullable=False),
        sa.Column(u'service_class', mysql.VARCHAR(length=255),
                  nullable=False),
        sa.Column(u'plugin', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'driver', mysql.VARCHAR(length=255), nullable=True),
        sa.Column(u'service_type_id', mysql.VARCHAR(length=36),
                  nullable=False),
        sa.ForeignKeyConstraint(['service_type_id'], [u'servicetypes.id'],
                                name=u'servicedefinitions_ibfk_1'),
        sa.PrimaryKeyConstraint(u'id', u'service_class', u'service_type_id'))
Ejemplo n.º 6
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('networkconnections')
    op.drop_table('networkgatewaydevices')
    op.drop_table('networkgateways')
Ejemplo n.º 7
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'ml2_network_segments',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('network_type', sa.String(length=32), nullable=False),
        sa.Column('physical_network', sa.String(length=64), nullable=True),
        sa.Column('segmentation_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table(
        'ml2_vlan_allocations',
        sa.Column('physical_network', sa.String(length=64), nullable=False),
        sa.Column('vlan_id', sa.Integer(), autoincrement=False,
                  nullable=False),
        sa.Column('allocated', sa.Boolean(), autoincrement=False,
                  nullable=False),
        sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
    )
    op.create_table(
        'ml2_flat_allocations',
        sa.Column('physical_network', sa.String(length=64), nullable=False),
        sa.PrimaryKeyConstraint('physical_network')
    )
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ofctenantmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcnetworkmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcportmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
    op.create_table(
        'ofcfiltermappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'),
        sa.UniqueConstraint('ofc_id')
    )
Ejemplo n.º 9
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('networkconnections')
    op.drop_table('networkgatewaydevices')
    op.drop_table('networkgateways')
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('networksecuritybindings',
                    sa.Column('network_id', sa.String(length=36),
                    nullable=False),
                    sa.Column('port_security_enabled', sa.Boolean(),
                    nullable=False),
                    sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                    ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('network_id'))
    op.create_table('portsecuritybindings',
                    sa.Column('port_id', sa.String(length=36),
                    nullable=False),
                    sa.Column('port_security_enabled', sa.Boolean(),
                    nullable=False),
                    sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
                    ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('port_id'))
    ### end Alembic commands ###

    # Copy network and port ids over to network|port(securitybindings) table
    # and set port_security_enabled to false as ip address pairs were not
    # configured in NVP originally.
    op.execute("INSERT INTO networksecuritybindings SELECT id as "
               "network_id, False as port_security_enabled from networks")
    op.execute("INSERT INTO portsecuritybindings SELECT id as port_id, "
               "False as port_security_enabled from ports")
Ejemplo n.º 11
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "qosqueues",
        sa.Column("tenant_id", sa.String(length=255), nullable=True),
        sa.Column("id", sa.String(length=36), nullable=False),
        sa.Column("name", sa.String(length=255), nullable=True),
        sa.Column("default", sa.Boolean(), nullable=True),
        sa.Column("min", sa.Integer(), nullable=False),
        sa.Column("max", sa.Integer(), nullable=True),
        sa.Column("qos_marking", sa.Enum("untrusted", "trusted", name="qosqueues_qos_marking"), nullable=True),
        sa.Column("dscp", sa.Integer(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "networkqueuemappings",
        sa.Column("network_id", sa.String(length=36), nullable=False),
        sa.Column("queue_id", sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(["network_id"], ["networks.id"], ondelete="CASCADE"),
        sa.ForeignKeyConstraint(["queue_id"], ["qosqueues.id"], ondelete="CASCADE"),
        sa.PrimaryKeyConstraint("network_id"),
    )
    op.create_table(
        "portqueuemappings",
        sa.Column("port_id", sa.String(length=36), nullable=False),
        sa.Column("queue_id", sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(["port_id"], ["ports.id"], ondelete="CASCADE"),
        sa.ForeignKeyConstraint(["queue_id"], ["qosqueues.id"]),
        sa.PrimaryKeyConstraint("port_id", "queue_id"),
    )
Ejemplo n.º 12
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'networksecuritybindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))
    op.create_table(
        'portsecuritybindings',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id'))
    ### end Alembic commands ###

    # Copy network and port ids over to network|port(securitybindings) table
    # and set port_security_enabled to false as ip address pairs were not
    # configured in NVP originally.
    op.execute("INSERT INTO networksecuritybindings SELECT id as "
               "network_id, False as port_security_enabled from networks")
    op.execute("INSERT INTO portsecuritybindings SELECT id as port_id, "
               "False as port_security_enabled from ports")
Ejemplo n.º 13
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.add_column("routers", sa.Column("enable_snat", sa.Boolean(), nullable=False, default=True))
    # Set enable_snat to True for existing routers
    op.execute("UPDATE routers SET enable_snat=True")
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table(u'port_bindings')
    op.drop_table(u'services_bindings')
    op.drop_table(u'portprofiles')
    op.drop_table(u'portprofile_bindings')
Ejemplo n.º 15
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table(u'port_bindings')
    op.drop_table(u'services_bindings')
    op.drop_table(u'portprofiles')
    op.drop_table(u'portprofile_bindings')
Ejemplo n.º 16
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("portqueuemappings")
    op.drop_table("networkqueuemappings")
    op.drop_table("qosqueues")
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("securitygroupportbindings")
    op.drop_table("securitygrouprules")
    op.drop_table("securitygroups")
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('ofcfiltermappings')
    op.drop_table('ofcportmappings')
    op.drop_table('ofcnetworkmappings')
    op.drop_table('ofctenantmappings')
Ejemplo n.º 19
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ml2_network_segments')
    op.drop_table('ml2_flat_allocations')
    op.drop_table('ml2_vlan_allocations')
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('ofcfiltermappings')
    op.drop_table('ofcportmappings')
    op.drop_table('ofcnetworkmappings')
    op.drop_table('ofctenantmappings')
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.rename_table(
        'subnetroutes',
        'routes',
    )
    op.drop_table('routerroutes')
Ejemplo n.º 22
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.add_column(
        'routers',
        sa.Column('enable_snat', sa.Boolean(), nullable=False, default=True))
    # Set enable_snat to True for existing routers
    op.execute("UPDATE routers SET enable_snat=True")
Ejemplo n.º 23
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ovs_tunnel_ips',
        sa.Column('ip_address', sa.String(length=255), nullable=False),
        sa.PrimaryKeyConstraint('ip_address')
    )
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'maclearningstates',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('mac_learning_enabled', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id'))
Ejemplo n.º 25
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ofp_server',
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('address', sa.String(length=255)),
        sa.Column('host_type', sa.String(length=255)),
        sa.PrimaryKeyConstraint(u'id'))
Ejemplo n.º 26
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'quantum_nvp_port_mapping',
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.Column('nvp_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('quantum_id'))
Ejemplo n.º 27
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'quantum_nvp_port_mapping',
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.Column('nvp_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('quantum_id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'portbindingports',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('host', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id')
    )
Ejemplo n.º 29
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table(u'poolstatisticss')
    op.drop_table(u'members')
    op.drop_table(u'healthmonitors')
    op.drop_table(u'pools')
    op.drop_table(u'sessionpersistences')
    op.drop_table(u'poolmonitorassociations')
    op.drop_table(u'vips')
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'quotas', sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('resource', sa.String(length=255), nullable=True),
        sa.Column('limit', sa.Integer(), nullable=True),
        sa.PrimaryKeyConstraint('id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('portlocations',
                    sa.Column('port_id', sa.String(length=255),
                              primary_key=True, nullable=False),
                    sa.Column('host_id',
                              sa.String(length=255), nullable=False)
                    )
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ofp_server',
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('address', sa.String(length=255)),
        sa.Column('host_type', sa.String(length=255)),
        sa.PrimaryKeyConstraint(u'id')
    )
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'maclearningstates',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('mac_learning_enabled', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(
        ['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('port_id'))
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return
    op.alter_column('nvp_network_bindings', 'phy_uuid',
                    name='tz_uuid',
                    existing_type=sa.String(36),
                    existing_nullable=True)
    op.alter_column('nvp_network_bindings', 'binding_type',
                    type_=sa.Enum('flat', 'vlan', 'stt', 'gre',
                                  name='nvp_network_bindings_binding_type'),
                    existing_nullable=True)
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'quotas',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('resource', sa.String(length=255), nullable=True),
        sa.Column('limit', sa.Integer(), nullable=True),
        sa.PrimaryKeyConstraint('id')
    )
Ejemplo n.º 36
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'nvp_network_bindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('binding_type', sa.Enum('flat', 'vlan', 'stt', 'gre'),
                  nullable=False),
        sa.Column('tz_uuid', sa.String(length=36), nullable=True),
        sa.Column('vlan_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'port_bindings',
        sa.Column(u'id', sa.Integer(), autoincrement=True,
                  nullable=False),
        sa.Column(u'port_id', sa.String(255), nullable=False),
        sa.Column(u'blade_intf_dn', sa.String(255), nullable=False),
        sa.Column(u'portprofile_name', sa.String(255),
                  nullable=True),
        sa.Column(u'vlan_name', sa.String(255), nullable=True),
        sa.Column(u'vlan_id', sa.Integer(), nullable=True),
        sa.Column(u'qos', sa.String(255), nullable=True),
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'vif_id', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint(u'id')
    )
    op.create_table(
        u'service_bindings',
        sa.Column(u'id', sa.Integer(), autoincrement=True,
                  nullable=False),
        sa.Column(u'service_id', sa.String(255), nullable=True),
        sa.Column(u'mnget_id', sa.String(255), nullable=True),
        sa.Column(u'nbnet_id', sa.String(255), nullable=True),
        sa.Column(u'sbnet_id', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint(u'id')
    )
    op.create_table(
        u'portprofiles',
        sa.Column(u'uuid', sa.String(255), nullable=False),
        sa.Column(u'name', sa.String(255), nullable=True),
        sa.Column(u'vlan_id', sa.Integer(), nullable=True),
        sa.Column(u'qos', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint(u'uuid')
    )
    op.create_table(
        u'portprofile_bindings',
        sa.Column(u'id', sa.String(255), nullable=False),
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'port_id', sa.Integer(), nullable=True),
        sa.Column(u'portprofile_id', sa.String(255), nullable=True),
        sa.Column(u'portprofile_id', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(['portprofile_id'], ['portprofiles.uuid'], ),
        sa.ForeignKeyConstraint(['ports'], ['ports.id'], ),
        sa.PrimaryKeyConstraint(u'id')
    )
Ejemplo n.º 38
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return
    op.alter_column('nvp_network_bindings',
                    'phy_uuid',
                    name='tz_uuid',
                    existing_type=sa.String(36),
                    existing_nullable=True)
    op.alter_column('nvp_network_bindings',
                    'binding_type',
                    type_=sa.Enum('flat',
                                  'vlan',
                                  'stt',
                                  'gre',
                                  name='nvp_network_bindings_binding_type'),
                    existing_nullable=True)
Ejemplo n.º 39
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return
    op.create_table('networkgateways',
                    sa.Column('id', sa.String(length=36), nullable=False),
                    sa.Column('name', sa.String(length=255), nullable=True),
                    sa.Column('tenant_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('shared', sa.Boolean(), nullable=True),
                    sa.PrimaryKeyConstraint('id'))
    op.create_table('networkgatewaydevices',
                    sa.Column('id', sa.String(length=36), nullable=False),
                    sa.Column('network_gateway_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('interface_name', sa.String(length=64),
                              nullable=True),
                    sa.ForeignKeyConstraint(['network_gateway_id'],
                                            ['networkgateways.id'],
                                            ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('id'))
    op.create_table('networkconnections',
                    sa.Column('tenant_id', sa.String(length=255),
                              nullable=True),
                    sa.Column('network_gateway_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('network_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('segmentation_type',
                              sa.Enum('flat', 'vlan',
                                      name="net_conn_seg_type"),
                              nullable=True),
                    sa.Column('segmentation_id', sa.Integer(),
                              nullable=True),
                    sa.Column('port_id', sa.String(length=36),
                              nullable=False),
                    sa.ForeignKeyConstraint(['network_gateway_id'],
                                            ['networkgateways.id'],
                                            ondelete='CASCADE'),
                    sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                            ondelete='CASCADE'),
                    sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
                                            ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('port_id'),
                    sa.UniqueConstraint('network_gateway_id',
                                        'segmentation_type',
                                        'segmentation_id'))
Ejemplo n.º 40
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        "tunnelkeys",
        sa.Column("network_id", sa.String(length=36), nullable=False),
        sa.Column("last_key", sa.Integer(), autoincrement=False, nullable=False),
        sa.ForeignKeyConstraint(["network_id"], ["networks.id"], ondelete="CASCADE"),
        sa.PrimaryKeyConstraint("last_key"),
    )

    op.create_table(
        "tunnelkeylasts",
        sa.Column("last_key", sa.Integer(), autoincrement=False, nullable=False),
        sa.PrimaryKeyConstraint("last_key"),
    )
Ejemplo n.º 41
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return
    op.create_table('networkgateways',
                    sa.Column('id', sa.String(length=36), nullable=False),
                    sa.Column('name', sa.String(length=255), nullable=True),
                    sa.Column('tenant_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('shared', sa.Boolean(), nullable=True),
                    sa.PrimaryKeyConstraint('id'))
    op.create_table('networkgatewaydevices',
                    sa.Column('id', sa.String(length=36), nullable=False),
                    sa.Column('network_gateway_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('interface_name', sa.String(length=64),
                              nullable=True),
                    sa.ForeignKeyConstraint(['network_gateway_id'],
                                            ['networkgateways.id'],
                                            ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('id'))
    op.create_table('networkconnections',
                    sa.Column('tenant_id', sa.String(length=255),
                              nullable=True),
                    sa.Column('network_gateway_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('network_id', sa.String(length=36),
                              nullable=True),
                    sa.Column('segmentation_type',
                              sa.Enum('flat', 'vlan',
                                      name="net_conn_seg_type"),
                              nullable=True),
                    sa.Column('segmentation_id', sa.Integer(),
                              nullable=True),
                    sa.Column('port_id', sa.String(length=36),
                              nullable=False),
                    sa.ForeignKeyConstraint(['network_gateway_id'],
                                            ['networkgateways.id'],
                                            ondelete='CASCADE'),
                    sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                            ondelete='CASCADE'),
                    sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
                                            ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('port_id'),
                    sa.UniqueConstraint('network_gateway_id',
                                        'segmentation_type',
                                        'segmentation_id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'securitygroups',
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('name', sa.String(length=255), nullable=True),
        sa.Column('description', sa.String(length=255), nullable=True),
        sa.Column('external_id', sa.Integer(), nullable=True),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('external_id')
    )
    op.create_table(
        'securitygrouprules',
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('external_id', sa.Integer(), nullable=True),
        sa.Column('security_group_id', sa.String(length=36), nullable=False),
        sa.Column('source_group_id', sa.String(length=36), nullable=True),
        sa.Column('direction',
                  sa.Enum('ingress', 'egress',
                          name='securitygrouprules_direction'),
                  nullable=True),
        sa.Column('ethertype', sa.String(length=40), nullable=True),
        sa.Column('protocol', sa.String(length=40), nullable=True),
        sa.Column('port_range_min', sa.Integer(), nullable=True),
        sa.Column('port_range_max', sa.Integer(), nullable=True),
        sa.Column('source_ip_prefix', sa.String(length=255), nullable=True),
        sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['source_group_id'], ['securitygroups.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table(
        'securitygroupportbindings',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('security_group_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id']),
        sa.PrimaryKeyConstraint('port_id', 'security_group_id')
    )
Ejemplo n.º 43
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'agents', sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('agent_type', sa.String(length=255), nullable=False),
        sa.Column('binary', sa.String(length=255), nullable=False),
        sa.Column('topic', sa.String(length=255), nullable=False),
        sa.Column('host', sa.String(length=255), nullable=False),
        sa.Column('admin_state_up', sa.Boolean(), nullable=False),
        sa.Column('created_at', sa.DateTime(), nullable=False),
        sa.Column('started_at', sa.DateTime(), nullable=False),
        sa.Column('heartbeat_timestamp', sa.DateTime(), nullable=False),
        sa.Column('description', sa.String(length=255), nullable=True),
        sa.Column('configurations', sa.String(length=4095), nullable=False),
        sa.PrimaryKeyConstraint('id'))
Ejemplo n.º 44
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        u'port_bindings',
        sa.Column(u'id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column(u'port_id', sa.String(255), nullable=False),
        sa.Column(u'blade_intf_dn', sa.String(255), nullable=False),
        sa.Column(u'portprofile_name', sa.String(255), nullable=True),
        sa.Column(u'vlan_name', sa.String(255), nullable=True),
        sa.Column(u'vlan_id', sa.Integer(), nullable=True),
        sa.Column(u'qos', sa.String(255), nullable=True),
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'vif_id', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(
        u'service_bindings',
        sa.Column(u'id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column(u'service_id', sa.String(255), nullable=True),
        sa.Column(u'mnget_id', sa.String(255), nullable=True),
        sa.Column(u'nbnet_id', sa.String(255), nullable=True),
        sa.Column(u'sbnet_id', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint(u'id'))
    op.create_table(u'portprofiles',
                    sa.Column(u'uuid', sa.String(255), nullable=False),
                    sa.Column(u'name', sa.String(255), nullable=True),
                    sa.Column(u'vlan_id', sa.Integer(), nullable=True),
                    sa.Column(u'qos', sa.String(255), nullable=True),
                    sa.PrimaryKeyConstraint(u'uuid'))
    op.create_table(
        u'portprofile_bindings',
        sa.Column(u'id', sa.String(255), nullable=False),
        sa.Column(u'tenant_id', sa.String(255), nullable=True),
        sa.Column(u'port_id', sa.Integer(), nullable=True),
        sa.Column(u'portprofile_id', sa.String(255), nullable=True),
        sa.Column(u'portprofile_id', sa.Boolean(), nullable=False),
        sa.ForeignKeyConstraint(
            ['portprofile_id'],
            ['portprofiles.uuid'],
        ), sa.ForeignKeyConstraint(
            ['ports'],
            ['ports.id'],
        ), sa.PrimaryKeyConstraint(u'id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'nvp_network_bindings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('binding_type',
                  sa.Enum('flat',
                          'vlan',
                          'stt',
                          'gre',
                          name='nvp_network_bindings_binding_type'),
                  nullable=False),
        sa.Column('tz_uuid', sa.String(length=36), nullable=True),
        sa.Column('vlan_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))
Ejemplo n.º 46
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'routerrules', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('source', sa.String(length=64), nullable=False),
        sa.Column('destination', sa.String(length=64), nullable=False),
        sa.Column('action', sa.String(length=10), nullable=False),
        sa.Column('router_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'nexthops', sa.Column('rule_id', sa.Integer(), nullable=False),
        sa.Column('nexthop', sa.String(length=64), nullable=False),
        sa.ForeignKeyConstraint(['rule_id'], ['routerrules.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('rule_id', 'nexthop'))
Ejemplo n.º 47
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'tunnelkeys',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('last_key', sa.Integer(), autoincrement=False,
                  nullable=False),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('last_key')
    )

    op.create_table(
        'tunnelkeylasts',
        sa.Column('last_key', sa.Integer(), autoincrement=False,
                  nullable=False),
        sa.PrimaryKeyConstraint('last_key')
    )
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'securitygroups',
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('name', sa.String(length=255), nullable=True),
        sa.Column('description', sa.String(length=255), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'securitygrouprules',
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('security_group_id', sa.String(length=36), nullable=False),
        sa.Column('remote_group_id', sa.String(length=36), nullable=True),
        sa.Column('direction',
                  sa.Enum('ingress',
                          'egress',
                          name='securitygrouprules_direction'),
                  nullable=True),
        sa.Column('ethertype', sa.String(length=40), nullable=True),
        sa.Column('protocol', sa.String(length=40), nullable=True),
        sa.Column('port_range_min', sa.Integer(), nullable=True),
        sa.Column('port_range_max', sa.Integer(), nullable=True),
        sa.Column('remote_ip_prefix', sa.String(length=255), nullable=True),
        sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['remote_group_id'], ['securitygroups.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'securitygroupportbindings',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('security_group_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['security_group_id'], ['securitygroups.id']),
        sa.PrimaryKeyConstraint('port_id', 'security_group_id'))
Ejemplo n.º 49
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'qosqueues',
        sa.Column('tenant_id', sa.String(length=255), nullable=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('name', sa.String(length=255), nullable=True),
        sa.Column('default', sa.Boolean(), nullable=True),
        sa.Column('min', sa.Integer(), nullable=False),
        sa.Column('max', sa.Integer(), nullable=True),
        sa.Column('qos_marking',
                  sa.Enum('untrusted', 'trusted',
                          name='qosqueues_qos_marking'),
                  nullable=True), sa.Column('dscp',
                                            sa.Integer(),
                                            nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'networkqueuemappings',
        sa.Column('network_id', sa.String(length=36), nullable=False),
        sa.Column('queue_id', sa.String(length=36), nullable=True),
        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'],
                                ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('network_id'))
    op.create_table(
        'portqueuemappings',
        sa.Column('port_id', sa.String(length=36), nullable=False),
        sa.Column('queue_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),
        sa.ForeignKeyConstraint(
            ['queue_id'],
            ['qosqueues.id'],
        ), sa.PrimaryKeyConstraint('port_id', 'queue_id'))
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.create_table(
        'ofctenantmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'), sa.UniqueConstraint('ofc_id'))
    op.create_table(
        'ofcnetworkmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'), sa.UniqueConstraint('ofc_id'))
    op.create_table(
        'ofcportmappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'), sa.UniqueConstraint('ofc_id'))
    op.create_table(
        'ofcfiltermappings',
        sa.Column('ofc_id', sa.String(length=255), nullable=False),
        sa.Column('quantum_id', sa.String(length=36), nullable=False),
        sa.PrimaryKeyConstraint('quantum_id'), sa.UniqueConstraint('ofc_id'))
Ejemplo n.º 51
0
def upgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('ofp_server')
Ejemplo n.º 52
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('agents')
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_table('nvp_network_bindings')
Ejemplo n.º 54
0
def downgrade(active_plugin=None, options=None):
    if not migration.should_run(active_plugin, migration_for_plugins):
        return

    op.drop_column('routers', 'enable_snat')