-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathapi.proto
49 lines (40 loc) · 1.05 KB
/
api.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
// protoc --go_out=model --go_opt=module=application-model model/api.proto
syntax = "proto3";
package generated;
option go_package = "application-model/generated";
message CPUTaskResponse {
// List of all services that executed CPU tasks and their execution times
map<string, float> services = 1;
}
message ServiceResponse {
// Protocol used to contact this service
string protocol = 1;
// Response status code
// HTTP: 200 OK, 404 Not Found, etc
// gRPC: OK, InvalidArgument, etc
string status = 2;
}
message NetworkTaskResponse {
// List of all services that executed or responded to network tasks
repeated string services = 1;
// Responses from services
map<string, ServiceResponse> responses = 2;
// Random payload
string payload = 3;
}
message TaskResponses {
CPUTaskResponse cpu_task = 1;
NetworkTaskResponse network_task = 2;
}
message Request {
// Random payload
string payload = 1;
}
message Response {
// Name of called endpoint
string endpoint = 1;
// Task responses
TaskResponses tasks = 2;
// Error message
string message = 3;
}