Static Web Middleware for OpenStack Swift
Version information (major, minor, revision).
Version string 'major.minor.revision'.
The swift3 middleware will emulate the S3 REST api on top of swift.
The following operations are currently supported:
- GET Service
- DELETE Bucket
- GET Bucket (List Objects)
- PUT Bucket
- DELETE Object
- Delete Multiple Objects
- GET Object
- HEAD Object
- PUT Object
- PUT Object (Copy)
To add this middleware to your configuration, add the swift3 middleware in front of the auth middleware, and before any other middleware that look at swift requests (like rate limiting).
To set up your client, the access key will be the concatenation of the account and user strings that should look like test:tester, and the secret access key is the account password. The host should also point to the swift storage hostname. It also will have to use the old style calling format, and not the hostname based container format.
An example client using the python boto library might look like the following for an SAIO setup:
from boto.s3.connection import S3Connection
connection = S3Connection(
aws_access_key_id='test:tester',
aws_secret_access_key='testing',
port=8080,
host='127.0.0.1',
is_secure=False,
calling_format=boto.s3.connection.OrdinaryCallingFormat())
Bases: swift.common.wsgi.WSGIContext
Handles bucket request.
Handle DELETE Bucket request
Handle GET Bucket (List Objects) request
Handle HEAD Bucket (Get Metadata) request
Handle POST Bucket (Delete/Upload Multiple Objects) request
Handle PUT Bucket request
Bases: swift.common.wsgi.WSGIContext
Handles requests on objects
Handle DELETE Object request
Handle GET Object request
Handle HEAD Object request
Handle PUT Object and PUT Object (Copy) request
Bases: swift.common.wsgi.WSGIContext
Handles account level requests.
Handle GET Service request
Bases: object
Swift3 S3 compatibility midleware
Canonicalize a request to a token that can be signed.
Standard filter factory to use the middleware with paste.deploy
Attempts to construct an S3 ACL based on what is found in the swift headers
Given an HTTP response code, create a properly formatted xml error response
| Parameters: | code – error code |
|---|---|
| Returns: | webob.response object |
Takes an S3 style ACL and returns a list of header/value pairs that implement that ACL in Swift, or “Unsupported” if there isn’t a way to do that yet.
Validates the name of the bucket against S3 criteria, http://docs.amazonwebservices.com/AmazonS3/latest/BucketRestrictions.html True if valid, False otherwise