1.3.0
This commit is contained in:
@@ -76,7 +76,7 @@ func DiskDataSource(ctx context.Context, state *models.DiskModel, c *client.Clie
|
||||
VMID: types.Int64Value(int64(recordDisk.VMID)),
|
||||
}
|
||||
|
||||
state.Images, diags = types.ListValueFrom(ctx, types.StringType, recordDisk.Images)
|
||||
state.Images, diags = types.ListValueFrom(ctx, types.Int64Type, recordDisk.Images)
|
||||
if diags != nil {
|
||||
tflog.Error(ctx, fmt.Sprint("flattens.DiskDataSource: cannot flatten recordDisk.Images to state.Images", diags))
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func DiskListDataSource(ctx context.Context, state *models.DisksModel, c *client
|
||||
VMID: types.Int64Value(int64(recordDisk.VMID)),
|
||||
}
|
||||
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.StringType, recordDisk.Images)
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.Int64Type, recordDisk.Images)
|
||||
if diags != nil {
|
||||
tflog.Error(ctx, fmt.Sprint("flattens.DiskListDataSource: cannot flatten recordDisk.Images to d.Images", diags))
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func DiskListDeletedDataSource(ctx context.Context, state *models.ListDisksModel
|
||||
VMID: types.Int64Value(int64(recordDisk.VMID)),
|
||||
}
|
||||
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.StringType, recordDisk.Images)
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.Int64Type, recordDisk.Images)
|
||||
if diags != nil {
|
||||
tflog.Error(ctx, fmt.Sprint("flattens.DiskListDeletedDataSource: cannot flatten recordDisk.Images to d.Images", diags))
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func DiskListUnattachedDataSource(ctx context.Context, state *models.DataSourceD
|
||||
VMID: types.Int64Value(int64(recordDisk.VMID)),
|
||||
}
|
||||
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.StringType, recordDisk.Images)
|
||||
d.Images, diags = types.ListValueFrom(ctx, types.Int64Type, recordDisk.Images)
|
||||
if diags != nil {
|
||||
tflog.Error(ctx, fmt.Sprint("flattens.DiskListUnattachedDataSource: cannot flatten recordDisk.Images to d.Images", diags))
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func DiskReplicationDataSource(ctx context.Context, state *models.RecordDiskMode
|
||||
GID: types.Int64Value(int64(recordDisk.GID)),
|
||||
GUID: types.Int64Value(int64(recordDisk.GUID)),
|
||||
ImageID: types.Int64Value(int64(recordDisk.ImageID)),
|
||||
Images: flattens.FlattenSimpleTypeToList(ctx, types.StringType, recordDisk.Images),
|
||||
Images: flattens.FlattenSimpleTypeToList(ctx, types.Int64Type, recordDisk.Images),
|
||||
Name: types.StringValue(recordDisk.Name),
|
||||
IQN: types.StringValue(recordDisk.IQN),
|
||||
Login: types.StringValue(recordDisk.Login),
|
||||
|
||||
@@ -86,7 +86,7 @@ func DiskResource(ctx context.Context, plan *models.ResourceDiskModel, c *client
|
||||
VMID: types.Int64Value(int64(recordDisk.VMID)),
|
||||
}
|
||||
|
||||
plan.Images, diags = types.ListValueFrom(ctx, types.StringType, recordDisk.Images)
|
||||
plan.Images, diags = types.ListValueFrom(ctx, types.Int64Type, recordDisk.Images)
|
||||
if diags != nil {
|
||||
tflog.Error(ctx, fmt.Sprint("flattens.DiskResource: cannot flatten recordDisk.Images to plan.Images", diags))
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func DiskReplicationResource(ctx context.Context, state *models.ResourceRecordDi
|
||||
GUID: types.Int64Value(int64(recordDisk.GUID)),
|
||||
GID: types.Int64Value(int64(recordDisk.GID)),
|
||||
ImageID: types.Int64Value(int64(recordDisk.ImageID)),
|
||||
Images: flattens.FlattenSimpleTypeToList(ctx, types.StringType, recordDisk.Images),
|
||||
Images: flattens.FlattenSimpleTypeToList(ctx, types.Int64Type, recordDisk.Images),
|
||||
IQN: types.StringValue(recordDisk.IQN),
|
||||
Login: types.StringValue(recordDisk.Login),
|
||||
Milestones: types.Int64Value(int64(recordDisk.Milestones)),
|
||||
|
||||
@@ -64,7 +64,7 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -98,7 +98,7 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -98,7 +98,7 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -109,7 +109,7 @@ func MakeSchemaDataSourceDiskListUnattached() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -71,7 +71,7 @@ func MakeSchemaDataSourceDiskReplication() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -204,7 +204,7 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"last_updated": schema.StringAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -107,7 +107,7 @@ func MakeSchemaResourceDiskReplication() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -45,14 +45,14 @@ func CreateRequestResourceDisk(ctx context.Context, plan *models.ResourceDiskMod
|
||||
AccountID: uint64(plan.AccountID.ValueInt64()),
|
||||
Name: plan.DiskName.ValueString(),
|
||||
Size: uint64(plan.SizeMax.ValueInt64()),
|
||||
GID: uint64(plan.GID.ValueInt64()),
|
||||
//GID: uint64(plan.GID.ValueInt64()),
|
||||
}
|
||||
|
||||
if plan.Type.IsUnknown() {
|
||||
createReq.Type = "D" // default value
|
||||
} else {
|
||||
createReq.Type = plan.Type.ValueString()
|
||||
}
|
||||
//if plan.Type.IsUnknown() {
|
||||
// createReq.Type = "D" // default value
|
||||
//} else {
|
||||
// createReq.Type = plan.Type.ValueString()
|
||||
//}
|
||||
if !plan.SEPID.IsUnknown() {
|
||||
createReq.SEPID = uint64(plan.SEPID.ValueInt64())
|
||||
}
|
||||
@@ -62,9 +62,9 @@ func CreateRequestResourceDisk(ctx context.Context, plan *models.ResourceDiskMod
|
||||
if !plan.Description.IsUnknown() {
|
||||
createReq.Description = plan.Description.ValueString()
|
||||
}
|
||||
if !plan.SSDSize.IsUnknown() {
|
||||
createReq.SSDSize = uint64(plan.SSDSize.ValueInt64())
|
||||
}
|
||||
//if !plan.SSDSize.IsUnknown() {
|
||||
// createReq.SSDSize = uint64(plan.SSDSize.ValueInt64())
|
||||
//}
|
||||
|
||||
return createReq
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user