1.2.0
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/diag"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
"github.com/hashicorp/terraform-plugin-log/tflog"
|
||||
decort "repository.basistech.ru/BASIS/decort-golang-sdk"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/lb"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudapi/lb/models"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/status"
|
||||
)
|
||||
|
||||
func CreateResourceLB(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) (uint64, diag.Diagnostics) {
|
||||
func CreateResourceLB(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) (uint64, diag.Diagnostics) {
|
||||
tflog.Info(ctx, fmt.Sprintf("Start create ResourceLB: name %s", plan.Name.ValueString()))
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -63,7 +63,7 @@ func CreateResourceLB(ctx context.Context, plan *models.ResourceLBModel, c *deco
|
||||
return lbId, nil
|
||||
}
|
||||
|
||||
func LBResourceCheckPresence(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) (*lb.RecordLB, diag.Diagnostics) {
|
||||
func LBResourceCheckPresence(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) (*lb.RecordLB, diag.Diagnostics) {
|
||||
tflog.Info(ctx, fmt.Sprintf("LBCheckPresence: Get info about LB with ID - %v", plan.ID.ValueString()))
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -83,7 +83,7 @@ func LBResourceCheckPresence(ctx context.Context, plan *models.ResourceLBModel,
|
||||
return lbItem, nil
|
||||
}
|
||||
|
||||
func LBEnableDisable(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBEnableDisable(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "EnableDisable lb with ID", map[string]any{"lb_id": plan.ID.ValueString()})
|
||||
diags := diag.Diagnostics{}
|
||||
lbId, err := strconv.ParseUint(plan.ID.ValueString(), 10, 64)
|
||||
@@ -109,7 +109,7 @@ func LBEnableDisable(ctx context.Context, plan *models.ResourceLBModel, c *decor
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBReadStatus(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBReadStatus(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Read status lb with ID", map[string]any{"lb_id": plan.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -167,7 +167,7 @@ func LBReadStatus(ctx context.Context, plan *models.ResourceLBModel, c *decort.D
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBRestore(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBRestore(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Restore lb with ID", map[string]any{"lb_id": plan.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -188,7 +188,7 @@ func LBRestore(ctx context.Context, plan *models.ResourceLBModel, c *decort.Deco
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBStartStop(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBStartStop(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "StartStop lb with ID", map[string]any{"lb_id": plan.ID.ValueString()})
|
||||
diags := diag.Diagnostics{}
|
||||
lbId, err := strconv.ParseUint(plan.ID.ValueString(), 10, 64)
|
||||
@@ -220,7 +220,7 @@ func LBStartStop(ctx context.Context, plan *models.ResourceLBModel, c *decort.De
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBUpdateHaMode(ctx context.Context, state *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBUpdateHaMode(ctx context.Context, state *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Update ha mode from lb with ID", map[string]any{"id": state.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -242,7 +242,7 @@ func LBUpdateHaMode(ctx context.Context, state *models.ResourceLBModel, c *decor
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBUpdateSysctlParams(ctx context.Context, plan *models.ResourceLBModel, state *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBUpdateSysctlParams(ctx context.Context, plan *models.ResourceLBModel, state *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Update sysctl parameters from LB with ID", map[string]any{"id": state.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -279,7 +279,7 @@ func LBUpdateSysctlParams(ctx context.Context, plan *models.ResourceLBModel, sta
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBUpdateDescription(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBUpdateDescription(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Update description from lb with ID", map[string]any{"id": plan.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -301,7 +301,7 @@ func LBUpdateDescription(ctx context.Context, plan *models.ResourceLBModel, c *d
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBRestart(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBRestart(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Restart lb with ID", map[string]any{"id": plan.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
@@ -332,7 +332,7 @@ func LBRestart(ctx context.Context, plan *models.ResourceLBModel, c *decort.Deco
|
||||
return diags
|
||||
}
|
||||
|
||||
func LBConfigReset(ctx context.Context, plan *models.ResourceLBModel, c *decort.DecortClient) diag.Diagnostics {
|
||||
func LBConfigReset(ctx context.Context, plan *models.ResourceLBModel, c *client.Client) diag.Diagnostics {
|
||||
tflog.Info(ctx, "Reset config from lb with ID", map[string]any{"id": plan.ID.ValueString()})
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
|
||||
Reference in New Issue
Block a user