1 # Copyright (C) 2021 Wind River Systems, Inc.
\r
3 # Licensed under the Apache License, Version 2.0 (the "License");
\r
4 # you may not use this file except in compliance with the License.
\r
5 # You may obtain a copy of the License at
\r
7 # http://www.apache.org/licenses/LICENSE-2.0
\r
9 # Unless required by applicable law or agreed to in writing, software
\r
10 # distributed under the License is distributed on an "AS IS" BASIS,
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 # See the License for the specific language governing permissions and
\r
13 # limitations under the License.
\r
15 # from datetime import datetime
\r
16 from sqlalchemy import (
\r
30 # from sqlalchemy.orm import mapper
\r
32 # from o2ims.domain import stx_object as ocloudModel
\r
34 from o2common.service.unit_of_work import AbstractUnitOfWork
\r
35 # from o2ims.adapter.unit_of_work import SqlAlchemyUnitOfWork
\r
36 from o2ims.domain.resource_type import ResourceTypeEnum
\r
38 from o2common.helper import o2logging
\r
39 logger = o2logging.get_logger(__name__)
\r
41 metadata = MetaData()
\r
46 Column("id", String(255), primary_key=True),
\r
47 Column("type", Enum(ResourceTypeEnum)),
\r
48 Column("name", String(255)),
\r
49 Column("updatetime", DateTime),
\r
50 Column("createtime", DateTime),
\r
51 Column("hash", String(255)),
\r
52 Column("content", String)
\r
56 def start_o2ims_stx_mappers(uow: AbstractUnitOfWork):
\r
58 # logger.info("Starting O2 IMS Stx mappers")
\r
59 # mapper(ocloudModel.StxGenericModel, stxobject)
\r
62 # engine1 = uow.session.get_bind()
\r
63 # metadata.create_all(engine1)
\r