Loading src/context/service/database/Device.py +2 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Set, Tuple from common.method_wrappers.ServiceExceptions import InvalidArgumentException, NotFoundException from common.proto.context_pb2 import Device, DeviceFilter, DeviceId, TopologyId #from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Device import json_device_id from context.service.database.uuids.Topology import topology_get_uuid from .models.DeviceModel import DeviceModel Loading @@ -32,8 +32,6 @@ from .models.enums.KpiSampleType import grpc_to_enum__kpi_sample_type from .uuids.Device import device_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .ConfigRule import compose_config_rules_data, upsert_config_rules from common.tools.grpc.Tools import grpc_message_to_json import json LOGGER = logging.getLogger(__name__) Loading Loading @@ -118,7 +116,7 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: 'name' : endpoint_name, 'endpoint_type' : endpoint.endpoint_type, 'kpi_sample_types' : kpi_sample_types, 'endpoint_location': json.dumps(grpc_message_to_json(endpoint.endpoint_location)), 'endpoint_location': grpc_message_to_json_string(endpoint.endpoint_location), 'created_at' : now, 'updated_at' : now, }) Loading src/context/service/database/models/ServiceModel.py +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class ServiceModel(_Base): created_at = Column(DateTime, nullable=False) updated_at = Column(DateTime, nullable=False) context = relationship('ContextModel', back_populates='services', lazy='selectin',) context = relationship('ContextModel', back_populates='services', lazy='selectin') service_endpoints = relationship('ServiceEndPointModel') # lazy='selectin', back_populates='service' constraints = relationship('ServiceConstraintModel', passive_deletes=True) # lazy='selectin', back_populates='service' config_rules = relationship('ServiceConfigRuleModel', passive_deletes=True) # lazy='selectin', back_populates='service' Loading Loading
src/context/service/database/Device.py +2 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Set, Tuple from common.method_wrappers.ServiceExceptions import InvalidArgumentException, NotFoundException from common.proto.context_pb2 import Device, DeviceFilter, DeviceId, TopologyId #from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Device import json_device_id from context.service.database.uuids.Topology import topology_get_uuid from .models.DeviceModel import DeviceModel Loading @@ -32,8 +32,6 @@ from .models.enums.KpiSampleType import grpc_to_enum__kpi_sample_type from .uuids.Device import device_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .ConfigRule import compose_config_rules_data, upsert_config_rules from common.tools.grpc.Tools import grpc_message_to_json import json LOGGER = logging.getLogger(__name__) Loading Loading @@ -118,7 +116,7 @@ def device_set(db_engine : Engine, request : Device) -> Tuple[Dict, bool]: 'name' : endpoint_name, 'endpoint_type' : endpoint.endpoint_type, 'kpi_sample_types' : kpi_sample_types, 'endpoint_location': json.dumps(grpc_message_to_json(endpoint.endpoint_location)), 'endpoint_location': grpc_message_to_json_string(endpoint.endpoint_location), 'created_at' : now, 'updated_at' : now, }) Loading
src/context/service/database/models/ServiceModel.py +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ class ServiceModel(_Base): created_at = Column(DateTime, nullable=False) updated_at = Column(DateTime, nullable=False) context = relationship('ContextModel', back_populates='services', lazy='selectin',) context = relationship('ContextModel', back_populates='services', lazy='selectin') service_endpoints = relationship('ServiceEndPointModel') # lazy='selectin', back_populates='service' constraints = relationship('ServiceConstraintModel', passive_deletes=True) # lazy='selectin', back_populates='service' config_rules = relationship('ServiceConfigRuleModel', passive_deletes=True) # lazy='selectin', back_populates='service' Loading