1.1.0
This commit is contained in:
@@ -0,0 +1,253 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDisk() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
"disk_id": schema.Int64Attribute{
|
||||
Required: 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,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": 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,
|
||||
},
|
||||
"machine_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"machine_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"milestones": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
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_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"purge_time": 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,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
"reference_id": 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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskList() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
"by_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"account_name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"disk_max_size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"shared": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"type": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"sort_by": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"page": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"items": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"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,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_id": 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,
|
||||
},
|
||||
"machine_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"machine_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"milestones": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
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_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"purge_time": 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,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
"reference_id": 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskListDeleted() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
"by_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"account_name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"disk_max_size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"shared": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"type": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"sort_by": schema.StringAttribute{
|
||||
Optional: true,
|
||||
},
|
||||
"page": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
},
|
||||
"items": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"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,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_id": 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,
|
||||
},
|
||||
"machine_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"machine_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"milestones": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
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_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"purge_time": 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,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
"reference_id": 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskListTypes() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// optional attributes
|
||||
"sort_by": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page number",
|
||||
},
|
||||
"size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"items": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"entry_count": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskListTypesDetailed() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// optional attributes
|
||||
"sort_by": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page number",
|
||||
},
|
||||
"size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"items": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"pools": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"system": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"types": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskListUnattached() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// optional attributes
|
||||
"by_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Find by ID",
|
||||
},
|
||||
"account_name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "Find by account name",
|
||||
},
|
||||
"disk_max_size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Find by max disk size",
|
||||
},
|
||||
"status": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "Find by status",
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "ID of the account the disks belong to",
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "find by sep ID",
|
||||
},
|
||||
"pool_name": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "find by pool name",
|
||||
},
|
||||
"type": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "type of the disks",
|
||||
},
|
||||
"sort_by": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page number",
|
||||
},
|
||||
"size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"items": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"ckey": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"meta": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"account_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"acl": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"boot_partition": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
"disk_path": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_id": 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,
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
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_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"purge_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reality_device_number": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskReplication() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
"disk_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "Id of primary disk",
|
||||
},
|
||||
"status_replication": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: "Status of replication",
|
||||
},
|
||||
"account_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
Description: "The unique ID of the subscriber-owner of the disk",
|
||||
},
|
||||
"account_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: "The name of the subscriber '(account') to whom this disk belongs",
|
||||
},
|
||||
"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,
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": 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,
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
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_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"purge_time": 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,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskSnapshot() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// required attributes
|
||||
"disk_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "The unique ID of the subscriber-owner of the disk",
|
||||
},
|
||||
"label": schema.StringAttribute{
|
||||
Required: true,
|
||||
Description: "Name of the snapshot",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": 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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
)
|
||||
|
||||
func MakeSchemaDataSourceDiskSnapshotList() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// required attributes
|
||||
"disk_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "The unique ID of the subscriber-owner of the disk",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"items": schema.ListNestedAttribute{
|
||||
Computed: true,
|
||||
NestedObject: schema.NestedAttributeObject{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"guid": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"label": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reference_id": 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,303 @@
|
||||
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/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"
|
||||
)
|
||||
|
||||
func MakeSchemaResourceDisk() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// required attributes
|
||||
"account_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "ID of the account",
|
||||
},
|
||||
"disk_name": schema.StringAttribute{
|
||||
Required: true,
|
||||
Description: "Iname of disk",
|
||||
},
|
||||
"size_max": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "size in GB, default is 10",
|
||||
},
|
||||
"gid": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "ID of the grid (platform)",
|
||||
},
|
||||
"node_ids": schema.ListAttribute{
|
||||
ElementType: types.Int64Type,
|
||||
Optional: true,
|
||||
Description: "ID of the grid (platform)",
|
||||
},
|
||||
"ssd_size": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Description: "size in GB, default is 10",
|
||||
},
|
||||
// optional attributes
|
||||
"desc": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "description of disk",
|
||||
},
|
||||
"pool": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Pool for disk location",
|
||||
},
|
||||
"sep_id": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
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
|
||||
},
|
||||
Description: "(B;D;T) B=Boot;D=Data;T=Temp",
|
||||
// default is D
|
||||
},
|
||||
"detach": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Description: "Detaching the disk from compute",
|
||||
// default is false
|
||||
},
|
||||
"permanently": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Description: "Whether to completely delete the disk, works only with non attached disks",
|
||||
// default is false
|
||||
},
|
||||
"shareable": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "share disk",
|
||||
},
|
||||
"iotune": schema.SingleNestedAttribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"read_bytes_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Number of bytes to read per second",
|
||||
},
|
||||
"read_bytes_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum number of bytes to read",
|
||||
},
|
||||
"read_iops_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Number of io read operations per second",
|
||||
},
|
||||
"read_iops_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum number of io read operations",
|
||||
},
|
||||
"size_iops_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Size of io operations",
|
||||
},
|
||||
"total_bytes_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Total size bytes per second",
|
||||
},
|
||||
"total_bytes_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum total size of bytes per second",
|
||||
},
|
||||
"total_iops_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Total number of io operations per second",
|
||||
},
|
||||
"total_iops_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum total number of io operations per second",
|
||||
},
|
||||
"write_bytes_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Number of bytes to write per second",
|
||||
},
|
||||
"write_bytes_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum number of bytes to write per second",
|
||||
},
|
||||
"write_iops_sec": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Number of write operations per second",
|
||||
},
|
||||
"write_iops_sec_max": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Maximum number of write operations per second",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
PlanModifiers: []planmodifier.String{
|
||||
stringplanmodifier.UseStateForUnknown(),
|
||||
},
|
||||
},
|
||||
"disk_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,
|
||||
},
|
||||
"destruction_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"devicename": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"disk_path": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"guid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"image_id": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"images": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.StringType,
|
||||
},
|
||||
"last_updated": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: "Timestamp of the last Terraform update of the disk resource.",
|
||||
},
|
||||
"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,
|
||||
},
|
||||
"purge_attempts": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"present_to": schema.ListAttribute{
|
||||
Computed: true,
|
||||
ElementType: types.Int64Type,
|
||||
},
|
||||
"purge_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reality_device_number": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
"reference_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_name": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"role": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"sep_type": schema.StringAttribute{
|
||||
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,
|
||||
},
|
||||
"vmid": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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"
|
||||
)
|
||||
|
||||
func MakeSchemaResourceDiskSnapshot() map[string]schema.Attribute {
|
||||
return map[string]schema.Attribute{
|
||||
// required attributes
|
||||
"disk_id": schema.Int64Attribute{
|
||||
Required: true,
|
||||
Description: "The unique ID of the subscriber-owner of the disk",
|
||||
},
|
||||
"label": schema.StringAttribute{
|
||||
Required: true,
|
||||
Description: "Name of the snapshot",
|
||||
},
|
||||
|
||||
// optional attributes
|
||||
"rollback": schema.BoolAttribute{
|
||||
Optional: true,
|
||||
Description: "Needed in order to make a snapshot rollback",
|
||||
// default is false
|
||||
},
|
||||
"timestamp": schema.Int64Attribute{
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Description: "Snapshot time",
|
||||
},
|
||||
|
||||
// computed attributes
|
||||
"id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
PlanModifiers: []planmodifier.String{
|
||||
stringplanmodifier.UseStateForUnknown(),
|
||||
},
|
||||
// id is generated as "<disk_id>#<label>"
|
||||
},
|
||||
"last_updated": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: "Timestamp of the last Terraform update of the disk resource.",
|
||||
},
|
||||
"guid": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"res_id": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"snap_set_guid": schema.StringAttribute{
|
||||
Computed: true,
|
||||
},
|
||||
"snap_set_time": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user