From d2ff0a3aa28e1ab346a7a5dbfaf1ae8b673fed3f Mon Sep 17 00:00:00 2001
From: Waleed Akbar <wakbar@cttc.es>
Date: Tue, 11 Jun 2024 11:02:06 +0000
Subject: [PATCH] Analytic_frontend.proto added

---
 proto/analytics_frontend.proto | 49 ++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 proto/analytics_frontend.proto

diff --git a/proto/analytics_frontend.proto b/proto/analytics_frontend.proto
new file mode 100644
index 000000000..6af761ae5
--- /dev/null
+++ b/proto/analytics_frontend.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+package device;
+
+import "context.proto";
+import "kpi_manager.proto";
+import "kpi_sample_types.proto";
+
+service AnalyticsFrontendService {
+  rpc StartAnalyzer  (Analyzer      ) returns (AnalyzerId   ) {}
+  rpc StopAnalyzer   (AnalyzerId    ) returns (context.Empty) {}
+  rpc SelectAnalyzers(AnalyzerFilter) returns (AnalyzerList ) {}
+}
+
+message AnalyzerId {
+  context.Uuid analyzer_id = 1;
+}
+
+enum AnalyzerMode {
+  ANALYZERMODE_BATCH    = 0;
+  ANALYZERMODE_STRAMING = 1;
+}
+
+message Analyzer {
+  repeated kpi_manager.KpiId kpi_id = 1; // The KPI Ids to be processed by the analyzer
+  AnalyzerMode               mode   = 2; // Operation mode of the analyzer
+  float batch_min_duration_s        = 3; // In batch mode, min duration to collect before executing batch
+  float batch_max_duration_s        = 4; // In batch mode, max duration collected to execute the batch
+  uint  batch_min_size              = 5; // In batch mode, min number of samples to collect before executing batch
+  uint  batch_max_size              = 6; // In batch mode, max number of samples collected to execute the batch
+}
+
+message AnalyzerFilter {
+  // Analyzer that fulfill the filter are those that match ALL the following fields.
+  // An empty list means: any value is accepted.
+  // All fields empty means: list all Analyzers
+  repeated AnalyzerId                     analyzer_id    = 1;
+  repeated kpi_manager.KpiId              kpi_id          = 2;
+  repeated kpi_sample_types.KpiSampleType kpi_sample_type = 3;
+  repeated context.DeviceId               device_id       = 4;
+  repeated context.EndPointId             endpoint_id     = 5;
+  repeated context.ServiceId              service_id      = 6;
+  repeated context.SliceId                slice_id        = 7;
+  repeated context.ConnectionId           connection_id   = 8;
+  repeated context.LinkId                 link_id         = 9;
+}
+
+message AnalyzerList {
+  repeated Analyzer analyzer_list = 1;
+}
-- 
GitLab