finding last snapshot using boto

Posted by shantanuo on Stack Overflow See other posts from Stack Overflow or by shantanuo
Published on 2013-10-15T11:22:25Z Indexed on 2013/10/18 3:54 UTC
Read the original article Hit count: 221

Filed under:
|

I have read the explanation about "describe_cluster_snapshots" from ...

http://docs.pythonboto.org/en/latest/ref/redshift.html#boto.redshift.layer1.RedshiftConnection.create_cluster

It has an option start_time and end_time but there is no way to sort it. How do I get the id of the latest snapshot using boto?

Here is what I have tried but it does not seem to return the last snapshot.

mysnap=conn.describe_cluster_snapshots()

mysnapidentifier=mysnap['DescribeClusterSnapshotsResponse']['DescribeClusterSnapshotsResult']['Snapshots'][-1]['SnapshotIdentifier'] 

© Stack Overflow or respective owner

Related posts about boto

Related posts about amazon-redshift