python-etcd3-async 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
etcdrpc/rpc.proto ADDED
@@ -0,0 +1,924 @@
1
+ //
2
+ // Copyright 2016-2021 The jetcd authors
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ syntax = "proto3";
18
+
19
+ import "etcdrpc/kv.proto";
20
+ import "etcdrpc/auth.proto";
21
+
22
+ package etcdserverpb;
23
+
24
+ option java_multiple_files = true;
25
+ option java_package = "io.etcd.jetcd.api";
26
+ option java_outer_classname = "JetcdProto";
27
+ option objc_class_prefix = "Jetcd";
28
+
29
+ service KV {
30
+ // Range gets the keys in the range from the key-value store.
31
+ rpc Range(RangeRequest) returns (RangeResponse) {}
32
+
33
+ // Put puts the given key into the key-value store.
34
+ // A put request increments the revision of the key-value store
35
+ // and generates one event in the event history.
36
+ rpc Put(PutRequest) returns (PutResponse) {}
37
+
38
+ // DeleteRange deletes the given range from the key-value store.
39
+ // A delete request increments the revision of the key-value store
40
+ // and generates a delete event in the event history for every deleted key.
41
+ rpc DeleteRange(DeleteRangeRequest) returns (DeleteRangeResponse) {}
42
+
43
+ // Txn processes multiple requests in a single transaction.
44
+ // A txn request increments the revision of the key-value store
45
+ // and generates events with the same revision for every completed request.
46
+ // It is not allowed to modify the same key several times within one txn.
47
+ rpc Txn(TxnRequest) returns (TxnResponse) {}
48
+
49
+ // Compact compacts the event history in the etcd key-value store. The key-value
50
+ // store should be periodically compacted or the event history will continue to grow
51
+ // indefinitely.
52
+ rpc Compact(CompactionRequest) returns (CompactionResponse) {}
53
+ }
54
+
55
+ service Watch {
56
+ // Progress requests that a watch stream progress status
57
+ // be sent in the watch response stream as soon as possible.
58
+ // For watch progress responses, the header.revision indicates progress. All future events
59
+ // received in this stream are guaranteed to have a higher revision number than the
60
+ // header.revision number.
61
+ rpc Progress(WatchProgressRequest) returns (WatchResponse) {}
62
+
63
+ // Watch watches for events happening or that have happened. Both input and output
64
+ // are streams; the input stream is for creating and canceling watchers and the output
65
+ // stream sends events. One watch RPC can watch on multiple key ranges, streaming events
66
+ // for several watches at once. The entire event history can be watched starting from the
67
+ // last compaction revision.
68
+ rpc Watch(stream WatchRequest) returns (stream WatchResponse) {}
69
+ }
70
+
71
+ service Lease {
72
+ // LeaseGrant creates a lease which expires if the server does not receive a keepAlive
73
+ // within a given time to live period. All keys attached to the lease will be expired and
74
+ // deleted if the lease expires. Each expired key generates a delete event in the event history.
75
+ rpc LeaseGrant(LeaseGrantRequest) returns (LeaseGrantResponse) {}
76
+
77
+ // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
78
+ rpc LeaseRevoke(LeaseRevokeRequest) returns (LeaseRevokeResponse) {}
79
+
80
+ // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
81
+ // to the server and streaming keep alive responses from the server to the client.
82
+ rpc LeaseKeepAlive(stream LeaseKeepAliveRequest) returns (stream LeaseKeepAliveResponse) {}
83
+
84
+ // LeaseTimeToLive retrieves lease information.
85
+ rpc LeaseTimeToLive(LeaseTimeToLiveRequest) returns (LeaseTimeToLiveResponse) {}
86
+
87
+ // TODO(xiangli) List all existing Leases?
88
+ }
89
+
90
+ service Cluster {
91
+ // MemberAdd adds a member into the cluster.
92
+ rpc MemberAdd(MemberAddRequest) returns (MemberAddResponse) {}
93
+
94
+ // MemberRemove removes an existing member from the cluster.
95
+ rpc MemberRemove(MemberRemoveRequest) returns (MemberRemoveResponse) {}
96
+
97
+ // MemberUpdate updates the member configuration.
98
+ rpc MemberUpdate(MemberUpdateRequest) returns (MemberUpdateResponse) {}
99
+
100
+ // MemberList lists all the members in the cluster.
101
+ rpc MemberList(MemberListRequest) returns (MemberListResponse) {}
102
+ }
103
+
104
+ service Maintenance {
105
+ // Alarm activates, deactivates, and queries alarms regarding cluster health.
106
+ rpc Alarm(AlarmRequest) returns (AlarmResponse) {}
107
+
108
+ // Status gets the status of the member.
109
+ rpc Status(StatusRequest) returns (StatusResponse) {}
110
+
111
+ // Defragment defragments a member's backend database to recover storage space.
112
+ rpc Defragment(DefragmentRequest) returns (DefragmentResponse) {}
113
+
114
+ // Hash returns the hash of the local KV state for consistency checking purpose.
115
+ // This is designed for testing; do not use this in production when there
116
+ // are ongoing transactions.
117
+ rpc Hash(HashRequest) returns (HashResponse) {}
118
+
119
+ // HashKV computes the hash of all MVCC keys up to a given revision.
120
+ rpc HashKV(HashKVRequest) returns (HashKVResponse) {}
121
+
122
+ // Snapshot sends a snapshot of the entire backend from a member over a stream to a client.
123
+ rpc Snapshot(SnapshotRequest) returns (stream SnapshotResponse) {}
124
+
125
+ // MoveLeader requests current leader node to transfer its leadership to transferee.
126
+ rpc MoveLeader(MoveLeaderRequest) returns (MoveLeaderResponse) {}
127
+ }
128
+
129
+ service Auth {
130
+ // AuthEnable enables authentication.
131
+ rpc AuthEnable(AuthEnableRequest) returns (AuthEnableResponse) {}
132
+
133
+ // AuthDisable disables authentication.
134
+ rpc AuthDisable(AuthDisableRequest) returns (AuthDisableResponse) {}
135
+
136
+ // Authenticate processes an authenticate request.
137
+ rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) {}
138
+
139
+ // UserAdd adds a new user.
140
+ rpc UserAdd(AuthUserAddRequest) returns (AuthUserAddResponse) {}
141
+
142
+ // UserGet gets detailed user information.
143
+ rpc UserGet(AuthUserGetRequest) returns (AuthUserGetResponse) {}
144
+
145
+ // UserList gets a list of all users.
146
+ rpc UserList(AuthUserListRequest) returns (AuthUserListResponse) {}
147
+
148
+ // UserDelete deletes a specified user.
149
+ rpc UserDelete(AuthUserDeleteRequest) returns (AuthUserDeleteResponse) {}
150
+
151
+ // UserChangePassword changes the password of a specified user.
152
+ rpc UserChangePassword(AuthUserChangePasswordRequest) returns (AuthUserChangePasswordResponse) {}
153
+
154
+ // UserGrant grants a role to a specified user.
155
+ rpc UserGrantRole(AuthUserGrantRoleRequest) returns (AuthUserGrantRoleResponse) {}
156
+
157
+ // UserRevokeRole revokes a role of specified user.
158
+ rpc UserRevokeRole(AuthUserRevokeRoleRequest) returns (AuthUserRevokeRoleResponse) {}
159
+
160
+ // RoleAdd adds a new role.
161
+ rpc RoleAdd(AuthRoleAddRequest) returns (AuthRoleAddResponse) {}
162
+
163
+ // RoleGet gets detailed role information.
164
+ rpc RoleGet(AuthRoleGetRequest) returns (AuthRoleGetResponse) {}
165
+
166
+ // RoleList gets lists of all roles.
167
+ rpc RoleList(AuthRoleListRequest) returns (AuthRoleListResponse) {}
168
+
169
+ // RoleDelete deletes a specified role.
170
+ rpc RoleDelete(AuthRoleDeleteRequest) returns (AuthRoleDeleteResponse) {}
171
+
172
+ // RoleGrantPermission grants a permission of a specified key or range to a specified role.
173
+ rpc RoleGrantPermission(AuthRoleGrantPermissionRequest) returns (AuthRoleGrantPermissionResponse) {}
174
+
175
+ // RoleRevokePermission revokes a key or range permission of a specified role.
176
+ rpc RoleRevokePermission(AuthRoleRevokePermissionRequest) returns (AuthRoleRevokePermissionResponse) {}
177
+ }
178
+
179
+ message ResponseHeader {
180
+ // cluster_id is the ID of the cluster which sent the response.
181
+ uint64 cluster_id = 1;
182
+ // member_id is the ID of the member which sent the response.
183
+ uint64 member_id = 2;
184
+ // revision is the key-value store revision when the request was applied.
185
+ // For watch progress responses, the header.revision indicates progress. All future events
186
+ // recieved in this stream are guaranteed to have a higher revision number than the
187
+ // header.revision number.
188
+ int64 revision = 3;
189
+ // raft_term is the raft term when the request was applied.
190
+ uint64 raft_term = 4;
191
+ }
192
+
193
+ message RangeRequest {
194
+ enum SortOrder {
195
+ NONE = 0; // default, no sorting
196
+ ASCEND = 1; // lowest target value first
197
+ DESCEND = 2; // highest target value first
198
+ }
199
+ enum SortTarget {
200
+ KEY = 0;
201
+ VERSION = 1;
202
+ CREATE = 2;
203
+ MOD = 3;
204
+ VALUE = 4;
205
+ }
206
+
207
+ // key is the first key for the range. If range_end is not given, the request only looks up key.
208
+ bytes key = 1;
209
+ // range_end is the upper bound on the requested range [key, range_end).
210
+ // If range_end is '\0', the range is all keys >= key.
211
+ // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"),
212
+ // then the range request gets all keys prefixed with key.
213
+ // If both key and range_end are '\0', then the range request returns all keys.
214
+ bytes range_end = 2;
215
+ // limit is a limit on the number of keys returned for the request. When limit is set to 0,
216
+ // it is treated as no limit.
217
+ int64 limit = 3;
218
+ // revision is the point-in-time of the key-value store to use for the range.
219
+ // If revision is less or equal to zero, the range is over the newest key-value store.
220
+ // If the revision has been compacted, ErrCompacted is returned as a response.
221
+ int64 revision = 4;
222
+
223
+ // sort_order is the order for returned sorted results.
224
+ SortOrder sort_order = 5;
225
+
226
+ // sort_target is the key-value field to use for sorting.
227
+ SortTarget sort_target = 6;
228
+
229
+ // serializable sets the range request to use serializable member-local reads.
230
+ // Range requests are linearizable by default; linearizable requests have higher
231
+ // latency and lower throughput than serializable requests but reflect the current
232
+ // consensus of the cluster. For better performance, in exchange for possible stale reads,
233
+ // a serializable range request is served locally without needing to reach consensus
234
+ // with other nodes in the cluster.
235
+ bool serializable = 7;
236
+
237
+ // keys_only when set returns only the keys and not the values.
238
+ bool keys_only = 8;
239
+
240
+ // count_only when set returns only the count of the keys in the range.
241
+ bool count_only = 9;
242
+
243
+ // min_mod_revision is the lower bound for returned key mod revisions; all keys with
244
+ // lesser mod revisions will be filtered away.
245
+ int64 min_mod_revision = 10;
246
+
247
+ // max_mod_revision is the upper bound for returned key mod revisions; all keys with
248
+ // greater mod revisions will be filtered away.
249
+ int64 max_mod_revision = 11;
250
+
251
+ // min_create_revision is the lower bound for returned key create revisions; all keys with
252
+ // lesser create trevisions will be filtered away.
253
+ int64 min_create_revision = 12;
254
+
255
+ // max_create_revision is the upper bound for returned key create revisions; all keys with
256
+ // greater create revisions will be filtered away.
257
+ int64 max_create_revision = 13;
258
+ }
259
+
260
+ message RangeResponse {
261
+ ResponseHeader header = 1;
262
+ // kvs is the list of key-value pairs matched by the range request.
263
+ // kvs is empty when count is requested.
264
+ repeated mvccpb.KeyValue kvs = 2;
265
+ // more indicates if there are more keys to return in the requested range.
266
+ bool more = 3;
267
+ // count is set to the number of keys within the range when requested.
268
+ int64 count = 4;
269
+ }
270
+
271
+ message PutRequest {
272
+ // key is the key, in bytes, to put into the key-value store.
273
+ bytes key = 1;
274
+ // value is the value, in bytes, to associate with the key in the key-value store.
275
+ bytes value = 2;
276
+ // lease is the lease ID to associate with the key in the key-value store. A lease
277
+ // value of 0 indicates no lease.
278
+ int64 lease = 3;
279
+
280
+ // If prev_kv is set, etcd gets the previous key-value pair before changing it.
281
+ // The previous key-value pair will be returned in the put response.
282
+ bool prev_kv = 4;
283
+
284
+ // If ignore_value is set, etcd updates the key using its current value.
285
+ // Returns an error if the key does not exist.
286
+ bool ignore_value = 5;
287
+
288
+ // If ignore_lease is set, etcd updates the key using its current lease.
289
+ // Returns an error if the key does not exist.
290
+ bool ignore_lease = 6;
291
+ }
292
+
293
+ message PutResponse {
294
+ ResponseHeader header = 1;
295
+ // if prev_kv is set in the request, the previous key-value pair will be returned.
296
+ mvccpb.KeyValue prev_kv = 2;
297
+ }
298
+
299
+ message DeleteRangeRequest {
300
+ // key is the first key to delete in the range.
301
+ bytes key = 1;
302
+ // range_end is the key following the last key to delete for the range [key, range_end).
303
+ // If range_end is not given, the range is defined to contain only the key argument.
304
+ // If range_end is one bit larger than the given key, then the range is all the keys
305
+ // with the prefix (the given key).
306
+ // If range_end is '\0', the range is all keys greater than or equal to the key argument.
307
+ bytes range_end = 2;
308
+
309
+ // If prev_kv is set, etcd gets the previous key-value pairs before deleting it.
310
+ // The previous key-value pairs will be returned in the delete response.
311
+ bool prev_kv = 3;
312
+ }
313
+
314
+ message DeleteRangeResponse {
315
+ ResponseHeader header = 1;
316
+ // deleted is the number of keys deleted by the delete range request.
317
+ int64 deleted = 2;
318
+ // if prev_kv is set in the request, the previous key-value pairs will be returned.
319
+ repeated mvccpb.KeyValue prev_kvs = 3;
320
+ }
321
+
322
+ message RequestOp {
323
+ // request is a union of request types accepted by a transaction.
324
+ oneof request {
325
+ RangeRequest request_range = 1;
326
+ PutRequest request_put = 2;
327
+ DeleteRangeRequest request_delete_range = 3;
328
+ TxnRequest request_txn = 4;
329
+ }
330
+ }
331
+
332
+ message ResponseOp {
333
+ // response is a union of response types returned by a transaction.
334
+ oneof response {
335
+ RangeResponse response_range = 1;
336
+ PutResponse response_put = 2;
337
+ DeleteRangeResponse response_delete_range = 3;
338
+ TxnResponse response_txn = 4;
339
+ }
340
+ }
341
+
342
+ message Compare {
343
+ enum CompareResult {
344
+ EQUAL = 0;
345
+ GREATER = 1;
346
+ LESS = 2;
347
+ NOT_EQUAL = 3;
348
+ }
349
+ enum CompareTarget {
350
+ VERSION = 0;
351
+ CREATE = 1;
352
+ MOD = 2;
353
+ VALUE = 3;
354
+ LEASE = 4;
355
+ }
356
+ // result is logical comparison operation for this comparison.
357
+ CompareResult result = 1;
358
+ // target is the key-value field to inspect for the comparison.
359
+ CompareTarget target = 2;
360
+ // key is the subject key for the comparison operation.
361
+ bytes key = 3;
362
+ oneof target_union {
363
+ // version is the version of the given key
364
+ int64 version = 4;
365
+ // create_revision is the creation revision of the given key
366
+ int64 create_revision = 5;
367
+ // mod_revision is the last modified revision of the given key.
368
+ int64 mod_revision = 6;
369
+ // value is the value of the given key, in bytes.
370
+ bytes value = 7;
371
+ // lease is the lease id of the given key.
372
+ int64 lease = 8;
373
+ // leave room for more target_union field tags, jump to 64
374
+ }
375
+
376
+ // range_end compares the given target to all keys in the range [key, range_end).
377
+ // See RangeRequest for more details on key ranges.
378
+ bytes range_end = 64;
379
+ // TODO: fill out with most of the rest of RangeRequest fields when needed.
380
+ }
381
+
382
+ // From google paxosdb paper:
383
+ // Our implementation hinges around a powerful primitive which we call MultiOp. All other database
384
+ // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
385
+ // and consists of three components:
386
+ // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
387
+ // for the absence or presence of a value, or compare with a given value. Two different tests in the guard
388
+ // may apply to the same or different entries in the database. All tests in the guard are applied and
389
+ // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
390
+ // it executes f op (see item 3 below).
391
+ // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
392
+ // lookup operation, and applies to a single database entry. Two different operations in the list may apply
393
+ // to the same or different entries in the database. These operations are executed
394
+ // if guard evaluates to
395
+ // true.
396
+ // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
397
+ message TxnRequest {
398
+ // compare is a list of predicates representing a conjunction of terms.
399
+ // If the comparisons succeed, then the success requests will be processed in order,
400
+ // and the response will contain their respective responses in order.
401
+ // If the comparisons fail, then the failure requests will be processed in order,
402
+ // and the response will contain their respective responses in order.
403
+ repeated Compare compare = 1;
404
+ // success is a list of requests which will be applied when compare evaluates to true.
405
+ repeated RequestOp success = 2;
406
+ // failure is a list of requests which will be applied when compare evaluates to false.
407
+ repeated RequestOp failure = 3;
408
+ }
409
+
410
+ message TxnResponse {
411
+ ResponseHeader header = 1;
412
+ // succeeded is set to true if the compare evaluated to true or false otherwise.
413
+ bool succeeded = 2;
414
+ // responses is a list of responses corresponding to the results from applying
415
+ // success if succeeded is true or failure if succeeded is false.
416
+ repeated ResponseOp responses = 3;
417
+ }
418
+
419
+ // CompactionRequest compacts the key-value store up to a given revision. All superseded keys
420
+ // with a revision less than the compaction revision will be removed.
421
+ message CompactionRequest {
422
+ // revision is the key-value store revision for the compaction operation.
423
+ int64 revision = 1;
424
+ // physical is set so the RPC will wait until the compaction is physically
425
+ // applied to the local database such that compacted entries are totally
426
+ // removed from the backend database.
427
+ bool physical = 2;
428
+ }
429
+
430
+ message CompactionResponse {
431
+ ResponseHeader header = 1;
432
+ }
433
+
434
+ message HashRequest {
435
+ }
436
+
437
+ message HashKVRequest {
438
+ // revision is the key-value store revision for the hash operation.
439
+ int64 revision = 1;
440
+ }
441
+
442
+ message HashKVResponse {
443
+ ResponseHeader header = 1;
444
+ // hash is the hash value computed from the responding member's MVCC keys up to a given revision.
445
+ uint32 hash = 2;
446
+ // compact_revision is the compacted revision of key-value store when hash begins.
447
+ int64 compact_revision = 3;
448
+ }
449
+
450
+ message HashResponse {
451
+ ResponseHeader header = 1;
452
+ // hash is the hash value computed from the responding member's key-value store.
453
+ uint32 hash = 2;
454
+ }
455
+
456
+ message SnapshotRequest {
457
+ }
458
+
459
+ message SnapshotResponse {
460
+ // header has the current key-value store information. The first header in the snapshot
461
+ // stream indicates the point in time of the snapshot.
462
+ ResponseHeader header = 1;
463
+
464
+ // remaining_bytes is the number of blob bytes to be sent after this message
465
+ uint64 remaining_bytes = 2;
466
+
467
+ // blob contains the next chunk of the snapshot in the snapshot stream.
468
+ bytes blob = 3;
469
+ }
470
+
471
+ message WatchRequest {
472
+ // request_union is a request to either create a new watcher or cancel an existing watcher.
473
+ oneof request_union {
474
+ WatchCreateRequest create_request = 1;
475
+ WatchCancelRequest cancel_request = 2;
476
+ WatchProgressRequest progress_request = 3;
477
+ }
478
+ }
479
+
480
+ message WatchCreateRequest {
481
+ // key is the key to register for watching.
482
+ bytes key = 1;
483
+ // range_end is the end of the range [key, range_end) to watch. If range_end is not given,
484
+ // only the key argument is watched. If range_end is equal to '\0', all keys greater than
485
+ // or equal to the key argument are watched.
486
+ // If the range_end is one bit larger than the given key,
487
+ // then all keys with the prefix (the given key) will be watched.
488
+ bytes range_end = 2;
489
+ // start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
490
+ int64 start_revision = 3;
491
+ // progress_notify is set so that the etcd server will periodically send a WatchResponse with
492
+ // no events to the new watcher if there are no recent events. It is useful when clients
493
+ // wish to recover a disconnected watcher starting from a recent known revision.
494
+ // The etcd server may decide how often it will send notifications based on current load.
495
+ bool progress_notify = 4;
496
+
497
+ enum FilterType {
498
+ // filter out put event.
499
+ NOPUT = 0;
500
+ // filter out delete event.
501
+ NODELETE = 1;
502
+ }
503
+ // filters filter the events at server side before it sends back to the watcher.
504
+ repeated FilterType filters = 5;
505
+
506
+ // If prev_kv is set, created watcher gets the previous KV before the event happens.
507
+ // If the previous KV is already compacted, nothing will be returned.
508
+ bool prev_kv = 6;
509
+
510
+ // If watch_id is provided and non-zero, it will be assigned to this watcher.
511
+ // Since creating a watcher in etcd is not a synchronous operation,
512
+ // this can be used ensure that ordering is correct when creating multiple
513
+ // watchers on the same stream. Creating a watcher with a ID already in
514
+ // use on the stream will cause an error to be returned.
515
+ int64 watch_id = 7;
516
+
517
+ // fragment enables splitting large revisions into multiple watch responses.
518
+ bool fragment = 8;
519
+ }
520
+
521
+ message WatchCancelRequest {
522
+ // watch_id is the watcher id to cancel so that no more events are transmitted.
523
+ int64 watch_id = 1;
524
+ }
525
+
526
+ // Requests a watch stream progress status be sent in the
527
+ // watch response stream as soon as possible.
528
+ message WatchProgressRequest {
529
+ }
530
+
531
+ message WatchResponse {
532
+ ResponseHeader header = 1;
533
+ // watch_id is the ID of the watcher that corresponds to the response.
534
+ int64 watch_id = 2;
535
+ // created is set to true if the response is for a create watch request.
536
+ // The client should record the watch_id and expect to receive events for
537
+ // the created watcher from the same stream.
538
+ // All events sent to the created watcher will attach with the same watch_id.
539
+ bool created = 3;
540
+ // canceled is set to true if the response is for a cancel watch request.
541
+ // No further events will be sent to the canceled watcher.
542
+ bool canceled = 4;
543
+ // compact_revision is set to the minimum index if a watcher tries to watch
544
+ // at a compacted index.
545
+ //
546
+ // This happens when creating a watcher at a compacted revision or the watcher cannot
547
+ // catch up with the progress of the key-value store.
548
+ //
549
+ // The client should treat the watcher as canceled and should not try to create any
550
+ // watcher with the same start_revision again.
551
+ int64 compact_revision = 5;
552
+
553
+ // cancel_reason indicates the reason for canceling the watcher.
554
+ string cancel_reason = 6;
555
+
556
+ // fragment is true if large watch response was split over multiple responses.
557
+ bool fragment = 7;
558
+
559
+ repeated mvccpb.Event events = 11;
560
+ }
561
+
562
+ message LeaseGrantRequest {
563
+ // TTL is the advisory time-to-live in seconds.
564
+ int64 TTL = 1;
565
+ // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.
566
+ int64 ID = 2;
567
+ }
568
+
569
+ message LeaseGrantResponse {
570
+ ResponseHeader header = 1;
571
+ // ID is the lease ID for the granted lease.
572
+ int64 ID = 2;
573
+ // TTL is the server chosen lease time-to-live in seconds.
574
+ int64 TTL = 3;
575
+ string error = 4;
576
+ }
577
+
578
+ message LeaseRevokeRequest {
579
+ // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.
580
+ int64 ID = 1;
581
+ }
582
+
583
+ message LeaseRevokeResponse {
584
+ ResponseHeader header = 1;
585
+ }
586
+
587
+ message LeaseKeepAliveRequest {
588
+ // ID is the lease ID for the lease to keep alive.
589
+ int64 ID = 1;
590
+ }
591
+
592
+ message LeaseKeepAliveResponse {
593
+ ResponseHeader header = 1;
594
+ // ID is the lease ID from the keep alive request.
595
+ int64 ID = 2;
596
+ // TTL is the new time-to-live for the lease.
597
+ int64 TTL = 3;
598
+ }
599
+
600
+ message LeaseTimeToLiveRequest {
601
+ // ID is the lease ID for the lease.
602
+ int64 ID = 1;
603
+ // keys is true to query all the keys attached to this lease.
604
+ bool keys = 2;
605
+ }
606
+
607
+ message LeaseTimeToLiveResponse {
608
+ ResponseHeader header = 1;
609
+ // ID is the lease ID from the keep alive request.
610
+ int64 ID = 2;
611
+ // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds.
612
+ int64 TTL = 3;
613
+ // GrantedTTL is the initial granted time in seconds upon lease creation/renewal.
614
+ int64 grantedTTL = 4;
615
+ // Keys is the list of keys attached to this lease.
616
+ repeated bytes keys = 5;
617
+ }
618
+
619
+ message Member {
620
+ // ID is the member ID for this member.
621
+ uint64 ID = 1;
622
+ // name is the human-readable name of the member. If the member is not started, the name will be an empty string.
623
+ string name = 2;
624
+ // peerURLs is the list of URLs the member exposes to the cluster for communication.
625
+ repeated string peerURLs = 3;
626
+ // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty.
627
+ repeated string clientURLs = 4;
628
+ // isLearner indicates if the member is raft learner.
629
+ bool isLearner = 5;
630
+ }
631
+
632
+ message MemberAddRequest {
633
+ // peerURLs is the list of URLs the added member will use to communicate with the cluster.
634
+ repeated string peerURLs = 1;
635
+ // isLearner indicates if the added member is raft learner.
636
+ bool isLearner = 2;
637
+ }
638
+
639
+ message MemberAddResponse {
640
+ ResponseHeader header = 1;
641
+ // member is the member information for the added member.
642
+ Member member = 2;
643
+ // members is a list of all members after adding the new member.
644
+ repeated Member members = 3;
645
+ }
646
+
647
+ message MemberRemoveRequest {
648
+ // ID is the member ID of the member to remove.
649
+ uint64 ID = 1;
650
+ }
651
+
652
+ message MemberRemoveResponse {
653
+ ResponseHeader header = 1;
654
+ // members is a list of all members after removing the member.
655
+ repeated Member members = 2;
656
+ }
657
+
658
+ message MemberUpdateRequest {
659
+ // ID is the member ID of the member to update.
660
+ uint64 ID = 1;
661
+ // peerURLs is the new list of URLs the member will use to communicate with the cluster.
662
+ repeated string peerURLs = 2;
663
+ }
664
+
665
+ message MemberUpdateResponse{
666
+ ResponseHeader header = 1;
667
+ // members is a list of all members after updating the member.
668
+ repeated Member members = 2;
669
+ }
670
+
671
+ message MemberListRequest {
672
+ bool linearizable = 1;
673
+ }
674
+
675
+ message MemberListResponse {
676
+ ResponseHeader header = 1;
677
+ // members is a list of all members associated with the cluster.
678
+ repeated Member members = 2;
679
+ }
680
+
681
+ message MemberPromoteRequest {
682
+ // ID is the member ID of the member to promote.
683
+ uint64 ID = 1;
684
+ }
685
+
686
+ message MemberPromoteResponse {
687
+ ResponseHeader header = 1;
688
+ // members is a list of all members after promoting the new member.
689
+ repeated Member members = 2;
690
+ }
691
+
692
+ message DefragmentRequest {
693
+ }
694
+
695
+ message DefragmentResponse {
696
+ ResponseHeader header = 1;
697
+ }
698
+
699
+ message MoveLeaderRequest {
700
+ // targetID is the node ID for the new leader.
701
+ uint64 targetID = 1;
702
+ }
703
+
704
+ message MoveLeaderResponse {
705
+ ResponseHeader header = 1;
706
+ }
707
+
708
+ enum AlarmType {
709
+ NONE = 0; // default, used to query if any alarm is active
710
+ NOSPACE = 1; // space quota is exhausted
711
+ CORRUPT = 2; // kv store corruption detected
712
+ }
713
+
714
+ message AlarmRequest {
715
+ enum AlarmAction {
716
+ GET = 0;
717
+ ACTIVATE = 1;
718
+ DEACTIVATE = 2;
719
+ }
720
+ // action is the kind of alarm request to issue. The action
721
+ // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a
722
+ // raised alarm.
723
+ AlarmAction action = 1;
724
+ // memberID is the ID of the member associated with the alarm. If memberID is 0, the
725
+ // alarm request covers all members.
726
+ uint64 memberID = 2;
727
+ // alarm is the type of alarm to consider for this request.
728
+ AlarmType alarm = 3;
729
+ }
730
+
731
+ message AlarmMember {
732
+ // memberID is the ID of the member associated with the raised alarm.
733
+ uint64 memberID = 1;
734
+ // alarm is the type of alarm which has been raised.
735
+ AlarmType alarm = 2;
736
+ }
737
+
738
+ message AlarmResponse {
739
+ ResponseHeader header = 1;
740
+ // alarms is a list of alarms associated with the alarm request.
741
+ repeated AlarmMember alarms = 2;
742
+ }
743
+
744
+ message StatusRequest {
745
+ }
746
+
747
+ message StatusResponse {
748
+ ResponseHeader header = 1;
749
+ // version is the cluster protocol version used by the responding member.
750
+ string version = 2;
751
+ // dbSize is the size of the backend database, in bytes, of the responding member.
752
+ int64 dbSize = 3;
753
+ // leader is the member ID which the responding member believes is the current leader.
754
+ uint64 leader = 4;
755
+ // raftIndex is the current raft index of the responding member.
756
+ uint64 raftIndex = 5;
757
+ // raftTerm is the current raft term of the responding member.
758
+ uint64 raftTerm = 6;
759
+ }
760
+
761
+ message AuthEnableRequest {
762
+ }
763
+
764
+ message AuthDisableRequest {
765
+ }
766
+
767
+ message AuthStatusRequest {
768
+ }
769
+
770
+ message AuthenticateRequest {
771
+ string name = 1;
772
+ string password = 2;
773
+ }
774
+
775
+ message AuthUserAddRequest {
776
+ string name = 1;
777
+ string password = 2;
778
+ // options is the options for creating the user.
779
+ // authpb.UserAddOptions options = 3;
780
+ string hashedPassword = 3;
781
+ }
782
+
783
+ message AuthUserGetRequest {
784
+ string name = 1;
785
+ }
786
+
787
+ message AuthUserDeleteRequest {
788
+ // name is the name of the user to delete.
789
+ string name = 1;
790
+ }
791
+
792
+ message AuthUserChangePasswordRequest {
793
+ // name is the name of the user whose password is being changed.
794
+ string name = 1;
795
+ // password is the new password for the user.
796
+ string password = 2;
797
+ // hashedPassword is the new hashed password for the user.
798
+ string hashedPassword = 3;
799
+ }
800
+
801
+ message AuthUserGrantRoleRequest {
802
+ // user is the name of the user which should be granted a given role.
803
+ string user = 1;
804
+ // role is the name of the role to grant to the user.
805
+ string role = 2;
806
+ }
807
+
808
+ message AuthUserRevokeRoleRequest {
809
+ string name = 1;
810
+ string role = 2;
811
+ }
812
+
813
+ message AuthRoleAddRequest {
814
+ // name is the name of the role to add to the authentication system.
815
+ string name = 1;
816
+ }
817
+
818
+ message AuthRoleGetRequest {
819
+ string role = 1;
820
+ }
821
+
822
+ message AuthUserListRequest {
823
+ }
824
+
825
+ message AuthRoleListRequest {
826
+ }
827
+
828
+ message AuthRoleDeleteRequest {
829
+ string role = 1;
830
+ }
831
+
832
+ message AuthRoleGrantPermissionRequest {
833
+ // name is the name of the role which will be granted the permission.
834
+ string name = 1;
835
+ // perm is the permission to grant to the role.
836
+ authpb.Permission perm = 2;
837
+ }
838
+
839
+ message AuthRoleRevokePermissionRequest {
840
+ string role = 1;
841
+ string key = 2;
842
+ string range_end = 3;
843
+ }
844
+
845
+ message AuthEnableResponse {
846
+ ResponseHeader header = 1;
847
+ }
848
+
849
+ message AuthDisableResponse {
850
+ ResponseHeader header = 1;
851
+ }
852
+
853
+ message AuthStatusResponse {
854
+ ResponseHeader header = 1;
855
+ bool enabled = 2;
856
+ // authRevision is the current revision of auth store
857
+ uint64 authRevision = 3;
858
+ }
859
+
860
+ message AuthenticateResponse {
861
+ ResponseHeader header = 1;
862
+ // token is an authorized token that can be used in succeeding RPCs
863
+ string token = 2;
864
+ }
865
+
866
+ message AuthUserAddResponse {
867
+ ResponseHeader header = 1;
868
+ }
869
+
870
+ message AuthUserGetResponse {
871
+ ResponseHeader header = 1;
872
+
873
+ repeated string roles = 2;
874
+ }
875
+
876
+ message AuthUserDeleteResponse {
877
+ ResponseHeader header = 1;
878
+ }
879
+
880
+ message AuthUserChangePasswordResponse {
881
+ ResponseHeader header = 1;
882
+ }
883
+
884
+ message AuthUserGrantRoleResponse {
885
+ ResponseHeader header = 1;
886
+ }
887
+
888
+ message AuthUserRevokeRoleResponse {
889
+ ResponseHeader header = 1;
890
+ }
891
+
892
+ message AuthRoleAddResponse {
893
+ ResponseHeader header = 1;
894
+ }
895
+
896
+ message AuthRoleGetResponse {
897
+ ResponseHeader header = 1;
898
+
899
+ repeated authpb.Permission perm = 2;
900
+ }
901
+
902
+ message AuthRoleListResponse {
903
+ ResponseHeader header = 1;
904
+
905
+ repeated string roles = 2;
906
+ }
907
+
908
+ message AuthUserListResponse {
909
+ ResponseHeader header = 1;
910
+
911
+ repeated string users = 2;
912
+ }
913
+
914
+ message AuthRoleDeleteResponse {
915
+ ResponseHeader header = 1;
916
+ }
917
+
918
+ message AuthRoleGrantPermissionResponse {
919
+ ResponseHeader header = 1;
920
+ }
921
+
922
+ message AuthRoleRevokePermissionResponse {
923
+ ResponseHeader header = 1;
924
+ }