diff --git a/src/context/service/database/Constraint.py b/src/context/service/database/Constraint.py index 0540841c3a570f9a1e28ec530998b115f73a62a7..768108d9b71050e197d90e011f5e47403292a46e 100644 --- a/src/context/service/database/Constraint.py +++ b/src/context/service/database/Constraint.py @@ -66,7 +66,7 @@ def compose_constraints_data( constraint_name = '{:s}:{:s}:{:s}'.format(parent_kind, kind.value, endpoint_uuid) elif kind in { ConstraintKindEnum.SCHEDULE, ConstraintKindEnum.SLA_CAPACITY, ConstraintKindEnum.SLA_LATENCY, - ConstraintKindEnum.SLA_AVAILABILITY, ConstraintKindEnum.SLA_ISOLATION_LEVEL + ConstraintKindEnum.SLA_AVAILABILITY, ConstraintKindEnum.SLA_ISOLATION }: constraint_name = '{:s}:{:s}:'.format(parent_kind, kind.value) else: diff --git a/src/context/service/database/models/ConstraintModel.py b/src/context/service/database/models/ConstraintModel.py index 01c7bcb76b00ac5d8b49d9f99f010d1ddfd30788..e9660d502c4420ec69c2bdc883d5e03ef283ca54 100644 --- a/src/context/service/database/models/ConstraintModel.py +++ b/src/context/service/database/models/ConstraintModel.py @@ -19,15 +19,17 @@ from typing import Dict from ._Base import _Base # Enum values should match name of field in Constraint message +# - enum item name should be Constraint message type in upper case +# - enum item value should be Constraint message type as it is in the proto files class ConstraintKindEnum(enum.Enum): - CUSTOM = 'custom' - SCHEDULE = 'schedule' - ENDPOINT_LOCATION = 'endpoint_location' - ENDPOINT_PRIORITY = 'endpoint_priority' - SLA_CAPACITY = 'sla_capacity' - SLA_LATENCY = 'sla_latency' - SLA_AVAILABILITY = 'sla_availability' - SLA_ISOLATION_LEVEL = 'sla_isolation' + CUSTOM = 'custom' + SCHEDULE = 'schedule' + ENDPOINT_LOCATION = 'endpoint_location' + ENDPOINT_PRIORITY = 'endpoint_priority' + SLA_CAPACITY = 'sla_capacity' + SLA_LATENCY = 'sla_latency' + SLA_AVAILABILITY = 'sla_availability' + SLA_ISOLATION = 'sla_isolation' class ConstraintModel(_Base): __tablename__ = 'constraint' diff --git a/src/webui/service/templates/service/detail.html b/src/webui/service/templates/service/detail.html index d99ede3e02c9716782317efc60fcc8d92e2e811a..b267f986c5e80af9f26b7beb060b284e2eb5b4d5 100644 --- a/src/webui/service/templates/service/detail.html +++ b/src/webui/service/templates/service/detail.html @@ -157,7 +157,6 @@ <td>SLA Availability</td> <td>-</td> <td> - {{ constraint.sla_availability.availability }} %; {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths; {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}-active </td> diff --git a/src/webui/service/templates/slice/detail.html b/src/webui/service/templates/slice/detail.html index 6c8d15aed6fcf91580e9fa3bfe9f2f9a14e7666b..2c1b55afb84bbe9d5dde92fe574cca094040b7af 100644 --- a/src/webui/service/templates/slice/detail.html +++ b/src/webui/service/templates/slice/detail.html @@ -157,7 +157,6 @@ <td>SLA Availability</td> <td>-</td> <td> - {{ constraint.sla_availability.availability }} %; {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths; {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}-active </td>