dapr-client 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +10 -6
- data/bin/regen_client.sh +6 -0
- data/dapr/proto/common/v1/common.proto +13 -28
- data/dapr/proto/runtime/v1/appcallback.proto +29 -7
- data/dapr/proto/runtime/v1/dapr.proto +256 -5
- data/example.rb +9 -9
- data/examples/app-callback/README.md +9 -4
- data/examples/app-callback/app_callback_service.rb +6 -4
- data/examples/invoke-simple/README.md +2 -2
- data/examples/invoke-simple/invoke-receiver.rb +1 -0
- data/examples/pubsub-simple/README.md +2 -2
- data/examples/pubsub-simple/publisher.rb +6 -2
- data/examples/pubsub-simple/subscriber.rb +7 -3
- data/examples/state-store/README.md +1 -1
- data/lib/dapr/proto/common/v1/common_pb.rb +6 -16
- data/lib/dapr/proto/runtime/v1/appcallback_pb.rb +14 -2
- data/lib/dapr/proto/runtime/v1/appcallback_services_pb.rb +2 -2
- data/lib/dapr/proto/runtime/v1/dapr_pb.rb +145 -3
- data/lib/dapr/proto/runtime/v1/dapr_services_pb.rb +29 -4
- data/lib/dapr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7513c69fe9529ced9c6a0d4aa98ef4ccd34e9bea66da811d0fca7a4d2c56538c
|
4
|
+
data.tar.gz: ccaab0c3d0b5d2ae34a4f81ad1004f849b7177082e2637426763a059120a9461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e1af0ad18be5cfd140f76eeb75fa13043e79b1685fa4c4e9681ab2015717fd39558e6b8ad30009e731b1606f47edead29a1142fbf5a91b4c5eb2c90f84290c
|
7
|
+
data.tar.gz: 6956a7e04d8ac0a820037791e479b386d5c6ecaffa8fd84c2690c17a8e83039cbf3a703e37d755ec3ba065080904df500f8c6750643ac2c0234f80f650d20fc7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
# Dapr SDK for Ruby
|
2
2
|
|
3
|
-
This is
|
3
|
+
This is a Dapr SDK for Ruby, based on the auto-generated proto client.<br>
|
4
4
|
|
5
|
-
For more
|
5
|
+
For more infomation on Dapr and gRPC see the [getting started guides](https://docs.dapr.io/getting-started/).
|
6
6
|
|
7
7
|
The repository generates the following package
|
8
8
|
- dapr-client
|
9
9
|
|
10
|
+
## Supported Versions
|
11
|
+
|
12
|
+
The auto-generated proto client and the examples is this repo are based on Dapr v1.0.0.
|
13
|
+
|
10
14
|
## Installation
|
11
15
|
|
12
16
|
Add this line to your application's Gemfile:
|
@@ -28,19 +32,19 @@ Or install it yourself as:
|
|
28
32
|
A client can be created as follows:
|
29
33
|
|
30
34
|
```ruby
|
31
|
-
require "dapr_services_pb"
|
35
|
+
require "dapr/proto/runtime/v1/dapr_services_pb"
|
32
36
|
|
33
|
-
client = Dapr::Dapr::Stub.new(
|
37
|
+
client = Dapr::Proto::Runtime::V1::Dapr::Stub.new("localhost:#{ENV['DAPR_GRPC_PORT']}", :this_channel_is_insecure)
|
34
38
|
```
|
35
39
|
|
36
40
|
You can find a complete example [here](https://github.com/tjwp/dapr-ruby-sdk/blob/master/example.rb)
|
37
41
|
|
38
|
-
### Running the code locally
|
42
|
+
### Running the example code locally
|
39
43
|
|
40
44
|
You can execute this code using the local dapr runtime:
|
41
45
|
|
42
46
|
```sh
|
43
|
-
dapr run --
|
47
|
+
dapr run --app-id ruby-example -- bundle exec ruby example.rb
|
44
48
|
```
|
45
49
|
|
46
50
|
## Development
|
data/bin/regen_client.sh
CHANGED
@@ -11,5 +11,11 @@ bundle exec grpc_tools_ruby_protoc -I . --ruby_out=lib --grpc_out=lib dapr/proto
|
|
11
11
|
bundle exec grpc_tools_ruby_protoc -I . --ruby_out=lib --grpc_out=lib dapr/proto/runtime/v1/dapr.proto
|
12
12
|
bundle exec grpc_tools_ruby_protoc -I . --ruby_out=lib --grpc_out=lib dapr/proto/runtime/v1/appcallback.proto
|
13
13
|
|
14
|
+
# Prefix top-level Dapr constant in dapr_services_pb
|
15
|
+
dapr_services="lib/dapr/proto/runtime/v1/dapr_services_pb.rb"
|
16
|
+
mv $dapr_services ${dapr_services}.tmp
|
17
|
+
cat ${dapr_services}.tmp | sed -e "s/ Dapr::Proto/ ::Dapr::Proto/" > $dapr_services
|
18
|
+
rm ${dapr_services}.tmp
|
19
|
+
|
14
20
|
set +x
|
15
21
|
echo "Done."
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// ------------------------------------------------------------
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Copyright (c) Microsoft Corporation and Dapr Contributors.
|
3
3
|
// Licensed under the MIT License.
|
4
4
|
// ------------------------------------------------------------
|
5
5
|
|
@@ -8,7 +8,6 @@ syntax = "proto3";
|
|
8
8
|
package dapr.proto.common.v1;
|
9
9
|
|
10
10
|
import "google/protobuf/any.proto";
|
11
|
-
import "google/protobuf/duration.proto";
|
12
11
|
|
13
12
|
option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1";
|
14
13
|
option java_outer_classname = "CommonProtos";
|
@@ -40,8 +39,8 @@ message HTTPExtension {
|
|
40
39
|
// Required. HTTP verb.
|
41
40
|
Verb verb = 1;
|
42
41
|
|
43
|
-
// querystring
|
44
|
-
|
42
|
+
// Optional. querystring represents an encoded HTTP url query string in the following format: name=value&name2=value2
|
43
|
+
string querystring = 2;
|
45
44
|
}
|
46
45
|
|
47
46
|
// InvokeRequest is the message to invoke a method with the data.
|
@@ -90,16 +89,22 @@ message StateItem {
|
|
90
89
|
|
91
90
|
// The entity tag which represents the specific version of data.
|
92
91
|
// The exact ETag format is defined by the corresponding data store.
|
93
|
-
|
92
|
+
Etag etag = 3;
|
94
93
|
|
95
94
|
// The metadata which will be passed to state store component.
|
96
95
|
map<string,string> metadata = 4;
|
97
96
|
|
98
|
-
// Options for concurrency
|
97
|
+
// Options for concurrency and consistency to save the state.
|
99
98
|
StateOptions options = 5;
|
100
99
|
}
|
101
100
|
|
102
|
-
//
|
101
|
+
// Etag represents a state item version
|
102
|
+
message Etag {
|
103
|
+
// value sets the etag value
|
104
|
+
string value = 1;
|
105
|
+
}
|
106
|
+
|
107
|
+
// StateOptions configures concurrency and consistency for state operations
|
103
108
|
message StateOptions {
|
104
109
|
// Enum describing the supported concurrency for state.
|
105
110
|
enum StateConcurrency {
|
@@ -117,24 +122,4 @@ message StateOptions {
|
|
117
122
|
|
118
123
|
StateConcurrency concurrency = 1;
|
119
124
|
StateConsistency consistency = 2;
|
120
|
-
|
121
|
-
}
|
122
|
-
|
123
|
-
// StateRetryPolicy represents retry policy to set and delete state operations.
|
124
|
-
message StateRetryPolicy {
|
125
|
-
// Enum describing the support retry pattern
|
126
|
-
enum RetryPattern {
|
127
|
-
RETRY_UNSPECIFIED = 0;
|
128
|
-
RETRY_LINEAR = 1;
|
129
|
-
RETRY_EXPONENTIAL = 2;
|
130
|
-
}
|
131
|
-
|
132
|
-
// Maximum number of retries.
|
133
|
-
int32 threshold = 1;
|
134
|
-
|
135
|
-
// Retry pattern.
|
136
|
-
RetryPattern pattern = 2;
|
137
|
-
|
138
|
-
// Initial delay between retries.
|
139
|
-
google.protobuf.Duration interval = 3;
|
140
|
-
}
|
125
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// ------------------------------------------------------------
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Copyright (c) Microsoft Corporation and Dapr Contributors.
|
3
3
|
// Licensed under the MIT License.
|
4
4
|
// ------------------------------------------------------------
|
5
5
|
|
@@ -26,7 +26,7 @@ service AppCallback {
|
|
26
26
|
rpc ListTopicSubscriptions(google.protobuf.Empty) returns (ListTopicSubscriptionsResponse) {}
|
27
27
|
|
28
28
|
// Subscribes events from Pubsub
|
29
|
-
rpc OnTopicEvent(TopicEventRequest) returns (
|
29
|
+
rpc OnTopicEvent(TopicEventRequest) returns (TopicEventResponse) {}
|
30
30
|
|
31
31
|
// Lists all input bindings subscribed by this app.
|
32
32
|
rpc ListInputBindings(google.protobuf.Empty) returns (ListInputBindingsResponse) {}
|
@@ -38,7 +38,7 @@ service AppCallback {
|
|
38
38
|
rpc OnBindingEvent(BindingEventRequest) returns (BindingEventResponse) {}
|
39
39
|
}
|
40
40
|
|
41
|
-
// TopicEventRequest message is
|
41
|
+
// TopicEventRequest message is compatible with CloudEvent spec v1.0
|
42
42
|
// https://github.com/cloudevents/spec/blob/v1.0/spec.md
|
43
43
|
message TopicEventRequest {
|
44
44
|
// id identifies the event. Producers MUST ensure that source + id
|
@@ -67,11 +67,30 @@ message TopicEventRequest {
|
|
67
67
|
|
68
68
|
// The pubsub topic which publisher sent to.
|
69
69
|
string topic = 6;
|
70
|
+
|
71
|
+
// The name of the pubsub the publisher sent to.
|
72
|
+
string pubsub_name = 8;
|
73
|
+
}
|
74
|
+
|
75
|
+
// TopicEventResponse is response from app on published message
|
76
|
+
message TopicEventResponse {
|
77
|
+
// TopicEventResponseStatus allows apps to have finer control over handling of the message.
|
78
|
+
enum TopicEventResponseStatus {
|
79
|
+
// SUCCESS is the default behavior: message is acknowledged and not retried or logged.
|
80
|
+
SUCCESS = 0;
|
81
|
+
// RETRY status signals Dapr to retry the message as part of an expected scenario (no warning is logged).
|
82
|
+
RETRY = 1;
|
83
|
+
// DROP status signals Dapr to drop the message as part of an unexpected scenario (warning is logged).
|
84
|
+
DROP = 2;
|
85
|
+
}
|
86
|
+
|
87
|
+
// The list of output bindings.
|
88
|
+
TopicEventResponseStatus status = 1;
|
70
89
|
}
|
71
90
|
|
72
91
|
// BindingEventRequest represents input bindings event.
|
73
92
|
message BindingEventRequest {
|
74
|
-
//
|
93
|
+
// Required. The name of the input binding component.
|
75
94
|
string name = 1;
|
76
95
|
|
77
96
|
// Required. The payload that the input bindings sent
|
@@ -117,11 +136,14 @@ message ListTopicSubscriptionsResponse {
|
|
117
136
|
|
118
137
|
// TopicSubscription represents topic and metadata.
|
119
138
|
message TopicSubscription {
|
139
|
+
// Required. The name of the pubsub containing the topic below to subscribe to.
|
140
|
+
string pubsub_name = 1;
|
141
|
+
|
120
142
|
// Required. The name of topic which will be subscribed
|
121
|
-
string topic =
|
143
|
+
string topic = 2;
|
122
144
|
|
123
|
-
// The optional properties used for this topic's
|
124
|
-
map<string,string> metadata =
|
145
|
+
// The optional properties used for this topic's subscription e.g. session id
|
146
|
+
map<string,string> metadata = 3;
|
125
147
|
}
|
126
148
|
|
127
149
|
// ListInputBindingsResponse is the message including the list of input bindings.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// ------------------------------------------------------------
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Copyright (c) Microsoft Corporation and Dapr Contributors.
|
3
3
|
// Licensed under the MIT License.
|
4
4
|
// ------------------------------------------------------------
|
5
5
|
|
@@ -7,6 +7,7 @@ syntax = "proto3";
|
|
7
7
|
|
8
8
|
package dapr.proto.runtime.v1;
|
9
9
|
|
10
|
+
import "google/protobuf/any.proto";
|
10
11
|
import "google/protobuf/empty.proto";
|
11
12
|
import "dapr/proto/common/v1/common.proto";
|
12
13
|
|
@@ -23,12 +24,21 @@ service Dapr {
|
|
23
24
|
// Gets the state for a specific key.
|
24
25
|
rpc GetState(GetStateRequest) returns (GetStateResponse) {}
|
25
26
|
|
27
|
+
// Gets a bulk of state items for a list of keys
|
28
|
+
rpc GetBulkState(GetBulkStateRequest) returns (GetBulkStateResponse) {}
|
29
|
+
|
26
30
|
// Saves the state for a specific key.
|
27
31
|
rpc SaveState(SaveStateRequest) returns (google.protobuf.Empty) {}
|
28
32
|
|
29
33
|
// Deletes the state for a specific key.
|
30
34
|
rpc DeleteState(DeleteStateRequest) returns (google.protobuf.Empty) {}
|
31
35
|
|
36
|
+
// Deletes a bulk of state items for a list of keys
|
37
|
+
rpc DeleteBulkState(DeleteBulkStateRequest) returns (google.protobuf.Empty) {}
|
38
|
+
|
39
|
+
// Executes transactions for a specified store
|
40
|
+
rpc ExecuteStateTransaction(ExecuteStateTransactionRequest) returns (google.protobuf.Empty) {}
|
41
|
+
|
32
42
|
// Publishes events to the specific topic.
|
33
43
|
rpc PublishEvent(PublishEventRequest) returns (google.protobuf.Empty) {}
|
34
44
|
|
@@ -37,6 +47,36 @@ service Dapr {
|
|
37
47
|
|
38
48
|
// Gets secrets from secret stores.
|
39
49
|
rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) {}
|
50
|
+
|
51
|
+
// Gets a bulk of secrets
|
52
|
+
rpc GetBulkSecret(GetBulkSecretRequest) returns (GetBulkSecretResponse) {}
|
53
|
+
|
54
|
+
// Register an actor timer.
|
55
|
+
rpc RegisterActorTimer(RegisterActorTimerRequest) returns (google.protobuf.Empty) {}
|
56
|
+
|
57
|
+
// Unregister an actor timer.
|
58
|
+
rpc UnregisterActorTimer(UnregisterActorTimerRequest) returns (google.protobuf.Empty) {}
|
59
|
+
|
60
|
+
// Register an actor reminder.
|
61
|
+
rpc RegisterActorReminder(RegisterActorReminderRequest) returns (google.protobuf.Empty) {}
|
62
|
+
|
63
|
+
// Unregister an actor reminder.
|
64
|
+
rpc UnregisterActorReminder(UnregisterActorReminderRequest) returns (google.protobuf.Empty) {}
|
65
|
+
|
66
|
+
// Gets the state for a specific actor.
|
67
|
+
rpc GetActorState(GetActorStateRequest) returns (GetActorStateResponse) {}
|
68
|
+
|
69
|
+
// Executes state transactions for a specified actor
|
70
|
+
rpc ExecuteActorStateTransaction(ExecuteActorStateTransactionRequest) returns (google.protobuf.Empty) {}
|
71
|
+
|
72
|
+
// InvokeActor calls a method on an actor.
|
73
|
+
rpc InvokeActor (InvokeActorRequest) returns (InvokeActorResponse) {}
|
74
|
+
|
75
|
+
// Gets metadata of the sidecar
|
76
|
+
rpc GetMetadata (google.protobuf.Empty) returns (GetMetadataResponse) {}
|
77
|
+
|
78
|
+
// Sets value in extended metadata of the sidecar
|
79
|
+
rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {}
|
40
80
|
}
|
41
81
|
|
42
82
|
// InvokeServiceRequest represents the request message for Service invocation.
|
@@ -58,6 +98,50 @@ message GetStateRequest {
|
|
58
98
|
|
59
99
|
// The read consistency of the state store.
|
60
100
|
common.v1.StateOptions.StateConsistency consistency = 3;
|
101
|
+
|
102
|
+
// The metadata which will be sent to state store components.
|
103
|
+
map<string,string> metadata = 4;
|
104
|
+
}
|
105
|
+
|
106
|
+
// GetBulkStateRequest is the message to get a list of key-value states from specific state store.
|
107
|
+
message GetBulkStateRequest {
|
108
|
+
// The name of state store.
|
109
|
+
string store_name = 1;
|
110
|
+
|
111
|
+
// The keys to get.
|
112
|
+
repeated string keys = 2;
|
113
|
+
|
114
|
+
// The number of parallel operations executed on the state store for a get operation.
|
115
|
+
int32 parallelism = 3;
|
116
|
+
|
117
|
+
// The metadata which will be sent to state store components.
|
118
|
+
map<string,string> metadata = 4;
|
119
|
+
}
|
120
|
+
|
121
|
+
// GetBulkStateResponse is the response conveying the list of state values.
|
122
|
+
message GetBulkStateResponse {
|
123
|
+
// The list of items containing the keys to get values for.
|
124
|
+
repeated BulkStateItem items = 1;
|
125
|
+
}
|
126
|
+
|
127
|
+
// BulkStateItem is the response item for a bulk get operation.
|
128
|
+
// Return values include the item key, data and etag.
|
129
|
+
message BulkStateItem {
|
130
|
+
// state item key
|
131
|
+
string key = 1;
|
132
|
+
|
133
|
+
// The byte array data
|
134
|
+
bytes data = 2;
|
135
|
+
|
136
|
+
// The entity tag which represents the specific version of data.
|
137
|
+
// ETag format is defined by the corresponding data store.
|
138
|
+
string etag = 3;
|
139
|
+
|
140
|
+
// The error that was returned from the state store in case of a failed get operation.
|
141
|
+
string error = 4;
|
142
|
+
|
143
|
+
// The metadata which will be sent to app.
|
144
|
+
map<string,string> metadata = 5;
|
61
145
|
}
|
62
146
|
|
63
147
|
// GetStateResponse is the response conveying the state value and etag.
|
@@ -68,6 +152,9 @@ message GetStateResponse {
|
|
68
152
|
// The entity tag which represents the specific version of data.
|
69
153
|
// ETag format is defined by the corresponding data store.
|
70
154
|
string etag = 2;
|
155
|
+
|
156
|
+
// The metadata which will be sent to app.
|
157
|
+
map<string,string> metadata = 3;
|
71
158
|
}
|
72
159
|
|
73
160
|
// DeleteStateRequest is the message to delete key-value states in the specific state store.
|
@@ -80,11 +167,23 @@ message DeleteStateRequest {
|
|
80
167
|
|
81
168
|
// The entity tag which represents the specific version of data.
|
82
169
|
// The exact ETag format is defined by the corresponding data store.
|
83
|
-
|
170
|
+
common.v1.Etag etag = 3;
|
84
171
|
|
85
172
|
// State operation options which includes concurrency/
|
86
173
|
// consistency/retry_policy.
|
87
174
|
common.v1.StateOptions options = 4;
|
175
|
+
|
176
|
+
// The metadata which will be sent to state store components.
|
177
|
+
map<string,string> metadata = 5;
|
178
|
+
}
|
179
|
+
|
180
|
+
// DeleteBulkStateRequest is the message to delete a list of key-value states from specific state store.
|
181
|
+
message DeleteBulkStateRequest {
|
182
|
+
// The name of state store.
|
183
|
+
string store_name = 1;
|
184
|
+
|
185
|
+
// The array of the state key values.
|
186
|
+
repeated common.v1.StateItem states = 2;
|
88
187
|
}
|
89
188
|
|
90
189
|
// SaveStateRequest is the message to save multiple states into state store.
|
@@ -98,11 +197,23 @@ message SaveStateRequest {
|
|
98
197
|
|
99
198
|
// PublishEventRequest is the message to publish event data to pubsub topic
|
100
199
|
message PublishEventRequest {
|
200
|
+
// The name of the pubsub component
|
201
|
+
string pubsub_name = 1;
|
202
|
+
|
101
203
|
// The pubsub topic
|
102
|
-
string topic =
|
204
|
+
string topic = 2;
|
103
205
|
|
104
206
|
// The data which will be published to topic.
|
105
|
-
bytes data =
|
207
|
+
bytes data = 3;
|
208
|
+
|
209
|
+
// The content type for the data (optional).
|
210
|
+
string data_content_type = 4;
|
211
|
+
|
212
|
+
// The metadata passing to pub components
|
213
|
+
//
|
214
|
+
// metadata property:
|
215
|
+
// - key : the key of the message.
|
216
|
+
map<string,string> metadata = 5;
|
106
217
|
}
|
107
218
|
|
108
219
|
// InvokeBindingRequest is the message to send data to output bindings
|
@@ -147,9 +258,149 @@ message GetSecretRequest {
|
|
147
258
|
map<string,string> metadata = 3;
|
148
259
|
}
|
149
260
|
|
150
|
-
// GetSecretResponse is the response
|
261
|
+
// GetSecretResponse is the response message to convey the requested secret.
|
151
262
|
message GetSecretResponse {
|
152
263
|
// data is the secret value. Some secret store, such as kubernetes secret
|
153
264
|
// store, can save multiple secrets for single secret key.
|
154
265
|
map<string, string> data = 1;
|
155
266
|
}
|
267
|
+
|
268
|
+
// GetBulkSecretRequest is the message to get the secrets from secret store.
|
269
|
+
message GetBulkSecretRequest {
|
270
|
+
// The name of secret store.
|
271
|
+
string store_name = 1;
|
272
|
+
|
273
|
+
// The metadata which will be sent to secret store components.
|
274
|
+
map<string,string> metadata = 2;
|
275
|
+
}
|
276
|
+
|
277
|
+
// SecretResponse is a map of decrypted string/string values
|
278
|
+
message SecretResponse {
|
279
|
+
map<string, string> secrets = 1;
|
280
|
+
}
|
281
|
+
|
282
|
+
// GetBulkSecretResponse is the response message to convey the requested secrets.
|
283
|
+
message GetBulkSecretResponse {
|
284
|
+
// data hold the secret values. Some secret store, such as kubernetes secret
|
285
|
+
// store, can save multiple secrets for single secret key.
|
286
|
+
map<string, SecretResponse> data = 1;
|
287
|
+
}
|
288
|
+
|
289
|
+
// TransactionalStateOperation is the message to execute a specified operation with a key-value pair.
|
290
|
+
message TransactionalStateOperation {
|
291
|
+
// The type of operation to be executed
|
292
|
+
string operationType = 1;
|
293
|
+
|
294
|
+
// State values to be operated on
|
295
|
+
common.v1.StateItem request = 2;
|
296
|
+
}
|
297
|
+
|
298
|
+
// ExecuteStateTransactionRequest is the message to execute multiple operations on a specified store.
|
299
|
+
message ExecuteStateTransactionRequest {
|
300
|
+
// Required. name of state store.
|
301
|
+
string storeName = 1;
|
302
|
+
|
303
|
+
// Required. transactional operation list.
|
304
|
+
repeated TransactionalStateOperation operations = 2;
|
305
|
+
|
306
|
+
// The metadata used for transactional operations.
|
307
|
+
map<string,string> metadata = 3;
|
308
|
+
}
|
309
|
+
|
310
|
+
// RegisterActorTimerRequest is the message to register a timer for an actor of a given type and id.
|
311
|
+
message RegisterActorTimerRequest {
|
312
|
+
string actor_type = 1;
|
313
|
+
string actor_id = 2;
|
314
|
+
string name = 3;
|
315
|
+
string due_time = 4;
|
316
|
+
string period = 5;
|
317
|
+
string callback = 6;
|
318
|
+
bytes data = 7;
|
319
|
+
}
|
320
|
+
|
321
|
+
// UnregisterActorTimerRequest is the message to unregister an actor timer
|
322
|
+
message UnregisterActorTimerRequest {
|
323
|
+
string actor_type = 1;
|
324
|
+
string actor_id = 2;
|
325
|
+
string name = 3;
|
326
|
+
}
|
327
|
+
|
328
|
+
// RegisterActorReminderRequest is the message to register a reminder for an actor of a given type and id.
|
329
|
+
message RegisterActorReminderRequest {
|
330
|
+
string actor_type = 1;
|
331
|
+
string actor_id = 2;
|
332
|
+
string name = 3;
|
333
|
+
string due_time = 4;
|
334
|
+
string period = 5;
|
335
|
+
bytes data = 6;
|
336
|
+
}
|
337
|
+
|
338
|
+
// UnregisterActorReminderRequest is the message to unregister an actor reminder.
|
339
|
+
message UnregisterActorReminderRequest {
|
340
|
+
string actor_type = 1;
|
341
|
+
string actor_id = 2;
|
342
|
+
string name = 3;
|
343
|
+
}
|
344
|
+
|
345
|
+
// GetActorStateRequest is the message to get key-value states from specific actor.
|
346
|
+
message GetActorStateRequest {
|
347
|
+
string actor_type = 1;
|
348
|
+
string actor_id = 2;
|
349
|
+
string key = 3;
|
350
|
+
}
|
351
|
+
|
352
|
+
// GetActorStateResponse is the response conveying the actor's state value.
|
353
|
+
message GetActorStateResponse {
|
354
|
+
bytes data = 1;
|
355
|
+
}
|
356
|
+
|
357
|
+
// ExecuteActorStateTransactionRequest is the message to execute multiple operations on a specified actor.
|
358
|
+
message ExecuteActorStateTransactionRequest {
|
359
|
+
string actor_type = 1;
|
360
|
+
string actor_id = 2;
|
361
|
+
repeated TransactionalActorStateOperation operations = 3;
|
362
|
+
}
|
363
|
+
|
364
|
+
// TransactionalAcorStateOperation is the message to execute a specified operation with a key-value pair.
|
365
|
+
message TransactionalActorStateOperation {
|
366
|
+
string operationType = 1;
|
367
|
+
string key = 2;
|
368
|
+
google.protobuf.Any value = 3;
|
369
|
+
}
|
370
|
+
|
371
|
+
// InvokeActorRequest is the message to call an actor.
|
372
|
+
message InvokeActorRequest {
|
373
|
+
string actor_type = 1;
|
374
|
+
string actor_id = 2;
|
375
|
+
string method = 3;
|
376
|
+
bytes data = 4;
|
377
|
+
}
|
378
|
+
|
379
|
+
// InvokeActorResponse is the method that returns an actor invocation response.
|
380
|
+
message InvokeActorResponse {
|
381
|
+
bytes data = 1;
|
382
|
+
}
|
383
|
+
|
384
|
+
// GetMetadataResponse is a message that is returned on GetMetadata rpc call
|
385
|
+
message GetMetadataResponse {
|
386
|
+
string id = 1;
|
387
|
+
repeated ActiveActorsCount active_actors_count = 2;
|
388
|
+
repeated RegisteredComponents registered_components = 3;
|
389
|
+
map<string,string> extended_metadata = 4;
|
390
|
+
}
|
391
|
+
|
392
|
+
message ActiveActorsCount {
|
393
|
+
string type = 1;
|
394
|
+
int32 count = 2;
|
395
|
+
}
|
396
|
+
|
397
|
+
message RegisteredComponents {
|
398
|
+
string name = 1;
|
399
|
+
string type = 2;
|
400
|
+
string version = 3;
|
401
|
+
}
|
402
|
+
|
403
|
+
message SetMetadataRequest {
|
404
|
+
string key = 1;
|
405
|
+
string value = 2;
|
406
|
+
}
|
data/example.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dapr_services_pb"
|
3
|
+
require "dapr/proto/runtime/v1/dapr_services_pb"
|
4
4
|
|
5
5
|
port = ENV.fetch('DAPR_GRPC_PORT', '5001')
|
6
6
|
dapr_uri = "localhost:#{port}"
|
7
7
|
|
8
|
-
client = Dapr::Dapr::Stub.new(dapr_uri, :this_channel_is_insecure)
|
9
|
-
data =
|
10
|
-
client.publish_event(Dapr::
|
8
|
+
client = Dapr::Proto::Runtime::V1::Dapr::Stub.new(dapr_uri, :this_channel_is_insecure)
|
9
|
+
data = 'lala'
|
10
|
+
client.publish_event(Dapr::Proto::Runtime::V1::PublishEventRequest.new(pubsub_name: 'pubsub', topic: 'sith', data: 'lala'))
|
11
11
|
puts('Published')
|
12
12
|
|
13
13
|
key = 'mykey'
|
14
14
|
store_name = 'statestore'
|
15
|
-
|
16
|
-
|
17
|
-
client.save_state(
|
15
|
+
state = Dapr::Proto::Common::V1::StateItem.new(key: key, value: 'my state')
|
16
|
+
req = Dapr::Proto::Runtime::V1::SaveStateRequest.new(store_name: store_name, states: [state])
|
17
|
+
client.save_state(req)
|
18
18
|
puts('Saved!')
|
19
19
|
|
20
|
-
resp = client.get_state(Dapr::
|
20
|
+
resp = client.get_state(Dapr::Proto::Runtime::V1::GetStateRequest.new(store_name: store_name, key: key))
|
21
21
|
puts('Got state!')
|
22
22
|
puts(resp)
|
23
23
|
|
24
|
-
client.delete_state(Dapr::
|
24
|
+
client.delete_state(Dapr::Proto::Runtime::V1::DeleteStateRequest.new(store_name: store_name, key: key))
|
25
25
|
puts('Deleted!')
|
@@ -3,18 +3,23 @@
|
|
3
3
|
Run the example service:
|
4
4
|
|
5
5
|
```bash
|
6
|
-
dapr run --app-id app-callback --protocol grpc --app-port 50051 \
|
7
|
-
bundle exec ruby app_callback_example.rb
|
6
|
+
dapr run --app-id app-callback --app-protocol grpc --app-port 50051 \
|
7
|
+
-- bundle exec ruby app_callback_example.rb
|
8
8
|
```
|
9
9
|
|
10
10
|
Make a request to invoke a method:
|
11
11
|
|
12
12
|
```bash
|
13
|
-
dapr invoke -
|
13
|
+
dapr invoke --app-id app-callback --method foobar --data '{"foo": "bar"}'
|
14
14
|
```
|
15
15
|
|
16
16
|
Publish a message to a topic:
|
17
17
|
|
18
18
|
```bash
|
19
|
-
dapr publish -
|
19
|
+
dapr publish -i app-callback --pubsub pubsub --topic "example" --data "5"
|
20
|
+
```
|
21
|
+
|
22
|
+
Invoke the binding:
|
23
|
+
```ruby
|
24
|
+
dapr run --app-id invoke-binding -- bundle exec ruby invoke-binding.rb
|
20
25
|
```
|
@@ -8,10 +8,10 @@ class AppCallbackService < Dapr::Proto::Runtime::V1::AppCallback::Service
|
|
8
8
|
Protocol = Dapr::Proto::Runtime::V1
|
9
9
|
|
10
10
|
def on_invoke(invoke, _call)
|
11
|
-
puts "invoked!"
|
12
11
|
# Be careful! method() is a builtin method in Ruby
|
13
12
|
method = invoke['method']
|
14
13
|
raw_data = invoke.data
|
14
|
+
puts "invoked method '#{method}' with data '#{raw_data}'!"
|
15
15
|
data = JSON.parse(raw_data.value) if raw_data&.value
|
16
16
|
result = { method: method, data: data }
|
17
17
|
Dapr::Proto::Common::V1::InvokeResponse.new(data: Any.new(value: result.to_json))
|
@@ -21,20 +21,22 @@ class AppCallbackService < Dapr::Proto::Runtime::V1::AppCallback::Service
|
|
21
21
|
|
22
22
|
def list_topic_subscriptions(_empty, _call)
|
23
23
|
puts "topics requested!"
|
24
|
+
pubsub_name = "pubsub"
|
24
25
|
Protocol::ListTopicSubscriptionsResponse.
|
25
|
-
new(subscriptions: Array(Protocol::TopicSubscription.new(topic: "example")))
|
26
|
+
new(subscriptions: Array(Protocol::TopicSubscription.new(pubsub_name: pubsub_name, topic: "example")))
|
26
27
|
end
|
27
28
|
|
28
29
|
def list_input_bindings(_empty, _call)
|
29
30
|
puts "bindings requested!"
|
30
|
-
|
31
|
+
bindings = %w(binding)
|
32
|
+
Protocol::ListInputBindingsResponse.new(bindings: bindings)
|
31
33
|
end
|
32
34
|
|
33
35
|
def on_binding_event(binding_event, _call)
|
34
36
|
puts "binding event!"
|
35
37
|
name = binding_event.name
|
36
38
|
raw_data = binding_event.data
|
37
|
-
|
39
|
+
_metadata = binding_event.metadata
|
38
40
|
puts "Binding Event: name:#{name}, data: #{raw_data}"
|
39
41
|
Protocol::BindingEventResponse.new # data: Any.new(value:)
|
40
42
|
end
|
@@ -10,8 +10,8 @@ To run this example, use the following code:
|
|
10
10
|
|
11
11
|
```
|
12
12
|
# 1. Start Receiver (expose gRPC receiver server on port 50051)
|
13
|
-
dapr run --app-id invoke-receiver --protocol grpc --app-port 50051 bundle exec ruby invoke-receiver.rb
|
13
|
+
dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 -- bundle exec ruby invoke-receiver.rb
|
14
14
|
|
15
15
|
# 2. Start Caller
|
16
|
-
dapr run --app-id invoke-caller --
|
16
|
+
dapr run --app-id invoke-caller -- bundle exec ruby invoke-caller.rb
|
17
17
|
```
|
@@ -9,6 +9,7 @@ class InvokeReceiverService < Dapr::Proto::Runtime::V1::AppCallback::Service
|
|
9
9
|
|
10
10
|
def on_invoke(invoke, _call)
|
11
11
|
content_type = "text/plain; charset=UTF-8"
|
12
|
+
puts "Invoked method '#{invoke["method"]}' with value '#{invoke["data"]["value"]}'"
|
12
13
|
data = if invoke["method"] == "my-method"
|
13
14
|
Any.new(value: "INVOKE_RECEIVED")
|
14
15
|
else
|
@@ -6,8 +6,8 @@ To run this example, use the following commands:
|
|
6
6
|
|
7
7
|
```bash
|
8
8
|
# 1. Start Subscriber (expose gRPC receiver server on port 50051)
|
9
|
-
dapr run --app-id subscriber --protocol grpc --app-port 50051 bundle exec ruby subscriber.rb
|
9
|
+
dapr run --app-id subscriber --app-protocol grpc --app-port 50051 -- bundle exec ruby subscriber.rb
|
10
10
|
|
11
11
|
# 2. Start Publisher
|
12
|
-
dapr run --app-id publisher --
|
12
|
+
dapr run --app-id publisher -- bundle exec ruby publisher.rb
|
13
13
|
```
|
@@ -9,7 +9,11 @@ RuntimeV1 = Dapr::Proto::Runtime::V1
|
|
9
9
|
port = ENV["DAPR_GRPC_PORT"]
|
10
10
|
client = Dapr::Proto::Runtime::V1::Dapr::Stub.new("localhost:#{port}", :this_channel_is_insecure)
|
11
11
|
|
12
|
+
# This matches the name of the pubsub component used
|
13
|
+
pubsub_name = "pubsub"
|
14
|
+
|
15
|
+
data = "ACTION=1"
|
12
16
|
client.publish_event(RuntimeV1::PublishEventRequest.
|
13
|
-
new(topic: "TOPIC_A", data:
|
17
|
+
new(pubsub_name: pubsub_name, topic: "TOPIC_A", data: data))
|
14
18
|
|
15
|
-
puts "Published
|
19
|
+
puts "Published #{data}"
|
@@ -7,16 +7,20 @@ $stdout.sync = true
|
|
7
7
|
class Subscriber < Dapr::Proto::Runtime::V1::AppCallback::Service
|
8
8
|
RuntimeV1 = Dapr::Proto::Runtime::V1
|
9
9
|
|
10
|
+
|
10
11
|
# Dapr will call this method to get the list of topics the app
|
11
12
|
# wants to subscribe to. In this example, we are telling Dapr
|
12
13
|
# To subscribe to a topic named TOPIC_A
|
13
14
|
def list_topic_subscriptions(_empty, _call)
|
15
|
+
# Name of the configured pubsub component
|
16
|
+
pubsub_name = "pubsub"
|
17
|
+
|
14
18
|
RuntimeV1::ListTopicSubscriptionsResponse.new(
|
15
|
-
subscriptions: Array(RuntimeV1::TopicSubscription.new(topic: "TOPIC_A")))
|
19
|
+
subscriptions: Array(RuntimeV1::TopicSubscription.new(pubsub_name: pubsub_name, topic: "TOPIC_A")))
|
16
20
|
end
|
17
21
|
|
18
|
-
def on_topic_event(
|
19
|
-
puts "Event received!"
|
22
|
+
def on_topic_event(topic_event, _call)
|
23
|
+
puts "Event received #{topic_event}!"
|
20
24
|
Google::Protobuf::Empty.new
|
21
25
|
end
|
22
26
|
end
|
@@ -4,12 +4,11 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'google/protobuf/any_pb'
|
7
|
-
require 'google/protobuf/duration_pb'
|
8
7
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
8
|
add_file("dapr/proto/common/v1/common.proto", :syntax => :proto3) do
|
10
9
|
add_message "dapr.proto.common.v1.HTTPExtension" do
|
11
10
|
optional :verb, :enum, 1, "dapr.proto.common.v1.HTTPExtension.Verb"
|
12
|
-
|
11
|
+
optional :querystring, :string, 2
|
13
12
|
end
|
14
13
|
add_enum "dapr.proto.common.v1.HTTPExtension.Verb" do
|
15
14
|
value :NONE, 0
|
@@ -35,14 +34,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
35
34
|
add_message "dapr.proto.common.v1.StateItem" do
|
36
35
|
optional :key, :string, 1
|
37
36
|
optional :value, :bytes, 2
|
38
|
-
optional :etag, :
|
37
|
+
optional :etag, :message, 3, "dapr.proto.common.v1.Etag"
|
39
38
|
map :metadata, :string, :string, 4
|
40
39
|
optional :options, :message, 5, "dapr.proto.common.v1.StateOptions"
|
41
40
|
end
|
41
|
+
add_message "dapr.proto.common.v1.Etag" do
|
42
|
+
optional :value, :string, 1
|
43
|
+
end
|
42
44
|
add_message "dapr.proto.common.v1.StateOptions" do
|
43
45
|
optional :concurrency, :enum, 1, "dapr.proto.common.v1.StateOptions.StateConcurrency"
|
44
46
|
optional :consistency, :enum, 2, "dapr.proto.common.v1.StateOptions.StateConsistency"
|
45
|
-
optional :retry_policy, :message, 3, "dapr.proto.common.v1.StateRetryPolicy"
|
46
47
|
end
|
47
48
|
add_enum "dapr.proto.common.v1.StateOptions.StateConcurrency" do
|
48
49
|
value :CONCURRENCY_UNSPECIFIED, 0
|
@@ -54,16 +55,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
54
55
|
value :CONSISTENCY_EVENTUAL, 1
|
55
56
|
value :CONSISTENCY_STRONG, 2
|
56
57
|
end
|
57
|
-
add_message "dapr.proto.common.v1.StateRetryPolicy" do
|
58
|
-
optional :threshold, :int32, 1
|
59
|
-
optional :pattern, :enum, 2, "dapr.proto.common.v1.StateRetryPolicy.RetryPattern"
|
60
|
-
optional :interval, :message, 3, "google.protobuf.Duration"
|
61
|
-
end
|
62
|
-
add_enum "dapr.proto.common.v1.StateRetryPolicy.RetryPattern" do
|
63
|
-
value :RETRY_UNSPECIFIED, 0
|
64
|
-
value :RETRY_LINEAR, 1
|
65
|
-
value :RETRY_EXPONENTIAL, 2
|
66
|
-
end
|
67
58
|
end
|
68
59
|
end
|
69
60
|
|
@@ -76,11 +67,10 @@ module Dapr
|
|
76
67
|
InvokeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.InvokeRequest").msgclass
|
77
68
|
InvokeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.InvokeResponse").msgclass
|
78
69
|
StateItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateItem").msgclass
|
70
|
+
Etag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.Etag").msgclass
|
79
71
|
StateOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateOptions").msgclass
|
80
72
|
StateOptions::StateConcurrency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateOptions.StateConcurrency").enummodule
|
81
73
|
StateOptions::StateConsistency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateOptions.StateConsistency").enummodule
|
82
|
-
StateRetryPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateRetryPolicy").msgclass
|
83
|
-
StateRetryPolicy::RetryPattern = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.common.v1.StateRetryPolicy.RetryPattern").enummodule
|
84
74
|
end
|
85
75
|
end
|
86
76
|
end
|
@@ -15,6 +15,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
15
15
|
optional :data_content_type, :string, 5
|
16
16
|
optional :data, :bytes, 7
|
17
17
|
optional :topic, :string, 6
|
18
|
+
optional :pubsub_name, :string, 8
|
19
|
+
end
|
20
|
+
add_message "dapr.proto.runtime.v1.TopicEventResponse" do
|
21
|
+
optional :status, :enum, 1, "dapr.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus"
|
22
|
+
end
|
23
|
+
add_enum "dapr.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus" do
|
24
|
+
value :SUCCESS, 0
|
25
|
+
value :RETRY, 1
|
26
|
+
value :DROP, 2
|
18
27
|
end
|
19
28
|
add_message "dapr.proto.runtime.v1.BindingEventRequest" do
|
20
29
|
optional :name, :string, 1
|
@@ -36,8 +45,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
36
45
|
repeated :subscriptions, :message, 1, "dapr.proto.runtime.v1.TopicSubscription"
|
37
46
|
end
|
38
47
|
add_message "dapr.proto.runtime.v1.TopicSubscription" do
|
39
|
-
optional :
|
40
|
-
|
48
|
+
optional :pubsub_name, :string, 1
|
49
|
+
optional :topic, :string, 2
|
50
|
+
map :metadata, :string, :string, 3
|
41
51
|
end
|
42
52
|
add_message "dapr.proto.runtime.v1.ListInputBindingsResponse" do
|
43
53
|
repeated :bindings, :string, 1
|
@@ -50,6 +60,8 @@ module Dapr
|
|
50
60
|
module Runtime
|
51
61
|
module V1
|
52
62
|
TopicEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.TopicEventRequest").msgclass
|
63
|
+
TopicEventResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.TopicEventResponse").msgclass
|
64
|
+
TopicEventResponse::TopicEventResponseStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus").enummodule
|
53
65
|
BindingEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.BindingEventRequest").msgclass
|
54
66
|
BindingEventResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.BindingEventResponse").msgclass
|
55
67
|
BindingEventResponse::BindingEventConcurrency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.BindingEventResponse.BindingEventConcurrency").enummodule
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Source: dapr/proto/runtime/v1/appcallback.proto for package 'dapr.proto.runtime.v1'
|
3
3
|
# Original file comments:
|
4
4
|
# ------------------------------------------------------------
|
5
|
-
# Copyright (c) Microsoft Corporation.
|
5
|
+
# Copyright (c) Microsoft Corporation and Dapr Contributors.
|
6
6
|
# Licensed under the MIT License.
|
7
7
|
# ------------------------------------------------------------
|
8
8
|
#
|
@@ -31,7 +31,7 @@ module Dapr
|
|
31
31
|
# Lists all topics subscribed by this app.
|
32
32
|
rpc :ListTopicSubscriptions, Google::Protobuf::Empty, ListTopicSubscriptionsResponse
|
33
33
|
# Subscribes events from Pubsub
|
34
|
-
rpc :OnTopicEvent, TopicEventRequest,
|
34
|
+
rpc :OnTopicEvent, TopicEventRequest, TopicEventResponse
|
35
35
|
# Lists all input bindings subscribed by this app.
|
36
36
|
rpc :ListInputBindings, Google::Protobuf::Empty, ListInputBindingsResponse
|
37
37
|
# Listens events from the input bindings
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
+
require 'google/protobuf/any_pb'
|
6
7
|
require 'google/protobuf/empty_pb'
|
7
8
|
require 'dapr/proto/common/v1/common_pb'
|
8
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
@@ -15,24 +16,50 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
15
16
|
optional :store_name, :string, 1
|
16
17
|
optional :key, :string, 2
|
17
18
|
optional :consistency, :enum, 3, "dapr.proto.common.v1.StateOptions.StateConsistency"
|
19
|
+
map :metadata, :string, :string, 4
|
20
|
+
end
|
21
|
+
add_message "dapr.proto.runtime.v1.GetBulkStateRequest" do
|
22
|
+
optional :store_name, :string, 1
|
23
|
+
repeated :keys, :string, 2
|
24
|
+
optional :parallelism, :int32, 3
|
25
|
+
map :metadata, :string, :string, 4
|
26
|
+
end
|
27
|
+
add_message "dapr.proto.runtime.v1.GetBulkStateResponse" do
|
28
|
+
repeated :items, :message, 1, "dapr.proto.runtime.v1.BulkStateItem"
|
29
|
+
end
|
30
|
+
add_message "dapr.proto.runtime.v1.BulkStateItem" do
|
31
|
+
optional :key, :string, 1
|
32
|
+
optional :data, :bytes, 2
|
33
|
+
optional :etag, :string, 3
|
34
|
+
optional :error, :string, 4
|
35
|
+
map :metadata, :string, :string, 5
|
18
36
|
end
|
19
37
|
add_message "dapr.proto.runtime.v1.GetStateResponse" do
|
20
38
|
optional :data, :bytes, 1
|
21
39
|
optional :etag, :string, 2
|
40
|
+
map :metadata, :string, :string, 3
|
22
41
|
end
|
23
42
|
add_message "dapr.proto.runtime.v1.DeleteStateRequest" do
|
24
43
|
optional :store_name, :string, 1
|
25
44
|
optional :key, :string, 2
|
26
|
-
optional :etag, :
|
45
|
+
optional :etag, :message, 3, "dapr.proto.common.v1.Etag"
|
27
46
|
optional :options, :message, 4, "dapr.proto.common.v1.StateOptions"
|
47
|
+
map :metadata, :string, :string, 5
|
48
|
+
end
|
49
|
+
add_message "dapr.proto.runtime.v1.DeleteBulkStateRequest" do
|
50
|
+
optional :store_name, :string, 1
|
51
|
+
repeated :states, :message, 2, "dapr.proto.common.v1.StateItem"
|
28
52
|
end
|
29
53
|
add_message "dapr.proto.runtime.v1.SaveStateRequest" do
|
30
54
|
optional :store_name, :string, 1
|
31
55
|
repeated :states, :message, 2, "dapr.proto.common.v1.StateItem"
|
32
56
|
end
|
33
57
|
add_message "dapr.proto.runtime.v1.PublishEventRequest" do
|
34
|
-
optional :
|
35
|
-
optional :
|
58
|
+
optional :pubsub_name, :string, 1
|
59
|
+
optional :topic, :string, 2
|
60
|
+
optional :data, :bytes, 3
|
61
|
+
optional :data_content_type, :string, 4
|
62
|
+
map :metadata, :string, :string, 5
|
36
63
|
end
|
37
64
|
add_message "dapr.proto.runtime.v1.InvokeBindingRequest" do
|
38
65
|
optional :name, :string, 1
|
@@ -52,6 +79,98 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
52
79
|
add_message "dapr.proto.runtime.v1.GetSecretResponse" do
|
53
80
|
map :data, :string, :string, 1
|
54
81
|
end
|
82
|
+
add_message "dapr.proto.runtime.v1.GetBulkSecretRequest" do
|
83
|
+
optional :store_name, :string, 1
|
84
|
+
map :metadata, :string, :string, 2
|
85
|
+
end
|
86
|
+
add_message "dapr.proto.runtime.v1.SecretResponse" do
|
87
|
+
map :secrets, :string, :string, 1
|
88
|
+
end
|
89
|
+
add_message "dapr.proto.runtime.v1.GetBulkSecretResponse" do
|
90
|
+
map :data, :string, :message, 1, "dapr.proto.runtime.v1.SecretResponse"
|
91
|
+
end
|
92
|
+
add_message "dapr.proto.runtime.v1.TransactionalStateOperation" do
|
93
|
+
optional :operationType, :string, 1
|
94
|
+
optional :request, :message, 2, "dapr.proto.common.v1.StateItem"
|
95
|
+
end
|
96
|
+
add_message "dapr.proto.runtime.v1.ExecuteStateTransactionRequest" do
|
97
|
+
optional :storeName, :string, 1
|
98
|
+
repeated :operations, :message, 2, "dapr.proto.runtime.v1.TransactionalStateOperation"
|
99
|
+
map :metadata, :string, :string, 3
|
100
|
+
end
|
101
|
+
add_message "dapr.proto.runtime.v1.RegisterActorTimerRequest" do
|
102
|
+
optional :actor_type, :string, 1
|
103
|
+
optional :actor_id, :string, 2
|
104
|
+
optional :name, :string, 3
|
105
|
+
optional :due_time, :string, 4
|
106
|
+
optional :period, :string, 5
|
107
|
+
optional :callback, :string, 6
|
108
|
+
optional :data, :bytes, 7
|
109
|
+
end
|
110
|
+
add_message "dapr.proto.runtime.v1.UnregisterActorTimerRequest" do
|
111
|
+
optional :actor_type, :string, 1
|
112
|
+
optional :actor_id, :string, 2
|
113
|
+
optional :name, :string, 3
|
114
|
+
end
|
115
|
+
add_message "dapr.proto.runtime.v1.RegisterActorReminderRequest" do
|
116
|
+
optional :actor_type, :string, 1
|
117
|
+
optional :actor_id, :string, 2
|
118
|
+
optional :name, :string, 3
|
119
|
+
optional :due_time, :string, 4
|
120
|
+
optional :period, :string, 5
|
121
|
+
optional :data, :bytes, 6
|
122
|
+
end
|
123
|
+
add_message "dapr.proto.runtime.v1.UnregisterActorReminderRequest" do
|
124
|
+
optional :actor_type, :string, 1
|
125
|
+
optional :actor_id, :string, 2
|
126
|
+
optional :name, :string, 3
|
127
|
+
end
|
128
|
+
add_message "dapr.proto.runtime.v1.GetActorStateRequest" do
|
129
|
+
optional :actor_type, :string, 1
|
130
|
+
optional :actor_id, :string, 2
|
131
|
+
optional :key, :string, 3
|
132
|
+
end
|
133
|
+
add_message "dapr.proto.runtime.v1.GetActorStateResponse" do
|
134
|
+
optional :data, :bytes, 1
|
135
|
+
end
|
136
|
+
add_message "dapr.proto.runtime.v1.ExecuteActorStateTransactionRequest" do
|
137
|
+
optional :actor_type, :string, 1
|
138
|
+
optional :actor_id, :string, 2
|
139
|
+
repeated :operations, :message, 3, "dapr.proto.runtime.v1.TransactionalActorStateOperation"
|
140
|
+
end
|
141
|
+
add_message "dapr.proto.runtime.v1.TransactionalActorStateOperation" do
|
142
|
+
optional :operationType, :string, 1
|
143
|
+
optional :key, :string, 2
|
144
|
+
optional :value, :message, 3, "google.protobuf.Any"
|
145
|
+
end
|
146
|
+
add_message "dapr.proto.runtime.v1.InvokeActorRequest" do
|
147
|
+
optional :actor_type, :string, 1
|
148
|
+
optional :actor_id, :string, 2
|
149
|
+
optional :method, :string, 3
|
150
|
+
optional :data, :bytes, 4
|
151
|
+
end
|
152
|
+
add_message "dapr.proto.runtime.v1.InvokeActorResponse" do
|
153
|
+
optional :data, :bytes, 1
|
154
|
+
end
|
155
|
+
add_message "dapr.proto.runtime.v1.GetMetadataResponse" do
|
156
|
+
optional :id, :string, 1
|
157
|
+
repeated :active_actors_count, :message, 2, "dapr.proto.runtime.v1.ActiveActorsCount"
|
158
|
+
repeated :registered_components, :message, 3, "dapr.proto.runtime.v1.RegisteredComponents"
|
159
|
+
map :extended_metadata, :string, :string, 4
|
160
|
+
end
|
161
|
+
add_message "dapr.proto.runtime.v1.ActiveActorsCount" do
|
162
|
+
optional :type, :string, 1
|
163
|
+
optional :count, :int32, 2
|
164
|
+
end
|
165
|
+
add_message "dapr.proto.runtime.v1.RegisteredComponents" do
|
166
|
+
optional :name, :string, 1
|
167
|
+
optional :type, :string, 2
|
168
|
+
optional :version, :string, 3
|
169
|
+
end
|
170
|
+
add_message "dapr.proto.runtime.v1.SetMetadataRequest" do
|
171
|
+
optional :key, :string, 1
|
172
|
+
optional :value, :string, 2
|
173
|
+
end
|
55
174
|
end
|
56
175
|
end
|
57
176
|
|
@@ -61,14 +180,37 @@ module Dapr
|
|
61
180
|
module V1
|
62
181
|
InvokeServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.InvokeServiceRequest").msgclass
|
63
182
|
GetStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetStateRequest").msgclass
|
183
|
+
GetBulkStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetBulkStateRequest").msgclass
|
184
|
+
GetBulkStateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetBulkStateResponse").msgclass
|
185
|
+
BulkStateItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.BulkStateItem").msgclass
|
64
186
|
GetStateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetStateResponse").msgclass
|
65
187
|
DeleteStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.DeleteStateRequest").msgclass
|
188
|
+
DeleteBulkStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.DeleteBulkStateRequest").msgclass
|
66
189
|
SaveStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.SaveStateRequest").msgclass
|
67
190
|
PublishEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.PublishEventRequest").msgclass
|
68
191
|
InvokeBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.InvokeBindingRequest").msgclass
|
69
192
|
InvokeBindingResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.InvokeBindingResponse").msgclass
|
70
193
|
GetSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetSecretRequest").msgclass
|
71
194
|
GetSecretResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetSecretResponse").msgclass
|
195
|
+
GetBulkSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetBulkSecretRequest").msgclass
|
196
|
+
SecretResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.SecretResponse").msgclass
|
197
|
+
GetBulkSecretResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetBulkSecretResponse").msgclass
|
198
|
+
TransactionalStateOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.TransactionalStateOperation").msgclass
|
199
|
+
ExecuteStateTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.ExecuteStateTransactionRequest").msgclass
|
200
|
+
RegisterActorTimerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.RegisterActorTimerRequest").msgclass
|
201
|
+
UnregisterActorTimerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.UnregisterActorTimerRequest").msgclass
|
202
|
+
RegisterActorReminderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.RegisterActorReminderRequest").msgclass
|
203
|
+
UnregisterActorReminderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.UnregisterActorReminderRequest").msgclass
|
204
|
+
GetActorStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetActorStateRequest").msgclass
|
205
|
+
GetActorStateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetActorStateResponse").msgclass
|
206
|
+
ExecuteActorStateTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.ExecuteActorStateTransactionRequest").msgclass
|
207
|
+
TransactionalActorStateOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.TransactionalActorStateOperation").msgclass
|
208
|
+
InvokeActorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.InvokeActorRequest").msgclass
|
209
|
+
InvokeActorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.InvokeActorResponse").msgclass
|
210
|
+
GetMetadataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.GetMetadataResponse").msgclass
|
211
|
+
ActiveActorsCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.ActiveActorsCount").msgclass
|
212
|
+
RegisteredComponents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.RegisteredComponents").msgclass
|
213
|
+
SetMetadataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("dapr.proto.runtime.v1.SetMetadataRequest").msgclass
|
72
214
|
end
|
73
215
|
end
|
74
216
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Source: dapr/proto/runtime/v1/dapr.proto for package 'dapr.proto.runtime.v1'
|
3
3
|
# Original file comments:
|
4
4
|
# ------------------------------------------------------------
|
5
|
-
# Copyright (c) Microsoft Corporation.
|
5
|
+
# Copyright (c) Microsoft Corporation and Dapr Contributors.
|
6
6
|
# Licensed under the MIT License.
|
7
7
|
# ------------------------------------------------------------
|
8
8
|
#
|
@@ -24,21 +24,46 @@ module Dapr
|
|
24
24
|
self.unmarshal_class_method = :decode
|
25
25
|
self.service_name = 'dapr.proto.runtime.v1.Dapr'
|
26
26
|
|
27
|
-
# Invokes a method on a remote Dapr app.
|
28
|
-
# Nested Dapr modules are problematic so this must be prefixed as a top-level constant
|
27
|
+
# Invokes a method on a remote Dapr app.
|
29
28
|
rpc :InvokeService, InvokeServiceRequest, ::Dapr::Proto::Common::V1::InvokeResponse
|
30
|
-
# Gets the state for a specific key.
|
29
|
+
# Gets the state for a specific key.
|
31
30
|
rpc :GetState, GetStateRequest, GetStateResponse
|
31
|
+
# Gets a bulk of state items for a list of keys
|
32
|
+
rpc :GetBulkState, GetBulkStateRequest, GetBulkStateResponse
|
32
33
|
# Saves the state for a specific key.
|
33
34
|
rpc :SaveState, SaveStateRequest, Google::Protobuf::Empty
|
34
35
|
# Deletes the state for a specific key.
|
35
36
|
rpc :DeleteState, DeleteStateRequest, Google::Protobuf::Empty
|
37
|
+
# Deletes a bulk of state items for a list of keys
|
38
|
+
rpc :DeleteBulkState, DeleteBulkStateRequest, Google::Protobuf::Empty
|
39
|
+
# Executes transactions for a specified store
|
40
|
+
rpc :ExecuteStateTransaction, ExecuteStateTransactionRequest, Google::Protobuf::Empty
|
36
41
|
# Publishes events to the specific topic.
|
37
42
|
rpc :PublishEvent, PublishEventRequest, Google::Protobuf::Empty
|
38
43
|
# Invokes binding data to specific output bindings
|
39
44
|
rpc :InvokeBinding, InvokeBindingRequest, InvokeBindingResponse
|
40
45
|
# Gets secrets from secret stores.
|
41
46
|
rpc :GetSecret, GetSecretRequest, GetSecretResponse
|
47
|
+
# Gets a bulk of secrets
|
48
|
+
rpc :GetBulkSecret, GetBulkSecretRequest, GetBulkSecretResponse
|
49
|
+
# Register an actor timer.
|
50
|
+
rpc :RegisterActorTimer, RegisterActorTimerRequest, Google::Protobuf::Empty
|
51
|
+
# Unregister an actor timer.
|
52
|
+
rpc :UnregisterActorTimer, UnregisterActorTimerRequest, Google::Protobuf::Empty
|
53
|
+
# Register an actor reminder.
|
54
|
+
rpc :RegisterActorReminder, RegisterActorReminderRequest, Google::Protobuf::Empty
|
55
|
+
# Unregister an actor reminder.
|
56
|
+
rpc :UnregisterActorReminder, UnregisterActorReminderRequest, Google::Protobuf::Empty
|
57
|
+
# Gets the state for a specific actor.
|
58
|
+
rpc :GetActorState, GetActorStateRequest, GetActorStateResponse
|
59
|
+
# Executes state transactions for a specified actor
|
60
|
+
rpc :ExecuteActorStateTransaction, ExecuteActorStateTransactionRequest, Google::Protobuf::Empty
|
61
|
+
# InvokeActor calls a method on an actor.
|
62
|
+
rpc :InvokeActor, InvokeActorRequest, InvokeActorResponse
|
63
|
+
# Gets metadata of the sidecar
|
64
|
+
rpc :GetMetadata, Google::Protobuf::Empty, GetMetadataResponse
|
65
|
+
# Sets value in extended metadata of the sidecar
|
66
|
+
rpc :SetMetadata, SetMetadataRequest, Google::Protobuf::Empty
|
42
67
|
end
|
43
68
|
|
44
69
|
Stub = Service.rpc_stub_class
|
data/lib/dapr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapr-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tjwp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
|
-
rubygems_version: 3.
|
166
|
+
rubygems_version: 3.1.4
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Dapr SDK for Ruby
|