The backend storage implementation for Simple Storage Service
provided by Amazon Web Services.
-
sqlalchemy_imageattach.stores.s3.BASE_URL_FORMAT = 'https://{0}.s3.amazonaws.com'
(str) The format string of base url of AWS S3.
Contains no trailing slash.
Default is 'https://{0}.s3.amazonaws.com'.
-
sqlalchemy_imageattach.stores.s3.DEFAULT_MAX_AGE = 31536000
(numbers.Integral) The default max-age seconds of
. It’s the default value of
S3Store.max_age attribute.
-
class sqlalchemy_imageattach.stores.s3.S3Request(url, bucket, access_key, secret_key, data=None, headers={}, method=None, content_type=None)
HTTP request for S3 REST API which does authentication.
-
class sqlalchemy_imageattach.stores.s3.S3SandboxStore(underlying, overriding, access_key=None, secret_key=None, max_age=31536000, underlying_prefix='', overriding_prefix='')
It stores images into physically two separated S3 buckets while
these look like logically exist in the same store. It takes two buckets
for read-only and overwrite: underlying and overriding.
It’s useful for development/testing purpose, because you can use
the production store in sandbox.
Parameters: |
- underlying (basestring) – the name of underlying bucket for read-only
- overriding (basestring) – the name of overriding bucket to record
overriding modifications
- max_age (numbers.Integral) – the max-age seconds of .
default is DEFAULT_MAX_AGE
- overriding_prefix (basestring) – means the same to S3Store.prefix but
it’s only applied for overriding
- underlying_prefix (basestring) – means the same to S3Store.prefix but
it’s only applied for underlying
|
-
DELETED_MARK_MIMETYPE = 'application/x-sqlalchemy-imageattach-sandbox-deleted'
All keys marked as “deleted” have this mimetype as
its header.
-
overriding = None
(S3Store) The overriding store to record overriding
modification.
-
underlying = None
(S3Store) The underlying store for read-only.
-
class sqlalchemy_imageattach.stores.s3.S3Store(bucket, access_key=None, secret_key=None, max_age=31536000, prefix='')
Image storage backend implementation using S3. It implements
Store interface.
Parameters: |
- bucket (basestring) – the buckect name
- max_age (numbers.Integral) – the max-age seconds of .
default is DEFAULT_MAX_AGE
- prefix (basestring) – the optional key prefix to logically separate stores
with the same bucket. not used by default
|
-
bucket = None
(basestring) The S3 bucket name.
-
max_age = None
(numbers.Integral) The max-age seconds of
.
-
prefix = None
(basestring) The optional key prefix to logically separate
stores with the same bucket.