1
1
// Copyright (c) HashiCorp, Inc.
2
2
// SPDX-License-Identifier: MPL-2.0
3
3
4
- // Terraform Plugin RPC protocol version 5.9
4
+ // Terraform Plugin RPC protocol version 5.10
5
5
//
6
- // This file defines version 5.9 of the RPC protocol. To implement a plugin
6
+ // This file defines version 5.10 of the RPC protocol. To implement a plugin
7
7
// against this protocol, copy this definition into your own codebase and
8
8
// use protoc to generate stubs for your target language.
9
9
//
@@ -349,6 +349,10 @@ service Provider {
349
349
rpc RenewEphemeralResource (RenewEphemeralResource .Request ) returns (RenewEphemeralResource .Response );
350
350
rpc CloseEphemeralResource (CloseEphemeralResource .Request ) returns (CloseEphemeralResource .Response );
351
351
352
+ /////// List
353
+ rpc ListResource (ListResource .Request ) returns (stream ListResource .Event );
354
+ rpc ValidateListResourceConfig (ValidateListResourceConfig .Request ) returns (ValidateListResourceConfig .Response );
355
+
352
356
// Functions
353
357
354
358
// GetFunctions returns the definitions of all functions.
@@ -375,6 +379,7 @@ message GetMetadata {
375
379
// functions returns metadata for any functions.
376
380
repeated FunctionMetadata functions = 5 ;
377
381
repeated EphemeralResourceMetadata ephemeral_resources = 6 ;
382
+ repeated ListResourceMetadata list_resources = 7 ;
378
383
}
379
384
380
385
message FunctionMetadata {
@@ -393,6 +398,10 @@ message GetMetadata {
393
398
message EphemeralResourceMetadata {
394
399
string type_name = 1 ;
395
400
}
401
+
402
+ message ListResourceMetadata {
403
+ string type_name = 1 ;
404
+ }
396
405
}
397
406
398
407
message GetProviderSchema {
@@ -409,6 +418,7 @@ message GetProviderSchema {
409
418
// functions is a mapping of function names to definitions.
410
419
map <string , Function > functions = 7 ;
411
420
map <string , Schema > ephemeral_resource_schemas = 8 ;
421
+ map <string , Schema > list_resource_schemas = 9 ;
412
422
}
413
423
}
414
424
@@ -824,3 +834,41 @@ message UpgradeResourceIdentity {
824
834
repeated Diagnostic diagnostics = 2 ;
825
835
}
826
836
}
837
+
838
+ message ListResource {
839
+ message Request {
840
+ // type_name is the list resource type name.
841
+ string type_name = 1 ;
842
+
843
+ // configuration is the list ConfigSchema-based configuration data.
844
+ DynamicValue config = 2 ;
845
+
846
+ // when include_resource_object is set to true, the provider should
847
+ // include the full resource object for each result
848
+ bool include_resource_object = 3 ;
849
+ }
850
+
851
+ message Event {
852
+ // identity is the resource identity data of the resource instance.
853
+ ResourceIdentityData identity = 1 ;
854
+
855
+ // display_name can be displayed in a UI to make it easier for humans to identify a resource
856
+ string display_name = 2 ;
857
+
858
+ // optional resource object which can be useful when combining list blocks in configuration
859
+ optional DynamicValue resource_object = 3 ;
860
+
861
+ // A warning or error diagnostics for this event
862
+ repeated Diagnostic diagnostic = 4 ;
863
+ }
864
+ }
865
+
866
+ message ValidateListResourceConfig {
867
+ message Request {
868
+ string type_name = 1 ;
869
+ DynamicValue config = 2 ;
870
+ }
871
+ message Response {
872
+ repeated Diagnostic diagnostics = 1 ;
873
+ }
874
+ }
0 commit comments