DescribeDBSnapshots() public method

Returns information about DB snapshots. This API action supports pagination.
/// DBSnapshotIdentifier does not refer to an existing DB snapshot. ///
public DescribeDBSnapshots ( ) : Amazon.RDS.Model.DescribeDBSnapshotsResponse
return Amazon.RDS.Model.DescribeDBSnapshotsResponse
Beispiel #1
0
        private static DBSnapshot getNewerSnapshot(string databaseNameOrigin, AmazonRDSClient rdsClient)
        {
            DescribeDBSnapshotsRequest describeSnapshotsRequest =
            new DescribeDBSnapshotsRequest()
            {
                DBInstanceIdentifier = databaseNameOrigin,
                SnapshotType = "automated"

            };
            DescribeDBSnapshotsResponse describeSnapshotsResponse =
                rdsClient.DescribeDBSnapshots(describeSnapshotsRequest);

            List<DBSnapshot> snapshots = describeSnapshotsResponse.DBSnapshots;

            IEnumerable<DBSnapshot> orderedSnapshots = snapshots.OrderByDescending(x => x.SnapshotCreateTime);

            DBSnapshot newerSnapshot = orderedSnapshots.First();
            return newerSnapshot;
        }