Loading src/common/tools/object_factory/EndPoint.py +10 −5 Original line number Diff line number Diff line Loading @@ -20,9 +20,12 @@ def json_endpoint_descriptor( sample_types : List[int] = [], location : Optional[Dict] = None ) -> Dict: result = {'uuid': endpoint_uuid, 'type': endpoint_type} if endpoint_name is not None: result['name'] = endpoint_name if sample_types is not None and len(sample_types) > 0: result['sample_types'] = sample_types if location is not None and len(location) > 0: result['location'] = location if endpoint_name is not None: result['name'] = endpoint_name if sample_types is not None and len(sample_types) > 0: result['sample_types'] = sample_types if location is not None and len(location) > 0: result['location'] = location return result def json_endpoint_id(device_id : Dict, endpoint_uuid : str, topology_id : Optional[Dict] = None): Loading @@ -47,8 +50,10 @@ def json_endpoint( 'endpoint_id': json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id), 'endpoint_type': endpoint_type, } if len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) if location: result['endpoint_location'] = copy.deepcopy(location) if kpi_sample_types is not None and len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) if location is not None: result['endpoint_location'] = copy.deepcopy(location) return result def json_endpoints( Loading src/service/.gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ unit_test service: # Service preparation - > docker run --name $IMAGE_NAME -d -p 3030:3030 --env "LOG_LEVEL=DEBUG" --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" --env "DEVICESERVICE_SERVICE_HOST=${DEVICESERVICE_SERVICE_HOST}" --env "PATHCOMPSERVICE_SERVICE_HOST=${PATHCOMPSERVICE_SERVICE_HOST}" Loading src/service/service/ServiceServiceServicerImpl.py +3 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): for endpoint_id in request.service_endpoint_ids: service.service_endpoint_ids.add().CopyFrom(endpoint_id) # pylint: disable=no-member LOGGER.warning('[before] request={:s}'.format(grpc_message_to_json_string(request))) for constraint in request.service_constraints: if constraint.action != ConstraintActionEnum.CONSTRAINTACTION_SET: continue if constraint.WhichOneof('constraint') != 'endpoint_location': continue Loading @@ -130,6 +131,8 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): ] if closer_endpoint_id not in service_endpoint_ids: service.service_endpoint_ids.append(closer_endpoint_id) LOGGER.warning('[after] request={:s}'.format(grpc_message_to_json_string(request))) LOGGER.warning('[after] service={:s}'.format(grpc_message_to_json_string(service))) del service.service_constraints[:] # pylint: disable=no-member for constraint in request.service_constraints: Loading Loading
src/common/tools/object_factory/EndPoint.py +10 −5 Original line number Diff line number Diff line Loading @@ -20,9 +20,12 @@ def json_endpoint_descriptor( sample_types : List[int] = [], location : Optional[Dict] = None ) -> Dict: result = {'uuid': endpoint_uuid, 'type': endpoint_type} if endpoint_name is not None: result['name'] = endpoint_name if sample_types is not None and len(sample_types) > 0: result['sample_types'] = sample_types if location is not None and len(location) > 0: result['location'] = location if endpoint_name is not None: result['name'] = endpoint_name if sample_types is not None and len(sample_types) > 0: result['sample_types'] = sample_types if location is not None and len(location) > 0: result['location'] = location return result def json_endpoint_id(device_id : Dict, endpoint_uuid : str, topology_id : Optional[Dict] = None): Loading @@ -47,8 +50,10 @@ def json_endpoint( 'endpoint_id': json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id), 'endpoint_type': endpoint_type, } if len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) if location: result['endpoint_location'] = copy.deepcopy(location) if kpi_sample_types is not None and len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) if location is not None: result['endpoint_location'] = copy.deepcopy(location) return result def json_endpoints( Loading
src/service/.gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ unit_test service: # Service preparation - > docker run --name $IMAGE_NAME -d -p 3030:3030 --env "LOG_LEVEL=DEBUG" --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" --env "DEVICESERVICE_SERVICE_HOST=${DEVICESERVICE_SERVICE_HOST}" --env "PATHCOMPSERVICE_SERVICE_HOST=${PATHCOMPSERVICE_SERVICE_HOST}" Loading
src/service/service/ServiceServiceServicerImpl.py +3 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): for endpoint_id in request.service_endpoint_ids: service.service_endpoint_ids.add().CopyFrom(endpoint_id) # pylint: disable=no-member LOGGER.warning('[before] request={:s}'.format(grpc_message_to_json_string(request))) for constraint in request.service_constraints: if constraint.action != ConstraintActionEnum.CONSTRAINTACTION_SET: continue if constraint.WhichOneof('constraint') != 'endpoint_location': continue Loading @@ -130,6 +131,8 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): ] if closer_endpoint_id not in service_endpoint_ids: service.service_endpoint_ids.append(closer_endpoint_id) LOGGER.warning('[after] request={:s}'.format(grpc_message_to_json_string(request))) LOGGER.warning('[after] service={:s}'.format(grpc_message_to_json_string(service))) del service.service_constraints[:] # pylint: disable=no-member for constraint in request.service_constraints: Loading