"Fossies" - the Fresh Open Source Software Archive

Member "tacker-4.0.0/tacker/db/migration/alembic_migrations/versions/985e28392890_add_vnflcm_db.py" (14 Oct 2020, 4800 Bytes) of package /linux/misc/openstack/tacker-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "985e28392890_add_vnflcm_db.py" see the Fossies "Dox" file reference documentation.

    1 # Copyright (C) 2020 NTT DATA
    2 # All Rights Reserved.
    3 #
    4 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    5 #    not use this file except in compliance with the License. You may obtain
    6 #    a copy of the License at
    7 #
    8 #         http://www.apache.org/licenses/LICENSE-2.0
    9 #
   10 #    Unless required by applicable law or agreed to in writing, software
   11 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   12 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   13 #    License for the specific language governing permissions and limitations
   14 #    under the License.
   15 #
   16 
   17 # flake8: noqa: E402
   18 
   19 """VNF instance management changes
   20 
   21 Revision ID: 985e28392890
   22 Revises: 975e28392888
   23 Create Date: 2019-12-10 02:40:12.966027
   24 
   25 """
   26 
   27 # revision identifiers, used by Alembic.
   28 revision = '985e28392890'
   29 down_revision = '975e28392888'
   30 
   31 from alembic import op
   32 import sqlalchemy as sa
   33 from sqlalchemy import Boolean
   34 
   35 from tacker.db import types
   36 
   37 
   38 def upgrade(active_plugins=None, options=None):
   39     op.create_table(
   40         'vnf_instances',
   41         sa.Column('id', types.Uuid(length=36), nullable=False),
   42         sa.Column('vnf_instance_name', sa.String(length=255), nullable=True,
   43             default=""),
   44         sa.Column('vnf_instance_description',
   45                   sa.String(length=1024), nullable=True, default=""),
   46         sa.Column('vnfd_id', types.Uuid(length=36), nullable=False),
   47         sa.Column('vnf_provider', sa.String(length=255), nullable=False),
   48         sa.Column('vnf_product_name', sa.String(length=255), nullable=False),
   49         sa.Column('vnf_software_version', sa.String(length=255),
   50                   nullable=False),
   51         sa.Column('vnfd_version', sa.String(length=255), nullable=False),
   52         sa.Column('instantiation_state',
   53                   sa.String(length=255), nullable=False),
   54         sa.Column('task_state',
   55                   sa.String(length=255), nullable=True),
   56         sa.Column('vim_connection_info', sa.JSON(), nullable=True),
   57         sa.Column('tenant_id', sa.String(length=64), nullable=False),
   58         sa.Column('created_at', sa.DateTime(), nullable=False),
   59         sa.Column('updated_at', sa.DateTime(), nullable=True),
   60         sa.Column('deleted_at', sa.DateTime(), nullable=True),
   61         sa.Column('deleted', sa.Boolean, default=False),
   62         sa.PrimaryKeyConstraint('id'),
   63         mysql_engine='InnoDB'
   64     )
   65 
   66     op.create_table(
   67         'vnf_instantiated_info',
   68         sa.Column('id', sa.Integer, nullable=False, autoincrement=True),
   69         sa.Column('vnf_instance_id', types.Uuid(length=36), nullable=False),
   70         sa.Column('flavour_id', sa.String(length=255), nullable=False),
   71         sa.Column('ext_cp_info', sa.JSON(), nullable=True),
   72         sa.Column('ext_virtual_link_info', sa.JSON(), nullable=True),
   73         sa.Column('ext_managed_virtual_link_info', sa.JSON(), nullable=True),
   74         sa.Column('vnfc_resource_info', sa.JSON(), nullable=True),
   75         sa.Column('vnf_virtual_link_resource_info', sa.JSON(), nullable=True),
   76         sa.Column('virtual_storage_resource_info', sa.JSON(), nullable=True),
   77         sa.Column('vnf_state', sa.String(length=255), nullable=False),
   78         sa.Column('instance_id', sa.String(length=255), nullable=True),
   79         sa.Column('instantiation_level_id',
   80                   sa.String(length=255), nullable=True),
   81         sa.Column('additional_params', sa.JSON(), nullable=True),
   82         sa.Column('created_at', sa.DateTime(), nullable=False),
   83         sa.Column('updated_at', sa.DateTime(), nullable=True),
   84         sa.Column('deleted_at', sa.DateTime(), nullable=True),
   85         sa.Column('deleted', Boolean, default=False),
   86         sa.PrimaryKeyConstraint('id'),
   87         sa.ForeignKeyConstraint(['vnf_instance_id'],
   88                                 ['vnf_instances.id'], ),
   89         mysql_engine='InnoDB'
   90     )
   91 
   92     op.create_table(
   93         'vnf_resources',
   94         sa.Column('id', types.Uuid(length=36), nullable=False),
   95         sa.Column('vnf_instance_id', types.Uuid(length=36), nullable=False),
   96         sa.Column('resource_name', sa.String(length=255), nullable=False),
   97         sa.Column('resource_type', sa.String(length=255), nullable=False),
   98         sa.Column('resource_identifier', sa.String(length=255),
   99                   nullable=False),
  100         sa.Column('resource_status', sa.String(length=255), nullable=False),
  101         sa.Column('created_at', sa.DateTime(), nullable=False),
  102         sa.Column('updated_at', sa.DateTime(), nullable=True),
  103         sa.Column('deleted_at', sa.DateTime(), nullable=True),
  104         sa.Column('deleted', Boolean, default=False),
  105         sa.PrimaryKeyConstraint('id'),
  106         sa.ForeignKeyConstraint(['vnf_instance_id'],
  107                                 ['vnf_instances.id'], ),
  108         mysql_engine='InnoDB'
  109     )