diff --git a/src/context/service/database/models/enums/ConfigAction.py b/src/context/service/database/models/enums/ConfigAction.py index 5d7aa6b44ecb58f769a1c70a5cabdda98ba51bca..526024a1fedf3331ca45e3cb517ff9d58ce28c25 100644 --- a/src/context/service/database/models/enums/ConfigAction.py +++ b/src/context/service/database/models/enums/ConfigAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConfigActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConfigActionEnum should be named +# as in the proto files removing the prefixes. For example, +# proto item ConfigActionEnum.CONFIGACTION_SET should be +# included as SET. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_ConfigActionEnum(enum.Enum): UNDEFINED = ConfigActionEnum.CONFIGACTION_UNDEFINED SET = ConfigActionEnum.CONFIGACTION_SET diff --git a/src/context/service/database/models/enums/ConstraintAction.py b/src/context/service/database/models/enums/ConstraintAction.py index 65533b6f579ffe153b046dfcb39d37758f4c0577..2a53b8e1c5e97e48cbda9648c8473313bce6f4cd 100644 --- a/src/context/service/database/models/enums/ConstraintAction.py +++ b/src/context/service/database/models/enums/ConstraintAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConstraintActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConstraintActionEnum should be named +# as in the proto files removing the prefixes. For example, proto +# item ConstraintActionEnum.CONFIGACTION_SET should be included +# as SET. If item name does not match, automatic mapping of proto +# enums to database enums will fail. class ORM_ConstraintActionEnum(enum.Enum): UNDEFINED = ConstraintActionEnum.CONSTRAINTACTION_UNDEFINED SET = ConstraintActionEnum.CONSTRAINTACTION_SET diff --git a/src/context/service/database/models/enums/DeviceDriver.py b/src/context/service/database/models/enums/DeviceDriver.py index 0ed68d23b9ba04c7f12d3d4d0d378cbbfc9a879a..66635decc5369c8b7601863da85f497626d70ac8 100644 --- a/src/context/service/database/models/enums/DeviceDriver.py +++ b/src/context/service/database/models/enums/DeviceDriver.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import DeviceDriverEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceDriverEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG should be included as +# OPENCONFIG. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_DeviceDriverEnum(enum.Enum): UNDEFINED = DeviceDriverEnum.DEVICEDRIVER_UNDEFINED OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG diff --git a/src/context/service/database/models/enums/DeviceOperationalStatus.py b/src/context/service/database/models/enums/DeviceOperationalStatus.py index a121fab86408493bf0b211f4fcc8423aafa969cf..9e98869dce025e51c20ff0aca0dcd78a9ab57fe1 100644 --- a/src/context/service/database/models/enums/DeviceOperationalStatus.py +++ b/src/context/service/database/models/enums/DeviceOperationalStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import DeviceOperationalStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceOperationalStatusEnum should be +# named as in the proto files removing the prefixes. For example, +# proto item DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED +# should be declared as ENABLED. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_DeviceOperationalStatusEnum(enum.Enum): UNDEFINED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED diff --git a/src/context/service/database/models/enums/KpiSampleType.py b/src/context/service/database/models/enums/KpiSampleType.py index 3bf5d06f047016af7167d0d59a315ac465abfd19..5cef9ac199a0cc3389092e4ea375940e27554066 100644 --- a/src/context/service/database/models/enums/KpiSampleType.py +++ b/src/context/service/database/models/enums/KpiSampleType.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.kpi_sample_types_pb2 import KpiSampleType from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_KpiSampleTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED should be declared as +# BYTES_RECEIVED. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_KpiSampleTypeEnum(enum.Enum): UNKNOWN = KpiSampleType.KPISAMPLETYPE_UNKNOWN PACKETS_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED diff --git a/src/context/service/database/models/enums/PolicyRuleState.py b/src/context/service/database/models/enums/PolicyRuleState.py index c4aa950a11605682f1c78e544767ea7e0a7b24b4..e16ee01e36b5e2ec2ad8e07f7cb6201ee091e76f 100644 --- a/src/context/service/database/models/enums/PolicyRuleState.py +++ b/src/context/service/database/models/enums/PolicyRuleState.py @@ -16,6 +16,13 @@ import enum, functools from common.proto.policy_pb2 import PolicyRuleStateEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_PolicyRuleStateEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# PolicyRuleStateEnum.POLICY_INSERTED should be declared as INSERTED. +# In this case, since the entries in the proto enum have a different prefix +# than that specified in class ORM_PolicyRuleStateEnum, we force the prefix +# using argument grpc_enum_prefix. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_PolicyRuleStateEnum(enum.Enum): UNDEFINED = PolicyRuleStateEnum.POLICY_UNDEFINED # Undefined rule state FAILED = PolicyRuleStateEnum.POLICY_FAILED # Rule failed diff --git a/src/context/service/database/models/enums/ServiceStatus.py b/src/context/service/database/models/enums/ServiceStatus.py index cd2a183b825eff54a51a844ea6834263bbabbc31..ae0ad55bcfe327b981881bcd304124c9bb6576ab 100644 --- a/src/context/service/database/models/enums/ServiceStatus.py +++ b/src/context/service/database/models/enums/ServiceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ServiceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceStatusEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ServiceStatusEnum.SERVICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceStatusEnum(enum.Enum): UNDEFINED = ServiceStatusEnum.SERVICESTATUS_UNDEFINED PLANNED = ServiceStatusEnum.SERVICESTATUS_PLANNED diff --git a/src/context/service/database/models/enums/ServiceType.py b/src/context/service/database/models/enums/ServiceType.py index 3937eaa114429ce9d004933a5d5baf1ae6137513..0ed1938a7ca1e566bea815d9ce936150bb91d9dc 100644 --- a/src/context/service/database/models/enums/ServiceType.py +++ b/src/context/service/database/models/enums/ServiceType.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ServiceTypeEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ConfigActionEnum.CONFIGACTION_SET should be declared as SET. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceTypeEnum(enum.Enum): UNKNOWN = ServiceTypeEnum.SERVICETYPE_UNKNOWN L3NM = ServiceTypeEnum.SERVICETYPE_L3NM diff --git a/src/context/service/database/models/enums/SliceStatus.py b/src/context/service/database/models/enums/SliceStatus.py index 5d77578b4cb4ee155981ede4395b1cafc3be4ef7..32ef0cc4a3d65aa96346b038534ca65bc3e4f95c 100644 --- a/src/context/service/database/models/enums/SliceStatus.py +++ b/src/context/service/database/models/enums/SliceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import SliceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_SliceStatusEnum should be named as in +# the proto file but removing the prefixes. For example, proto item +# SliceStatusEnum.SLICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_SliceStatusEnum(enum.Enum): UNDEFINED = SliceStatusEnum.SLICESTATUS_UNDEFINED PLANNED = SliceStatusEnum.SLICESTATUS_PLANNED