-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconnector_sdk.proto
109 lines (92 loc) · 2.28 KB
/
connector_sdk.proto
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
99
100
101
102
103
104
105
106
107
108
109
syntax = "proto3";
option optimize_for = SPEED;
option java_multiple_files = true;
option go_package = "fivetran.com/fivetran_sdk";
package fivetran_sdk;
import "common.proto";
// Fivetran (grpc client) <> Connector (grpc server)
service Connector {
rpc ConfigurationForm (ConfigurationFormRequest) returns (ConfigurationFormResponse) {}
rpc Test (TestRequest) returns (TestResponse) {}
rpc Schema (SchemaRequest) returns (SchemaResponse) {}
rpc Update (UpdateRequest) returns (stream UpdateResponse) {}
}
message SchemaRequest {
map<string, string> configuration = 1;
}
message SchemaResponse {
oneof response {
bool schema_response_not_supported = 1;
SchemaList with_schema = 2;
TableList without_schema = 3;
}
optional bool selection_not_supported = 4;
}
message UpdateRequest {
map<string, string> configuration = 1;
optional Selection selection = 2;
optional string state_json = 3;
}
message Selection {
oneof selection {
TablesWithNoSchema without_schema = 1;
TablesWithSchema with_schema = 2;
}
}
message TablesWithNoSchema {
repeated TableSelection tables = 1;
bool include_new_tables = 2;
}
message TablesWithSchema {
repeated SchemaSelection schemas = 1;
bool include_new_schemas = 2;
}
message SchemaSelection {
bool included = 1;
string schema_name = 2;
repeated TableSelection tables = 3;
bool include_new_tables = 4;
}
message TableSelection {
bool included = 1;
string table_name = 2;
map<string, bool> columns = 3;
bool include_new_columns = 4;
}
message UpdateResponse {
oneof response {
LogEntry log_entry = 1;
Operation operation = 2;
}
}
enum LogLevel {
INFO = 0;
WARNING = 1;
SEVERE = 2;
}
message LogEntry {
LogLevel level = 1;
string message = 2;
}
message Operation {
oneof op {
Record record = 1;
SchemaChange schema_change = 2;
Checkpoint checkpoint = 3;
}
}
message SchemaChange {
oneof change {
SchemaList with_schema = 1;
TableList without_schema = 2;
}
}
message Record {
optional string schema_name = 1;
string table_name = 2;
OpType type = 3;
map<string, ValueType> data = 4;
}
message Checkpoint {
string state_json = 1;
}