def describe_db_cluster_snapshots(opts={})
response = Excon::Response.new
snapshots = self.data[:cluster_snapshots].values
if opts[:identifier]
snapshots = snapshots.select { |snapshot| snapshot['DBClusterIdentifier'] == opts[:identifier] }
end
if opts[:snapshot_id]
snapshots = snapshots.select { |snapshot| snapshot['DBClusterSnapshotIdentifier'] == opts[:snapshot_id] }
raise Fog::AWS::RDS::NotFound.new("DBClusterSnapshot #{opts[:snapshot_id]} not found") if snapshots.empty?
end
snapshots.each do |snapshot|
case snapshot['Status']
when 'creating'
if Time.now - snapshot['SnapshotCreateTime'] > Fog::Mock.delay
snapshot['Status'] = 'available'
end
end
end
response.status = 200
response.body = {
'ResponseMetadata' => { "RequestId" => Fog::AWS::Mock.request_id },
'DescribeDBClusterSnapshotsResult' => { 'DBClusterSnapshots' => snapshots }
}
response
end