AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Describes the specified EBS volumes or all of your EBS volumes.
If you are describing a long list of volumes, we recommend that you paginate the output to make the list more manageable. For more information, see Pagination.
For more information about EBS volumes, see Amazon EBS volumes in the Amazon EBS User Guide.
We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts.
The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.
For .NET Core this operation is only available in asynchronous form. Please refer to DescribeVolumesAsync.
Namespace: Amazon.EC2
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public virtual DescribeVolumesResponse DescribeVolumes( DescribeVolumesRequest request )
Container for the necessary parameters to execute the DescribeVolumes service method.
This example describes all of your volumes in the default region.
var client = new AmazonEC2Client(); var response = client.DescribeVolumes(new DescribeVolumesRequest { }); string nextToken = response.NextToken; List<Volume> volumes = response.Volumes;
This example describes all volumes that are both attached to the instance with the ID i-1234567890abcdef0 and set to delete when the instance terminates.
var client = new AmazonEC2Client(); var response = client.DescribeVolumes(new DescribeVolumesRequest { Filters = new List<Filter> { new Filter { Name = "attachment.instance-id", Values = new List<string> { "i-1234567890abcdef0" } }, new Filter { Name = "attachment.delete-on-termination", Values = new List<string> { "true" } } } }); List<Volume> volumes = response.Volumes;
.NET Framework:
Supported in: 4.5 and newer, 3.5