This commit is contained in:
asteam
2024-12-04 13:18:58 +03:00
parent 003e4d656e
commit 76ea459b3d
417 changed files with 30051 additions and 975 deletions

View File

@@ -52,7 +52,6 @@ func DiskResource(ctx context.Context, plan *models.ResourceDiskModel, c *decort
Type: plan.Type,
Detach: plan.Detach,
Permanently: plan.Permanently,
Reason: plan.Reason,
Shareable: plan.Shareable,
Timeouts: plan.Timeouts,

View File

@@ -45,7 +45,6 @@ func DiskReplicationResource(ctx context.Context, state *models.ResourceRecordDi
Start: state.Start,
Detach: state.Detach,
Permanently: state.Permanently,
Reason: state.Reason,
Id: types.StringValue(strconv.Itoa(int(recordDisk.Replication.DiskID))),
ACL: types.StringValue(string(diskAcl)),
AccountID: types.Int64Value(int64(recordDisk.AccountID)),

View File

@@ -20,7 +20,6 @@ type ResourceDiskModel struct {
Type types.String `tfsdk:"type"`
Detach types.Bool `tfsdk:"detach"`
Permanently types.Bool `tfsdk:"permanently"`
Reason types.String `tfsdk:"reason"`
Shareable types.Bool `tfsdk:"shareable"`
IOTune types.Object `tfsdk:"iotune"`
Timeouts timeouts.Value `tfsdk:"timeouts"`

View File

@@ -17,7 +17,6 @@ type ResourceRecordDiskReplicationModel struct {
Start types.Bool `tfsdk:"start"`
Detach types.Bool `tfsdk:"detach"`
Permanently types.Bool `tfsdk:"permanently"`
Reason types.String `tfsdk:"reason"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields

View File

@@ -312,10 +312,6 @@ func (r *resourceDisk) Delete(ctx context.Context, req resource.DeleteRequest, r
Permanently: state.Permanently.ValueBool(), // default false
}
if !state.Reason.IsNull() {
delReq.Reason = state.Reason.ValueString()
}
tflog.Info(ctx, "Delete resourceDisk: before call CloudAPI().Disks().Delete", map[string]any{"req": delReq})
_, err := r.client.CloudAPI().Disks().Delete(ctx, delReq)
if err != nil {

View File

@@ -284,10 +284,6 @@ func (r *resourceDiskReplication) Delete(ctx context.Context, req resource.Delet
Permanently: state.Permanently.ValueBool(), // default false
}
if !state.Reason.IsNull() {
delReq.Reason = state.Reason.ValueString()
}
tflog.Info(ctx, "Delete resourceDiskReplication: before call CloudAPI().Disks().Delete", map[string]any{"req": delReq})
_, err := r.client.CloudAPI().Disks().Delete(ctx, delReq)
if err != nil {

View File

@@ -64,10 +64,6 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
Description: "Whether to completely delete the disk, works only with non attached disks",
// default is false
},
"reason": schema.StringAttribute{
Optional: true,
Description: "Reason for deletion",
},
"shareable": schema.BoolAttribute{
Optional: true,
Computed: true,

View File

@@ -39,9 +39,6 @@ func MakeSchemaResourceDiskReplication() map[string]schema.Attribute {
"permanently": schema.BoolAttribute{
Optional: true,
},
"reason": schema.StringAttribute{
Optional: true,
},
// computed attributes
"id": schema.StringAttribute{
Computed: true,

View File

@@ -193,7 +193,6 @@ func RestoreDisk(ctx context.Context, diskId uint64, c *decort.DecortClient) dia
restoreReq := disks.RestoreRequest{
DiskID: diskId,
Reason: "Terraform automatic restore",
}
tflog.Info(ctx, "RestoreDisk: before calling CloudAPI().Disks().Restore", map[string]any{"diskId": diskId, "req": restoreReq})