Skip to content

Commit 86f0a9a

Browse files
committed
Update protocol for PSS
1 parent dd4bf55 commit 86f0a9a

File tree

2 files changed

+4608
-2798
lines changed

2 files changed

+4608
-2798
lines changed

docs/plugin-protocol/tfplugin6.proto

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,19 @@ service Provider {
375375
//////// Provider-contributed Functions
376376
rpc CallFunction(CallFunction.Request) returns (CallFunction.Response);
377377

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+
378391
//////// Graceful Shutdown
379392
rpc StopProvider(StopProvider.Request) returns (StopProvider.Response);
380393
}
@@ -426,6 +439,7 @@ message GetProviderSchema {
426439
map<string, Function> functions = 7;
427440
map<string, Schema> ephemeral_resource_schemas = 8;
428441
map<string, Schema> list_resource_schemas = 9;
442+
map<string, Schema> state_store_schemas = 10;
429443
repeated Diagnostic diagnostics = 4;
430444
Schema provider_meta = 5;
431445
ServerCapabilities server_capabilities = 6;
@@ -839,3 +853,95 @@ message ValidateListResourceConfig {
839853
repeated Diagnostic diagnostics = 1;
840854
}
841855
}
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

Comments
 (0)