AWS SDK Version 3 for .NET
API Reference

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.

Container for the parameters to the DescribeSnapshots operation. Describes the specified EBS snapshots available to you or all of the EBS snapshots available to you.

The snapshots available to you include public snapshots, private snapshots that you own, and private snapshots owned by other Amazon Web Services accounts for which you have explicit create volume permissions.

The create volume permissions fall into the following categories:

The list of snapshots returned can be filtered by specifying snapshot IDs, snapshot owners, or Amazon Web Services accounts with create volume permissions. If no options are specified, Amazon EC2 returns all snapshots for which you have create volume permissions.

If you specify one or more snapshot IDs, only snapshots that have the specified IDs are returned. If you specify an invalid snapshot ID, an error is returned. If you specify a snapshot ID for which you do not have access, it is not included in the returned results.

If you specify one or more snapshot owners using the OwnerIds option, only snapshots from the specified owners and for which you have access are returned. The results can include the Amazon Web Services account IDs of the specified owners, amazon for snapshots owned by Amazon, or self for snapshots that you own.

If you specify a list of restorable users, only snapshots with create snapshot permissions for those users are returned. You can specify Amazon Web Services account IDs (if you own the snapshots), self for snapshots for which you own or have explicit permissions, or all for public snapshots.

If you are describing a long list of snapshots, we recommend that you paginate the output to make the list more manageable. For more information, see Pagination.

To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores.

For more information about EBS snapshots, see Amazon EBS snapshots in the Amazon EBS User Guide.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.EC2.AmazonEC2Request
      Amazon.EC2.Model.DescribeSnapshotsRequest

Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public class DescribeSnapshotsRequest : AmazonEC2Request
         IAmazonWebServiceRequest

The DescribeSnapshotsRequest type exposes the following members

Constructors

NameDescription
Public Method DescribeSnapshotsRequest()

Properties

NameTypeDescription
Public Property Filters System.Collections.Generic.List<Amazon.EC2.Model.Filter>

Gets and sets the property Filters.

The filters.

  • description - A description of the snapshot.

  • encrypted - Indicates whether the snapshot is encrypted (true | false)

  • owner-alias - The owner alias, from an Amazon-maintained list (amazon). This is not the user-configured Amazon Web Services account alias set using the IAM console. We recommend that you use the related parameter instead of this filter.

  • owner-id - The Amazon Web Services account ID of the owner. We recommend that you use the related parameter instead of this filter.

  • progress - The progress of the snapshot, as a percentage (for example, 80%).

  • snapshot-id - The snapshot ID.

  • start-time - The time stamp when the snapshot was initiated.

  • status - The status of the snapshot (pending | completed | error).

  • storage-tier - The storage tier of the snapshot (archive | standard).

  • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

  • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • volume-id - The ID of the volume the snapshot is for.

  • volume-size - The size of the volume, in GiB.

Public Property MaxResults System.Int32

Gets and sets the property MaxResults.

The maximum number of snapshots to return for this request. This value can be between 5 and 1,000; if this value is larger than 1,000, only 1,000 results are returned. If this parameter is not used, then the request returns all snapshots. You cannot specify this parameter and the snapshot IDs parameter in the same request. For more information, see Pagination.

Public Property NextToken System.String

Gets and sets the property NextToken.

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Public Property OwnerIds System.Collections.Generic.List<System.String>

Gets and sets the property OwnerIds.

Scopes the results to snapshots with the specified owners. You can specify a combination of Amazon Web Services account IDs, self, and amazon.

Public Property RestorableByUserIds System.Collections.Generic.List<System.String>

Gets and sets the property RestorableByUserIds.

The IDs of the Amazon Web Services accounts that can create volumes from the snapshot.

Public Property SnapshotIds System.Collections.Generic.List<System.String>

Gets and sets the property SnapshotIds.

The snapshot IDs.

Default: Describes the snapshots for which you have create volume permissions.

Examples

This example describes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``.

To describe a snapshot


var client = new AmazonEC2Client();
var response = client.DescribeSnapshots(new DescribeSnapshotsRequest 
{
    SnapshotIds = new List<string> {
        "snap-1234567890abcdef0"
    }
});

string nextToken = response.NextToken;
List<Snapshot> snapshots = response.Snapshots;

            

This example describes all snapshots owned by the ID 012345678910 that are in the ``pending`` status.

To describe snapshots using filters


var client = new AmazonEC2Client();
var response = client.DescribeSnapshots(new DescribeSnapshotsRequest 
{
    Filters = new List<Filter> {
        new Filter {
            Name = "status",
            Values = new List<string> {
                "pending"
            }
        }
    },
    OwnerIds = new List<string> {
        "012345678910"
    }
});

string nextToken = response.NextToken;
List<Snapshot> snapshots = response.Snapshots;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5