tsdb_plugin.proto 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. option go_package = "proto";
  3. package plugins;
  4. import "google/protobuf/timestamp.proto";
  5. // Message represents a simple message sent to the Echo service.
  6. message TsdbQuery {
  7. Timerange timerange = 1;
  8. DatasourceInfo datasource = 2;
  9. repeated Query queries = 3;
  10. }
  11. message Query {
  12. string refId = 1;
  13. string modelJson = 2;
  14. int64 MaxDataPoints = 3;
  15. int64 intervalMs = 4;
  16. DatasourceInfo datasource = 5;
  17. }
  18. message Timerange {
  19. string from = 1;
  20. string to = 2;
  21. google.protobuf.Timestamp now = 3;
  22. }
  23. message Response {
  24. string message = 1;
  25. repeated QueryResult results = 2;
  26. }
  27. message QueryResult {
  28. string error = 1;
  29. string errorString = 2;
  30. string refId = 3;
  31. string metaJson = 4;
  32. repeated TsdbSeries series = 5;
  33. //repeat TsdbTables tables = x;
  34. }
  35. message DatasourceInfo {
  36. string name = 1;
  37. string type = 2;
  38. string access = 3;
  39. string url = 4;
  40. bool basicAuth = 5;
  41. string basicAuthUser = 6;
  42. string basicAuthPassword = 7;
  43. string jsonData = 8;
  44. string secureJsonData = 9;
  45. }
  46. message TsdbSeries {
  47. string name = 1;
  48. map<string, string> tags = 2;
  49. repeated Point points = 3;
  50. }
  51. message Point {
  52. google.protobuf.Timestamp timestamp = 1;
  53. double value = 2;
  54. }
  55. service TsdbPlugin {
  56. rpc Query(TsdbQuery) returns (Response);
  57. }