syntax = "proto3";
package device;

import "context.proto";
import "kpi_manager.proto";

service TelemetryFrontendService {
  rpc StartCollector  (Collector      ) returns (CollectorId  ) {}
  rpc StopCollector   (CollectorId    ) returns (context.Empty) {}
  rpc SelectCollectors(CollectorFilter) returns (CollectorList) {}
}

message CollectorId {
  context.Uuid collector_id = 1;
}

message Collector {
  CollectorId          collector_id     = 1;     // The Collector ID
  kpi_manager.KpiId kpi_id           = 2;     // The KPI Id to be associated to the collected samples
  float                duration_s       = 3;     // Terminate data collection after duration[seconds]; duration==0 means indefinitely
  float                interval_s       = 4;     // Interval between collected samples
}

message CollectorFilter {
  // Collector 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 Collectors
  repeated CollectorId          collector_id    = 1;
  repeated kpi_manager.KpiId kpi_id          = 2;
}

message CollectorList {
  repeated Collector collector_list = 1;
}
