You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
4.3 KiB
116 lines
4.3 KiB
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"`
|
|
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,
|
|
}
|