Commit 93a17d1f authored by kesnar's avatar kesnar
Browse files

feat: implement p4-service-handler

parent e9e22817
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -240,7 +240,6 @@ enum ServiceTypeEnum {
  SERVICETYPE_L3NM = 1;
  SERVICETYPE_L2NM = 2;
  SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3;
  SERVICETYPE_P4 = 4;
}

enum ServiceStatusEnum {
+10 −0
Original line number Diff line number Diff line
@@ -61,3 +61,13 @@ def json_service_tapi_planned(
        service_uuid, ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, context_id=json_context_id(context_uuid),
        status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints,
        config_rules=config_rules)

def json_service_p4_planned(
        service_uuid : str, endpoint_ids : List[Dict] = [], constraints : List[Dict] = [],
        config_rules : List[Dict] = [], context_uuid : str = DEFAULT_CONTEXT_UUID
    ):

    return json_service(
        service_uuid, ServiceTypeEnum.SERVICETYPE_L2NM, context_id=json_context_id(context_uuid),
        status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints,
        config_rules=config_rules)
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ class ORM_ServiceTypeEnum(Enum):
    L3NM                      = ServiceTypeEnum.SERVICETYPE_L3NM
    L2NM                      = ServiceTypeEnum.SERVICETYPE_L2NM
    TAPI_CONNECTIVITY_SERVICE = ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE
    P4_SERVICE                = ServiceTypeEnum.SERVICETYPE_P4

grpc_to_enum__service_type = functools.partial(
    grpc_to_enum, ServiceTypeEnum, ORM_ServiceTypeEnum)
+1 −2
Original line number Diff line number Diff line
@@ -23,8 +23,7 @@ SERVICE_TYPE_VALUES = {
    ServiceTypeEnum.SERVICETYPE_UNKNOWN,
    ServiceTypeEnum.SERVICETYPE_L3NM,
    ServiceTypeEnum.SERVICETYPE_L2NM,
    ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE,
    ServiceTypeEnum.SERVICETYPE_P4
    ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE
}

DEVICE_DRIVER_VALUES = {
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ SERVICE_HANDLERS = [
    ]),
    (P4ServiceHandler, [
        {
            FilterFieldEnum.SERVICE_TYPE: ServiceTypeEnum.SERVICETYPE_P4,
            FilterFieldEnum.SERVICE_TYPE: ServiceTypeEnum.SERVICETYPE_L2NM,
            FilterFieldEnum.DEVICE_DRIVER: DeviceDriverEnum.DEVICEDRIVER_P4,
        }
    ]),
Loading