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
syntax = "proto3";
package emerwen.webtomaster;
option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto";
import "google/protobuf/empty.proto";
import "shared/target.proto";
import "shared/worker.proto";
service WebToMaster {
rpc GetWorkers (google.protobuf.Empty) returns (WorkersResponse);
rpc NewWorker (NewWorkerRequest) returns (google.protobuf.Empty);
rpc PatchWorker (PatchWorkerRequest) returns (google.protobuf.Empty);
rpc DeleteTarget (DeleteTargetRequest) returns (google.protobuf.Empty);
rpc NewTarget (NewTargetRequest) returns (google.protobuf.Empty);
rpc PatchTarget (PatchTargetRequest) returns (google.protobuf.Empty);
rpc DeleteWorker (DeleteWorkerRequest) returns (google.protobuf.Empty);
}
message WorkersResponse {
repeated shared.Worker workers = 1;
}
message NewWorkerRequest {
string name = 1;
}
message PatchWorkerRequest {
string worker_id = 1;
optional string name = 2;
}
message DeleteWorkerRequest {
string worker_id = 1;
}
message NewTargetRequest {
string worker_id = 1;
string name = 2;
string addr = 3;
int32 interval = 4;
oneof method {
shared.MethodPing ping = 5;
shared.MethodGET get = 6;
}
}
message PatchTargetRequest {
string target_id = 1;
optional string name = 2;
optional string addr = 3;
optional int32 interval = 4;
oneof method {
shared.MethodPing ping = 5;
shared.MethodGET get = 6;
}
}
message DeleteTargetRequest {
string target_id = 1;
}