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.
282 lines
6.2 KiB
282 lines
6.2 KiB
package schemas
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
|
|
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
|
|
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
|
|
"github.com/hashicorp/terraform-plugin-framework/types"
|
|
)
|
|
|
|
func MakeSchemaResourceDiskReplication() map[string]schema.Attribute {
|
|
// required attributes
|
|
return map[string]schema.Attribute{
|
|
"disk_id": schema.Int64Attribute{
|
|
Required: true,
|
|
},
|
|
"disk_name": schema.StringAttribute{
|
|
Required: true,
|
|
},
|
|
"sep_id": schema.Int64Attribute{
|
|
Required: true,
|
|
},
|
|
"pool_name": schema.StringAttribute{
|
|
Required: true,
|
|
},
|
|
|
|
// optional attributes
|
|
"pause": schema.BoolAttribute{
|
|
Optional: true,
|
|
},
|
|
"reverse": schema.BoolAttribute{
|
|
Optional: true,
|
|
},
|
|
"start": schema.BoolAttribute{
|
|
Optional: true,
|
|
},
|
|
"detach": schema.BoolAttribute{
|
|
Optional: true,
|
|
},
|
|
"permanently": schema.BoolAttribute{
|
|
Optional: true,
|
|
},
|
|
|
|
// computed attributes
|
|
"id": schema.StringAttribute{
|
|
Computed: true,
|
|
PlanModifiers: []planmodifier.String{
|
|
stringplanmodifier.UseStateForUnknown(),
|
|
},
|
|
},
|
|
"replica_disk_id": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"status_replication": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"account_id": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"account_name": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"acl": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"boot_partition": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"computes": schema.ListNestedAttribute{
|
|
Computed: true,
|
|
NestedObject: schema.NestedAttributeObject{
|
|
Attributes: map[string]schema.Attribute{
|
|
"compute_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"compute_name": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"created_time": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"deleted_time": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"desc": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"destruction_time": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"devicename": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"disk_path": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"guid": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"gid": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"image_id": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"images": schema.ListAttribute{
|
|
Computed: true,
|
|
ElementType: types.StringType,
|
|
},
|
|
"iotune": schema.SingleNestedAttribute{
|
|
Computed: true,
|
|
Attributes: map[string]schema.Attribute{
|
|
"read_bytes_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"read_bytes_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"read_iops_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"read_iops_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"size_iops_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"total_bytes_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"total_bytes_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"total_iops_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"total_iops_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"write_bytes_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"write_bytes_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"write_iops_sec": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"write_iops_sec_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
"iqn": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"login": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"milestones": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"order": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"params": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"parent_id": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"passwd": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"pci_slot": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"pool": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"present_to": schema.ListAttribute{
|
|
Computed: true,
|
|
ElementType: types.Int64Type,
|
|
},
|
|
"purge_time": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"purge_attempts": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"replication": schema.SingleNestedAttribute{
|
|
Computed: true,
|
|
Attributes: map[string]schema.Attribute{
|
|
"disk_id": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"pool_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"role": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"self_volume_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"storage_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"volume_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
"reality_device_number": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"res_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"reference_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"res_name": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"role": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"sep_type": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"shareable": schema.BoolAttribute{
|
|
Computed: true,
|
|
},
|
|
"size_max": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"size_used": schema.Float64Attribute{
|
|
Computed: true,
|
|
},
|
|
"snapshots": schema.ListNestedAttribute{
|
|
Computed: true,
|
|
NestedObject: schema.NestedAttributeObject{
|
|
Attributes: map[string]schema.Attribute{
|
|
"guid": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"label": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"res_id": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"snap_set_guid": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"snap_set_time": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
"timestamp": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"status": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"tech_status": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"type": schema.StringAttribute{
|
|
Computed: true,
|
|
},
|
|
"vmid": schema.Int64Attribute{
|
|
Computed: true,
|
|
},
|
|
}
|
|
}
|