Skip to content
Snippets Groups Projects
Commit 9e226625 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

Changes in Telemetry Service

**Frontend:**
- Deleted irrelevant lines.

**Backend:**
- Added `delete_db_row_by_id` in the Stop Collector method.
parent 88caa1cf
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!261(CTTC) New Analytics Component
......@@ -32,8 +32,6 @@ from common.tools.service.GenericGrpcService import GenericGrpcService
LOGGER = logging.getLogger(__name__)
METRICS_POOL = MetricsPool('TelemetryBackend', 'backendService')
# EXPORTER_ENDPOINT = "http://10.152.183.2:9100/metrics"
class TelemetryBackendService(GenericGrpcService):
"""
......
......@@ -89,7 +89,14 @@ class TelemetryFrontendServiceServicerImpl(TelemetryFrontendServiceServicer):
request : CollectorId, grpc_context: grpc.ServicerContext # type: ignore
) -> Empty: # type: ignore
LOGGER.info ("gRPC message: {:}".format(request))
self.PublishStopRequestOnKafka(request)
try:
collector_to_delete = request.collector_id.uuid
self.tele_db_obj.delete_db_row_by_id(
CollectorModel, "collector_id", collector_to_delete
)
self.PublishStopRequestOnKafka(request)
except Exception as e:
LOGGER.error('Unable to delete collector. Error: {:}'.format(e))
return Empty()
def PublishStopRequestOnKafka(self, collector_id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment