@@ -198,6 +198,7 @@ func (s *GRPCProviderServer) GetMetadata(ctx context.Context, req *tfprotov5.Get
198
198
EphemeralResources : make ([]tfprotov5.EphemeralResourceMetadata , 0 ),
199
199
Functions : make ([]tfprotov5.FunctionMetadata , 0 ),
200
200
ListResources : make ([]tfprotov5.ListResourceMetadata , 0 ),
201
+ Actions : make ([]tfprotov5.ActionMetadata , 0 ),
201
202
Resources : make ([]tfprotov5.ResourceMetadata , 0 , len (s .provider .ResourcesMap )),
202
203
ServerCapabilities : s .serverCapabilities (),
203
204
}
@@ -227,6 +228,7 @@ func (s *GRPCProviderServer) GetProviderSchema(ctx context.Context, req *tfproto
227
228
EphemeralResourceSchemas : make (map [string ]* tfprotov5.Schema , 0 ),
228
229
Functions : make (map [string ]* tfprotov5.Function , 0 ),
229
230
ListResourceSchemas : make (map [string ]* tfprotov5.Schema , 0 ),
231
+ ActionSchemas : make (map [string ]* tfprotov5.ActionSchema , 0 ),
230
232
ResourceSchemas : make (map [string ]* tfprotov5.Schema , len (s .provider .ResourcesMap )),
231
233
ServerCapabilities : s .serverCapabilities (),
232
234
}
@@ -2065,6 +2067,68 @@ func (s *GRPCProviderServer) ListResource(ctx context.Context, req *tfprotov5.Li
2065
2067
return resp , nil
2066
2068
}
2067
2069
2070
+ func (s * GRPCProviderServer ) ValidateActionConfig (ctx context.Context , req * tfprotov5.ValidateActionConfigRequest ) (* tfprotov5.ValidateActionConfigResponse , error ) {
2071
+ ctx = logging .InitContext (ctx )
2072
+
2073
+ logging .HelperSchemaTrace (ctx , "Returning error for action type validate" )
2074
+
2075
+ resp := & tfprotov5.ValidateActionConfigResponse {
2076
+ Diagnostics : []* tfprotov5.Diagnostic {
2077
+ {
2078
+ Severity : tfprotov5 .DiagnosticSeverityError ,
2079
+ Summary : "Unknown Action Type" ,
2080
+ Detail : fmt .Sprintf ("The %q action type is not supported by this provider." , req .ActionType ),
2081
+ },
2082
+ },
2083
+ }
2084
+
2085
+ return resp , nil
2086
+ }
2087
+
2088
+ func (s * GRPCProviderServer ) PlanAction (ctx context.Context , req * tfprotov5.PlanActionRequest ) (* tfprotov5.PlanActionResponse , error ) {
2089
+ ctx = logging .InitContext (ctx )
2090
+
2091
+ logging .HelperSchemaTrace (ctx , "Returning error for action type plan" )
2092
+
2093
+ resp := & tfprotov5.PlanActionResponse {
2094
+ Diagnostics : []* tfprotov5.Diagnostic {
2095
+ {
2096
+ Severity : tfprotov5 .DiagnosticSeverityError ,
2097
+ Summary : "Unknown Action Type" ,
2098
+ Detail : fmt .Sprintf ("The %q action type is not supported by this provider." , req .ActionType ),
2099
+ },
2100
+ },
2101
+ }
2102
+
2103
+ return resp , nil
2104
+ }
2105
+
2106
+ func (s * GRPCProviderServer ) InvokeAction (ctx context.Context , req * tfprotov5.InvokeActionRequest ) (* tfprotov5.InvokeActionServerStream , error ) {
2107
+ ctx = logging .InitContext (ctx )
2108
+
2109
+ logging .HelperSchemaTrace (ctx , "Returning error for action invoke" )
2110
+
2111
+ event := make ([]tfprotov5.InvokeActionEvent , 0 )
2112
+
2113
+ event = append (event , tfprotov5.InvokeActionEvent {
2114
+ Type : tfprotov5.CompletedInvokeActionEventType {
2115
+ Diagnostics : []* tfprotov5.Diagnostic {
2116
+ {
2117
+ Severity : tfprotov5 .DiagnosticSeverityError ,
2118
+ Summary : "Unknown Action Type" ,
2119
+ Detail : fmt .Sprintf ("The %q action type is not supported by this provider." , req .ActionType ),
2120
+ },
2121
+ },
2122
+ },
2123
+ })
2124
+
2125
+ resp := & tfprotov5.InvokeActionServerStream {
2126
+ Events : slices .Values (event ),
2127
+ }
2128
+
2129
+ return resp , nil
2130
+ }
2131
+
2068
2132
func pathToAttributePath (path cty.Path ) * tftypes.AttributePath {
2069
2133
var steps []tftypes.AttributePathStep
2070
2134
0 commit comments