Add db script for vnf lcm changes
Added new db tables required for vnf lcm feature. Blueprint: bp/support-etsi-nfv-specs Change-Id: I14290bfd314da5f23ab6e353ce719a170bfc78b0
This commit is contained in:
parent
e4d52d1483
commit
30fcfcc0a8
@ -141,7 +141,7 @@ snowballstemmer==1.2.1
|
||||
Sphinx==1.6.5
|
||||
sphinxcontrib-websupport==1.0.1
|
||||
sqlalchemy-migrate==0.11.0
|
||||
SQLAlchemy==1.0.10
|
||||
SQLAlchemy==1.3.0
|
||||
sqlparse==0.2.4
|
||||
statsd==3.2.2
|
||||
stestr==2.0.0
|
||||
|
@ -14,7 +14,7 @@ jsonschema>=2.6.0 # MIT
|
||||
keystonemiddleware>=4.17.0 # Apache-2.0
|
||||
kombu!=4.0.2,>=4.0.0 # BSD
|
||||
netaddr>=0.7.18 # BSD
|
||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||
SQLAlchemy>=1.3.0 # MIT
|
||||
WebOb>=1.7.1 # MIT
|
||||
python-heatclient>=1.10.0 # Apache-2.0
|
||||
python-keystoneclient>=3.8.0 # Apache-2.0
|
||||
|
@ -162,3 +162,63 @@ class VnfPackage(model_base.BASE, models.SoftDeleteMixin,
|
||||
@property
|
||||
def metadetails(self):
|
||||
return {m.key: m.value for m in self._metadata}
|
||||
|
||||
|
||||
class VnfInstance(model_base.BASE, models.SoftDeleteMixin,
|
||||
models.TimestampMixin, models_v1.HasId):
|
||||
"""Represents a Vnf Instance."""
|
||||
|
||||
__tablename__ = 'vnf_instances'
|
||||
vnf_instance_name = sa.Column(sa.String(255), nullable=True)
|
||||
vnf_instance_description = sa.Column(sa.String(1024), nullable=True)
|
||||
vnf_provider = sa.Column(sa.String(255), nullable=False)
|
||||
vnf_product_name = sa.Column(sa.String(255), nullable=False)
|
||||
vnf_software_version = sa.Column(sa.String(255), nullable=False)
|
||||
vnfd_version = sa.Column(sa.String(255), nullable=False)
|
||||
vnfd_id = sa.Column(types.Uuid, nullable=False)
|
||||
instantiation_state = sa.Column(sa.String(255), nullable=False)
|
||||
task_state = sa.Column(sa.String(255), nullable=True)
|
||||
vim_connection_info = sa.Column(sa.JSON(), nullable=True)
|
||||
tenant_id = sa.Column('tenant_id', sa.String(length=64), nullable=False)
|
||||
|
||||
|
||||
class VnfInstantiatedInfo(model_base.BASE, models.SoftDeleteMixin,
|
||||
models.TimestampMixin):
|
||||
"""Contain the details of VNF instance"""
|
||||
|
||||
__tablename__ = 'vnf_instantiated_info'
|
||||
id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)
|
||||
vnf_instance_id = sa.Column(sa.String,
|
||||
sa.ForeignKey('vnf_instances.id'),
|
||||
nullable=False)
|
||||
flavour_id = sa.Column(sa.String(255), nullable=False)
|
||||
ext_cp_info = sa.Column(sa.JSON(), nullable=False)
|
||||
ext_virtual_link_info = sa.Column(sa.JSON(), nullable=True)
|
||||
ext_managed_virtual_link_info = sa.Column(sa.JSON(), nullable=True)
|
||||
vnfc_resource_info = sa.Column(sa.JSON(), nullable=True)
|
||||
vnf_virtual_link_resource_info = sa.Column(sa.JSON(), nullable=True)
|
||||
virtual_storage_resource_info = sa.Column(sa.JSON(), nullable=True)
|
||||
vnf_state = sa.Column(sa.String(255), nullable=False)
|
||||
instance_id = sa.Column(sa.String(255), nullable=True)
|
||||
instantiation_level_id = sa.Column(sa.String(255), nullable=True)
|
||||
additional_params = sa.Column(sa.JSON(), nullable=True)
|
||||
|
||||
vnf_instance = orm.relationship(VnfInstance,
|
||||
backref=orm.backref('instantiated_vnf_info', uselist=False),
|
||||
foreign_keys=vnf_instance_id,
|
||||
primaryjoin='and_(VnfInstantiatedInfo.vnf_instance_id == '
|
||||
'VnfInstance.id, VnfInstantiatedInfo.deleted == 0)')
|
||||
|
||||
|
||||
class VnfResource(model_base.BASE, models.SoftDeleteMixin,
|
||||
models.TimestampMixin, models_v1.HasId):
|
||||
"""Resources belongs to the VNF"""
|
||||
|
||||
__tablename__ = 'vnf_resources'
|
||||
vnf_instance_id = sa.Column(sa.String(36),
|
||||
sa.ForeignKey('vnf_instances.id'),
|
||||
nullable=False)
|
||||
resource_name = sa.Column(sa.String(255), nullable=True)
|
||||
resource_type = sa.Column(sa.String(255), nullable=False)
|
||||
resource_identifier = sa.Column(sa.String(255), nullable=False)
|
||||
resource_status = sa.Column(sa.String(255), nullable=False)
|
||||
|
@ -0,0 +1,107 @@
|
||||
# Copyright (C) 2020 NTT DATA
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
"""VNF instance management changes
|
||||
|
||||
Revision ID: 985e28392890
|
||||
Revises: 975e28392888
|
||||
Create Date: 2019-12-10 02:40:12.966027
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '985e28392890'
|
||||
down_revision = '975e28392888'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import Boolean
|
||||
|
||||
from tacker.db import types
|
||||
|
||||
|
||||
def upgrade(active_plugins=None, options=None):
|
||||
op.create_table(
|
||||
'vnf_instances',
|
||||
sa.Column('id', types.Uuid(length=36), nullable=False),
|
||||
sa.Column('vnf_instance_name', sa.String(length=255), nullable=True,
|
||||
default=""),
|
||||
sa.Column('vnf_instance_description',
|
||||
sa.String(length=1024), nullable=True, default=""),
|
||||
sa.Column('vnfd_id', types.Uuid(length=36), nullable=False),
|
||||
sa.Column('vnf_provider', sa.String(length=255), nullable=False),
|
||||
sa.Column('vnf_product_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('vnf_software_version', sa.String(length=255),
|
||||
nullable=False),
|
||||
sa.Column('vnfd_version', sa.String(length=255), nullable=False),
|
||||
sa.Column('instantiation_state',
|
||||
sa.String(length=255), nullable=False),
|
||||
sa.Column('task_state',
|
||||
sa.String(length=255), nullable=True),
|
||||
sa.Column('vim_connection_info', sa.JSON(), nullable=True),
|
||||
sa.Column('tenant_id', sa.String(length=64), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted', sa.Boolean, default=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
mysql_engine='InnoDB'
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'vnf_instantiated_info',
|
||||
sa.Column('id', sa.Integer, nullable=False, autoincrement=True),
|
||||
sa.Column('vnf_instance_id', types.Uuid(length=36), nullable=False),
|
||||
sa.Column('flavour_id', sa.String(length=255), nullable=False),
|
||||
sa.Column('ext_cp_info', sa.JSON(), nullable=True),
|
||||
sa.Column('ext_virtual_link_info', sa.JSON(), nullable=True),
|
||||
sa.Column('ext_managed_virtual_link_info', sa.JSON(), nullable=True),
|
||||
sa.Column('vnfc_resource_info', sa.JSON(), nullable=True),
|
||||
sa.Column('vnf_virtual_link_resource_info', sa.JSON(), nullable=True),
|
||||
sa.Column('virtual_storage_resource_info', sa.JSON(), nullable=True),
|
||||
sa.Column('vnf_state', sa.String(length=255), nullable=False),
|
||||
sa.Column('instance_id', sa.String(length=255), nullable=True),
|
||||
sa.Column('instantiation_level_id',
|
||||
sa.String(length=255), nullable=True),
|
||||
sa.Column('additional_params', sa.JSON(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted', Boolean, default=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.ForeignKeyConstraint(['vnf_instance_id'],
|
||||
['vnf_instances.id'], ),
|
||||
mysql_engine='InnoDB'
|
||||
)
|
||||
|
||||
op.create_table(
|
||||
'vnf_resources',
|
||||
sa.Column('id', types.Uuid(length=36), nullable=False),
|
||||
sa.Column('vnf_instance_id', types.Uuid(length=36), nullable=False),
|
||||
sa.Column('resource_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('resource_type', sa.String(length=255), nullable=False),
|
||||
sa.Column('resource_identifier', sa.String(length=255),
|
||||
nullable=False),
|
||||
sa.Column('resource_status', sa.String(length=255), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('deleted', Boolean, default=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.ForeignKeyConstraint(['vnf_instance_id'],
|
||||
['vnf_instances.id'], ),
|
||||
mysql_engine='InnoDB'
|
||||
)
|
@ -1 +1 @@
|
||||
975e28392888
|
||||
985e28392890
|
||||
|
Loading…
Reference in New Issue
Block a user