I am trying to get list of keys with some prefix in amazon s3 bucket. I followed the steps shown here But still i am get keys available in that bucket with that prefix. Below is the code i tried.
conn = boto.connect_s3(anon=True)
bucket = conn.get_bucket('aws-publicdatasets')
for each_rs in self.bucket.list(prefix="/project_prefix/prefx_key2/prefix_key3/"):
print each_rs.name
But the below code is working fine to retrieve all the keys in aws puvlic data sets
conn = boto.connect_s3(anon=True)
bucket = conn.get_bucket('aws-publicdatasets')
for each_rs in self.bucket.list():
print each_rs.name
I tried with get_all_keys(prefix="/project_prefix/prefx_key2/prefix_key3/") but still no luck. Is there any other way to get list of keys having given prefix?