Skip to content

Commit c448cd9

Browse files
committed
Add LockState and UnlockState methods to .proto file for Protocol v6
1 parent fca79ea commit c448cd9

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

tfprotov6/internal/tfplugin6/tfplugin6.proto

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ service Provider {
399399
rpc ReadStateBytes(ReadStateBytes.Request) returns (stream ReadStateBytes.Response);
400400
// WriteStateBytes streams byte chunks of a given state file into a state store
401401
rpc WriteStateBytes(stream WriteStateBytes.RequestChunk) returns (WriteStateBytes.Response);
402+
// LockState locks a given state (i.e. CE workspace)
403+
rpc LockState(LockState.Request) returns (LockState.Response);
404+
// UnlockState unlocks a given state (i.e. CE workspace)
405+
rpc UnlockState(UnlockState.Request) returns (UnlockState.Response);
406+
402407
// GetStates returns a list of all states (i.e. CE workspaces) managed by a given state store
403408
rpc GetStates(GetStates.Request) returns (GetStates.Response);
404409
// DeleteState instructs a given state store to delete a specific state (i.e. a CE workspace)
@@ -422,7 +427,7 @@ message GetMetadata {
422427
repeated FunctionMetadata functions = 5;
423428
repeated EphemeralResourceMetadata ephemeral_resources = 6;
424429
repeated ListResourceMetadata list_resources = 7;
425-
reserved 8; // TODO: Field number 8 will be used by state stores
430+
repeated StateStoreMetadata state_stores = 8;
426431
repeated ActionMetadata actions = 9;
427432
}
428433

@@ -447,6 +452,10 @@ message GetMetadata {
447452
string type_name = 1;
448453
}
449454

455+
message StateStoreMetadata {
456+
string type_name = 1;
457+
}
458+
450459
message ActionMetadata {
451460
string type_name = 1;
452461
}
@@ -1006,6 +1015,30 @@ message StateRange {
10061015
int64 end = 2;
10071016
}
10081017

1018+
message LockState {
1019+
message Request {
1020+
string type_name = 1;
1021+
string state_id = 2;
1022+
// operation represents an ongoing operation due to which lock is held (e.g. refresh, plan, apply)
1023+
string operation = 3;
1024+
}
1025+
message Response {
1026+
string lock_id = 1;
1027+
repeated Diagnostic diagnostics = 2;
1028+
}
1029+
}
1030+
1031+
message UnlockState {
1032+
message Request {
1033+
string type_name = 1;
1034+
string state_id = 2;
1035+
string lock_id = 3;
1036+
}
1037+
message Response {
1038+
repeated Diagnostic diagnostics = 1;
1039+
}
1040+
}
1041+
10091042
message GetStates {
10101043
message Request {
10111044
string type_name = 1;

0 commit comments

Comments
 (0)