tsdb_plugin.proto 1.2 KB

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