Querying Details About All EVS Disks in the Recycle Bin
Function
This API is used to query details about all EVS disks in the recycle bin.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v3/{project_id}/recycle-bin-volumes/detail
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition The project ID. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | Definition The disk name. You can call the Querying Details About All EVS Disks API to obtain the disk name. Constraints It can contain a maximum of 64 characters. Range N/A Default Value N/A |
| status | No | String | Definition The disk status. For details, see "EVS Disk Status". Constraints N/A Range N/A Default Value N/A |
| limit | No | Integer | Definition The maximum number of query results that can be returned. Constraints N/A Range 1–1000 Default Value 1000 |
| availability_zone | No | String | Definition The AZ information. You can call the Querying All AZs API or refer to Regions and Endpoints to obtain the AZ information. Constraints N/A Range N/A Default Value N/A |
| service_type | No | String | Definition The service type. Constraints N/A Range Default Value N/A |
| offset | No | Integer | Definition The offset in the pagination query. Constraints N/A Range The value is an integer greater than 0 but less than the total number of disks. Default Value 0 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition The user token. You can obtain it by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Definition The total number of disks. Range N/A |
| volumes | Array of recycleBinVolume objects | Definition The disk list. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition The disk ID. Range N/A |
| name | String | Definition The disk name. Range N/A |
| description | String | Definition The disk description. Range N/A |
| status | String | Definition The disk status. For details, see EVS Disk Status. Range N/A |
| attachments | Array of Attachment objects | Definition The disk attachment information. Range N/A |
| multiattach | Boolean | Definition Whether the disk is shareable. Range |
| size | Integer | Definition The disk capacity, in GiB. Range N/A |
| metadata | Map<String,Object> | Definition The disk metadata information. Callers can add or remove the metadata information. Range The keys of this parameter used in EVS are described as follows:
|
| bootable | String | Definition Whether the disk is bootable. Range |
| tags | Map<String,String> | Definition The disk tags. A maximum of 10 tags can be added to a disk. A tag key must be unique. Deduplication will be performed for duplicate keys. So only one key among duplicate keys of a tag is valid. Tag key: A tag key can contain a maximum of 36 characters. It can contain letters, digits, underscores (_), hyphens (-), and Unicode characters (\u4E00-\u9FFF). Tag value: A tag value can contain a maximum of 43 characters and can be an empty string. It can contain letters, digits, underscores (_), periods (.), hyphens (-), and Unicode characters (\u4E00-\u9FFF). Range N/A |
| availability_zone | String | Definition The AZ to which the disk belongs. Range N/A |
| created_at | String | Definition The time when the disk was created. Range Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
| service_type | String | Definition The service to which the disk belongs. Range |
| updated_at | String | Definition The time when the disk information was updated. Range Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
| volume_type | String | Definition The disk type. Range The value can be SATA, SAS, GPSSD, SSD, ESSD, or GPSSD2. |
| enterprise_project_id | String | Definition The enterprise project ID. Range N/A |
| plan_delete_at | String | Definition The time when a deleted disk will be permanently removed from the recycle bin. Range Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
| pre_deleted_at | String | Definition The time when a disk was moved to the recycle bin. Range Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
| dedicated_storage_id | String | Definition The ID of the dedicated storage pool housing the disk. Range N/A |
| dedicated_storage_name | String | Definition The name of the dedicated storage pool housing the disk. Range N/A |
| volume_image_metadata | Map<String,Object> | Definition The metadata of the disk image. For details about the volume_image_metadata field, see Querying Image Details. Range N/A |
| wwn | String | Definition The disk's unique identifier. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| attached_at | String | Definition The time when the disk was attached. Range Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
| attachment_id | String | Definition The attachment ID. Range N/A |
| device | String | Definition The device name. Range N/A |
| host_name | String | Definition The name of the physical host housing the cloud server to which the disk is attached. Range N/A |
| id | String | Definition The ID of the attached disk. Range N/A |
| server_id | String | Definition The ID of the server to which the disk is attached. Range N/A |
| volume_id | String | Definition The disk ID. Range N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error | Error object | Definition The error code returned if an error occurs. For details about the error code, see Error Codes. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| code | String | Definition The error code returned if an error occurs. Range For details about the error code, see Error Codes. |
| message | String | Definition The error message returned if an error occurs. Range A character string that describes the error message. |
Example Requests
GET https://evs.cn-north-1.myhuaweicloud.com/v3/490e121341fc481d95f946ef844cb06a/recycle-bin-volumes/detail
Example Responses
Status code: 200
OK
{
"count" : 1,
"volumes" : [ {
"id" : "0482c74b-1f85-4bc9-868c-64caecc16b61",
"name" : "test",
"status" : "restorable",
"multiattach" : false,
"size" : 89,
"metadata" : { },
"bootable" : "false",
"tags" : { },
"availability_zone" : "az1.dc1",
"created_at" : "2018-12-11T07:25:15.531000",
"volume_type" : "SATA",
"volume_image_metadata" : { },
"updated_at" : "2019-01-12T18:01:50.851000",
"service_type" : "EVS",
"enterprise_project_id" : "0",
"plan_delete_at" : "2019-01-18T22:31:58.642000",
"pre_deleted_at" : "2019-01-11T22:31:58.642000"
} ]
} Status code: 400
Bad Request
{
"error" : {
"message" : "XXXX",
"code" : "XXX"
}
} SDK Sample Code
The SDK sample code is as follows.
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.evs.v2.region.EvsRegion; import com.huaweicloud.sdk.evs.v2.*; import com.huaweicloud.sdk.evs.v2.model.*; public class ListVolumesInRecycleSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); EvsClient client = EvsClient.newBuilder() .withCredential(auth) .withRegion(EvsRegion.valueOf("<YOUR REGION>")) .build(); ListVolumesInRecycleRequest request = new ListVolumesInRecycleRequest(); try { ListVolumesInRecycleResponse response = client.listVolumesInRecycle(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkevs.v2.region.evs_region import EvsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkevs.v2 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = EvsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EvsRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListVolumesInRecycleRequest() response = client.list_volumes_in_recycle(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" evs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := evs.NewEvsClient( evs.EvsClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListVolumesInRecycleRequest{} response, err := client.ListVolumesInRecycle(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
More
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot