1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
syntax = "proto3";
option go_package = "datasource";
package models;
message DatasourceRequest {
TimeRange timeRange = 1;
DatasourceInfo datasource = 2;
repeated Query queries = 3;
}
message Query {
string refId = 1;
int64 maxDataPoints = 2;
int64 intervalMs = 3;
string modelJson = 4;
}
message TimeRange {
string fromRaw = 1;
string toRaw = 2;
int64 fromEpochMs = 3;
int64 toEpochMs = 4;
}
message DatasourceResponse {
repeated QueryResult results = 1;
}
message QueryResult {
string error = 1;
string refId = 2;
string metaJson = 3;
repeated TimeSeries series = 4;
repeated Table tables = 5;
}
message Table {
repeated TableColumn columns = 1;
repeated TableRow rows = 2;
}
message TableColumn {
string name = 1;
}
message TableRow {
repeated RowValue values = 1;
}
message RowValue {
enum Kind {
// Field type null.
TYPE_NULL = 0;
// Field type double.
TYPE_DOUBLE = 1;
// Field type int64.
TYPE_INT64 = 2;
// Field type bool.
TYPE_BOOL = 3;
// Field type string.
TYPE_STRING = 4;
// Field type bytes.
TYPE_BYTES = 5;
};
Kind kind = 1;
double doubleValue = 2;
int64 int64Value = 3;
bool boolValue = 4;
string stringValue = 5;
bytes bytesValue = 6;
}
message DatasourceInfo {
int64 id = 1;
int64 orgId = 2;
string name = 3;
string type = 4;
string url = 5;
string jsonData = 6;
map<string,string> decryptedSecureJsonData = 7;
}
message TimeSeries {
string name = 1;
map<string, string> tags = 2;
repeated Point points = 3;
}
message Point {
int64 timestamp = 1;
double value = 2;
}
service DatasourcePlugin {
rpc Query(DatasourceRequest) returns (DatasourceResponse);
}
|