forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomation.proto
80 lines (65 loc) · 2.1 KB
/
automation.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
// Protobuf data structures for the automation framework.
// Messages (e.g. Task) are used both for checkpoint data and API access
// (e.g. retrieving the current status of a pending cluster operation).
syntax = "proto3";
package automation;
enum ClusterOperationState {
UNKNOWN_CLUSTER_OPERATION_STATE = 0;
CLUSTER_OPERATION_NOT_STARTED = 1;
CLUSTER_OPERATION_RUNNING = 2;
CLUSTER_OPERATION_DONE = 3;
}
message ClusterOperation {
string id = 1;
// TaskContainer are processed sequentially, one at a time.
repeated TaskContainer serial_tasks = 2;
// Cached value. This has to be re-evaluated e.g. after a checkpoint load because running tasks may have already finished.
ClusterOperationState state = 3;
// Error of the first task which failed. Set after state advanced to CLUSTER_OPERATION_DONE. If empty, all tasks succeeded. Cached value, see state above.
string error = 4;
}
// TaskContainer holds one or more task which may be executed in parallel.
// "concurrency", if > 0, limits the amount of concurrently executed tasks.
message TaskContainer {
repeated Task parallel_tasks = 1;
int32 concurrency = 2;
}
enum TaskState {
UNKNOWN_TASK_STATE = 0;
NOT_STARTED = 1;
RUNNING = 2;
DONE = 3;
}
// Task represents a specific task which should be automatically executed.
message Task {
// Task specification.
string name = 1;
map <string, string> parameters = 2;
// Runtime data.
string id = 3;
TaskState state = 4;
// Set after state advanced to DONE.
string output = 5;
// Set after state advanced to DONE. If empty, the task did succeed.
string error = 6;
}
message EnqueueClusterOperationRequest {
string name = 1;
map <string, string> parameters = 2;
}
message EnqueueClusterOperationResponse {
string id = 1;
}
message GetClusterOperationStateRequest {
string id = 1;
}
message GetClusterOperationStateResponse {
ClusterOperationState state = 1;
}
message GetClusterOperationDetailsRequest {
string id = 1;
}
message GetClusterOperationDetailsResponse {
// Full snapshot of the execution e.g. including output of each task.
ClusterOperation cluster_op = 2;
}