Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
TFS
controller
Compare revisions
79423dca2735fe4d06b6a6c64620f7250b388a7f...29b6cfbd1009560aa808280d35f22555889c4b4c
Commits (4)
Added specific requirements in "telemetry_frontend"
· 8a0adf79
Waleed Akbar
authored
Apr 26, 2024
8a0adf79
Add "# type: ignore" to surpass warning message
· 7c705a70
Waleed Akbar
authored
Apr 26, 2024
7c705a70
Adds dummy logic in "StartCollector" function
· 21f0b22a
Waleed Akbar
authored
Apr 26, 2024
21f0b22a
Correction of "collector_id.uuid" and "kpi_id.uuid" assignments
· 29b6cfbd
Waleed Akbar
authored
Apr 26, 2024
29b6cfbd
Hide whitespace changes
Inline
Side-by-side
src/kpi_manager/service/KpiManagerServiceServicerImpl.py
View file @
29b6cfbd
...
...
@@ -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
}
"
)
...
...
src/telemetry_frontend/requirements.in
0 → 100644
View file @
29b6cfbd
# 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
src/telemetry_frontend/service/TelemetryFrontendServiceServicerImpl.py
View file @
29b6cfbd
...
...
@@ -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
src/telemetry_frontend/tests/Messages.py
View file @
29b6cfbd
...
...
@@ -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_
uu
id
.
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