def direct_get_account(node, part, account, marker=None, limit=None, prefix=None, delimiter=None, conn_timeout=5, response_timeout=15):
 path = ('/' + account)
 qs = 'format=json'
 if marker:
  qs += ('&marker=%s' % quote(marker))
 if limit:
  qs += ('&limit=%d' % limit)
 if prefix:
  qs += ('&prefix=%s' % quote(prefix))
 if delimiter:
  qs += ('&delimiter=%s' % quote(delimiter))
 with Timeout(conn_timeout):
  conn = http_connect(node['ip'], node['port'], node['device'], part, 'GET', path, query_string=qs)
 with Timeout(response_timeout):
  resp = conn.getresponse()
 if (not is_success(resp.status)):
  resp.read()
  raise ClientException(('Account server %s:%s direct GET %s gave status %s' % (node['ip'], node['port'], repr(('/%s/%s%s' % (node['device'], part, path))), resp.status)), http_host=node['ip'], http_port=node['port'], http_device=node['device'], http_status=resp.status, http_reason=resp.reason)
 resp_headers = {}
 for (header, value) in resp.getheaders():
  resp_headers[header.lower()] = value
 if (resp.status == HTTP_NO_CONTENT):
  resp.read()
  return (resp_headers, [])
 return (resp_headers, json_loads(resp.read()))

def direct_get_account ( node , part , account , marker = None , limit = None , prefix = None , delimiter = None , conn_timeout = 5 , response_timeout = 15 ) : path = ( '/' + account ) qs = 'format=json' if marker : qs += ( '&marker=%s' % quote ( marker ) ) if limit : qs += ( '&limit=%d' % limit ) if prefix : qs += ( '&prefix=%s' % quote ( prefix ) ) if delimiter : qs += ( '&delimiter=%s' % quote ( delimiter ) ) with Timeout ( conn_timeout ) : conn = http_connect ( node [ 'ip' ] , node [ 'port' ] , node [ 'device' ] , part , 'GET' , path , query_string = qs ) with Timeout ( response_timeout ) : resp = conn . getresponse ( ) if ( not is_success ( resp . status ) ) : resp . read ( ) raise ClientException ( ( 'Account server %s:%s direct GET %s gave status %s' % ( node [ 'ip' ] , node [ 'port' ] , repr ( ( '/%s/%s%s' % ( node [ 'device' ] , part , path ) ) ) , resp . status ) ) , http_host = node [ 'ip' ] , http_port = node [ 'port' ] , http_device = node [ 'device' ] , http_status = resp . status , http_reason = resp . reason ) resp_headers = { } for ( header , value ) in resp . getheaders ( ) : resp_headers [ header . lower ( ) ] = value if ( resp . status == HTTP_NO_CONTENT ) : resp . read ( ) return ( resp_headers , [ ] ) return ( resp_headers , json_loads ( resp . read ( ) ) )
get listings directly from the account server .