1.1.0
This commit is contained in:
@@ -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,
|
||||
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user