From ea1a6d27408fb7de37c8f306fd8822d5fd564472 Mon Sep 17 00:00:00 2001 From: MrWolong Date: Thu, 26 Dec 2024 15:22:01 +0800 Subject: [PATCH] data-source/alicloud_ecs_disks: Removed the default value of the field enable_auto_snapshot; Improved the document --- alicloud/data_source_alicloud_ecs_disks.go | 12 +- .../data_source_alicloud_ecs_disks_test.go | 115 +++++++-------- alicloud/provider.go | 4 +- website/docs/d/ecs_disks.html.markdown | 134 +++++++++++------- 4 files changed, 149 insertions(+), 116 deletions(-) diff --git a/alicloud/data_source_alicloud_ecs_disks.go b/alicloud/data_source_alicloud_ecs_disks.go index 403cac7d7b45..46e8d7374ba7 100644 --- a/alicloud/data_source_alicloud_ecs_disks.go +++ b/alicloud/data_source_alicloud_ecs_disks.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) -func dataSourceAlicloudEcsDisks() *schema.Resource { +func dataSourceAliCloudEcsDisks() *schema.Resource { return &schema.Resource{ - Read: dataSourceAlicloudEcsDisksRead, + Read: dataSourceAliCloudEcsDisksRead, Schema: map[string]*schema.Schema{ "additional_attributes": { Type: schema.TypeList, @@ -89,7 +89,6 @@ func dataSourceAlicloudEcsDisks() *schema.Resource { Type: schema.TypeBool, Optional: true, ForceNew: true, - Default: true, }, "enable_automated_snapshot_policy": { Type: schema.TypeBool, @@ -247,6 +246,10 @@ func dataSourceAlicloudEcsDisks() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "expiration_time": { + Type: schema.TypeString, + Computed: true, + }, "iops": { Type: schema.TypeInt, Computed: true, @@ -382,7 +385,7 @@ func dataSourceAlicloudEcsDisks() *schema.Resource { } } -func dataSourceAlicloudEcsDisksRead(d *schema.ResourceData, meta interface{}) error { +func dataSourceAliCloudEcsDisksRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*connectivity.AliyunClient) action := "DescribeDisks" @@ -580,6 +583,7 @@ func dataSourceAlicloudEcsDisksRead(d *schema.ResourceData, meta interface{}) er "enable_automated_snapshot_policy": object["EnableAutomatedSnapshotPolicy"], "encrypted": string(OnFlag), "expired_time": object["ExpiredTime"], + "expiration_time": object["ExpiredTime"], "iops": formatInt(object["IOPS"]), "iops_read": formatInt(object["IOPSRead"]), "iops_write": formatInt(object["IOPSWrite"]), diff --git a/alicloud/data_source_alicloud_ecs_disks_test.go b/alicloud/data_source_alicloud_ecs_disks_test.go index 06172c8ad32b..ccfa4d5328ab 100644 --- a/alicloud/data_source_alicloud_ecs_disks_test.go +++ b/alicloud/data_source_alicloud_ecs_disks_test.go @@ -8,101 +8,101 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" ) -func TestAccAlicloudECSDisksDataSource(t *testing.T) { +func TestAccAliCloudECSDisksDataSource(t *testing.T) { rand := acctest.RandInt() idsConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}_fake"]`, }), } ZoneIdConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "zone_id": `"${alicloud_ecs_disk.default.zone_id}"`, }), } categoryConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "category": `"cloud_efficiency"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "category": `"cloud"`, }), } deleteAutoSnapshotConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "delete_auto_snapshot": `"true"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "delete_auto_snapshot": `"false"`, }), } deleteWithInstanceConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "delete_with_instance": `"true"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "delete_with_instance": `"false"`, }), } diskNameConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "disk_name": `"${alicloud_ecs_disk.default.disk_name}"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "disk_name": `"${alicloud_ecs_disk.default.disk_name}_fake"`, }), } enableAutoSnapshotConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "enable_auto_snapshot": `"true"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "enable_auto_snapshot": `"false"`, }), } encryptedConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "encrypted": `"on"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "encrypted": `"off"`, }), } paymentTypeConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "payment_type": `"PayAsYouGo"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "payment_type": `"Subscription"`, }), } tagsConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "tags": `{ "Created" = "TF" "Environment" = "Acceptance-test" }`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "tags": `{ "Created" = "TF-fake" @@ -111,37 +111,37 @@ func TestAccAlicloudECSDisksDataSource(t *testing.T) { }), } nameRegexConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "name_regex": `"${alicloud_ecs_disk.default.disk_name}"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "name_regex": `"${alicloud_ecs_disk.default.disk_name}_fake"`, }), } statusConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "status": `"Available"`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "ids": `["${alicloud_ecs_disk.default.id}"]`, "status": `"Creating"`, }), } pagingConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "disk_name": `"${alicloud_ecs_disk.default.disk_name}"`, "page_number": `1`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "disk_name": `"${alicloud_ecs_disk.default.disk_name}"`, "page_number": `2`, }), } allConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "zone_id": `"${alicloud_ecs_disk.default.zone_id}"`, "category": `"cloud_efficiency"`, "delete_auto_snapshot": `"true"`, @@ -159,7 +159,7 @@ func TestAccAlicloudECSDisksDataSource(t *testing.T) { }`, "page_number": `1`, }), - fakeConfig: testAccCheckAlicloudEcsDisksDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudEcsDisksDataSourceName(rand, map[string]string{ "category": `"cloud"`, "delete_auto_snapshot": `"false"`, "delete_with_instance": `"false"`, @@ -177,7 +177,7 @@ func TestAccAlicloudECSDisksDataSource(t *testing.T) { "page_number": `2`, }), } - var existAlicloudEcsDisksDataSourceNameMapFunc = func(rand int) map[string]string { + var existAliCloudEcsDisksDataSourceNameMapFunc = func(rand int) map[string]string { return map[string]string{ "ids.#": "1", "names.#": "1", @@ -208,7 +208,7 @@ func TestAccAlicloudECSDisksDataSource(t *testing.T) { "disks.0.tags.Environment": "Acceptance-test", } } - var fakeAlicloudEcsDisksDataSourceNameMapFunc = func(rand int) map[string]string { + var fakeAliCloudEcsDisksDataSourceNameMapFunc = func(rand int) map[string]string { return map[string]string{ "ids.#": "0", "names.#": "0", @@ -217,44 +217,45 @@ func TestAccAlicloudECSDisksDataSource(t *testing.T) { } var alicloudEcsDisksCheckInfo = dataSourceAttr{ resourceId: "data.alicloud_ecs_disks.default", - existMapFunc: existAlicloudEcsDisksDataSourceNameMapFunc, - fakeMapFunc: fakeAlicloudEcsDisksDataSourceNameMapFunc, + existMapFunc: existAliCloudEcsDisksDataSourceNameMapFunc, + fakeMapFunc: fakeAliCloudEcsDisksDataSourceNameMapFunc, } alicloudEcsDisksCheckInfo.dataSourceTestCheck(t, rand, idsConf, ZoneIdConf, categoryConf, deleteAutoSnapshotConf, deleteWithInstanceConf, diskNameConf, enableAutoSnapshotConf, encryptedConf, paymentTypeConf, tagsConf, nameRegexConf, statusConf, pagingConf, allConf) } -func testAccCheckAlicloudEcsDisksDataSourceName(rand int, attrMap map[string]string) string { +func testAccCheckAliCloudEcsDisksDataSourceName(rand int, attrMap map[string]string) string { var pairs []string for k, v := range attrMap { pairs = append(pairs, k+" = "+v) } config := fmt.Sprintf(` + variable "name" { + default = "tf-testAccDisk-%d" + } -variable "name" { - default = "tf-testAccDisk-%d" -} -data "alicloud_zones" "default" { - available_resource_creation= "VSwitch" -} -resource "alicloud_ecs_disk" "default" { - zone_id = "${data.alicloud_zones.default.zones.0.id}" - category = "cloud_efficiency" - delete_auto_snapshot = "true" - delete_with_instance = "true" - description = "Test For Terraform" - disk_name = var.name - enable_auto_snapshot = "true" - encrypted = "true" - size = "500" - tags = { - Created = "TF" - Environment = "Acceptance-test" - } -} + data "alicloud_zones" "default" { + available_resource_creation = "VSwitch" + } -data "alicloud_ecs_disks" "default" { - %s -} + resource "alicloud_ecs_disk" "default" { + zone_id = data.alicloud_zones.default.zones.0.id + category = "cloud_efficiency" + delete_auto_snapshot = "true" + delete_with_instance = "true" + description = "Test For Terraform" + disk_name = var.name + enable_auto_snapshot = "true" + encrypted = "true" + size = "500" + tags = { + Created = "TF" + Environment = "Acceptance-test" + } + } + + data "alicloud_ecs_disks" "default" { + %s + } `, rand, strings.Join(pairs, " \n ")) return config } diff --git a/alicloud/provider.go b/alicloud/provider.go index dd93e535236f..c7fa85610ae8 100644 --- a/alicloud/provider.go +++ b/alicloud/provider.go @@ -186,7 +186,7 @@ func Provider() terraform.ResourceProvider { "alicloud_instance_type_families": dataSourceAlicloudInstanceTypeFamilies(), "alicloud_instance_types": dataSourceAlicloudInstanceTypes(), "alicloud_instances": dataSourceAlicloudInstances(), - "alicloud_disks": dataSourceAlicloudEcsDisks(), + "alicloud_disks": dataSourceAliCloudEcsDisks(), "alicloud_network_interfaces": dataSourceAlicloudEcsNetworkInterfaces(), "alicloud_snapshots": dataSourceAlicloudEcsSnapshots(), "alicloud_vpcs": dataSourceAlicloudVpcs(), @@ -487,7 +487,7 @@ func Provider() terraform.ResourceProvider { "alicloud_adb_db_clusters": dataSourceAlicloudAdbDbClusters(), "alicloud_vpc_flow_logs": dataSourceAlicloudVpcFlowLogs(), "alicloud_network_acls": dataSourceAlicloudNetworkAcls(), - "alicloud_ecs_disks": dataSourceAlicloudEcsDisks(), + "alicloud_ecs_disks": dataSourceAliCloudEcsDisks(), "alicloud_ddoscoo_domain_resources": dataSourceAlicloudDdoscooDomainResources(), "alicloud_ddoscoo_ports": dataSourceAlicloudDdoscooPorts(), "alicloud_slb_load_balancers": dataSourceAlicloudSlbLoadBalancers(), diff --git a/website/docs/d/ecs_disks.html.markdown b/website/docs/d/ecs_disks.html.markdown index 414578a21845..8e4639c6eecd 100644 --- a/website/docs/d/ecs_disks.html.markdown +++ b/website/docs/d/ecs_disks.html.markdown @@ -7,24 +7,38 @@ description: |- Provides a list of Ecs Disks to the user. --- -# alicloud\_ecs\_disks +# alicloud_ecs_disks This data source provides the Ecs Disks of the current Alibaba Cloud user. --> **NOTE:** Available in v1.122.0+. +-> **NOTE:** Available since v1.122.0. ## Example Usage Basic Usage ```terraform -data "alicloud_ecs_disks" "example" { - ids = ["d-artgdsvdvxxxx"] - name_regex = "tf-test" +data "alicloud_zones" "default" { + available_resource_creation = "VSwitch" } -output "first_ecs_disk_id" { - value = data.alicloud_ecs_disks.example.disks.0.id +resource "alicloud_ecs_disk" "default" { + zone_id = data.alicloud_zones.default.zones.0.id + disk_name = "terraform-example" + description = "terraform-example" + category = "cloud_efficiency" + size = "30" + tags = { + Name = "terraform-example" + } +} + +data "alicloud_ecs_disks" "ids" { + ids = [alicloud_ecs_disk.default.id] +} + +output "ecs_disk_id_0" { + value = data.alicloud_ecs_disks.ids.disks.0.id } ``` @@ -35,19 +49,19 @@ The following arguments are supported: * `additional_attributes` - (Optional, ForceNew) Other attribute values. Currently, only the incoming value of IOPS is supported, which means to query the IOPS upper limit of the current disk. * `auto_snapshot_policy_id` - (Optional, ForceNew) Query cloud disks based on the automatic snapshot policy ID. * `zone_id` - (Optional, ForceNew) ID of the free zone to which the disk belongs. -* `availability_zone` - (Optional, ForceNew, Deprecated in v1.122.0+) Field `availability_zone` has been deprecated from provider version 1.122.0. New field `zone_id` instead. +* `availability_zone` - (Optional, ForceNew, Deprecated since v1.122.0) Field `availability_zone` has been deprecated from provider version 1.122.0. New field `zone_id` instead. * `category` - (Optional, ForceNew) Disk category. Valid values: `cloud`, `cloud_efficiency`, `cloud_essd`, `cloud_ssd`, `ephemeral_ssd`, `cloud_auto`, `cloud_essd_entry`. * `delete_auto_snapshot` - (Optional, ForceNew) Indicates whether the automatic snapshot is deleted when the disk is released. * `delete_with_instance` - (Optional, ForceNew) Indicates whether the disk is released together with the instance. * `disk_name` - (Optional, ForceNew) The disk name. -* `disk_type` - (Optional, ForceNew) The disk type. +* `disk_type` - (Optional, ForceNew) The disk type. Valid values: `system`, `data`, `all`. * `dry_run` - (Optional, ForceNew) Specifies whether to check the validity of the request without actually making the request.request Default value: false. Valid values: - * `true`: The validity of the request is checked but the request is not made. Check items include the required parameters, request format, service limits, and available ECS resources. If the check fails, the corresponding error message is returned. If the check succeeds, the DryRunOperation error code is returned. - * `false`: The validity of the request is checked. If the check succeeds, a 2xx HTTP status code is returned and the request is made. + * `true`: The validity of the request is checked but the request is not made. Check items include the required parameters, request format, service limits, and available ECS resources. If the check fails, the corresponding error message is returned. If the check succeeds, the DryRunOperation error code is returned. + * `false`: The validity of the request is checked. If the check succeeds, a 2xx HTTP status code is returned and the request is made. * `enable_auto_snapshot` - (Optional, ForceNew) Indicates whether the automatic snapshot is deleted when the disk is released. * `enable_automated_snapshot_policy` - (Optional, ForceNew) Whether the cloud disk has an automatic snapshot policy * `enable_shared` - (Optional, ForceNew) Whether it is shared block storage. -* `encrypted` - (Optional, ForceNew) Indicate whether the disk is encrypted or not. Possible values: `on` and `off`. +* `encrypted` - (Optional, ForceNew) Indicate whether the disk is encrypted or not. Valid values: `on` and `off`. * `ids` - (Optional, ForceNew, Computed) A list of Disk IDs. * `instance_id` - (Optional, ForceNew) Filter the results by the specified ECS instance ID. * `kms_key_id` - (Optional, ForceNew) The kms key id. @@ -57,51 +71,65 @@ The following arguments are supported: * `portable` - (Optional, ForceNew) Whether the cloud disk or local disk supports uninstallation. * `resource_group_id` - (Optional, ForceNew) The Id of resource group which the disk belongs. * `snapshot_id` - (Optional, ForceNew) The source snapshot id. -* `status` - (Optional, ForceNew) The status of disk. -* `type` - (Optional, ForceNew, Deprecated in v1.122.0+) Field `type` has been deprecated from provider version 1.122.0. New field `disk_type` instead. +* `status` - (Optional, ForceNew) The status of disk. Valid Values: `Attaching`, `Available`, `Creating`, `Detaching`, `In_use`, `Migrating`, `ReIniting`, `Transferring`. +* `type` - (Optional, ForceNew, Deprecated since v1.122.0) Field `type` has been deprecated from provider version 1.122.0. New field `disk_type` instead. * `tags` - (Optional) A map of tags assigned to the disks. +* `operation_locks` - (Optional, ForceNew) The reasons why the disk was locked. See [`operation_locks`](#operation_locks) below for details. -## Argument Reference +### `operation_locks` + +The operation_locks supports the following: + +* `lock_reason` - (Optional, ForceNew) The reason why the disk was locked. + +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `names` - A list of Disk names. * `disks` - A list of Ecs Disks. Each element contains the following attributes: - * `id` - ID of the disk. - * `disk_id` - ID of the disk. - * `name` - Disk name. - * `description` - Disk description. - * `region_id` - Region ID the disk belongs to. - * `availability_zone` - Availability zone of the disk. - * `zone_id` - The zone id. - * `status` - Current status. - * `type` - Disk type. - * `category` - Disk category. - * `encrypted` - Indicate whether the disk is encrypted or not. - * `size` - Disk size in GiB. - * `image_id` - ID of the image from which the disk is created. It is null unless the disk is created using an image. - * `snapshot_id` - Snapshot used to create the disk. It is null if no snapshot is used to create the disk. - * `instance_id` - ID of the related instance. It is `null` unless the `status` is `In_use`. - * `creation_time` - Disk creation time. - * `attached_time` - Disk attachment time. - * `detached_time` - Disk detachment time. - * `expiration_time` - Disk expiration time. - * `tags` - A map of tags assigned to the disk. - * `resource_group_id` - The Id of resource group. - * `auto_snapshot_policy_id` - Query cloud disks based on the automatic snapshot policy ID. - * `delete_auto_snapshot` - Indicates whether the automatic snapshot is deleted when the disk is released. - * `delete_with_instance` - Indicates whether the disk is released together with the instance. - * `device` - Cloud disk or the device name of the mounted instance on the site. - * `disk_name` - The disk name. - * `enable_auto_snapshot` - Whether the disk implements an automatic snapshot policy. - * `enable_automated_snapshot_policy` - Whether the disk implements an automatic snapshot policy. - * `mount_instance_num` - Number of instances mounted on shared storage. - * `mount_instances` - Disk mount instances. - * `attached_time` - A mount of time. - * `device` - The mount point of the disk. - * `instance_id` - The instance ID of the disk mount. - * `payment_type` - Payment method for disk. - * `performance_level` - Performance levels of ESSD cloud disk. - * `portable` - Whether the disk is unmountable. - * `product_code` - The product logo of the cloud market. - + * `id` - ID of the disk. + * `disk_id` - ID of the disk. + * `name` - Disk name. + * `description` - Disk description. + * `region_id` - Region ID the disk belongs to. + * `availability_zone` - Availability zone of the disk. + * `zone_id` - The zone id. + * `status` - Current status. + * `type` - The type of the disk. + * `category` - Disk category. + * `encrypted` - Indicate whether the disk is encrypted or not. + * `size` - Disk size in GiB. + * `image_id` - ID of the image from which the disk is created. It is null unless the disk is created using an image. + * `snapshot_id` - Snapshot used to create the disk. It is null if no snapshot is used to create the disk. + * `instance_id` - ID of the related instance. It is `null` unless the `status` is `In_use`. + * `creation_time` - Disk creation time. + * `attached_time` - Disk attachment time. + * `detached_time` - Disk detachment time. + * `expiration_time` - The time when the subscription disk expires. + * `tags` - A map of tags assigned to the disk. + * `resource_group_id` - The Id of resource group. + * `auto_snapshot_policy_id` - Query cloud disks based on the automatic snapshot policy ID. + * `delete_auto_snapshot` - Indicates whether the automatic snapshot is deleted when the disk is released. + * `delete_with_instance` - Indicates whether the disk is released together with the instance. + * `device` - Cloud disk or the device name of the mounted instance on the site. + * `disk_name` - The disk name. + * `enable_auto_snapshot` - Whether the disk implements an automatic snapshot policy. + * `enable_automated_snapshot_policy` - Whether the disk implements an automatic snapshot policy. + * `payment_type` - Payment method for disk. + * `performance_level` - Performance levels of ESSD cloud disk. + * `portable` - Whether the disk is unmountable. + * `product_code` - The product logo of the cloud market. + * `expired_time` - The time when the subscription disk expires. + * `iops` - The maximum number of read and write operations per second. + * `iops_read` - The maximum number of read operations per second. + * `iops_write` - The maximum number of write operations per second. + * `kms_key_id` - The ID of the KMS key that is used for the cloud disk. + * `disk_type` - The type of the disk. + * `mount_instance_num` - Number of instances mounted on shared storage. + * `mount_instances` - Disk mount instances. + * `attached_time` - A mount of time. + * `device` - The mount point of the disk. + * `instance_id` - The instance ID of the disk mount. + * `operation_locks` - The reasons why the disk was locked. + * `lock_reason` - The reason why the disk was locked.