Commits (4)
......@@ -36,8 +36,8 @@ class KpiManagerServiceServicerImpl(KpiManagerServiceServicer):
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
def SetKpiDescriptor(
self, request: KpiDescriptor, grpc_context: grpc.ServicerContext
) -> KpiId:
self, request: KpiDescriptor, grpc_context: grpc.ServicerContext # type: ignore
) -> KpiId: # type: ignore
response = KpiId()
kpi_description = request.kpi_description
kpi_sample_type = request.kpi_sample_type
......@@ -58,7 +58,7 @@ class KpiManagerServiceServicerImpl(KpiManagerServiceServicer):
return response
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
def DeleteKpiDescriptor(self, request: KpiId, grpc_context: grpc.ServicerContext) -> Empty:
def DeleteKpiDescriptor(self, request: KpiId, grpc_context: grpc.ServicerContext) -> Empty: # type: ignore
kpi_id = int(request.kpi_id.uuid)
kpi = self.management_db.get_KPI(kpi_id)
if kpi:
......@@ -68,7 +68,7 @@ class KpiManagerServiceServicerImpl(KpiManagerServiceServicer):
return Empty()
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
def GetKpiDescriptor(self, request: KpiId, grpc_context: grpc.ServicerContext) -> KpiDescriptor:
def GetKpiDescriptor(self, request: KpiId, grpc_context: grpc.ServicerContext) -> KpiDescriptor: # type: ignore
kpi_id = request.kpi_id.uuid
kpi_db = self.management_db.get_KPI(int(kpi_id))
kpiDescriptor = KpiDescriptor()
......@@ -86,7 +86,7 @@ class KpiManagerServiceServicerImpl(KpiManagerServiceServicer):
return kpiDescriptor
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
def SelectKpiDescriptor(self, request: KpiDescriptorFilter, grpc_context: grpc.ServicerContext) -> KpiDescriptorList:
def SelectKpiDescriptor(self, request: KpiDescriptorFilter, grpc_context: grpc.ServicerContext) -> KpiDescriptorList: # type: ignore
kpi_descriptor_list = KpiDescriptorList()
data = self.management_db.get_KPIS()
LOGGER.debug(f"data: {data}")
......
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
anytree==2.8.0
APScheduler==3.10.1
influx-line-protocol==0.1.4
psycopg2-binary==2.9.3
python-dateutil==2.8.2
python-json-logger==2.0.2
pytz==2024.1
questdb==1.0.1
requests==2.27.1
xmltodict==0.12.0
\ No newline at end of file
......@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import grpc
import logging
from monitoring.service.NameMapping import NameMapping
from common.proto.telemetry_frontend_pb2 import CollectorId, Collector
......@@ -27,12 +28,13 @@ class TelemetryFrontendServiceServicerImpl(TelemetryFrontendServiceServicer):
LOGGER.info('Init TelemetryFrontendService')
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
def StartCollector(self, request: Collector) -> CollectorId:
def StartCollector(self, request : Collector, grpc_context: grpc.ServicerContext # type: ignore
) -> CollectorId: # type: ignore
response = CollectorId()
collector_id = request.collector_id
collector_kpi_id = request.kpi_id
collector_duration = request.duration_s
collector_interval = request.interval_s
_collector_id = request.collector_id
# collector_kpi_id = request.kpi_id
# collector_duration = request.duration_s
# collector_interval = request.interval_s
response.collector_id.uuid = request.collector_id.uuid
response.collector_id.uuid = _collector_id.collector_id.uuid
return response
\ No newline at end of file
......@@ -22,9 +22,9 @@ def collector_id():
return _collector_id
def create_collector_request(coll_id_str):
_create_collector_request = telemetry_frontend_pb2.Collector()
_create_collector_request.collector_id.uuid = str(coll_id_str)
_create_collector_request.kpi_id.kpi_uuid.uuid = 'KPIid' + str(coll_id_str)
_create_collector_request.duration_s = float(-1)
_create_collector_request.interval_s = float(-1)
_create_collector_request = telemetry_frontend_pb2.Collector()
_create_collector_request.collector_id.collector_id.uuid = str(coll_id_str)
_create_collector_request.kpi_id.kpi_id.uuid = 'KPIid' + str(coll_id_str)
_create_collector_request.duration_s = float(-1)
_create_collector_request.interval_s = float(-1)
return _create_collector_request