@@ -375,6 +375,19 @@ service Provider {
375
375
//////// Provider-contributed Functions
376
376
rpc CallFunction (CallFunction .Request ) returns (CallFunction .Response );
377
377
378
+ // ValidateStateStoreConfig fills in any default values and performs configuration validation
379
+ rpc ValidateStateStoreConfig (ValidateStateStore .Request ) returns (ValidateStateStore .Response );
380
+ // ConfigureStateStore configures the Statestore, such as S3 connection in the context of already configured provider
381
+ rpc ConfigureStateStore (ConfigureStateStore .Request ) returns (ConfigureStateStore .Response );
382
+
383
+ rpc ReadState (ReadState .Request ) returns (stream ReadState .ResponseChunk );
384
+ rpc WriteState (stream WriteState .RequestChunk ) returns (stream WriteState .Response );
385
+
386
+ rpc LockState (LockState .Request ) returns (LockState .Response );
387
+ rpc UnlockState (UnlockState .Request ) returns (UnlockState .Response );
388
+ rpc GetStates (GetStates .Request ) returns (GetStates .Response );
389
+ rpc DeleteState (DeleteState .Request ) returns (DeleteState .Response );
390
+
378
391
//////// Graceful Shutdown
379
392
rpc StopProvider (StopProvider .Request ) returns (StopProvider .Response );
380
393
}
@@ -426,6 +439,7 @@ message GetProviderSchema {
426
439
map <string , Function > functions = 7 ;
427
440
map <string , Schema > ephemeral_resource_schemas = 8 ;
428
441
map <string , Schema > list_resource_schemas = 9 ;
442
+ map <string , Schema > state_store_schemas = 10 ;
429
443
repeated Diagnostic diagnostics = 4 ;
430
444
Schema provider_meta = 5 ;
431
445
ServerCapabilities server_capabilities = 6 ;
@@ -839,3 +853,95 @@ message ValidateListResourceConfig {
839
853
repeated Diagnostic diagnostics = 1 ;
840
854
}
841
855
}
856
+
857
+
858
+ message ValidateStateStore {
859
+ message Request {
860
+ string type_name = 1 ;
861
+ DynamicValue config = 2 ;
862
+ }
863
+ message Response {
864
+ repeated Diagnostic diagnostics = 1 ;
865
+ }
866
+ }
867
+
868
+ message ConfigureStateStore {
869
+ message Request {
870
+ string type_name = 1 ;
871
+ DynamicValue prepared_config = 2 ;
872
+ }
873
+ message Response {
874
+ repeated Diagnostic diagnostics = 1 ;
875
+ }
876
+ }
877
+
878
+ message ReadState {
879
+ message Request {
880
+ string type_name = 1 ;
881
+ string state_id = 2 ;
882
+ }
883
+ message ResponseChunk {
884
+ bytes data = 1 ;
885
+ // supplied with the first chunk
886
+ optional StateMeta meta = 2 ;
887
+ }
888
+ }
889
+
890
+ message WriteState {
891
+ message RequestChunk {
892
+ bytes data = 1 ;
893
+ string state_id = 2 ;
894
+ // supplied with the first chunk
895
+ optional StateMeta meta = 3 ;
896
+ }
897
+ message Response {
898
+ repeated Diagnostic diagnostics = 1 ;
899
+ }
900
+ }
901
+
902
+ message StateMeta {
903
+ bytes checksum = 1 ;
904
+ int64 number_of_chunks = 2 ;
905
+ }
906
+
907
+ message LockState {
908
+ message Request {
909
+ string type_name = 1 ;
910
+ string state_id = 2 ;
911
+ string operation = 3 ;
912
+ }
913
+ message Response {
914
+ string id = 1 ;
915
+ repeated Diagnostic diagnostics = 2 ;
916
+ }
917
+ }
918
+
919
+ message UnlockState {
920
+ message Request {
921
+ string type_name = 1 ;
922
+ string state_id = 2 ;
923
+ string lock_id = 3 ;
924
+ }
925
+ message Response {
926
+ repeated Diagnostic diagnostics = 1 ;
927
+ }
928
+ }
929
+
930
+ message GetStates {
931
+ message Request {
932
+ string type_name = 1 ;
933
+ }
934
+ message Response {
935
+ repeated string state_id = 1 ;
936
+ }
937
+ }
938
+
939
+ message DeleteState {
940
+ message Request {
941
+ string type_name = 1 ;
942
+ string state_id = 2 ;
943
+ }
944
+ message Response {
945
+ repeated Diagnostic diagnostics = 1 ;
946
+ }
947
+ }
0 commit comments