Add wrcp aio client test with real ocloud
[pti/o2.git] / o2ims / adapter / clients / orm_stx.py
1 # Copyright (C) 2021 Wind River Systems, Inc.\r
2 #\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
6 #\r
7 #      http://www.apache.org/licenses/LICENSE-2.0\r
8 #\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
14 \r
15 # from datetime import datetime\r
16 import logging\r
17 \r
18 from sqlalchemy import (\r
19     Table,\r
20     # MetaData,\r
21     Column,\r
22     # Integer,\r
23     String,\r
24     # Date,\r
25     DateTime,\r
26     # ForeignKey,\r
27     # event,\r
28 )\r
29 \r
30 from sqlalchemy.orm import mapper\r
31 # from sqlalchemy.sql.expression import true\r
32 \r
33 from o2ims.domain import stx_object as ocloudModel\r
34 from o2ims.adapter.orm import metadata\r
35 \r
36 logger = logging.getLogger(__name__)\r
37 \r
38 # metadata = MetaData()\r
39 \r
40 stxobject = Table(\r
41     "stxcache",\r
42     metadata,\r
43     Column("id", String(255), primary_key=True),\r
44     Column("name", String(255)),\r
45     Column("updatetime", DateTime),\r
46     Column("createtime", DateTime),\r
47     Column("content", String(255))\r
48 )\r
49 \r
50 \r
51 def start_o2ims_stx_mappers():\r
52     logger.info("Starting O2 IMS Stx mappers")\r
53     mapper(ocloudModel.StxGenericModel, stxobject)\r