Skip to content

Commit f36beda

Browse files
authored
Merge pull request #25 from wcs1only/release-1.0
Update for 1.0.0-rc.3
2 parents 8a45294 + 3dc7815 commit f36beda

File tree

10 files changed

+10494
-5727
lines changed

10 files changed

+10494
-5727
lines changed

dapr/proto/common/v1/common.proto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ message StateItem {
8989

9090
// The entity tag which represents the specific version of data.
9191
// The exact ETag format is defined by the corresponding data store.
92-
string etag = 3;
92+
Etag etag = 3;
9393

9494
// The metadata which will be passed to state store component.
9595
map<string,string> metadata = 4;
@@ -98,6 +98,12 @@ message StateItem {
9898
StateOptions options = 5;
9999
}
100100

101+
// Etag represents a state item version
102+
message Etag {
103+
// value sets the etag value
104+
string value = 1;
105+
}
106+
101107
// StateOptions configures concurrency and consistency for state operations
102108
message StateOptions {
103109
// Enum describing the supported concurrency for state.

dapr/proto/runtime/v1/dapr.proto

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ service Dapr {
3232

3333
// Deletes the state for a specific key.
3434
rpc DeleteState(DeleteStateRequest) returns (google.protobuf.Empty) {}
35-
35+
36+
// Deletes a bulk of state items for a list of keys
37+
rpc DeleteBulkState(DeleteBulkStateRequest) returns (google.protobuf.Empty) {}
38+
3639
// Executes transactions for a specified store
3740
rpc ExecuteStateTransaction(ExecuteStateTransactionRequest) returns (google.protobuf.Empty) {}
3841

@@ -68,6 +71,12 @@ service Dapr {
6871

6972
// InvokeActor calls a method on an actor.
7073
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) {}
7180
}
7281

7382
// InvokeServiceRequest represents the request message for Service invocation.
@@ -158,7 +167,7 @@ message DeleteStateRequest {
158167

159168
// The entity tag which represents the specific version of data.
160169
// The exact ETag format is defined by the corresponding data store.
161-
string etag = 3;
170+
common.v1.Etag etag = 3;
162171

163172
// State operation options which includes concurrency/
164173
// consistency/retry_policy.
@@ -168,6 +177,15 @@ message DeleteStateRequest {
168177
map<string,string> metadata = 5;
169178
}
170179

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;
187+
}
188+
171189
// SaveStateRequest is the message to save multiple states into state store.
172190
message SaveStateRequest {
173191
// The name of state store.
@@ -256,11 +274,16 @@ message GetBulkSecretRequest {
256274
map<string,string> metadata = 2;
257275
}
258276

259-
// GetBulkSecretResponse is the response message to convey the requested secret.
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.
260283
message GetBulkSecretResponse {
261284
// data hold the secret values. Some secret store, such as kubernetes secret
262285
// store, can save multiple secrets for single secret key.
263-
map<string, string> data = 1;
286+
map<string, SecretResponse> data = 1;
264287
}
265288

266289
// TransactionalStateOperation is the message to execute a specified operation with a key-value pair.
@@ -357,3 +380,27 @@ message InvokeActorRequest {
357380
message InvokeActorResponse {
358381
bytes data = 1;
359382
}
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+
}

examples/echo_app/README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,58 @@ This echo app example shows how to use service invocation using gRPC API. You ca
1010
1. Make sure that you reopen in container on VSCode
1111
2. Open new bash terminal
1212
3. Build echo_app
13+
1314
```
1415
cd examples/echo_app
16+
```
17+
18+
<!-- STEP
19+
name: Build example
20+
-->
21+
22+
```bash
1523
make
1624
```
1725

26+
<!-- END_STEP -->
27+
1828
### Run callee app
1929

2030
1. Open new bash terminal
2131
2. Run callee app
22-
```
32+
33+
<!-- STEP
34+
name: Run callee
35+
expected_stdout_lines:
36+
- '== APP == OnInvoke() is called'
37+
- '== APP == Got the message: hello dapr'
38+
background: true
39+
sleep: 5
40+
-->
41+
42+
```bash
2343
dapr run --app-id callee --app-protocol grpc --app-port 6000 ./echo_app callee 6000
2444
```
45+
46+
<!-- END_STEP -->
47+
2548
3. Run caller app
26-
```
49+
50+
<!-- STEP
51+
name: Run caller
52+
expected_stdout_lines:
53+
- "== APP == Call echo method to callee"
54+
- "== APP == Received [ack : hello dapr] from callee"
55+
background: true
56+
sleep: 5
57+
-->
58+
59+
```bash
2760
dapr run --app-id echo_app --app-protocol grpc --app-port 6100 ./echo_app caller 6100 callee
2861
```
62+
63+
<!-- END_STEP -->
64+
2965
4. Check the logs
3066
From callee app:
3167
```
@@ -45,6 +81,23 @@ From caller app:
4581
...
4682
```
4783

84+
## Cleanup
85+
86+
<!-- STEP
87+
expected_stdout_lines:
88+
- '✅ app stopped successfully: echo_app'
89+
- '✅ app stopped successfully: callee'
90+
expected_stderr_lines:
91+
name: Shutdown dapr
92+
-->
93+
94+
```bash
95+
dapr stop --app-id echo_app
96+
dapr stop --app-id callee
97+
```
98+
99+
<!-- END_STEP -->
100+
48101
## gRPC Debug
49102

50103
Set the below environment variable to debug gRPC server and client.

0 commit comments

Comments
 (0)