swiftwal

PostgreSQL binary backups, WAL archiving and PITR with Swift.

swiftwal.commands

Command line interface.

swiftwal.swiftconnection

Swift helpers.

class swiftwal.swiftconnection.SwiftConnection(args)[source]

A simple Swift interface providing just the functionality we need.

Object names beginning with ‘...’ are reserved for internal use.

chunk_size = 65536

Chunk size used for all operations that support it.

container = None

Container used for all operations, automatically created.

delete(name)[source]

Delete an object.

exists(name)[source]

True if the object exists.

gc(timeout=datetime.timedelta(0, 3600))[source]

Delete failed multipart uploads and partial multipart removals.

If a large object upload or deletion is interrupted, segments will be left in Swift that we are required to clean up.

An upload is deemed failed if there have been no segments created over the timeout interval.

get(name)[source]

Return a generator yielding the content of the object.

list(prefix=None)[source]

Full list of objects.

Returns a sequence of `SwiftObject`s. dictionaries, each containing metadata for a single object.

put(name, stream, content_type, large=False)[source]

Create an object.

Overwrites any existing object with the same name.

Set large to True to upload files larger than 5GB.

reset()[source]

Reset the connection.

size(name)[source]

Size of an object.

The standard ‘bytes’ item in an object’s metadata is not useful for large objects (which gives the size of the manifest object - 0).

Table Of Contents

Previous topic

License

This Page