@@ -13,9 +13,7 @@ import (
1313 "github.com/scaleway/scaleway-sdk-go/scw"
1414)
1515
16- var (
17- _ action.Action = (* ServerAction )(nil )
18- )
16+ var _ action.Action = (* ServerAction )(nil )
1917
2018type ServerAction struct {
2119 instanceAPI * instance.API
@@ -46,8 +44,8 @@ func (a *ServerAction) Metadata(ctx context.Context, req action.MetadataRequest,
4644type ServerActionModel struct {
4745 ServerID types.String `tfsdk:"server_id"`
4846 Zone types.String `tfsdk:"zone"`
49- Wait types.Bool `tfsdk:"wait"`
5047 Action types.String `tfsdk:"action"`
48+ Wait types.Bool `tfsdk:"wait"`
5149}
5250
5351func NewServerAction () action.Action {
@@ -91,6 +89,7 @@ func (a *ServerAction) Invoke(ctx context.Context, req action.InvokeRequest, res
9189 var data ServerActionModel
9290 // Read action config data into the model
9391 resp .Diagnostics .Append (req .Config .Get (ctx , & data )... )
92+
9493 if resp .Diagnostics .HasError () {
9594 return
9695 }
@@ -105,6 +104,7 @@ func (a *ServerAction) Invoke(ctx context.Context, req action.InvokeRequest, res
105104 "error in server action" ,
106105 fmt .Sprintf ("%s" , err ))
107106 }
107+
108108 if data .Wait .ValueBool () {
109109 _ , errWait := a .instanceAPI .WaitForServer (& instance.WaitForServerRequest {
110110 ServerID : data .ServerID .String (),
0 commit comments