-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathadmin.proto
422 lines (321 loc) · 11.2 KB
/
admin.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
syntax = "proto3";
package io.axoniq.axonserver.grpc.admin;
import "google/protobuf/empty.proto";
import "common.proto";
import "control.proto";
option java_multiple_files = true;
//************************ ContextAdminService *****************************
service ContextAdminService {
rpc CreateContext(CreateContextRequest) returns (stream google.protobuf.Empty) ;
rpc UpdateContextProperties(UpdateContextPropertiesRequest) returns (stream google.protobuf.Empty) ;
rpc DeleteContext(DeleteContextRequest) returns (stream google.protobuf.Empty) ;
rpc GetContext(GetContextRequest) returns (ContextOverview) ;
rpc GetContexts(google.protobuf.Empty) returns (stream ContextOverview) ;
rpc SubscribeContextUpdates(google.protobuf.Empty) returns (stream ContextUpdate) ;
}
service ReplicationGroupAdminService {
rpc GetNodes (google.protobuf.Empty) returns (stream NodeOverview) {}
rpc CreateReplicationGroup(CreateReplicationGroupRequest) returns (stream google.protobuf.Empty);
rpc GetReplicationGroups(google.protobuf.Empty) returns (stream ReplicationGroupOverview);
rpc GetReplicationGroup(GetReplicationGroupRequest) returns (ReplicationGroupOverview);
rpc DeleteReplicationGroup(DeleteReplicationGroupRequest) returns (stream google.protobuf.Empty) ;
rpc AddNodeToReplicationGroup(JoinReplicationGroup) returns (stream google.protobuf.Empty) ;
rpc RemoveNodeFromReplicationGroup(LeaveReplicationGroup) returns (stream google.protobuf.Empty) ;
}
message CreateContextRequest {
string name = 1;
string replicationGroupName = 2;
map<string, string> meta_data = 3;
}
message UpdateContextPropertiesRequest {
string name = 1;
map<string, string> meta_data = 3;
}
message DeleteContextRequest {
string name = 1;
bool preserveEventStore = 2;
}
message GetContextRequest {
string name = 1;
}
message ContextOverview {
string name = 1;
ReplicationGroupOverview replicationGroup = 2;
map<string, string> meta_data = 3;
int64 pendingSince = 4;
bool changePending = 5;
}
message ContextUpdate {
string context = 1;
ContextUpdateType type = 2;
}
enum ContextUpdateType {
/* new context has been created. */
CREATED = 0;
/* context has been removed */
DELETED = 1;
/* context has been updated */
UPDATED = 2;
}
message CreateReplicationGroupRequest {
string name = 1;
repeated ReplicationGroupMember members = 2;
int64 pendingSince = 3;
bool changePending = 4;
}
message ReplicationGroupOverview {
string name = 1;
repeated ReplicationGroupMember members = 2;
int64 pendingSince = 3;
bool changePending = 4;
repeated string contexts = 5;
}
message DeleteReplicationGroupRequest {
string name = 1;
bool preserveEventStore = 2;
}
message ReplicationGroupMember {
string node_name = 1;
string host = 2;
int32 port = 3;
Role role = 4;
bool pendingDelete = 5;
}
enum Role {
ROLE_PRIMARY = 0;
ROLE_ACTIVE_BACKUP = 2;
ROLE_PASSIVE_BACKUP = 3;
ROLE_MESSAGING_ONLY = 4;
ROLE_SECONDARY = 5;
}
message GetReplicationGroupRequest {
string name = 1;
}
message JoinReplicationGroup {
string replication_group_name = 1;
string node_name = 2;
Role role = 3;
}
message LeaveReplicationGroup {
string replication_group_name = 1;
string node_name = 2;
bool preserveEventStore = 3;
}
message ReplicationGroupContext {
string replication_group_name = 1;
string context_name = 2;
map<string, string> meta_data = 3;
}
//************************ ApplicationAdminService *****************************
service ApplicationAdminService {
rpc CreateOrUpdateApplication(ApplicationRequest) returns (Token);
rpc DeleteApplication(ApplicationId) returns (stream google.protobuf.Empty);
rpc GetApplication(ApplicationId) returns (ApplicationOverview);
rpc GetApplications(google.protobuf.Empty) returns (stream ApplicationOverview);
rpc RefreshToken(ApplicationId) returns (Token);
rpc GetConnectedApplicationsByContext(ContextId) returns (ConnectedApplicationOverview);
}
message ApplicationRequest {
string applicationName = 1;
string description = 2;
string token = 3;
repeated ApplicationContextRole rolesPerContext = 4;
map<string, string> meta_data = 5;
}
message ApplicationContextRole {
string context = 1;
repeated string roles = 2;
}
message Token {
string token = 1;
}
message ApplicationId {
string applicationName = 1;
}
message ApplicationOverview {
string applicationName = 1;
string description = 2;
repeated ApplicationContextRole rolesPerContext = 3;
map<string, string> meta_data = 4;
}
message ContextId {
string contextName = 1;
}
message ConnectedApplicationOverview {
repeated string nodes = 1;
repeated ClientApplication applications = 2;
}
message ClientApplication {
string name = 1;
repeated Client clients = 2;
repeated string commands = 3;
repeated QueryInfo queries = 4;
}
message Client {
string name = 1;
string node = 2;
repeated io.axoniq.axonserver.grpc.control.EventProcessorInfo processors = 3;
}
message QueryInfo {
string request = 1;
repeated string responseTypes = 2;
}
//************************ UserAdminService *****************************
service UserAdminService {
rpc CreateOrUpdateUser(CreateOrUpdateUserRequest) returns (stream google.protobuf.Empty);
rpc DeleteUser(DeleteUserRequest) returns (stream google.protobuf.Empty);
rpc GetUsers(google.protobuf.Empty) returns (stream UserOverview);
}
message CreateOrUpdateUserRequest {
string userName = 1;
string password = 2;
repeated UserRoleRequest userRoles = 3;
}
message DeleteUserRequest {
string userName = 1;
}
message UserRoleRequest {
string role = 1;
string context = 2;
}
message UserRoleOverview {
string role = 1;
string context = 2;
}
message UserOverview {
string userName = 1;
bool enabled = 2;
repeated UserRoleOverview userRoles = 3;
}
//***************************** Event Processor Admin Service ***************************
service EventProcessorAdminService {
/*The following api return a stream of Empty to allow the server to complete the stream without any result.*/
/* Request to pause an event processor */
rpc PauseEventProcessor(EventProcessorIdentifier) returns (AdminActionResult);
/* Request to start an event processor */
rpc StartEventProcessor(EventProcessorIdentifier) returns (AdminActionResult);
/* Request to split the largest segment of a streaming event processor */
rpc SplitEventProcessor(EventProcessorIdentifier) returns (AdminActionResult);
/* Request to merge the smallest two segments of a streaming event processor */
rpc MergeEventProcessor(EventProcessorIdentifier) returns (AdminActionResult);
/* Request to move the specified segment of a streaming event processor to the desired destination */
rpc MoveEventProcessorSegment(MoveSegment) returns (AdminActionResult);
/* Retrieves all event processors registered in an Axon Server cluster */
rpc GetAllEventProcessors(google.protobuf.Empty) returns (stream EventProcessor);
/* Retrieves all event processors registered in an Axon Server cluster for the specified component*/
rpc GetEventProcessorsByComponent(Component) returns (stream EventProcessor);
rpc LoadBalanceProcessor(LoadBalanceRequest) returns (stream google.protobuf.Empty);
rpc SetAutoLoadBalanceStrategy(LoadBalanceRequest) returns (stream google.protobuf.Empty);
rpc GetBalancingStrategies(google.protobuf.Empty) returns (stream LoadBalancingStrategy);
}
message AdminActionResult {
Result result = 1;
}
enum Result {
/* The handler confirmed that the action was executed successfully */
SUCCESS = 0;
/* The handler has accepted the result, no result will be returned */
ACCEPTED = 1;
}
message EventProcessorIdentifier {
/* the name of the processor */
string processor_name = 1;
/* the identifier of the token store this event processor is using */
string token_store_identifier = 2;
/* optional parameter to pass in the context name to indicate where the processor is located */
string context_name = 3;
}
message MoveSegment {
/* the identifier of the event processor */
EventProcessorIdentifier event_processor = 1;
/* the id of the segment to move */
int32 segment = 2;
/* the desired destination for the segment */
string target_client_id = 3;
}
message EventProcessor {
/* the identifier of the event processor */
EventProcessorIdentifier identifier = 1;
/* the event processor mode (subscribing, tracking, pooled) */
string mode = 2;
/* true if the event processor is streaming, false otherwise */
bool isStreaming = 3;
/* client instances that subscribed the event processor */
repeated EventProcessorInstance client_instance = 4;
/* current load balancing strategy name for the event processor */
string load_balancing_strategy_name = 5;
}
message EventProcessorInstance {
/* the client identifier */
string client_id = 1;
/* true if the client instance of the event processor is running, false otherwise */
bool isRunning = 2;
/* the max number of segments that this client can claim*/
int32 max_capacity = 3;
/* status of all segments claimed by the client */
repeated EventProcessorSegment claimed_segment = 4;
}
message EventProcessorSegment {
/* the identifier of the segment */
int32 id = 1;
/* the fractional unit representing the size of the segment*/
int32 one_part_of = 2;
/* the id of the client that claimed the segment */
string claimed_by = 3;
/* true if the segment has ever reached the head of the stream since it was started, false otherwise */
bool is_caughtUp = 4;
/* true if the segment is replaying, false otherwise */
bool is_replaying = 5;
/* the approximate position of the token */
int64 token_position = 6;
/* true if the segment is in an error loop, false otherwise */
bool is_in_error = 7;
/* the error description, if the segment is in error */
string error = 8;
}
message LoadBalanceRequest {
EventProcessorIdentifier processor = 1;
string strategy = 2;
}
message LoadBalancingStrategy {
string strategy = 1;
string label = 2;
}
/* Message containing connection information for an AxonServer Node */
message NodeOverview {
/* The host name to use when connecting to this node */
string host_name = 1;
/* The port number for gRPC connections */
int32 grpc_port = 2;
/* The port number for HTTP connections */
int32 http_port = 3;
/* The unique name of the node to connect with, for purpose of debugging */
string node_name = 4;
/* List of replication groups that belongs to this node */
repeated string replication_groups = 5;
/* List of tags associated with this node */
map<string, string> tags = 6;
}
/* AuthenticationService, allows to use Axon Server as authentication provider */
service AuthenticationService {
/* Authenticate a user, returns the user's roles */
rpc AuthenticateUser(AuthenticateUserRequest) returns (UserRoles);
/* Authenticate based on an application token, returns the application's roles */
rpc AuthenticateToken(Token) returns (ApplicationRoles);
}
message AuthenticateUserRequest {
string userName = 1;
string password = 2;
}
message ApplicationRoles {
string applicationName = 1;
repeated ContextRole applicationRole = 2;
}
message ContextRole {
string role = 1;
string context = 2;
}
message UserRoles {
string userName = 1;
repeated ContextRole userRoles = 3;
}