This commit is contained in:
asteam
2024-07-25 14:33:38 +03:00
commit 6f40af6a5f
946 changed files with 98335 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskModel struct {
// request fields
DiskID types.Int64 `tfsdk:"disk_id"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
ACL types.String `tfsdk:"acl"`
AccountID types.Int64 `tfsdk:"account_id"`
AccountName types.String `tfsdk:"account_name"`
Computes types.List `tfsdk:"computes"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
DeviceName types.String `tfsdk:"devicename"`
Description types.String `tfsdk:"desc"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
GID types.Int64 `tfsdk:"gid"`
ImageID types.Int64 `tfsdk:"image_id"`
Images types.List `tfsdk:"images"`
IOTune types.Object `tfsdk:"iotune"`
Name types.String `tfsdk:"disk_name"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
Pool types.String `tfsdk:"pool"`
PresentTo types.List `tfsdk:"present_to"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepType types.String `tfsdk:"sep_type"`
SepID types.Int64 `tfsdk:"sep_id"`
Shareable types.Bool `tfsdk:"shareable"`
SizeMax types.Int64 `tfsdk:"size_max"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
TechStatus types.String `tfsdk:"tech_status"`
Type types.String `tfsdk:"type"`
VMID types.Int64 `tfsdk:"vmid"`
}

View File

@@ -0,0 +1,69 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskListModel struct {
// request fields
ByID types.Int64 `tfsdk:"by_id"`
Name types.String `tfsdk:"name"`
AccountName types.String `tfsdk:"account_name"`
DiskMaxSize types.Int64 `tfsdk:"disk_max_size"`
Status types.String `tfsdk:"status"`
Shared types.Bool `tfsdk:"shared"`
AccountID types.Int64 `tfsdk:"account_id"`
Type types.String `tfsdk:"type"`
SEPID types.Int64 `tfsdk:"sep_id"`
PoolName types.String `tfsdk:"pool_name"`
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Items []ItemDiskModel `tfsdk:"items"`
EntryCount types.Int64 `tfsdk:"entry_count"`
}
type ItemDiskModel struct {
AccountID types.Int64 `tfsdk:"account_id"`
AccountName types.String `tfsdk:"account_name"`
ACL types.String `tfsdk:"acl"`
Computes types.List `tfsdk:"computes"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
Description types.String `tfsdk:"desc"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
DeviceName types.String `tfsdk:"devicename"`
GID types.Int64 `tfsdk:"gid"`
ImageID types.Int64 `tfsdk:"image_id"`
Images types.List `tfsdk:"images"`
IOTune types.Object `tfsdk:"iotune"`
MachineID types.Int64 `tfsdk:"machine_id"`
MachineName types.String `tfsdk:"machine_name"`
DiskId types.Int64 `tfsdk:"disk_id"`
DiskName types.String `tfsdk:"disk_name"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
Pool types.String `tfsdk:"pool"`
PresentTo types.List `tfsdk:"present_to"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepID types.Int64 `tfsdk:"sep_id"`
SepType types.String `tfsdk:"sep_type"`
Shareable types.Bool `tfsdk:"shareable"`
SizeMax types.Int64 `tfsdk:"size_max"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
TechStatus types.String `tfsdk:"tech_status"`
Type types.String `tfsdk:"type"`
VMID types.Int64 `tfsdk:"vmid"`
}

View File

@@ -0,0 +1,26 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskListDeletedModel struct {
// request fields
ByID types.Int64 `tfsdk:"by_id"`
Name types.String `tfsdk:"name"`
AccountName types.String `tfsdk:"account_name"`
DiskMaxSize types.Int64 `tfsdk:"disk_max_size"`
Shared types.Bool `tfsdk:"shared"`
AccountID types.Int64 `tfsdk:"account_id"`
Type types.String `tfsdk:"type"`
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Items []ItemDiskModel `tfsdk:"items"`
EntryCount types.Int64 `tfsdk:"entry_count"`
}

View File

@@ -0,0 +1,19 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskListTypesModel struct {
// request fields - optional
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Types types.List `tfsdk:"types"`
EntryCount types.Int64 `tfsdk:"entry_count"`
}

View File

@@ -0,0 +1,31 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskListTypesDetailedModel struct {
// request fields - optional
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Items []ItemDiskTypeDetailedModel `tfsdk:"items"`
EntryCount types.Int64 `tfsdk:"entry_count"`
}
type ItemDiskTypeDetailedModel struct {
Pools []ItemPoolModel `tfsdk:"pools"`
SepID types.Int64 `tfsdk:"sep_id"`
SepName types.String `tfsdk:"sep_name"`
}
type ItemPoolModel struct {
Name types.String `tfsdk:"name"`
System types.String `tfsdk:"system"`
Types types.List `tfsdk:"types"`
}

View File

@@ -0,0 +1,73 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskListUnattachedModel struct {
// request fields
ByID types.Int64 `tfsdk:"by_id"`
AccountName types.String `tfsdk:"account_name"`
DiskMaxSize types.Int64 `tfsdk:"disk_max_size"`
Status types.String `tfsdk:"status"`
AccountID types.Int64 `tfsdk:"account_id"`
SepID types.Int64 `tfsdk:"sep_id"`
PoolName types.String `tfsdk:"pool_name"`
Type types.String `tfsdk:"type"`
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Items []ItemDiskUnattachedModel `tfsdk:"items"`
EntryCount types.Int64 `tfsdk:"entry_count"`
}
type ItemDiskUnattachedModel struct {
CKey types.String `tfsdk:"ckey"`
Meta types.List `tfsdk:"meta"`
AccountID types.Int64 `tfsdk:"account_id"`
AccountName types.String `tfsdk:"account_name"`
ACL types.String `tfsdk:"acl"`
BootPartition types.Int64 `tfsdk:"boot_partition"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
Description types.String `tfsdk:"desc"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
DiskPath types.String `tfsdk:"disk_path"`
GID types.Int64 `tfsdk:"gid"`
GUID types.Int64 `tfsdk:"guid"`
DiskId types.Int64 `tfsdk:"disk_id"`
ImageID types.Int64 `tfsdk:"image_id"`
Images types.List `tfsdk:"images"`
IOTune types.Object `tfsdk:"iotune"`
Iqn types.String `tfsdk:"iqn"`
Login types.String `tfsdk:"login"`
Milestones types.Int64 `tfsdk:"milestones"`
DiskName types.String `tfsdk:"disk_name"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
Passwd types.String `tfsdk:"passwd"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
Pool types.String `tfsdk:"pool"`
PurgeAttempts types.Int64 `tfsdk:"purge_attempts"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
RealityDeviceNumber types.Int64 `tfsdk:"reality_device_number"`
ReferenceID types.String `tfsdk:"reference_id"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepID types.Int64 `tfsdk:"sep_id"`
Shareable types.Bool `tfsdk:"shareable"`
SizeMax types.Int64 `tfsdk:"size_max"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
TechStatus types.String `tfsdk:"tech_status"`
Type types.String `tfsdk:"type"`
VMID types.Int64 `tfsdk:"vmid"`
}

View File

@@ -0,0 +1,86 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type RecordDiskModel struct {
// request fields - required
DiskId types.Int64 `tfsdk:"disk_id"`
ID types.Int64 `tfsdk:"replica_disk_id"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
ACL types.String `tfsdk:"acl"`
AccountID types.Int64 `tfsdk:"account_id"`
AccountName types.String `tfsdk:"account_name"`
Computes types.List `tfsdk:"computes"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
DeviceName types.String `tfsdk:"devicename"`
Description types.String `tfsdk:"desc"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
GID types.Int64 `tfsdk:"gid"`
ImageID types.Int64 `tfsdk:"image_id"`
Images types.List `tfsdk:"images"`
IOTune DiskReplicationIOTune `tfsdk:"iotune"`
Name types.String `tfsdk:"disk_name"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
Pool types.String `tfsdk:"pool"`
PresentTo types.List `tfsdk:"present_to"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
Replication *ItemReplicationModel `tfsdk:"replication"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepType types.String `tfsdk:"sep_type"`
SepID types.Int64 `tfsdk:"sep_id"`
Shareable types.Bool `tfsdk:"shareable"`
SizeMax types.Int64 `tfsdk:"size_max"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
StatusReplication types.String `tfsdk:"status_replication"`
TechStatus types.String `tfsdk:"tech_status"`
Type types.String `tfsdk:"type"`
VMID types.Int64 `tfsdk:"vmid"`
}
type DiskReplicationIOTune struct {
ReadBytesSec types.Int64 `tfsdk:"read_bytes_sec"`
ReadBytesSecMax types.Int64 `tfsdk:"read_bytes_sec_max"`
ReadIOPSSec types.Int64 `tfsdk:"read_iops_sec"`
ReadIOPSSecMax types.Int64 `tfsdk:"read_iops_sec_max"`
SizeIOPSSec types.Int64 `tfsdk:"size_iops_sec"`
TotalBytesSec types.Int64 `tfsdk:"total_bytes_sec"`
TotalBytesSecMax types.Int64 `tfsdk:"total_bytes_sec_max"`
TotalIOPSSec types.Int64 `tfsdk:"total_iops_sec"`
TotalIOPSSecMax types.Int64 `tfsdk:"total_iops_sec_max"`
WriteBytesSec types.Int64 `tfsdk:"write_bytes_sec"`
WriteBytesSecMax types.Int64 `tfsdk:"write_bytes_sec_max"`
WriteIOPSSec types.Int64 `tfsdk:"write_iops_sec"`
WriteIOPSSecMax types.Int64 `tfsdk:"write_iops_sec_max"`
}
type ItemReplicationModel struct {
DiskID types.Int64 `tfsdk:"disk_id"`
PoolID types.String `tfsdk:"pool_id"`
Role types.String `tfsdk:"role"`
SelfVolumeID types.String `tfsdk:"self_volume_id"`
StorageID types.String `tfsdk:"storage_id"`
VolumeID types.String `tfsdk:"volume_id"`
}
type DiskReplicationItemSnapshot struct {
GUID types.String `tfsdk:"guid"`
Label types.String `tfsdk:"label"`
ReferenceID types.String `tfsdk:"reference_id"`
ResID types.String `tfsdk:"res_id"`
SnapSetGUID types.String `tfsdk:"snap_set_guid"`
SnapSetTime types.Int64 `tfsdk:"snap_set_time"`
TimeStamp types.Int64 `tfsdk:"timestamp"`
}

View File

@@ -0,0 +1,21 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskSnapshotModel struct {
// request fields
DiskID types.Int64 `tfsdk:"disk_id"`
Label types.String `tfsdk:"label"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
GUID types.String `tfsdk:"guid"`
ResID types.String `tfsdk:"res_id"`
SnapSetGUID types.String `tfsdk:"snap_set_guid"`
SnapSetTime types.Int64 `tfsdk:"snap_set_time"`
TimeStamp types.Int64 `tfsdk:"timestamp"`
}

View File

@@ -0,0 +1,16 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type DataSourceDiskSnapshotListModel struct {
// request fields
DiskID types.Int64 `tfsdk:"disk_id"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
Items types.List `tfsdk:"items"`
}

View File

@@ -0,0 +1,116 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type ResourceDiskModel struct {
// request fields - required
AccountID types.Int64 `tfsdk:"account_id"`
DiskName types.String `tfsdk:"disk_name"`
SizeMax types.Int64 `tfsdk:"size_max"`
GID types.Int64 `tfsdk:"gid"`
// request fields - optional
Description types.String `tfsdk:"desc"`
Pool types.String `tfsdk:"pool"`
SEPID types.Int64 `tfsdk:"sep_id"`
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"`
// response fields
Id types.String `tfsdk:"id"`
LastUpdated types.String `tfsdk:"last_updated"`
ACL types.String `tfsdk:"acl"`
AccountName types.String `tfsdk:"account_name"`
Computes types.List `tfsdk:"computes"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
DeviceName types.String `tfsdk:"devicename"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
DiskId types.Int64 `tfsdk:"disk_id"`
ImageID types.Int64 `tfsdk:"image_id"`
Images types.List `tfsdk:"images"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
PresentTo types.List `tfsdk:"present_to"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepType types.String `tfsdk:"sep_type"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
TechStatus types.String `tfsdk:"tech_status"`
VMID types.Int64 `tfsdk:"vmid"`
}
type IOTuneModel struct {
ReadBytesSec types.Int64 `tfsdk:"read_bytes_sec"`
ReadBytesSecMax types.Int64 `tfsdk:"read_bytes_sec_max"`
ReadIOPSSec types.Int64 `tfsdk:"read_iops_sec"`
ReadIOPSSecMax types.Int64 `tfsdk:"read_iops_sec_max"`
SizeIOPSSec types.Int64 `tfsdk:"size_iops_sec"`
TotalBytesSec types.Int64 `tfsdk:"total_bytes_sec"`
TotalBytesSecMax types.Int64 `tfsdk:"total_bytes_sec_max"`
TotalIOPSSec types.Int64 `tfsdk:"total_iops_sec"`
TotalIOPSSecMax types.Int64 `tfsdk:"total_iops_sec_max"`
WriteBytesSec types.Int64 `tfsdk:"write_bytes_sec"`
WriteBytesSecMax types.Int64 `tfsdk:"write_bytes_sec_max"`
WriteIOPSSec types.Int64 `tfsdk:"write_iops_sec"`
WriteIOPSSecMax types.Int64 `tfsdk:"write_iops_sec_max"`
}
type ItemSnapshotModel struct {
GUID types.String `tfsdk:"guid"`
Label types.String `tfsdk:"label"`
ResID types.String `tfsdk:"res_id"`
SnapSetGUID types.String `tfsdk:"snap_set_guid"`
SnapSetTime types.Int64 `tfsdk:"snap_set_time"`
TimeStamp types.Int64 `tfsdk:"timestamp"`
}
type ItemComputeModel struct {
ComputeId types.String `tfsdk:"compute_id"`
ComputeName types.String `tfsdk:"compute_name"`
}
var ItemCompute = map[string]attr.Type{
"compute_id": types.StringType,
"compute_name": types.StringType,
}
var ItemSnapshot = map[string]attr.Type{
"guid": types.StringType,
"label": types.StringType,
"res_id": types.StringType,
"snap_set_guid": types.StringType,
"snap_set_time": types.Int64Type,
"timestamp": types.Int64Type,
}
var ItemIOTune = map[string]attr.Type{
"read_bytes_sec": types.Int64Type,
"read_bytes_sec_max": types.Int64Type,
"read_iops_sec": types.Int64Type,
"read_iops_sec_max": types.Int64Type,
"size_iops_sec": types.Int64Type,
"total_bytes_sec": types.Int64Type,
"total_bytes_sec_max": types.Int64Type,
"total_iops_sec": types.Int64Type,
"total_iops_sec_max": types.Int64Type,
"write_bytes_sec": types.Int64Type,
"write_bytes_sec_max": types.Int64Type,
"write_iops_sec": types.Int64Type,
"write_iops_sec_max": types.Int64Type,
}

View File

@@ -0,0 +1,110 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type ResourceRecordDiskReplicationModel struct {
// request fields
DiskId types.Int64 `tfsdk:"disk_id"`
Name types.String `tfsdk:"disk_name"`
SepID types.Int64 `tfsdk:"sep_id"`
PoolName types.String `tfsdk:"pool_name"`
Pause types.Bool `tfsdk:"pause"`
Reverse types.Bool `tfsdk:"reverse"`
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
Id types.String `tfsdk:"id"`
ACL types.String `tfsdk:"acl"`
AccountID types.Int64 `tfsdk:"account_id"`
AccountName types.String `tfsdk:"account_name"`
Computes types.List `tfsdk:"computes"`
CreatedTime types.Int64 `tfsdk:"created_time"`
DeletedTime types.Int64 `tfsdk:"deleted_time"`
DeviceName types.String `tfsdk:"devicename"`
Description types.String `tfsdk:"desc"`
DestructionTime types.Int64 `tfsdk:"destruction_time"`
GID types.Int64 `tfsdk:"gid"`
ImageID types.Int64 `tfsdk:"image_id"`
ReplicationId types.Int64 `tfsdk:"replica_disk_id"`
Images types.List `tfsdk:"images"`
IOTune types.Object `tfsdk:"iotune"`
Order types.Int64 `tfsdk:"order"`
Params types.String `tfsdk:"params"`
ParentID types.Int64 `tfsdk:"parent_id"`
PCISlot types.Int64 `tfsdk:"pci_slot"`
Pool types.String `tfsdk:"pool"`
PresentTo types.List `tfsdk:"present_to"`
PurgeTime types.Int64 `tfsdk:"purge_time"`
Replication types.Object `tfsdk:"replication"`
ResID types.String `tfsdk:"res_id"`
ResName types.String `tfsdk:"res_name"`
Role types.String `tfsdk:"role"`
SepType types.String `tfsdk:"sep_type"`
Shareable types.Bool `tfsdk:"shareable"`
SizeMax types.Int64 `tfsdk:"size_max"`
SizeUsed types.Float64 `tfsdk:"size_used"`
Snapshots types.List `tfsdk:"snapshots"`
Status types.String `tfsdk:"status"`
StatusReplication types.String `tfsdk:"status_replication"`
TechStatus types.String `tfsdk:"tech_status"`
Type types.String `tfsdk:"type"`
VMID types.Int64 `tfsdk:"vmid"`
}
type ResourceDiskReplicationIOTuneModel struct {
ReadBytesSec types.Int64 `tfsdk:"read_bytes_sec"`
ReadBytesSecMax types.Int64 `tfsdk:"read_bytes_sec_max"`
ReadIOPSSec types.Int64 `tfsdk:"read_iops_sec"`
ReadIOPSSecMax types.Int64 `tfsdk:"read_iops_sec_max"`
SizeIOPSSec types.Int64 `tfsdk:"size_iops_sec"`
TotalBytesSec types.Int64 `tfsdk:"total_bytes_sec"`
TotalBytesSecMax types.Int64 `tfsdk:"total_bytes_sec_max"`
TotalIOPSSec types.Int64 `tfsdk:"total_iops_sec"`
TotalIOPSSecMax types.Int64 `tfsdk:"total_iops_sec_max"`
WriteBytesSec types.Int64 `tfsdk:"write_bytes_sec"`
WriteBytesSecMax types.Int64 `tfsdk:"write_bytes_sec_max"`
WriteIOPSSec types.Int64 `tfsdk:"write_iops_sec"`
WriteIOPSSecMax types.Int64 `tfsdk:"write_iops_sec_max"`
}
var ResourceDiskReplicationIOTune = map[string]attr.Type{
"read_bytes_sec": types.Int64Type,
"read_bytes_sec_max": types.Int64Type,
"read_iops_sec": types.Int64Type,
"read_iops_sec_max": types.Int64Type,
"size_iops_sec": types.Int64Type,
"total_bytes_sec": types.Int64Type,
"total_bytes_sec_max": types.Int64Type,
"total_iops_sec": types.Int64Type,
"total_iops_sec_max": types.Int64Type,
"write_bytes_sec": types.Int64Type,
"write_bytes_sec_max": types.Int64Type,
"write_iops_sec": types.Int64Type,
"write_iops_sec_max": types.Int64Type,
}
type ResourceItemReplicationModel struct {
DiskID types.Int64 `tfsdk:"disk_id"`
PoolID types.String `tfsdk:"pool_id"`
Role types.String `tfsdk:"role"`
SelfVolumeID types.String `tfsdk:"self_volume_id"`
StorageID types.String `tfsdk:"storage_id"`
VolumeID types.String `tfsdk:"volume_id"`
}
var ResourceItemReplication = map[string]attr.Type{
"disk_id": types.Int64Type,
"pool_id": types.StringType,
"role": types.StringType,
"self_volume_id": types.StringType,
"storage_id:": types.StringType,
"volume_id": types.StringType,
}

View File

@@ -0,0 +1,25 @@
package models
import (
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework/types"
)
type ResourceDiskSnapshotModel struct {
// request fields - required
DiskID types.Int64 `tfsdk:"disk_id"`
Label types.String `tfsdk:"label"`
// request fields - optional
Rollback types.Bool `tfsdk:"rollback"`
TimeStamp types.Int64 `tfsdk:"timestamp"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
// response fields
Id types.String `tfsdk:"id"`
LastUpdated types.String `tfsdk:"last_updated"`
GUID types.String `tfsdk:"guid"`
ResID types.String `tfsdk:"res_id"`
SnapSetGUID types.String `tfsdk:"snap_set_guid"`
SnapSetTime types.Int64 `tfsdk:"snap_set_time"`
}