1.3.0
This commit is contained in:
@@ -170,6 +170,9 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"boot_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"bootdisk_size": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -337,7 +340,7 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
"pool": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"present_to": schema.ListAttribute{
|
||||
"present_to": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
@@ -385,6 +388,9 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
"shareable": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"size_available": schema.Float64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"size_max": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -446,6 +452,9 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
"hp_backed": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"hot_resize": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"image_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -563,6 +572,9 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
},
|
||||
},
|
||||
"loader_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"lock_status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -581,6 +593,9 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
"name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"network_interface_naming": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"need_reboot": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -705,9 +720,69 @@ func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
|
||||
"user_managed": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"vgpus": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
"vgpus": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"mode": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"profile_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"ram": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"last_update_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"created_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"deleted_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"vmid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"pgpuid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"rg_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"last_claimed_by": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"pci_slot": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"bus_number": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"virtual_image_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
|
||||
@@ -176,6 +176,9 @@ func MakeSchemaDataSourceComputeList() map[string]schema.Attribute {
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"boot_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"bootdisk_size": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -247,6 +250,9 @@ func MakeSchemaDataSourceComputeList() map[string]schema.Attribute {
|
||||
"hp_backed": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"hot_resize": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"compute_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -364,6 +370,9 @@ func MakeSchemaDataSourceComputeList() map[string]schema.Attribute {
|
||||
"lock_status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"loader_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"manager_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -379,6 +388,9 @@ func MakeSchemaDataSourceComputeList() map[string]schema.Attribute {
|
||||
"name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"network_interface_naming": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"need_reboot": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
@@ -168,6 +168,9 @@ func MakeSchemaDataSourceComputeListDeleted() map[string]schema.Attribute {
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"boot_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"bootdisk_size": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -239,6 +242,9 @@ func MakeSchemaDataSourceComputeListDeleted() map[string]schema.Attribute {
|
||||
"hp_backed": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"hot_resize": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"compute_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -356,6 +362,9 @@ func MakeSchemaDataSourceComputeListDeleted() map[string]schema.Attribute {
|
||||
"lock_status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"loader_type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"manager_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -371,6 +380,9 @@ func MakeSchemaDataSourceComputeListDeleted() map[string]schema.Attribute {
|
||||
"name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"network_interface_naming": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"need_reboot": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
@@ -2,7 +2,6 @@ package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
|
||||
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
|
||||
"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"
|
||||
@@ -53,6 +52,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
// optional attributes
|
||||
"image_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "ID of the OS image to base this compute instance on.",
|
||||
},
|
||||
"without_boot_disk": schema.BoolAttribute{ //default false
|
||||
@@ -71,6 +71,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"affinity_rules": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"topology": schema.StringAttribute{
|
||||
@@ -107,6 +108,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"anti_affinity_rules": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"topology": schema.StringAttribute{
|
||||
@@ -146,10 +148,6 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
Computed: true,
|
||||
Description: "custom fields for Compute. Must be dict",
|
||||
},
|
||||
"stateless": schema.BoolAttribute{ //default false
|
||||
Optional: true,
|
||||
Description: "Compute will be stateless (SVA_KVM_X86) if set to True",
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
@@ -163,18 +161,12 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
"extra_disks": schema.SetAttribute{
|
||||
Optional: true,
|
||||
//Computed: true,
|
||||
Validators: []validator.Set{
|
||||
setvalidator.SizeAtMost(constants.MaxExtraDisksPerCompute),
|
||||
},
|
||||
ElementType: types.Int64Type,
|
||||
Description: "Optional list of IDs of extra disks to attach to this compute. You may specify several extra disks.",
|
||||
},
|
||||
"network": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Validators: []validator.Set{
|
||||
setvalidator.SizeBetween(1, constants.MaxNetworksPerCompute),
|
||||
},
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Optional network connection(s) for this compute. You may specify several network blocks, one for each connection.",
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
@@ -195,6 +187,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
Description: "Optional IP address to assign to this connection. This IP should belong to the selected network and free for use.",
|
||||
},
|
||||
"mac": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "MAC address associated with this connection. MAC address is assigned automatically.",
|
||||
},
|
||||
@@ -216,6 +209,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"tags": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"key": schema.StringAttribute{
|
||||
@@ -229,6 +223,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"port_forwarding": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"public_port_start": schema.Int64Attribute{
|
||||
@@ -252,6 +247,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"user_access": schema.SetNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"username": schema.StringAttribute{
|
||||
@@ -281,13 +277,9 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
},
|
||||
},
|
||||
"cd": schema.SingleNestedAttribute{
|
||||
"cd_image_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"cdrom_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
},
|
||||
},
|
||||
Computed: true,
|
||||
},
|
||||
"pin_to_stack": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
@@ -311,6 +303,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"pause": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
//Default: false,
|
||||
},
|
||||
"reset": schema.BoolAttribute{
|
||||
@@ -323,11 +316,6 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
Default: booldefault.StaticBool(true),
|
||||
//Default: true,
|
||||
},
|
||||
"auto_start": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
//Default: false,
|
||||
Description: "Flag for redeploy compute",
|
||||
},
|
||||
"force_stop": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
//Default: false,
|
||||
@@ -338,14 +326,6 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
//Default: false,
|
||||
Description: "Flag for resize compute",
|
||||
},
|
||||
"data_disks": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Validators: []validator.String{
|
||||
stringvalidator.OneOf("KEEP", "DETACH", "DESTROY"),
|
||||
},
|
||||
//Default: "DETACH",
|
||||
Description: "Flag for redeploy compute",
|
||||
},
|
||||
"started": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
@@ -372,6 +352,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"numa_affinity": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Validators: []validator.String{
|
||||
stringvalidator.OneOf("none", "strict", "loose"),
|
||||
},
|
||||
@@ -398,6 +379,7 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
},
|
||||
"pci_devices": schema.SetAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
Description: "ID of the connected pci devices",
|
||||
},
|
||||
@@ -415,6 +397,42 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
Description: "Flag for start compute after node exits from MAINTENANCE state",
|
||||
Default: booldefault.StaticBool(false),
|
||||
},
|
||||
"snapshot_delete_async": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Flag for deleting snapshots asynchronously",
|
||||
Default: booldefault.StaticBool(false),
|
||||
},
|
||||
"loader_type": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Type of VM",
|
||||
Validators: []validator.String{
|
||||
stringvalidator.OneOfCaseInsensitive("unknown", "linux", "windows"),
|
||||
},
|
||||
},
|
||||
|
||||
"boot_type": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Type of image upload",
|
||||
Validators: []validator.String{
|
||||
stringvalidator.OneOfCaseInsensitive("bios", "uefi"),
|
||||
},
|
||||
},
|
||||
"hot_resize": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Changing the size of a VM",
|
||||
},
|
||||
"network_interface_naming": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Name of the network interface",
|
||||
Validators: []validator.String{
|
||||
stringvalidator.OneOfCaseInsensitive("eth", "ens"),
|
||||
},
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"compute_id": schema.Int64Attribute{
|
||||
@@ -531,9 +549,6 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
"boot_disk_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"cd_image_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"clone_reference": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -804,9 +819,69 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
"user_managed": schema.BoolAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"vgpus": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
"vgpus": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"type": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"mode": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"profile_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"ram": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"last_update_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"created_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"deleted_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"vmid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"pgpuid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"rg_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"last_claimed_by": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"pci_slot": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"bus_number": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"virtual_image_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
@@ -822,9 +897,6 @@ func MakeSchemaResourceCompute() map[string]schema.Attribute {
|
||||
|
||||
func MakeSchemaResourceComputeDisks() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
"ckey": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"acl": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
@@ -866,7 +938,7 @@ func MakeSchemaResourceComputeDisks() map[string]schema.Attribute {
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Computed: true,
|
||||
@@ -942,7 +1014,7 @@ func MakeSchemaResourceComputeDisks() map[string]schema.Attribute {
|
||||
"pool": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"present_to": schema.ListAttribute{
|
||||
"present_to": schema.MapAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user