This commit is contained in:
asteam
2025-07-01 13:44:09 +03:00
parent 5382579a5f
commit ddbb12996d
1041 changed files with 2842 additions and 96448 deletions

View File

@@ -38,9 +38,15 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
},
},
},
"created_by": schema.StringAttribute{
Computed: true,
},
"created_time": schema.Int64Attribute{
Computed: true,
},
"deleted_by": schema.StringAttribute{
Computed: true,
},
"deleted_time": schema.Int64Attribute{
Computed: true,
},
@@ -61,7 +67,7 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"iotune": schema.SingleNestedAttribute{
Computed: true,
@@ -110,6 +116,15 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
"disk_name": schema.StringAttribute{
Computed: true,
},
"machine_id": schema.Int64Attribute{
Computed: true,
},
"machine_name": schema.StringAttribute{
Computed: true,
},
"milestones": schema.Int64Attribute{
Computed: true,
},
"order": schema.Int64Attribute{
Computed: true,
},
@@ -125,7 +140,7 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
"pool": schema.StringAttribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},
@@ -150,6 +165,9 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
"shareable": schema.BoolAttribute{
Computed: true,
},
"size_available": schema.Float64Attribute{
Computed: true,
},
"size_max": schema.Int64Attribute{
Computed: true,
},
@@ -190,6 +208,12 @@ func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
"type": schema.StringAttribute{
Computed: true,
},
"updated_by": schema.StringAttribute{
Computed: true,
},
"updated_time": schema.Int64Attribute{
Computed: true,
},
"vmid": schema.Int64Attribute{
Computed: true,
},

View File

@@ -91,9 +91,15 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
},
},
},
"created_by": schema.StringAttribute{
Computed: true,
},
"created_time": schema.Int64Attribute{
Computed: true,
},
"deleted_by": schema.StringAttribute{
Computed: true,
},
"deleted_time": schema.Int64Attribute{
Computed: true,
},
@@ -117,7 +123,7 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"iotune": schema.SingleNestedAttribute{
Computed: true,
@@ -169,6 +175,9 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
"machine_name": schema.StringAttribute{
Computed: true,
},
"milestones": schema.Int64Attribute{
Computed: true,
},
"disk_name": schema.StringAttribute{
Computed: true,
},
@@ -187,7 +196,7 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
"pool": schema.StringAttribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},
@@ -212,6 +221,9 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
"shareable": schema.BoolAttribute{
Computed: true,
},
"size_available": schema.Float64Attribute{
Computed: true,
},
"size_max": schema.Int64Attribute{
Computed: true,
},
@@ -252,6 +264,12 @@ func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
"type": schema.StringAttribute{
Computed: true,
},
"updated_by": schema.StringAttribute{
Computed: true,
},
"updated_time": schema.Int64Attribute{
Computed: true,
},
"vmid": schema.Int64Attribute{
Computed: true,
},

View File

@@ -79,9 +79,15 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
},
},
},
"created_by": schema.StringAttribute{
Computed: true,
},
"created_time": schema.Int64Attribute{
Computed: true,
},
"deleted_by": schema.StringAttribute{
Computed: true,
},
"deleted_time": schema.Int64Attribute{
Computed: true,
},
@@ -105,7 +111,7 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"iotune": schema.SingleNestedAttribute{
Computed: true,
@@ -157,6 +163,9 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
"machine_name": schema.StringAttribute{
Computed: true,
},
"milestones": schema.Int64Attribute{
Computed: true,
},
"disk_name": schema.StringAttribute{
Computed: true,
},
@@ -175,7 +184,7 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
"pool": schema.StringAttribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},
@@ -200,6 +209,9 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
"shareable": schema.BoolAttribute{
Computed: true,
},
"size_available": schema.Float64Attribute{
Computed: true,
},
"size_max": schema.Int64Attribute{
Computed: true,
},
@@ -240,6 +252,12 @@ func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
"type": schema.StringAttribute{
Computed: true,
},
"updated_by": schema.StringAttribute{
Computed: true,
},
"updated_time": schema.Int64Attribute{
Computed: true,
},
"vmid": schema.Int64Attribute{
Computed: true,
},

View File

@@ -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,

View File

@@ -66,7 +66,7 @@ func MakeSchemaDataSourceDiskReplication() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"iotune": schema.SingleNestedAttribute{
Computed: true,
@@ -130,7 +130,7 @@ func MakeSchemaDataSourceDiskReplication() map[string]schema.Attribute {
"pool": schema.StringAttribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},

View File

@@ -1,11 +1,10 @@
package schemas
import (
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
)
@@ -24,10 +23,6 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
Required: true,
Description: "size in GB, default is 10",
},
"gid": schema.Int64Attribute{
Required: true,
Description: "ID of the grid (platform)",
},
// optional attributes
"desc": schema.StringAttribute{
@@ -46,23 +41,21 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
Description: "Storage endpoint provider ID to create disk",
},
"type": schema.StringAttribute{
Optional: true,
Computed: true,
Validators: []validator.String{
stringvalidator.OneOf("B", "D", "T"), // case is not ignored
},
Computed: true,
Description: "(B;D;T) B=Boot;D=Data;T=Temp",
// default is D
},
"detach": schema.BoolAttribute{
Optional: true,
Computed: true,
Description: "Detaching the disk from compute",
// default is false
Default: booldefault.StaticBool(true),
},
"permanently": schema.BoolAttribute{
Optional: true,
Computed: true,
Description: "Whether to completely delete the disk, works only with non attached disks",
// default is false
Default: booldefault.StaticBool(true),
},
"shareable": schema.BoolAttribute{
Optional: true,
@@ -170,9 +163,15 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
},
},
},
"created_by": schema.StringAttribute{
Computed: true,
},
"created_time": schema.Int64Attribute{
Computed: true,
},
"deleted_by": schema.StringAttribute{
Computed: true,
},
"deleted_time": schema.Int64Attribute{
Computed: true,
},
@@ -187,12 +186,22 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"gid": schema.Int64Attribute{
Computed: true,
Description: "ID of the grid (platform)",
},
"last_updated": schema.StringAttribute{
Computed: true,
Description: "Timestamp of the last Terraform update of the disk resource.",
},
"machine_id": schema.Int64Attribute{
Computed: true,
},
"machine_name": schema.StringAttribute{
Computed: true,
},
"order": schema.Int64Attribute{
Computed: true,
},
@@ -205,7 +214,7 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
"pci_slot": schema.Int64Attribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},
@@ -258,6 +267,12 @@ func MakeSchemaResourceDisk() map[string]schema.Attribute {
"tech_status": schema.StringAttribute{
Computed: true,
},
"updated_by": schema.StringAttribute{
Computed: true,
},
"updated_time": schema.Int64Attribute{
Computed: true,
},
"vmid": schema.Int64Attribute{
Computed: true,
},

View File

@@ -97,7 +97,7 @@ func MakeSchemaResourceDiskReplication() map[string]schema.Attribute {
},
"images": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
ElementType: types.Int64Type,
},
"iotune": schema.SingleNestedAttribute{
Computed: true,
@@ -158,7 +158,7 @@ func MakeSchemaResourceDiskReplication() map[string]schema.Attribute {
"pool": schema.StringAttribute{
Computed: true,
},
"present_to": schema.ListAttribute{
"present_to": schema.MapAttribute{
Computed: true,
ElementType: types.Int64Type,
},