Table Of Contents

Previous topic

Object

This Page

Misc

Exceptions

exception swift.common.exceptions.ChunkReadTimeout(seconds=None, exception=None)

Bases: eventlet.timeout.Timeout

exception swift.common.exceptions.ChunkWriteTimeout(seconds=None, exception=None)

Bases: eventlet.timeout.Timeout

exception swift.common.exceptions.ClientException(msg, http_scheme='', http_host='', http_port='', http_path='', http_query='', http_status=0, http_reason='', http_device='', http_response_content='')

Bases: exceptions.Exception

exception swift.common.exceptions.ConnectionTimeout(seconds=None, exception=None)

Bases: eventlet.timeout.Timeout

exception swift.common.exceptions.DiskFileCollision

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DiskFileDeleted(metadata=None)

Bases: swift.common.exceptions.DiskFileNotExist

exception swift.common.exceptions.DiskFileDeviceUnavailable

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DiskFileError

Bases: swift.common.exceptions.SwiftException

exception swift.common.exceptions.DiskFileExpired(metadata=None)

Bases: swift.common.exceptions.DiskFileDeleted

exception swift.common.exceptions.DiskFileNoSpace

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DiskFileNotExist

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DiskFileNotOpen

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DiskFileQuarantined

Bases: swift.common.exceptions.DiskFileError

exception swift.common.exceptions.DriveNotMounted

Bases: swift.common.exceptions.SwiftException

exception swift.common.exceptions.DuplicateDeviceError

Bases: swift.common.exceptions.RingBuilderError

exception swift.common.exceptions.EmptyRingError

Bases: swift.common.exceptions.RingBuilderError

exception swift.common.exceptions.ListingIterError

Bases: swift.common.exceptions.SwiftException

exception swift.common.exceptions.ListingIterNotAuthorized(aresp)

Bases: swift.common.exceptions.ListingIterError

exception swift.common.exceptions.ListingIterNotFound

Bases: swift.common.exceptions.ListingIterError

exception swift.common.exceptions.LockTimeout(seconds=None, msg=None)

Bases: swift.common.exceptions.MessageTimeout

exception swift.common.exceptions.MessageTimeout(seconds=None, msg=None)

Bases: eventlet.timeout.Timeout

exception swift.common.exceptions.PathNotDir

Bases: exceptions.OSError

exception swift.common.exceptions.ReplicationException

Bases: exceptions.Exception

exception swift.common.exceptions.ReplicationLockTimeout(seconds=None, msg=None)

Bases: swift.common.exceptions.LockTimeout

exception swift.common.exceptions.RingBuilderError

Bases: swift.common.exceptions.SwiftException

exception swift.common.exceptions.RingValidationError

Bases: swift.common.exceptions.RingBuilderError

exception swift.common.exceptions.SegmentError

Bases: swift.common.exceptions.SwiftException

exception swift.common.exceptions.SwiftException

Bases: exceptions.Exception

Constraints

Utils

Swob

TempAuth

KeystoneAuth

ACLs

WSGI

Direct Client

Internal Client

Buffered HTTP

Monkey Patch httplib.HTTPResponse to buffer reads of headers. This can improve performance when making large numbers of small HTTP requests. This module also provides helper functions to make HTTP connections using BufferedHTTPResponse.

Warning

If you use this, be sure that the libraries you are using do not access the socket directly (xmlrpclib, I’m looking at you :/), and instead make all calls through httplib.

class swift.common.bufferedhttp.BufferedHTTPConnection(host, port=None, strict=None, timeout=<object object at 0x7f3d741260c0>, source_address=None)

Bases: httplib.HTTPConnection

HTTPConnection class that uses BufferedHTTPResponse

response_class

alias of BufferedHTTPResponse

class swift.common.bufferedhttp.BufferedHTTPResponse(sock, debuglevel=0, strict=0, method=None)

Bases: httplib.HTTPResponse

HTTPResponse class that buffers reading of headers

nuke_from_orbit()

Terminate the socket with extreme prejudice.

Closes the underlying socket regardless of whether or not anyone else has references to it. Use this when you are certain that nobody else you care about has a reference to this socket.

swift.common.bufferedhttp.http_connect(ipaddr, port, device, partition, method, path, headers=None, query_string=None, ssl=False)

Helper function to create an HTTPConnection object. If ssl is set True, HTTPSConnection will be used. However, if ssl=False, BufferedHTTPConnection will be used, which is buffered for backend Swift services.

Parameters:
  • ipaddr – IPv4 address to connect to
  • port – port to connect to
  • device – device of the node to query
  • partition – partition on the device
  • method – HTTP method to request (‘GET’, ‘PUT’, ‘POST’, etc.)
  • path – request path
  • headers – dictionary of headers
  • query_string – request query string
  • ssl – set True if SSL should be used (default: False)
Returns:

HTTPConnection object

swift.common.bufferedhttp.http_connect_raw(ipaddr, port, method, path, headers=None, query_string=None, ssl=False)

Helper function to create an HTTPConnection object. If ssl is set True, HTTPSConnection will be used. However, if ssl=False, BufferedHTTPConnection will be used, which is buffered for backend Swift services.

Parameters:
  • ipaddr – IPv4 address to connect to
  • port – port to connect to
  • method – HTTP method to request (‘GET’, ‘PUT’, ‘POST’, etc.)
  • path – request path
  • headers – dictionary of headers
  • query_string – request query string
  • ssl – set True if SSL should be used (default: False)
Returns:

HTTPConnection object

Healthcheck

Recon

MemCacheD

Manager

Ratelimit

StaticWeb

TempURL

FormPost

Domain Remap

CNAME Lookup

Proxy Logging

Bulk Operations (Delete and Archive Auto Extraction)

Container Quotas

Account Quotas

Static Large Objects

List Endpoints

Container Sync Realms

Container Sync Middleware

Discoverability

Swift can optionally be configured to provide clients with an interface providing details about the installation. If configured, a GET request to /info will return configuration data in JSON format. An example response:

{"swift": {"version": "1.8.1"}, "staticweb": {}, "tempurl": {}}

This would signify to the client that swift version 1.8.1 is running and that staticweb and tempurl are available in this installation.

There may be administrator-only information available via /info. To retrieve it, one must use an HMAC-signed request, similar to TempURL. The signature may be produced like so:

swift-temp-url GET 3600 /info secret 2>/dev/null | sed s/temp_url/swiftinfo/g