-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathruntime.proto
896 lines (725 loc) · 27.5 KB
/
runtime.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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
syntax = "proto3";
package spec.proto.runtime.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/any.proto";
import "spec/proto/runtime/v1/appcallback.proto";
option go_package = "mosn.io/layotto/spec/proto/runtime/v1;runtime";
option java_outer_classname = "RuntimeProto";
option java_package = "spec.proto.runtime.v1";
/* @exclude skip quickstart_generator */
// Runtime encapsulates variours Runtime APIs(such as Configuration API, Pub/Sub API, etc)
service Runtime {
//SayHello used for test
rpc SayHello(SayHelloRequest) returns (SayHelloResponse) {}
// InvokeService do rpc calls
rpc InvokeService(InvokeServiceRequest) returns (InvokeResponse) {}
// GetConfiguration gets configuration from configuration store.
rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) {}
// SaveConfiguration saves configuration into configuration store.
rpc SaveConfiguration(SaveConfigurationRequest) returns (google.protobuf.Empty) {}
// DeleteConfiguration deletes configuration from configuration store.
rpc DeleteConfiguration(DeleteConfigurationRequest) returns (google.protobuf.Empty) {}
// SubscribeConfiguration gets configuration from configuration store and subscribe the updates.
rpc SubscribeConfiguration(stream SubscribeConfigurationRequest) returns (stream SubscribeConfigurationResponse) {}
// Distributed Lock API
// A non-blocking method trying to get a lock with ttl.
rpc TryLock(TryLockRequest)returns (TryLockResponse) {}
// A method trying to unlock.
rpc Unlock(UnlockRequest)returns (UnlockResponse) {}
// A method used to support lease renewal for distributed lock.
rpc LockKeepAlive(LockKeepAliveRequest) returns (LockKeepAliveResponse){}
// Sequencer API
// Get next unique id with some auto-increment guarantee
rpc GetNextId(GetNextIdRequest)returns (GetNextIdResponse) {}
// Below are the APIs compatible with Dapr.
// We try to keep them same as Dapr's because we want to work with Dapr to build an API spec for cloud native runtime
// ,like CloudEvent for event data.
// Gets the state for a specific key.
rpc GetState(GetStateRequest) returns (GetStateResponse) {}
// Gets a bulk of state items for a list of keys
rpc GetBulkState(GetBulkStateRequest) returns (GetBulkStateResponse) {}
// Saves an array of state objects
rpc SaveState(SaveStateRequest) returns (google.protobuf.Empty) {}
// Deletes the state for a specific key.
rpc DeleteState(DeleteStateRequest) returns (google.protobuf.Empty) {}
// Deletes a bulk of state items for a list of keys
rpc DeleteBulkState(DeleteBulkStateRequest) returns (google.protobuf.Empty) {}
// Executes transactions for a specified store
rpc ExecuteStateTransaction(ExecuteStateTransactionRequest) returns (google.protobuf.Empty) {}
// Publishes events to the specific topic
rpc PublishEvent(PublishEventRequest) returns (google.protobuf.Empty) {}
// SubscribeTopicEvents subscribes to a PubSub topic and receives topic
// events from it.
rpc SubscribeTopicEvents(stream SubscribeTopicEventsRequest) returns (stream SubscribeTopicEventsResponse) {}
// Get file with stream
rpc GetFile(GetFileRequest) returns (stream GetFileResponse) {}
// Put file with stream
rpc PutFile(stream PutFileRequest) returns (google.protobuf.Empty) {}
// List all files
rpc ListFile(ListFileRequest) returns (ListFileResp){}
// Delete specific file
rpc DelFile(DelFileRequest) returns (google.protobuf.Empty){}
// Get file meta data, if file not exist,return code.NotFound error
rpc GetFileMeta(GetFileMetaRequest) returns (GetFileMetaResponse){}
// Invokes binding data to specific output bindings
rpc InvokeBinding(InvokeBindingRequest) returns (InvokeBindingResponse) {}
// Gets secrets from secret stores.
rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) {}
// Gets a bulk of secrets
rpc GetBulkSecret(GetBulkSecretRequest) returns (GetBulkSecretResponse) {}
}
// Get fileMeta request message
message GetFileMetaRequest{
// File meta request
FileRequest request = 1;
}
// Get fileMeta response message
message GetFileMetaResponse{
// The size of file
int64 size = 1;
// The modified time of file
string last_modified = 2;
// File meta response
FileMeta response = 3;
}
// FileMeta value
message FileMetaValue{
// File meta value
repeated string value = 1;
}
// A map that store FileMetaValue
message FileMeta{
// A data structure to store metadata
map<string,FileMetaValue> metadata = 1;
}
// Get file request message
message GetFileRequest {
// The name of store
string store_name = 1;
// The name of the file or object want to get.
string name = 2;
// The metadata for user extension.
map<string, string> metadata = 3;
}
// Get file response message
message GetFileResponse {
// The data of file
bytes data = 1;
}
// Put file request message
message PutFileRequest {
// The name of store
string store_name = 1;
// The name of the file or object want to put.
string name = 2;
// The data will be store.
bytes data = 3;
// The metadata for user extension.
map<string, string> metadata = 4;
}
// File request message
message FileRequest {
// The name of store
string store_name = 1;
// The name of the directory
string name = 2;
// The metadata for user extension.
map<string, string> metadata = 3;
}
// List file request message
message ListFileRequest {
// File request
FileRequest request = 1;
// Page size
int32 page_size = 2;
// Marker
string marker = 3;
}
// File info message
message FileInfo {
// The name of file
string file_name = 1;
// The size of file
int64 size = 2;
// The modified time of file
string last_modified = 3;
// The metadata for user extension.
map<string,string> metadata = 4;
}
// List file response message
message ListFileResp {
// File info
repeated FileInfo files = 1;
// Marker
string marker = 2;
// Is truncated
bool is_truncated = 3;
}
// Delete file request message
message DelFileRequest {
// File request
FileRequest request = 1;
}
// Get next id request message
message GetNextIdRequest {
// Required. Name of sequencer storage
string store_name = 1;
// Required. key is the identifier of a sequencer namespace,e.g. "order_table".
string key = 2;
// (optional) SequencerOptions configures requirements for auto-increment guarantee
SequencerOptions options = 3;
// (optional) The metadata which will be sent to the component.
map<string, string> metadata = 4;
}
// SequencerOptions configures requirements for auto-increment guarantee
message SequencerOptions {
// requirements for auto-increment guarantee
enum AutoIncrement {
// (default) WEAK means a "best effort" incrementing service.But there is no strict guarantee of global monotonically increasing.
//The next id is "probably" greater than current id.
WEAK = 0;
// STRONG means a strict guarantee of global monotonically increasing.
//The next id "must" be greater than current id.
STRONG = 1;
}
// Default STRONG auto-increment
AutoIncrement increment = 1;
// We removed Uniqueness enum to make it simple.
// Currently this API will give a "STRONG" guarantee:all the ID returned by this API will be globally unique under the specific key.
//
// enum Uniqueness{
// // WEAK means a "best effort" unqueness guarantee.
// // But it might duplicate in some corner cases.
// WEAK = 0;
// // STRONG means a strict guarantee of global uniqueness
// STRONG = 1;
// }
// Uniqueness uniqueness=2;
}
// Get next id response message
message GetNextIdResponse{
// The next unique id
// Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
int64 next_id = 1 [jstype = JS_STRING];
}
// Lock request message is distributed lock API which is not blocking method tring to get a lock with ttl
message TryLockRequest {
// Required. The lock store name,e.g. `redis`.
string store_name = 1;
// Required. resource_id is the lock key. e.g. `order_id_111`
// It stands for "which resource I want to protect"
string resource_id = 2;
// Required. lock_owner indicate the identifier of lock owner.
// You can generate a uuid as lock_owner.For example,in golang:
// req.LockOwner = uuid.New().String()
// This field is per request,not per process,so it is different for each request,
// which aims to prevent multi-thread in the same process trying the same lock concurrently.
// The reason why we don't make it automatically generated is:
// 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
// This name is so weird that we think it is inappropriate to put it into the api spec
// 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
// we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
// 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
// So this field in the request shouldn't be removed.
string lock_owner = 3;
// Required. expire is the time before expire.The time unit is second.
int32 expire = 4;
}
// Lock response message returns is the lock obtained.
message TryLockResponse {
// Is lock success
bool success = 1;
}
// UnLock request message
message UnlockRequest {
// The name of store
string store_name = 1;
// resource_id is the lock key.
string resource_id = 2;
// The owner of the lock
string lock_owner = 3;
}
// UnLock response message
message UnlockResponse {
// The enum of unlock status
enum Status {
// Unlock is success
SUCCESS = 0;
// The lock is not exist
LOCK_UNEXIST = 1;
// The lock is belong to others
LOCK_BELONG_TO_OTHERS = 2;
// Internal error
INTERNAL_ERROR = 3;
}
// The status of unlock
Status status = 1;
}
// LockKeepAlive request message
message LockKeepAliveRequest {
// Required. The lock store name,e.g. `redis`.
string store_name = 1;
// Required. resource_id is the lock key.
string resource_id = 2;
// Required. The owner of the lock.
string lock_owner = 3;
// Required. expire is the time before expire.The time unit is second.
int32 expire = 4;
}
// LockKeepAlive response message
message LockKeepAliveResponse {
// The enum of LockKeepAlive status
enum Status {
// Lease renewal success
SUCCESS = 0;
// The lock is not exist
LOCK_UNEXIST = 1;
// The lock is belong to others
LOCK_BELONG_TO_OTHERS = 2;
// Internal error
INTERNAL_ERROR = 3;
}
// The status of LockKeepAlive
Status status = 1;
}
// Hello request message
message SayHelloRequest {
// The name of service
string service_name = 1;
// Reuqest name
string name = 2;
// Optional. This field is used to control the packet size during load tests.
google.protobuf.Any data = 3;
}
// Hello response message
message SayHelloResponse {
// Hello
string hello = 1;
// Hello message of data
google.protobuf.Any data = 2;
}
// Invoke service request message
message InvokeServiceRequest {
// The identify of InvokeServiceRequest
string id = 1;
// InvokeServiceRequest message
CommonInvokeRequest message = 3;
}
// Common invoke request message which includes invoke method and data
message CommonInvokeRequest {
// The method of requset
string method = 1;
// The request data
google.protobuf.Any data = 2;
// The content type of request data
string content_type = 3;
// The extra information of http
HTTPExtension http_extension = 4;
}
// Http extension message is about invoke http information
message HTTPExtension {
// The enum of http reuest method
enum Verb {
// NONE
NONE = 0;
// GET method
GET = 1;
// HEAD method
HEAD = 2;
// POST method
POST = 3;
// PUT method
PUT = 4;
// DELETE method
DELETE = 5;
// CONNECT method
CONNECT = 6;
// CONNECT method
OPTIONS = 7;
// CONNECT method
TRACE = 8;
// PATCH method
PATCH = 9;
}
// The method of http reuest
Verb verb = 1;
// The query information of http
string querystring = 2;
}
// Invoke service response message is result of invoke service queset
message InvokeResponse {
// The response data
google.protobuf.Any data = 1;
// The content type of response data
string content_type = 2;
}
// ConfigurationItem represents a configuration item with key, content and other information.
message ConfigurationItem {
// Required. The key of configuration item
string key = 1;
// The content of configuration item
// Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
string content = 2;
// The group of configuration item.
string group = 3;
// The label of configuration item.
string label = 4;
// The tag list of configuration item.
map<string, string> tags = 5;
// The metadata which will be passed to configuration store component.
map<string, string> metadata = 6;
}
// GetConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
message GetConfigurationRequest {
// The name of configuration store.
string store_name = 1;
// The application id which
// Only used for admin, Ignored and reset for normal client
string app_id = 2;
// The group of keys.
string group = 3;
// The label for keys.
string label = 4;
// The keys to get.
repeated string keys = 5;
// The metadata which will be sent to configuration store components.
map<string, string> metadata = 6;
// Subscribes update event for given keys.
// If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
bool subscribe_update = 7;
}
// GetConfigurationResponse is the response conveying the list of configuration values.
message GetConfigurationResponse {
// The list of items containing configuration values.
repeated ConfigurationItem items = 1;
}
// SubscribeConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
message SubscribeConfigurationRequest {
// The name of configuration store.
string store_name = 1;
// The application id which
// Only used for admin, ignored and reset for normal client
string app_id = 2;
// The group of keys.
string group = 3;
// The label for keys.
string label = 4;
// The keys to get.
repeated string keys = 5;
// The metadata which will be sent to configuration store components.
map<string, string> metadata = 6;
}
// SubscribeConfigurationResponse is the response conveying the list of configuration values.
message SubscribeConfigurationResponse {
// The name of configuration store.
string store_name = 1;
// The application id.
// Only used for admin client.
string app_id = 2;
// The list of items containing configuration values.
repeated ConfigurationItem items = 3;
}
// SaveConfigurationRequest is the message to save a list of key-value configuration into specified configuration store.
message SaveConfigurationRequest {
// The name of configuration store.
string store_name = 1;
// The application id which
// Only used for admin, ignored and reset for normal client
string app_id = 2;
// The list of configuration items to save.
// To delete a exist item, set the key (also label) and let content to be empty
repeated ConfigurationItem items = 3;
// The metadata which will be sent to configuration store components.
map<string, string> metadata = 4;
}
// DeleteConfigurationRequest is the message to delete a list of key-value configuration from specified configuration store.
message DeleteConfigurationRequest {
// The name of configuration store.
string store_name = 1;
// The application id which
// Only used for admin, Ignored and reset for normal client
string app_id = 2;
// The group of keys.
string group = 3;
// The label for keys.
string label = 4;
// The keys to get.
repeated string keys = 5;
// The metadata which will be sent to configuration store components.
map<string, string> metadata = 6;
}
// GetStateRequest is the message to get key-value states from specific state store.
message GetStateRequest {
// Required. The name of state store.
string store_name = 1;
// Required. The key of the desired state
string key = 2;
// (optional) read consistency mode
StateOptions.StateConsistency consistency = 3;
// (optional) The metadata which will be sent to state store components.
map<string, string> metadata = 4;
}
// GetBulkStateRequest is the message to get a list of key-value states from specific state store.
message GetBulkStateRequest {
// Required. The name of state store.
string store_name = 1;
// Required. The keys to get.
repeated string keys = 2;
// (optional) The number of parallel operations executed on the state store for a get operation.
int32 parallelism = 3;
// (optional) The metadata which will be sent to state store components.
map<string, string> metadata = 4;
}
// GetBulkStateResponse is the response conveying the list of state values.
message GetBulkStateResponse {
// The list of items containing the keys to get values for.
repeated BulkStateItem items = 1;
}
// BulkStateItem is the response item for a bulk get operation.
// Return values include the item key, data and etag.
message BulkStateItem {
// state item key
string key = 1;
// The byte array data
bytes data = 2;
// The entity tag which represents the specific version of data.
// ETag format is defined by the corresponding data store.
string etag = 3;
// The error that was returned from the state store in case of a failed get operation.
string error = 4;
// The metadata which will be sent to app.
map<string, string> metadata = 5;
}
// GetStateResponse is the response conveying the state value and etag.
message GetStateResponse {
// The byte array data
bytes data = 1;
// The entity tag which represents the specific version of data.
// ETag format is defined by the corresponding data store.
string etag = 2;
// The metadata which will be sent to app.
map<string, string> metadata = 3;
}
// DeleteStateRequest is the message to delete key-value states in the specific state store.
message DeleteStateRequest {
// Required. The name of state store.
string store_name = 1;
// Required. The key of the desired state
string key = 2;
// (optional) The entity tag which represents the specific version of data.
// The exact ETag format is defined by the corresponding data store.
Etag etag = 3;
// (optional) State operation options which includes concurrency/
// consistency/retry_policy.
StateOptions options = 4;
// (optional) The metadata which will be sent to state store components.
map<string, string> metadata = 5;
}
// DeleteBulkStateRequest is the message to delete a list of key-value states from specific state store.
message DeleteBulkStateRequest {
// Required. The name of state store.
string store_name = 1;
// Required. The array of the state key values.
repeated StateItem states = 2;
}
// SaveStateRequest is the message to save multiple states into state store.
message SaveStateRequest {
// Required. The name of state store.
string store_name = 1;
// Required. The array of the state key values.
repeated StateItem states = 2;
}
// StateItem represents state key, value, and additional options to save state.
message StateItem {
// Required. The state key
string key = 1;
// Required. The state data for key
bytes value = 2;
// (optional) The entity tag which represents the specific version of data.
// The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
Etag etag = 3;
// (optional) additional key-value pairs to be passed to the state store.
map<string, string> metadata = 4;
// (optional) Options for concurrency and consistency to save the state.
StateOptions options = 5;
}
// Etag represents a state item version
message Etag {
// value sets the etag value
string value = 1;
}
// StateOptions configures concurrency and consistency for state operations
message StateOptions {
// Enum describing the supported concurrency for state.
// The API server uses Optimized Concurrency Control (OCC) with ETags.
// When an ETag is associated with an save or delete request, the store shall allow the update only if the attached ETag matches with the latest ETag in the database.
// But when ETag is missing in the write requests, the state store shall handle the requests in the specified strategy(e.g. a last-write-wins fashion).
enum StateConcurrency {
// Concurrency state is unspecified
CONCURRENCY_UNSPECIFIED = 0;
// First write wins
CONCURRENCY_FIRST_WRITE = 1;
// Last write wins
CONCURRENCY_LAST_WRITE = 2;
}
// Enum describing the supported consistency for state.
enum StateConsistency {
// Consistency state is unspecified
CONSISTENCY_UNSPECIFIED = 0;
// The API server assumes data stores are eventually consistent by default.A state store should:
// - For read requests, the state store can return data from any of the replicas
// - For write request, the state store should asynchronously replicate updates to configured quorum after acknowledging the update request.
CONSISTENCY_EVENTUAL = 1;
// When a strong consistency hint is attached, a state store should:
// - For read requests, the state store should return the most up-to-date data consistently across replicas.
// - For write/delete requests, the state store should synchronisely replicate updated data to configured quorum before completing the write request.
CONSISTENCY_STRONG = 2;
}
// The state operation of concurrency
StateConcurrency concurrency = 1;
// The state operation of consistency
StateConsistency consistency = 2;
}
// TransactionalStateOperation is the message to execute a specified operation with a key-value pair.
message TransactionalStateOperation {
// Required. The type of operation to be executed.
// Legal values include:
// "upsert" represents an update or create operation
// "delete" represents a delete operation
string operationType = 1;
// Required. State values to be operated on
StateItem request = 2;
}
// ExecuteStateTransactionRequest is the message to execute multiple operations on a specified store.
message ExecuteStateTransactionRequest {
// Required. name of state store.
string storeName = 1;
// Required. transactional operation list.
repeated TransactionalStateOperation operations = 2;
// (optional) The metadata used for transactional operations.
map<string, string> metadata = 3;
}
// PublishEventRequest is the message to publish event data to pubsub topic
message PublishEventRequest {
// The name of the pubsub component
string pubsub_name = 1;
// The pubsub topic
string topic = 2;
// The data which will be published to topic.
bytes data = 3;
// The content type for the data (optional).
string data_content_type = 4;
// The metadata passing to pub components
//
// metadata property:
// - key : the key of the message.
map<string, string> metadata = 5;
}
// SubscribeTopicEventsRequest is a message containing the details for
// subscribing to a topic via streaming.
// The first message must always be the initial request. All subsequent
// messages must be event processed responses.
message SubscribeTopicEventsRequest {
// The unique identifier for the subscription request.
oneof subscribe_topic_events_request_type {
// The initial message containing the details for subscribing to a topic.
SubscribeTopicEventsRequestInitial initial_request = 1;
// The message containing the subscription to a topic.
SubscribeTopicEventsRequestProcessed event_processed = 2;
}
}
// SubscribeTopicEventsRequestInitial is the initial message containing
// the details for subscribing to a topic via streaming.
message SubscribeTopicEventsRequestInitial {
// The name of the pubsub component
string pubsub_name = 1;
// The pubsub topic
string topic = 2;
// The metadata passing to pub components
//
// metadata property:
// - key : the key of the message.
map<string, string> metadata = 3;
// dead_letter_topic is the topic to which messages that fail to be processed
// are sent.
optional string dead_letter_topic = 4;
}
// SubscribeTopicEventsRequestProcessed is the message containing the
// subscription to a topic.
message SubscribeTopicEventsRequestProcessed {
// id is the unique identifier for the subscription request.
string id = 1;
// status is the result of the subscription request.
TopicEventResponse status = 2;
}
// SubscribeTopicEventsResponse is a message returned from layotto
// when subscribing to a topic via streaming.
message SubscribeTopicEventsResponse {
// The unique identifier for the subscription request.
oneof subscribe_topic_events_response_type {
// The initial response from layotto when subscribing to a topic.
SubscribeTopicEventsResponseInitial initial_response = 1;
// The event message from the topic.
TopicEventRequest event_message = 2;
}
}
// SubscribeTopicEventsResponseInitialAlpha1 is the initial response from layotto
// when subscribing to a topic.
message SubscribeTopicEventsResponseInitial {}
// InvokeBindingRequest is the message to send data to output bindings
message InvokeBindingRequest {
// The name of the output binding to invoke.
string name = 1;
// The data which will be sent to output binding.
bytes data = 2;
// The metadata passing to output binding components
// Common metadata property:
// - ttlInSeconds : the time to live in seconds for the message.
// If set in the binding definition will cause all messages to
// have a default time to live. The message ttl overrides any value
// in the binding definition.
map<string, string> metadata = 3;
// The name of the operation type for the binding to invoke
string operation = 4;
}
// InvokeBindingResponse is the message returned from an output binding invocation
message InvokeBindingResponse {
// The data which will be sent to output binding.
bytes data = 1;
// The metadata returned from an external system
map<string, string> metadata = 2;
}
// GetSecretRequest is the message to get secret from secret store.
message GetSecretRequest {
// The name of secret store.
string store_name = 1;
// The name of secret key.
string key = 2;
// The metadata which will be sent to secret store components.
// Contains version, status, and so on...
map<string,string> metadata = 3;
}
// GetSecretResponse is the response message to convey the requested secret.
message GetSecretResponse {
// data is the secret value. Some secret store, such as kubernetes secret
// store, can save multiple secrets for single secret key.
map<string, string> data = 1;
}
// GetBulkSecretRequest is the message to get the secrets from secret store.
message GetBulkSecretRequest {
// The name of secret store.
string store_name = 1;
// The metadata which will be sent to secret store components.
map<string,string> metadata = 2;
}
// GetBulkSecretResponse is the response message to convey the requested secrets.
message GetBulkSecretResponse {
// data hold the secret values. Some secret store, such as kubernetes secret
// store, can save multiple secrets for single secret key.
map<string, SecretResponse> data = 1;
}
// SecretResponse is a map of decrypted string/string values
message SecretResponse {
// The data struct of secrets
map<string, string> secrets = 1;
}