|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# |
| 4 | +# Copyright (c) 2023 The Johns Hopkins University Applied Physics |
| 5 | +# Laboratory LLC. |
| 6 | +# |
| 7 | +# This file is part of the Asynchronous Network Management System (ANMS). |
| 8 | +# |
| 9 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | +# you may not use this file except in compliance with the License. |
| 11 | +# You may obtain a copy of the License at |
| 12 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# Unless required by applicable law or agreed to in writing, software |
| 14 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +# See the License for the specific language governing permissions and |
| 17 | +# limitations under the License. |
| 18 | +# |
| 19 | +# This work was performed for the Jet Propulsion Laboratory, California |
| 20 | +# Institute of Technology, sponsored by the United States Government under |
| 21 | +# the prime contract 80NM0018D0004 between the Caltech and NASA under |
| 22 | +# subcontract 1658085. |
| 23 | +# |
| 24 | +from typing import Any |
| 25 | +from typing import Dict |
| 26 | + |
| 27 | +from anms.models.relational import Model |
| 28 | +from sqlalchemy import Column |
| 29 | +from sqlalchemy import Integer |
| 30 | +from sqlalchemy import String |
| 31 | + |
| 32 | +# class for vw_ctrl_definition used for build ari |
| 33 | +class Const(Model): |
| 34 | + __tablename__ = 'vw_const_actual' |
| 35 | + obj_actual_definition_id = Column(Integer, primary_key=True) |
| 36 | + data_type = Column(String) |
| 37 | + data_value = Column(String) |
| 38 | + use_desc = Column(String) |
| 39 | + obj_metadata_id = Column(Integer) |
| 40 | + data_model_name = Column(String) |
| 41 | + namespace = Column(String) |
| 42 | + data_type_id = Column(Integer) |
| 43 | + name = Column(String) |
| 44 | + data_model_id = Column(Integer) |
| 45 | + object_enumeration = Column(Integer) |
| 46 | + status = Column(String) |
| 47 | + reference = Column(String) |
| 48 | + description = Column(String) |
| 49 | + |
| 50 | + def __repr__(self) -> str: |
| 51 | + return self.as_dict().__repr__() |
| 52 | + |
| 53 | + def as_dict(self) -> Dict[str, Any]: |
| 54 | + dict_obj = { |
| 55 | + c.name: getattr(self, c.name) for c in self.__table__.columns |
| 56 | + } |
| 57 | + |
| 58 | + return dict_obj |
0 commit comments