Module Expr Str Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore TupleLoad Num Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Str body AugAssignAdd AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Dict Num Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpMod Str NameLoad TryExcept body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Raise Call NameLoad NameLoad If UnaryOpNot Call NameLoad GeneratorExp CompareEq NameLoad NameLoad comprehension NameStore NameLoad body Raise Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice BinOpSub Call NameLoad AttributeLoad NameLoad attr Num TryExcept body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body If BoolOpAnd Call AttributeLoad NameLoad attr Str CompareNotIn Str NameLoad body Raise Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad orelse Assign NameStore IfExp NameLoad BinOpAdd Str NameLoad Str TryExcept body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad Num Num NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults kwarg body Assign NameStore Dict Str Str NameLoad Dict If CompareIsNot NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str Call NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Return Call Call NameLoad keyword NameLoad keyword Dict Str Str NameLoad NameLoad TryExcept body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Return Call Call NameLoad Call NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad Dict Str BinOpMod Str TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr keyword Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore BinOpAdd Str Str orelse If CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore BinOpAdd Str Str orelse Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpAdd Str Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword NameLoad keyword Call NameLoad NameLoad keyword Call NameLoad BoolOpOr NameLoad Str keyword Call NameLoad BoolOpOr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad keyword NameLoad keyword NameLoad Return Call NameLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults kwarg body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list
N/A N/A 
List endpoints for an object, account or container.

This middleware makes it possible to integrate swift with software
that relies on data locality information to avoid network overhead,
such as Hadoop.

Using the original API, answers requests of the form::

    /endpoints/{account}/{container}/{object}
    /endpoints/{account}/{container}
    /endpoints/{account}
    /endpoints/v1/{account}/{container}/{object}
    /endpoints/v1/{account}/{container}
    /endpoints/v1/{account}

with a JSON-encoded list of endpoints of the form::

    http://{server}:{port}/{dev}/{part}/{acc}/{cont}/{obj}
    http://{server}:{port}/{dev}/{part}/{acc}/{cont}
    http://{server}:{port}/{dev}/{part}/{acc}

correspondingly, e.g.::

    http://10.1.1.1:6200/sda1/2/a/c2/o1
    http://10.1.1.1:6200/sda1/2/a/c2
    http://10.1.1.1:6200/sda1/2/a

Using the v2 API, answers requests of the form::

    /endpoints/v2/{account}/{container}/{object}
    /endpoints/v2/{account}/{container}
    /endpoints/v2/{account}

with a JSON-encoded dictionary containing a key 'endpoints' that maps to a list
of endpoints having the same form as described above, and a key 'headers' that
maps to a dictionary of headers that should be sent with a request made to
the endpoints, e.g.::

    { "endpoints": {"http://10.1.1.1:6010/sda1/2/a/c3/o1",
                    "http://10.1.1.1:6030/sda3/2/a/c3/o1",
                    "http://10.1.1.1:6040/sda4/2/a/c3/o1"},
      "headers": {"X-Backend-Storage-Policy-Index": "1"}}

In this example, the 'headers' dictionary indicates that requests to the
endpoint URLs should include the header 'X-Backend-Storage-Policy-Index: 1'
because the object's container is using storage policy index 1.

The '/endpoints/' path is customizable ('list_endpoints_path'
configuration parameter).

Intended for consumption by third-party services living inside the
cluster (as the endpoints make sense only inside the cluster behind
the firewall); potentially written in a different language.

This is why it's provided as a REST API and not just a Python API:
to avoid requiring clients to write their own ring parsers in their
languages, and to avoid the necessity to distribute the ring file
to clients and keep it up-to-date.

Note that the call is not authenticated, which means that a proxy
with this middleware enabled should not be open to an untrusted
environment (everyone can query the locality data using this middleware).
 N/A json six.moves.urllib.parse quote unquote swift.common.ring Ring swift.common.utils get_logger split_path swift.common.swob Request Response swift.common.swob HTTPBadRequest HTTPMethodNotAllowed swift.common.storage_policy POLICIES swift.proxy.controllers.base get_container_info N/A RESPONSE_VERSIONS N/A 1.0 2.0 ListEndpointsMiddleware N/A object N/A N/A 
    List endpoints for an object, account or container.

    See above for a full description.

    Uses configuration parameter `swift_dir` (default `/etc/swift`).

    :param app: The next WSGI filter or app in the paste.deploy
                chain.
    :param conf: The configuration dict for the middleware.
     __init__ N/A N/A self app conf N/A N/A N/A N/A self app app N/A N/A self logger N/A get_logger conf log_route endpoints N/A N/A self swift_dir N/A N/A conf get swift_dir /etc/swift N/A N/A self account_ring N/A Ring N/A self swift_dir ring_name account N/A N/A self container_ring N/A Ring N/A self swift_dir ring_name container N/A N/A self endpoints_path N/A N/A conf get list_endpoints_path /endpoints/ N/A N/A N/A N/A N/A self endpoints_path endswith / N/A N/A N/A self endpoints_path / N/A N/A self default_response_version 1.0 N/A N/A self response_map N/A 1.0 2.0 N/A self v1_format_response N/A self v2_format_response N/A get_object_ring N/A N/A self policy_idx N/A N/A N/A 
        Get the ring object to use to handle a request based on its policy.

        :policy_idx: policy index as defined in swift.conf
        :returns: appropriate ring object
         N/A N/A N/A POLICIES get_object_ring policy_idx N/A self swift_dir N/A _parse_version N/A N/A self raw_version N/A N/A N/A err_msg N/A Unsupported version %r raw_version N/A N/A N/A version N/A float N/A N/A raw_version lstrip v N/A N/A N/A ValueError N/A N/A N/A ValueError err_msg N/A N/A N/A any N/A N/A version v N/A v RESPONSE_VERSIONS N/A N/A N/A ValueError err_msg N/A version N/A _parse_path N/A N/A self request N/A N/A N/A 
        Parse path parts of request into a tuple of version, account,
        container, obj.  Unspecified path parts are filled in as None,
        except version which is always returned as a float using the
        configured default response version if not specified in the
        request.

        :param request: the swob request

        :returns: parsed path parts as a tuple with version filled in as
                  configured default response version if not specified.
        :raises: ValueError if path is invalid, message will say why.
         N/A clean_path N/A N/A request path N/A N/A N/A len N/A self endpoints_path 1 N/A N/A N/A N/A raw_version rest N/A split_path clean_path 1 2 True N/A N/A N/A ValueError N/A N/A N/A ValueError No account specified N/A N/A N/A version N/A N/A self _parse_version raw_version N/A N/A N/A ValueError N/A N/A N/A N/A N/A raw_version startswith v N/A _ raw_version N/A N/A N/A version N/A self default_response_version N/A rest clean_path N/A N/A rest N/A rest N/A / rest / N/A N/A N/A N/A account container obj N/A split_path rest 1 3 True N/A N/A N/A ValueError N/A N/A N/A ValueError No account specified N/A N/A version account container obj N/A v1_format_response N/A N/A self req endpoints N/A kwargs N/A N/A N/A Response N/A N/A json dumps endpoints content_type application/json N/A v2_format_response N/A N/A self req endpoints storage_policy_index N/A kwargs N/A N/A resp N/A endpoints headers endpoints N/A N/A N/A storage_policy_index None N/A N/A N/A N/A resp N/A headers N/A X-Backend-Storage-Policy-Index N/A str storage_policy_index N/A N/A Response N/A N/A json dumps resp content_type application/json N/A __call__ N/A N/A self env start_response N/A N/A N/A request N/A Request env N/A N/A N/A N/A N/A request path startswith N/A self endpoints_path N/A N/A N/A N/A self app env start_response N/A N/A N/A request method GET N/A N/A N/A N/A HTTPMethodNotAllowed req request headers N/A Allow GET env start_response N/A N/A N/A N/A version account container obj N/A N/A self _parse_path request N/A N/A N/A ValueError N/A err N/A N/A N/A N/A HTTPBadRequest N/A str err env start_response N/A N/A account None N/A N/A account N/A unquote account N/A N/A container None N/A N/A container N/A unquote container N/A N/A obj None N/A N/A obj N/A unquote obj N/A storage_policy_index None N/A N/A obj None N/A N/A container_info N/A get_container_info N/A PATH_INFO N/A /v1/%s/%s N/A account container N/A self app swift_source LE N/A storage_policy_index N/A container_info N/A storage_policy N/A obj_ring N/A N/A self get_object_ring storage_policy_index N/A N/A partition nodes N/A N/A obj_ring get_nodes account container obj N/A endpoint_template N/A http://{ip}:{port}/{device}/{partition}/ {account}/{container}/{obj} N/A N/A N/A container None N/A N/A N/A partition nodes N/A N/A N/A self container_ring get_nodes account container N/A endpoint_template N/A http://{ip}:{port}/{device}/{partition}/ {account}/{container} N/A N/A N/A partition nodes N/A N/A N/A self account_ring get_nodes account N/A endpoint_template N/A http://{ip}:{port}/{device}/{partition}/ {account} N/A endpoints N/A N/A node nodes N/A N/A endpoint N/A N/A endpoint_template format ip N/A node N/A ip port N/A node N/A port device N/A node N/A device partition partition account N/A quote account container N/A quote N/A container obj N/A quote N/A obj N/A N/A N/A endpoints append endpoint N/A resp N/A N/A N/A self response_map N/A version request endpoints endpoints storage_policy_index storage_policy_index N/A N/A resp env start_response N/A N/A filter_factory N/A N/A global_conf N/A local_conf N/A N/A conf N/A N/A global_conf copy N/A N/A N/A conf update local_conf list_endpoints_filter N/A N/A app N/A N/A N/A N/A ListEndpointsMiddleware app conf N/A N/A list_endpoints_filter N/A