Forcing S3 API Calls

All of Boto’s S3 classes and functions are wrapped in MimicDB functions to provide access to the local data instead of the S3 API. This means that changes to buckets and keys on S3 (outside of MimicDB), won’t be reflected in MimicDB unless the API call is forced.

Forcing an S3 API call also stores the response in MimicDB, so the forced call only has to happen once to retrieve new changes.

In most cases, passing force=True to the function will cause the S3 API call to be executed.

Warning

Bucket.__iter__ can not have arguments passed to it, so it defaults to not calling the API.

The following functions can be forced:

S3Connection.get_bucket(bucket_name, validate=True, headers=None, force=None)

Return a bucket from MimicDB if it exists. Return a S3ResponseError if the bucket does not exist and validate is passed.

Parameters:force (boolean) – If true, API call is forced to S3
S3Connection.get_all_buckets(*args, **kwargs)

Return a list of buckets in MimicDB.

Parameters:force (boolean) – If true, API call is forced to S3
Bucket.get_key(*args, **kwargs)

Return the key from MimicDB.

Parameters:force (boolean) – If true, API call is forced to S3
Bucket.get_all_keys(*args, **kwargs)

Return a list of keys from MimicDB.

Parameters:force (boolean) – If true, API call is forced to S3
Bucket.list(*args, **kwargs)

Return an iterable of keys from MimicDB.

Parameters:force (boolean) – If true, API call is forced to S3