Update SDK dependency (#177)
* Update dependencies * Update dependencies * Update dependencies * Update dependencies --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
506d1afdc2
commit
c7effac5c7
62 changed files with 382 additions and 382 deletions
|
|
@ -437,12 +437,12 @@ func (r *instanceResource) Update(ctx context.Context, req resource.UpdateReques
|
|||
return
|
||||
}
|
||||
// Update existing instance
|
||||
err = r.client.UpdateInstance(ctx, projectId, instanceId).UpdateInstancePayload(*payload).Execute()
|
||||
err = r.client.PartialUpdateInstance(ctx, projectId, instanceId).PartialUpdateInstancePayload(*payload).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
}
|
||||
waitResp, err := wait.UpdateInstanceWaitHandler(ctx, r.client, projectId, instanceId).WaitWithContext(ctx)
|
||||
waitResp, err := wait.PartialUpdateInstanceWaitHandler(ctx, r.client, projectId, instanceId).WaitWithContext(ctx)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating instance", fmt.Sprintf("Instance update waiting: %v", err))
|
||||
return
|
||||
|
|
@ -463,17 +463,17 @@ func (r *instanceResource) Update(ctx context.Context, req resource.UpdateReques
|
|||
tflog.Info(ctx, "PostgreSQL instance updated")
|
||||
}
|
||||
|
||||
func toUpdatePayload(model *Model, parameters *parametersModel, parametersPlugins *[]string) (*postgresql.UpdateInstancePayload, error) {
|
||||
func toUpdatePayload(model *Model, parameters *parametersModel, parametersPlugins *[]string) (*postgresql.PartialUpdateInstancePayload, error) {
|
||||
if model == nil {
|
||||
return nil, fmt.Errorf("nil model")
|
||||
}
|
||||
|
||||
if parameters == nil {
|
||||
return &postgresql.UpdateInstancePayload{
|
||||
return &postgresql.PartialUpdateInstancePayload{
|
||||
PlanId: conversion.StringValueToPointer(model.PlanId),
|
||||
}, nil
|
||||
}
|
||||
return &postgresql.UpdateInstancePayload{
|
||||
return &postgresql.PartialUpdateInstancePayload{
|
||||
Parameters: &postgresql.InstanceParameters{
|
||||
EnableMonitoring: conversion.BoolValueToPointer(parameters.EnableMonitoring),
|
||||
MetricsFrequency: conversion.Int64ValueToPointer(parameters.MetricsFrequency),
|
||||
|
|
@ -674,7 +674,7 @@ func mapParameters(params map[string]interface{}) (types.Object, error) {
|
|||
|
||||
func (r *instanceResource) loadPlanId(ctx context.Context, model *Model) error {
|
||||
projectId := model.ProjectId.ValueString()
|
||||
res, err := r.client.GetOfferings(ctx, projectId).Execute()
|
||||
res, err := r.client.ListOfferings(ctx, projectId).Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting PostgreSQL offerings: %w", err)
|
||||
}
|
||||
|
|
@ -712,7 +712,7 @@ func (r *instanceResource) loadPlanId(ctx context.Context, model *Model) error {
|
|||
func loadPlanNameAndVersion(ctx context.Context, client *postgresql.APIClient, model *Model) error {
|
||||
projectId := model.ProjectId.ValueString()
|
||||
planId := model.PlanId.ValueString()
|
||||
res, err := client.GetOfferings(ctx, projectId).Execute()
|
||||
res, err := client.ListOfferings(ctx, projectId).Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting PostgreSQL offerings: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue