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