This commit is contained in:
asteam
2025-07-31 15:51:28 +03:00
parent 2c70109d2d
commit 5d15e83d56
4266 changed files with 93 additions and 468985 deletions

View File

@@ -114,6 +114,16 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
c := m.(*controller.ControllerCfg)
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
if d.Get("started").(bool) {
stopReq := compute.StopRequest{
ComputeID: computeId,
Force: false,
}
if _, err := c.CloudBroker().Compute().Stop(ctx, stopReq); err != nil {
return err
}
}
resizeReq := compute.ResizeRequest{
ComputeID: computeId,
}
@@ -169,6 +179,12 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
}
}
if d.Get("started").(bool) {
if _, err := c.CloudBroker().Compute().Start(ctx, compute.StartRequest{ComputeID: computeId}); err != nil {
return err
}
}
return nil
}