Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad name NameStore body ImportFrom alias identifier ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam defaults body FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str BinOpSub NameLoad NameLoad Return NameLoad decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Str attr GeneratorExp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad body If Call NameLoad NameLoad NameLoad body Return NameLoad orelse If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse Return Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Yield handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad NameLoad attr Num body Raise Call NameLoad NameLoad NameLoad orelse Raise decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad UnaryOpNot Call AttributeLoad NameLoad attr body If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr orelse With Call NameLoad Str body Return Call NameLoad NameLoad NameLoad NameLoad TryExcept body Return Call NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body If BoolOpAnd CompareEq AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr body With Call NameLoad Str body Expr Call AttributeLoad NameLoad attr With Call NameLoad Str body Return Call NameLoad NameLoad NameLoad NameLoad orelse If BoolOpAnd CompareEq AttributeLoad NameLoad attr Num UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Str NameLoad orelse Raise decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIn Str NameLoad body Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str Return Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad kwarg body Expr Str If CompareIn NameLoad ListLoad Str body Return Call NameLoad Dict Str Str Str NameLoad Str Str If CompareIn NameLoad ListLoad Str Str body Return Call NameLoad Dict Str Str Str NameLoad Str NameLoad If CompareIn NameLoad ListLoad Str NameLoad body Return Call NameLoad Dict Str Str Str NameLoad NameLoad NameLoad Raise Call NameLoad Str decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad If BoolOpAnd Call AttributeLoad NameLoad attr Str CompareNotIn SubscriptLoad NameLoad Index Str ListLoad NameLoad NameLoad body Expr Call NameLoad SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareGt Call NameLoad Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr body Return ListLoad TupleLoad Str Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr orelse If CompareIs AttributeLoad NameLoad attr NameLoad body Return ListLoad orelse If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore BinOpMod Str AttributeLoad NameLoad attr Return ListLoad TupleLoad Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad kwarg body Expr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad kwarg body Expr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad Str NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore BinOpAdd NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str NameLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd Call AttributeLoad NameLoad attr BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Return If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Return TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Str Assign AttributeStore NameLoad attr BinOpMod Str NameLoad Return NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str NameLoad orelse Raise decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Dict Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad If Call AttributeLoad NameLoad attr Str body Return Call NameLoad NameLoad keyword NameLoad If BoolOpOr NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad CompareIs AttributeLoad NameLoad attr NameLoad body Return Call NameLoad BinOpMod Str NameLoad keyword NameLoad Assign NameStore IfExp CompareIs AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr Assign NameStore IfExp CompareIs AttributeLoad NameLoad attr NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad keyword NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args defaults kwarg body Expr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Assign NameStore NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad IfExp CompareIs NameLoad NameLoad Str BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args defaults kwarg body Assign NameStore ListLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListComp TupleLoad NameLoad NameLoad comprehension NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num Num If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr IfExp CompareIs NameLoad NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If NameLoad body Assign NameStore BinOpAdd NameLoad Call NameLoad BinOpAdd Str Call NameLoad NameLoad keyword NameLoad Assign NameStore Dict Str Str Str NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If NameLoad body Assign NameStore BinOpAdd NameLoad Call NameLoad BinOpAdd Str Call NameLoad NameLoad keyword NameLoad Return Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Expr TupleLoad Call AttributeLoad NameLoad attr TupleLoad Str Str If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareGt Call NameLoad NameLoad Num body Assign NameStore BinOpAdd NameLoad Call NameLoad BinOpAdd Str Call NameLoad NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad NameLoad Assign NameStore Dict Str Str Str Str NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareLtE Num AttributeLoad NameLoad attr body Raise Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore NameLoad body If CompareEq Call AttributeLoad NameLoad attr Str body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareEq Call AttributeLoad NameLoad attr Num Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Slice NameLoad NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareEq NameLoad Str body If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If BoolOpAnd CompareGtE AttributeLoad NameLoad attr TupleLoad Num Num Num CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Dict Str Str Str Str Call NameLoad Call NameLoad NameLoad NameLoad Str Str For TupleStore NameStore NameStore SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr Return Dict Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list Return NameLoad decorator_list
N/A N/A The **splunklib.binding** module provides a low-level binding interface to the
`Splunk REST API <http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTcontents>`_.

This module handles the wire details of calling the REST API, such as
authentication tokens, prefix paths, URL encoding, and so on. Actual path
segments, ``GET`` and ``POST`` arguments, and the parsing of responses is left
to the user.

If you want a friendlier interface to the Splunk REST API, use the
:mod:`splunklib.client` module.
 N/A httplib N/A logging N/A socket N/A ssl N/A urllib N/A io N/A sys N/A Cookie datetime datetime functools wraps StringIO StringIO contextlib contextmanager xml.etree.ElementTree XML N/A N/A xml.etree.ElementTree ParseError N/A N/A N/A ImportError N/A e N/A xml.parsers.expat ExpatError ParseError data record N/A __all__ N/A AuthenticationError connect Context handler HTTPError N/A DEFAULT_HOST localhost N/A DEFAULT_PORT 8089 N/A DEFAULT_SCHEME https _log_duration N/A N/A f N/A N/A new_f N/A N/A N/A args kwargs N/A N/A start_time N/A N/A datetime now N/A val N/A f args kwargs N/A end_time N/A N/A datetime now N/A N/A N/A logging debug Operation took %s N/A end_time start_time N/A val N/A N/A wraps f N/A new_f N/A _parse_cookies N/A N/A cookie_str dictionary N/A N/A N/A Tries to parse any key-value pairs of cookies in a string,
    then updates the the dictionary with any key-value pairs found.

    **Example**::
        dictionary = {}
        _parse_cookies('my=value', dictionary)
        # Now the following is True
        dictionary['my'] == 'value'

    :param cookie_str: A string containing "key=value" pairs from an HTTP "Set-Cookie" header.
    :type cookie_str: ``str``
    :param dictionary: A dictionary to update with any found key-value pairs.
    :type dictionary: ``dict``
     N/A parsed_cookie N/A N/A Cookie SimpleCookie cookie_str N/A cookie N/A N/A parsed_cookie values N/A N/A N/A dictionary N/A N/A cookie key N/A cookie coded_value N/A _make_cookie_header N/A N/A cookies N/A N/A N/A 
    Takes a list of 2-tuples of key-value pairs of
    cookies, and returns a valid HTTP ``Cookie``
    header.

    **Example**::

        header = _make_cookie_header([("key", "value"), ("key_2", "value_2")])
        # Now the following is True
        header == "key=value; key_2=value_2"

    :param cookies: A list of 2-tuples of cookie key-value pairs.
    :type cookies: ``list`` of 2-tuples
    :return: ``str` An HTTP header cookie string.
    :rtype: ``str``
     N/A N/A N/A ;  join N/A N/A %s=%s N/A key value N/A N/A key value cookies N/A _NoAuthenticationToken N/A object N/A N/A The value stored in a :class:`Context` or :class:`splunklib.client.Service`
    class that is not logged in.

    If a ``Context`` or ``Service`` object is created without an authentication
    token, and there has not yet been a call to the ``login`` method, the token
    field of the ``Context`` or ``Service`` object is set to
    ``_NoAuthenticationToken``.

    Likewise, after a ``Context`` or ``Service`` object has been logged out, the
    token is set to this value again.
     N/A N/A UrlEncoded N/A str N/A N/A This class marks URL-encoded strings.
    It should be considered an SDK-private implementation detail.

    Manually tracking whether strings are URL encoded can be difficult. Avoid
    calling ``urllib.quote`` to replace special characters with escapes. When
    you receive a URL-encoded string, *do* use ``urllib.unquote`` to replace
    escapes with single characters. Then, wrap any string you want to use as a
    URL in ``UrlEncoded``. Note that because the ``UrlEncoded`` class is
    idempotent, making multiple calls to it is OK.

    ``UrlEncoded`` objects are identical to ``str`` objects (including being
    equal if their contents are equal) except when passed to ``UrlEncoded``
    again.

    ``UrlEncoded`` removes the ``str`` type support for interpolating values
    with ``%`` (doing that raises a ``TypeError``). There is no reliable way to
    encode values this way, so instead, interpolate into a string, quoting by
    hand, and call ``UrlEncode`` with ``skip_encode=True``.

    **Example**::

        import urllib
        UrlEncoded('%s://%s' % (scheme, urllib.quote(host)), skip_encode=True)

    If you append ``str`` strings and ``UrlEncoded`` strings, the result is also
    URL encoded.

    **Example**::

        UrlEncoded('ab c') + 'de f' == UrlEncoded('ab cde f')
        'ab c' + UrlEncoded('de f') == UrlEncoded('ab cde f')
     __new__ N/A N/A self val skip_encode encode_slash N/A False False N/A N/A N/A isinstance val UrlEncoded N/A N/A val N/A N/A skip_encode N/A N/A N/A N/A str __new__ self val N/A N/A encode_slash N/A N/A N/A N/A str __new__ self N/A N/A urllib quote_plus val N/A N/A N/A N/A str __new__ self N/A N/A urllib quote val N/A __add__ N/A N/A self other N/A N/A N/A self + other

        If *other* is not a ``UrlEncoded``, URL encode it before
        adding it.
         N/A N/A isinstance other UrlEncoded N/A N/A N/A UrlEncoded N/A N/A str __add__ self other skip_encode True N/A N/A N/A UrlEncoded N/A N/A str __add__ self N/A N/A urllib quote other skip_encode True N/A __radd__ N/A N/A self other N/A N/A N/A other + self

        If *other* is not a ``UrlEncoded``, URL _encode it before
        adding it.
         N/A N/A isinstance other UrlEncoded N/A N/A N/A UrlEncoded N/A N/A str __radd__ self other skip_encode True N/A N/A N/A UrlEncoded N/A N/A str __add__ N/A N/A urllib quote other self skip_encode True N/A __mod__ N/A N/A self fields N/A N/A N/A Interpolation into ``UrlEncoded``s is disabled.

        If you try to write ``UrlEncoded("%s") % "abc", will get a
        ``TypeError``.
         N/A N/A TypeError Cannot interpolate into a UrlEncoded object. N/A __repr__ N/A N/A self N/A N/A N/A N/A UrlEncoded(%s) N/A repr N/A N/A urllib unquote N/A str self N/A N/A _handle_auth_error N/A N/A msg N/A N/A N/A Handle reraising HTTP authentication errors as something clearer.

    If an ``HTTPError`` is raised with status 401 (access denied) in
    the body of this context manager, reraise it as an
    ``AuthenticationError`` instead, with *msg* as its message.

    This function adds no round trips to the server.

    :param msg: The message to be raised in ``AuthenticationError``.
    :type msg: ``str``

    **Example**::

        with _handle_auth_error("Your login failed."):
             ... # make an HTTP request
     N/A N/A N/A N/A N/A N/A N/A HTTPError N/A he N/A N/A N/A N/A he status 401 N/A N/A N/A AuthenticationError msg he N/A N/A N/A contextmanager _authentication N/A N/A request_fun N/A N/A N/A Decorator to handle autologin and authentication errors.

    *request_fun* is a function taking no arguments that needs to
    be run with this ``Context`` logged into Splunk.

    ``_authentication``'s behavior depends on whether the
    ``autologin`` field of ``Context`` is set to ``True`` or
    ``False``. If it's ``False``, then ``_authentication``
    aborts if the ``Context`` is not logged in, and raises an
    ``AuthenticationError`` if an ``HTTPError`` of status 401 is
    raised in *request_fun*. If it's ``True``, then
    ``_authentication`` will try at all sensible places to
    log in before issuing the request.

    If ``autologin`` is ``False``, ``_authentication`` makes
    one roundtrip to the server if the ``Context`` is logged in,
    or zero if it is not. If ``autologin`` is ``True``, it's less
    deterministic, and may make at most three roundtrips (though
    that would be a truly pathological case).

    :param request_fun: A function of no arguments encapsulating
                        the request to make to the server.

    **Example**::

        import splunklib.binding as binding
        c = binding.connect(..., autologin=True)
        c.logout()
        def f():
            c.get("/services")
            return 42
        print _authentication(f)
     wrapper N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A self token _NoAuthenticationToken N/A N/A N/A self has_cookies N/A N/A N/A N/A self autologin N/A self username N/A self password N/A N/A N/A N/A self login N/A N/A N/A _handle_auth_error Request aborted: not logged in. N/A N/A N/A request_fun self args kwargs N/A N/A N/A N/A request_fun self args kwargs N/A N/A N/A HTTPError N/A he N/A N/A N/A N/A N/A he status 401 N/A self autologin N/A N/A N/A _handle_auth_error Autologin failed. N/A N/A N/A N/A self login N/A N/A _handle_auth_error Autologin succeeded, but there was an auth error on next request. Something is very wrong. N/A N/A N/A request_fun self args kwargs N/A N/A N/A N/A N/A he status 401 N/A N/A self autologin N/A N/A N/A AuthenticationError Request failed: Session is not logged in. he N/A N/A N/A N/A wraps request_fun N/A wrapper N/A _authority N/A N/A scheme host port N/A DEFAULT_SCHEME DEFAULT_HOST DEFAULT_PORT N/A N/A Construct a URL authority from the given *scheme*, *host*, and *port*.

    Named in accordance with RFC2396_, which defines URLs as::

        <scheme>://<authority><path>?<query>

    .. _RFC2396: http://www.ietf.org/rfc/rfc2396.txt

    So ``https://localhost:8000/a/b/b?boris=hilda`` would be parsed as::

        scheme := https
        authority := localhost:8000
        path := /a/b/c
        query := boris=hilda

    :param scheme: URL scheme (the default is "https")
    :type scheme: "http" or "https"
    :param host: The host name (the default is "localhost")
    :type host: string
    :param port: The port number (the default is 8089)
    :type port: integer
    :return: The URL authority.
    :rtype: UrlEncoded (subclass of ``str``)

    **Example**::

        _authority() == "https://localhost:8089"

        _authority(host="splunk.utopia.net") == "https://splunk.utopia.net:8089"

        _authority(host="2001:0db8:85a3:0000:0000:8a2e:0370:7334") ==             "https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8089"

        _authority(scheme="http", host="splunk.utopia.net", port="471") ==             "http://splunk.utopia.net:471"

     N/A N/A : host N/A N/A host N/A N/A [ host ] N/A N/A UrlEncoded N/A %s://%s:%s N/A scheme host port skip_encode True N/A namespace N/A N/A sharing owner app N/A None None None kwargs N/A N/A This function constructs a Splunk namespace.

    Every Splunk resource belongs to a namespace. The namespace is specified by
    the pair of values ``owner`` and ``app`` and is governed by a ``sharing`` mode.
    The possible values for ``sharing`` are: "user", "app", "global" and "system",
    which map to the following combinations of ``owner`` and ``app`` values:

        "user"   => {owner}, {app}

        "app"    => nobody, {app}

        "global" => nobody, {app}

        "system" => nobody, system

    "nobody" is a special user name that basically means no user, and "system"
    is the name reserved for system resources.

    "-" is a wildcard that can be used for both ``owner`` and ``app`` values and
    refers to all users and all apps, respectively.

    In general, when you specify a namespace you can specify any combination of
    these three values and the library will reconcile the triple, overriding the
    provided values as appropriate.

    Finally, if no namespacing is specified the library will make use of the
    ``/services`` branch of the REST API, which provides a namespaced view of
    Splunk resources equivelent to using ``owner={currentUser}`` and
    ``app={defaultApp}``.

    The ``namespace`` function returns a representation of the namespace from
    reconciling the values you provide. It ignores any keyword arguments other
    than ``owner``, ``app``, and ``sharing``, so you can provide ``dicts`` of
    configuration information without first having to extract individual keys.

    :param sharing: The sharing mode (the default is "user").
    :type sharing: "system", "global", "app", or "user"
    :param owner: The owner context (the default is "None").
    :type owner: ``string``
    :param app: The app context (the default is "None").
    :type app: ``string``
    :returns: A :class:`splunklib.data.Record` containing the reconciled
        namespace.

    **Example**::

        import splunklib.binding as binding
        n = binding.namespace(sharing="user", owner="boris", app="search")
        n = binding.namespace(sharing="global", app="search")
     N/A N/A sharing N/A system N/A N/A N/A record N/A sharing owner app sharing nobody system N/A N/A sharing N/A global app N/A N/A N/A record N/A sharing owner app sharing nobody app N/A N/A sharing N/A user None N/A N/A N/A record N/A sharing owner app sharing owner app N/A N/A ValueError Invalid value for argument: 'sharing' N/A Context N/A object N/A N/A This class represents a context that encapsulates a splunkd connection.

    The ``Context`` class encapsulates the details of HTTP requests,
    authentication, a default namespace, and URL prefixes to simplify access to
    the REST API.

    After creating a ``Context`` object, you must call its :meth:`login`
    method before you can issue requests to splunkd. Or, use the :func:`connect`
    function to create an already-authenticated ``Context`` object. You can
    provide a session token explicitly (the same token can be shared by multiple
    ``Context`` objects) to provide authentication.

    :param host: The host name (the default is "localhost").
    :type host: ``string``
    :param port: The port number (the default is 8089).
    :type port: ``integer``
    :param scheme: The scheme for accessing the service (the default is "https").
    :type scheme: "https" or "http"
    :param sharing: The sharing mode for the namespace (the default is "user").
    :type sharing: "global", "system", "app", or "user"
    :param owner: The owner context of the namespace (optional, the default is "None").
    :type owner: ``string``
    :param app: The app context of the namespace (optional, the default is "None").
    :type app: ``string``
    :param token: A session token. When provided, you don't need to call :meth:`login`.
    :type token: ``string``
    :param cookie: A session cookie. When provided, you don't need to call :meth:`login`.
        This parameter is only supported for Splunk 6.2+.
    :type cookie: ``string``
    :param username: The Splunk account username, which is used to
        authenticate the Splunk instance.
    :type username: ``string``
    :param password: The password for the Splunk account.
    :type password: ``string``
    :param handler: The HTTP request handler (optional).
    :returns: A ``Context`` instance.

    **Example**::

        import splunklib.binding as binding
        c = binding.Context(username="boris", password="natasha", ...)
        c.login()
        # Or equivalently
        c = binding.connect(username="boris", password="natasha")
        # Or if you already have a session token
        c = binding.Context(token="atg232342aa34324a")
        # Or if you already have a valid cookie
        c = binding.Context(cookie="splunkd_8089=...")
     __init__ N/A N/A self handler N/A None kwargs N/A N/A N/A self http N/A HttpLib handler N/A N/A self token N/A N/A kwargs get token _NoAuthenticationToken N/A N/A N/A self token None N/A N/A N/A self token _NoAuthenticationToken N/A N/A self scheme N/A N/A kwargs get scheme DEFAULT_SCHEME N/A N/A self host N/A N/A kwargs get host DEFAULT_HOST N/A N/A self port N/A int N/A N/A kwargs get port DEFAULT_PORT N/A N/A self authority N/A _authority N/A self scheme N/A self host N/A self port N/A N/A self namespace N/A namespace kwargs N/A N/A self username N/A N/A kwargs get username N/A N/A self password N/A N/A kwargs get password N/A N/A self autologin N/A N/A kwargs get autologin False N/A N/A N/A N/A kwargs has_key cookie N/A N/A kwargs N/A cookie N/A None _NoAuthenticationToken N/A N/A N/A _parse_cookies N/A kwargs N/A cookie N/A N/A self http _cookies N/A get_cookies N/A N/A self N/A N/A N/A Gets the dictionary of cookies from the ``HttpLib`` member of this instance.

        :return: Dictionary of cookies stored on the ``self.http``.
        :rtype: ``dict``
         N/A N/A N/A self http _cookies N/A has_cookies N/A N/A self N/A N/A N/A Returns true if the ``HttpLib`` member of this instance has at least
        one cookie stored.

        :return: ``True`` if there is at least one cookie, else ``False``
        :rtype: ``bool``
         N/A N/A N/A len N/A N/A self get_cookies 0 N/A _auth_headers N/A N/A self N/A N/A N/A Headers required to authenticate a request.

        Assumes your ``Context`` already has a authentication token or
        cookie, either provided explicitly or obtained by logging
        into the Splunk instance.

        :returns: A list of 2-tuples containing key and value
         N/A N/A N/A self has_cookies N/A N/A N/A N/A Cookie N/A _make_cookie_header N/A N/A N/A N/A self get_cookies items N/A N/A N/A N/A self token _NoAuthenticationToken N/A N/A N/A N/A N/A N/A N/A N/A self token startswith Splunk  N/A N/A token N/A self token N/A N/A token N/A Splunk %s N/A self token N/A N/A N/A Authorization token N/A property connect N/A N/A self N/A N/A N/A Returns an open connection (socket) to the Splunk instance.

        This method is used for writing bulk events to an index or similar tasks
        where the overhead of opening a connection multiple times would be
        prohibitive.

        :returns: A socket.

        **Example**::

            import splunklib.binding as binding
            c = binding.connect(...)
            socket = c.connect()
            socket.write("POST %s HTTP/1.1\r\n" % "some/path/to/post/to")
            socket.write("Host: %s:%s\r\n" % (c.host, c.port))
            socket.write("Accept-Encoding: identity\r\n")
            socket.write("Authorization: %s\r\n" % c.token)
            socket.write("X-Splunk-Input-Mode: Streaming\r\n")
            socket.write("\r\n")
         N/A sock N/A N/A socket socket N/A socket AF_INET N/A socket SOCK_STREAM N/A N/A N/A self scheme https N/A N/A sock N/A N/A ssl wrap_socket sock N/A N/A N/A sock connect N/A N/A N/A socket gethostbyname N/A self host N/A self port N/A sock N/A delete N/A N/A self path_segment owner app sharing N/A None None None query N/A N/A Performs a DELETE operation at the REST path segment with the given
        namespace and query.

        This method is named to match the HTTP method. ``delete`` makes at least
        one round trip to the server, one additional round trip for each 303
        status returned, and at most two additional round trips if
        the ``autologin`` field of :func:`connect` is set to ``True``.

        If *owner*, *app*, and *sharing* are omitted, this method uses the
        default :class:`Context` namespace. All other keyword arguments are
        included in the URL as query parameters.

        :raises AuthenticationError: Raised when the ``Context`` object is not
             logged in.
        :raises HTTPError: Raised when an error occurred in a GET operation from
             *path_segment*.
        :param path_segment: A REST path segment.
        :type path_segment: ``string``
        :param owner: The owner context of the namespace (optional).
        :type owner: ``string``
        :param app: The app context of the namespace (optional).
        :type app: ``string``
        :param sharing: The sharing mode of the namespace (optional).
        :type sharing: ``string``
        :param query: All other keyword arguments, which are used as query
            parameters.
        :type query: ``string``
        :return: The response from the server.
        :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``,
                and ``status``

        **Example**::

            c = binding.connect(...)
            c.delete('saved/searches/boris') == \
                {'body': ...a response reader object...,
                 'headers': [('content-length', '1786'),
                             ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'),
                             ('server', 'Splunkd'),
                             ('connection', 'close'),
                             ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'),
                             ('date', 'Fri, 11 May 2012 16:53:06 GMT'),
                             ('content-type', 'text/xml; charset=utf-8')],
                 'reason': 'OK',
                 'status': 200}
            c.delete('nonexistant/path') # raises HTTPError
            c.logout()
            c.delete('apps/local') # raises AuthenticationError
         N/A path N/A N/A self authority N/A N/A self _abspath path_segment owner owner app app sharing sharing N/A N/A N/A logging debug DELETE request to %s (body: %s) path N/A repr query N/A response N/A N/A N/A self http delete path N/A self _auth_headers query N/A response N/A _authentication _log_duration get N/A N/A self path_segment owner app sharing N/A None None None query N/A N/A Performs a GET operation from the REST path segment with the given
        namespace and query.

        This method is named to match the HTTP method. ``get`` makes at least
        one round trip to the server, one additional round trip for each 303
        status returned, and at most two additional round trips if
        the ``autologin`` field of :func:`connect` is set to ``True``.

        If *owner*, *app*, and *sharing* are omitted, this method uses the
        default :class:`Context` namespace. All other keyword arguments are
        included in the URL as query parameters.

        :raises AuthenticationError: Raised when the ``Context`` object is not
             logged in.
        :raises HTTPError: Raised when an error occurred in a GET operation from
             *path_segment*.
        :param path_segment: A REST path segment.
        :type path_segment: ``string``
        :param owner: The owner context of the namespace (optional).
        :type owner: ``string``
        :param app: The app context of the namespace (optional).
        :type app: ``string``
        :param sharing: The sharing mode of the namespace (optional).
        :type sharing: ``string``
        :param query: All other keyword arguments, which are used as query
            parameters.
        :type query: ``string``
        :return: The response from the server.
        :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``,
                and ``status``

        **Example**::

            c = binding.connect(...)
            c.get('apps/local') == \
                {'body': ...a response reader object...,
                 'headers': [('content-length', '26208'),
                             ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'),
                             ('server', 'Splunkd'),
                             ('connection', 'close'),
                             ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'),
                             ('date', 'Fri, 11 May 2012 16:30:35 GMT'),
                             ('content-type', 'text/xml; charset=utf-8')],
                 'reason': 'OK',
                 'status': 200}
            c.get('nonexistant/path') # raises HTTPError
            c.logout()
            c.get('apps/local') # raises AuthenticationError
         N/A path N/A N/A self authority N/A N/A self _abspath path_segment owner owner app app sharing sharing N/A N/A N/A logging debug GET request to %s (body: %s) path N/A repr query N/A response N/A N/A N/A self http get path N/A self _auth_headers query N/A response N/A _authentication _log_duration post N/A N/A self path_segment owner app sharing headers N/A None None None None query N/A N/A Performs a POST operation from the REST path segment with the given
        namespace and query.

        This method is named to match the HTTP method. ``post`` makes at least
        one round trip to the server, one additional round trip for each 303
        status returned, and at most two additional round trips if
        the ``autologin`` field of :func:`connect` is set to ``True``.

        If *owner*, *app*, and *sharing* are omitted, this method uses the
        default :class:`Context` namespace. All other keyword arguments are
        included in the URL as query parameters.

        Some of Splunk's endpoints, such as ``receivers/simple`` and
        ``receivers/stream``, require unstructured data in the POST body
        and all metadata passed as GET-style arguments. If you provide
        a ``body`` argument to ``post``, it will be used as the POST
        body, and all other keyword arguments will be passed as
        GET-style arguments in the URL.

        :raises AuthenticationError: Raised when the ``Context`` object is not
             logged in.
        :raises HTTPError: Raised when an error occurred in a GET operation from
             *path_segment*.
        :param path_segment: A REST path segment.
        :type path_segment: ``string``
        :param owner: The owner context of the namespace (optional).
        :type owner: ``string``
        :param app: The app context of the namespace (optional).
        :type app: ``string``
        :param sharing: The sharing mode of the namespace (optional).
        :type sharing: ``string``
        :param headers: List of extra HTTP headers to send (optional).
        :type headers: ``list`` of 2-tuples.
        :param query: All other keyword arguments, which are used as query
            parameters.
        :type query: ``string``
        :return: The response from the server.
        :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``,
                and ``status``

        **Example**::

            c = binding.connect(...)
            c.post('saved/searches', name='boris',
                   search='search * earliest=-1m | head 1') == \
                {'body': ...a response reader object...,
                 'headers': [('content-length', '10455'),
                             ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'),
                             ('server', 'Splunkd'),
                             ('connection', 'close'),
                             ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'),
                             ('date', 'Fri, 11 May 2012 16:46:06 GMT'),
                             ('content-type', 'text/xml; charset=utf-8')],
                 'reason': 'Created',
                 'status': 201}
            c.post('nonexistant/path') # raises HTTPError
            c.logout()
            # raises AuthenticationError:
            c.post('saved/searches', name='boris',
                   search='search * earliest=-1m | head 1')
         N/A N/A headers None N/A N/A headers N/A N/A path N/A N/A self authority N/A N/A self _abspath path_segment owner owner app app sharing sharing N/A N/A N/A logging debug POST request to %s (body: %s) path N/A repr query N/A all_headers N/A headers N/A self _auth_headers N/A response N/A N/A N/A self http post path all_headers query N/A response N/A _authentication _log_duration request N/A N/A self path_segment method headers body owner app sharing N/A GET None None None None N/A N/A Issues an arbitrary HTTP request to the REST path segment.

        This method is named to match ``httplib.request``. This function
        makes a single round trip to the server.

        If *owner*, *app*, and *sharing* are omitted, this method uses the
        default :class:`Context` namespace. All other keyword arguments are
        included in the URL as query parameters.

        :raises AuthenticationError: Raised when the ``Context`` object is not
             logged in.
        :raises HTTPError: Raised when an error occurred in a GET operation from
             *path_segment*.
        :param path_segment: A REST path segment.
        :type path_segment: ``string``
        :param method: The HTTP method to use (optional).
        :type method: ``string``
        :param headers: List of extra HTTP headers to send (optional).
        :type headers: ``list`` of 2-tuples.
        :param body: Content of the HTTP request (optional).
        :type body: ``string``
        :param owner: The owner context of the namespace (optional).
        :type owner: ``string``
        :param app: The app context of the namespace (optional).
        :type app: ``string``
        :param sharing: The sharing mode of the namespace (optional).
        :type sharing: ``string``
        :param query: All other keyword arguments, which are used as query
            parameters.
        :type query: ``string``
        :return: The response from the server.
        :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``,
                and ``status``

        **Example**::

            c = binding.connect(...)
            c.request('saved/searches', method='GET') == \
                {'body': ...a response reader object...,
                 'headers': [('content-length', '46722'),
                             ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'),
                             ('server', 'Splunkd'),
                             ('connection', 'close'),
                             ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'),
                             ('date', 'Fri, 11 May 2012 17:24:19 GMT'),
                             ('content-type', 'text/xml; charset=utf-8')],
                 'reason': 'OK',
                 'status': 200}
            c.request('nonexistant/path', method='GET') # raises HTTPError
            c.logout()
            c.get('apps/local') # raises AuthenticationError
         N/A N/A headers None N/A N/A headers N/A N/A path N/A N/A self authority N/A N/A self _abspath path_segment owner owner app app sharing sharing N/A all_headers N/A headers N/A self _auth_headers N/A N/A N/A logging debug %s request to %s (headers: %s, body: %s) method path N/A str all_headers N/A repr body N/A response N/A N/A N/A self http request path N/A method headers body method all_headers body N/A response N/A _authentication _log_duration login N/A N/A self N/A N/A N/A Logs into the Splunk instance referred to by the :class:`Context`
        object.

        Unless a ``Context`` is created with an explicit authentication token
        (probably obtained by logging in from a different ``Context`` object)
        you must call :meth:`login` before you can issue requests.
        The authentication token obtained from the server is stored in the
        ``token`` field of the ``Context`` object.

        :raises AuthenticationError: Raised when login fails.
        :returns: The ``Context`` object, so you can chain calls.

        **Example**::

            import splunklib.binding as binding
            c = binding.Context(...).login()
            # Then issue requests...
         N/A N/A N/A N/A self has_cookies N/A N/A N/A self username N/A N/A self password N/A N/A N/A N/A N/A N/A self token _NoAuthenticationToken N/A N/A N/A self username N/A N/A self password N/A N/A N/A N/A N/A response N/A N/A N/A self http post N/A N/A self authority N/A N/A self _abspath /services/auth/login username N/A self username password N/A self password cookie 1 N/A body N/A N/A N/A response body read N/A session N/A N/A N/A XML body findtext ./sessionKey N/A N/A self token N/A Splunk %s session N/A self N/A N/A N/A HTTPError N/A he N/A N/A N/A N/A he status 401 N/A N/A N/A AuthenticationError Login failed. he N/A N/A N/A logout N/A N/A self N/A N/A N/A Forgets the current session token, and cookies. N/A N/A self token _NoAuthenticationToken N/A N/A N/A self http _cookies N/A N/A self N/A _abspath N/A N/A self path_segment owner app sharing N/A None None None N/A N/A Qualifies *path_segment* into an absolute path for a URL.

        If *path_segment* is already absolute, returns it unchanged.
        If *path_segment* is relative, then qualifies it with either
        the provided namespace arguments or the ``Context``'s default
        namespace. Any forbidden characters in *path_segment* are URL
        encoded. This function has no network activity.

        Named to be consistent with RFC2396_.

        .. _RFC2396: http://www.ietf.org/rfc/rfc2396.txt

        :param path_segment: A relative or absolute URL path segment.
        :type path_segment: ``string``
        :param owner, app, sharing: Components of a namespace (defaults
                                    to the ``Context``'s namespace if all
                                    three are omitted)
        :type owner, app, sharing: ``string``
        :return: A ``UrlEncoded`` (a subclass of ``str``).
        :rtype: ``string``

        **Example**::

            import splunklib.binding as binding
            c = binding.connect(owner='boris', app='search', sharing='user')
            c._abspath('/a/b/c') == '/a/b/c'
            c._abspath('/a/b c/d') == '/a/b%20c/d'
            c._abspath('apps/local/search') ==                 '/servicesNS/boris/search/apps/local/search'
            c._abspath('apps/local/search', sharing='system') ==                 '/servicesNS/nobody/system/apps/local/search'
            url = c.authority + c._abspath('apps/local/sharing')
         N/A skip_encode N/A isinstance path_segment UrlEncoded N/A N/A N/A path_segment startswith / N/A N/A N/A UrlEncoded path_segment skip_encode skip_encode N/A N/A owner app sharing N/A N/A ns N/A namespace owner owner app app sharing sharing N/A N/A ns N/A self namespace N/A N/A N/A N/A ns app None N/A N/A ns owner None N/A N/A N/A UrlEncoded N/A /services/%s path_segment skip_encode skip_encode N/A oname N/A N/A N/A ns owner None nobody N/A ns owner N/A aname N/A N/A N/A ns app None system N/A ns app N/A path N/A UrlEncoded N/A /servicesNS/%s/%s/%s N/A oname aname path_segment skip_encode skip_encode N/A path N/A N/A connect N/A N/A N/A kwargs N/A N/A This function returns an authenticated :class:`Context` object.

    This function is a shorthand for calling :meth:`Context.login`.

    This function makes one round trip to the server.

    :param host: The host name (the default is "localhost").
    :type host: ``string``
    :param port: The port number (the default is 8089).
    :type port: ``integer``
    :param scheme: The scheme for accessing the service (the default is "https").
    :type scheme: "https" or "http"
    :param owner: The owner context of the namespace (the default is "None").
    :type owner: ``string``
    :param app: The app context of the namespace (the default is "None").
    :type app: ``string``
    :param sharing: The sharing mode for the namespace (the default is "user").
    :type sharing: "global", "system", "app", or "user"
    :param token: The current session token (optional). Session tokens can be
        shared across multiple service instances.
    :type token: ``string``
    :param cookie: A session cookie. When provided, you don't need to call :meth:`login`.
        This parameter is only supported for Splunk 6.2+.
    :type cookie: ``string``
    :param username: The Splunk account username, which is used to
        authenticate the Splunk instance.
    :type username: ``string``
    :param password: The password for the Splunk account.
    :type password: ``string``
    :param autologin: When ``True``, automatically tries to log in again if the
        session terminates.
    :type autologin: ``Boolean``
    :return: An initialized :class:`Context` instance.

    **Example**::

        import splunklib.binding as binding
        c = binding.connect(...)
        response = c.get("apps/local")
     N/A c N/A Context kwargs N/A N/A N/A c login N/A c N/A HTTPError N/A Exception N/A N/A This exception is raised for HTTP responses that return an error. __init__ N/A N/A self response _message N/A None N/A N/A status N/A response status N/A reason N/A response reason N/A body N/A N/A N/A response body read N/A N/A N/A detail N/A N/A N/A XML body findtext ./messages/msg N/A N/A N/A ParseError N/A err N/A N/A detail body N/A message N/A HTTP %d %s%s N/A status reason N/A N/A detail None N/A  -- %s detail N/A N/A N/A Exception __init__ self N/A _message message N/A N/A self status status N/A N/A self reason reason N/A N/A self headers N/A response headers N/A N/A self body body N/A N/A self _response response N/A N/A AuthenticationError N/A HTTPError N/A N/A Raised when a login request to Splunk fails.

    If your username was unknown or you provided an incorrect password
    in a call to :meth:`Context.login` or :meth:`splunklib.client.Service.login`,
    this exception is raised.
     __init__ N/A N/A self message cause N/A N/A N/A N/A N/A cause _response body N/A StringIO N/A cause body N/A N/A N/A HTTPError __init__ self N/A cause _response message N/A N/A _encode N/A N/A N/A kwargs N/A N/A items N/A N/A N/A key value N/A N/A kwargs iteritems N/A N/A N/A isinstance value list N/A N/A N/A N/A items extend N/A N/A key item N/A item value N/A N/A N/A N/A items append N/A key value N/A N/A N/A urllib urlencode items N/A _spliturl N/A N/A url N/A N/A N/A N/A scheme opaque N/A N/A urllib splittype url N/A N/A netloc path N/A N/A urllib splithost opaque N/A N/A host port N/A N/A urllib splitport netloc N/A N/A N/A N/A host startswith [ N/A N/A host endswith ] N/A N/A host N/A host N/A 1 -1 N/A N/A port None N/A N/A port DEFAULT_PORT N/A N/A scheme host port path N/A HttpLib N/A object N/A N/A A set of convenient methods for making HTTP calls.

    ``HttpLib`` provides a general :meth:`request` method, and :meth:`delete`,
    :meth:`post`, and :meth:`get` methods for the three HTTP methods that Splunk
    uses.

    By default, ``HttpLib`` uses Python's built-in ``httplib`` library,
    but you can replace it by passing your own handling function to the
    constructor for ``HttpLib``.

    The handling function should have the type:

        ``handler(`url`, `request_dict`) -> response_dict``

    where `url` is the URL to make the request to (including any query and
    fragment sections) as a dictionary with the following keys:

        - method: The method for the request, typically ``GET``, ``POST``, or ``DELETE``.

        - headers: A list of pairs specifying the HTTP headers (for example: ``[('key': value), ...]``).

        - body: A string containing the body to send with the request (this string
          should default to '').

    and ``response_dict`` is a dictionary with the following keys:

        - status: An integer containing the HTTP status code (such as 200 or 404).

        - reason: The reason phrase, if any, returned by the server.

        - headers: A list of pairs containing the response headers (for example, ``[('key': value), ...]``).

        - body: A stream-like object supporting ``read(size=None)`` and ``close()``
          methods to get the body of the response.

    The response dictionary is returned directly by ``HttpLib``'s methods with
    no further processing. By default, ``HttpLib`` calls the :func:`handler` function
    to get a handler function.
     __init__ N/A N/A self custom_handler N/A None N/A N/A N/A self handler N/A N/A custom_handler None N/A handler custom_handler N/A N/A self _cookies N/A N/A delete N/A N/A self url headers N/A None kwargs N/A N/A Sends a DELETE request to a URL.

        :param url: The URL.
        :type url: ``string``
        :param headers: A list of pairs specifying the headers for the HTTP
            response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``).
        :type headers: ``list``
        :param kwargs: Additional keyword arguments (optional). These arguments
            are interpreted as the query part of the URL. The order of keyword
            arguments is not preserved in the request, but the keywords and
            their arguments will be URL encoded.
        :type kwargs: ``dict``
        :returns: A dictionary describing the response (see :class:`HttpLib` for
            its structure).
        :rtype: ``dict``
         N/A N/A headers None N/A N/A headers N/A N/A kwargs N/A N/A url N/A url N/A UrlEncoded N/A ? N/A _encode kwargs skip_encode True N/A message N/A method headers DELETE headers N/A N/A N/A self request url message N/A get N/A N/A self url headers N/A None kwargs N/A N/A Sends a GET request to a URL.

        :param url: The URL.
        :type url: ``string``
        :param headers: A list of pairs specifying the headers for the HTTP
            response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``).
        :type headers: ``list``
        :param kwargs: Additional keyword arguments (optional). These arguments
            are interpreted as the query part of the URL. The order of keyword
            arguments is not preserved in the request, but the keywords and
            their arguments will be URL encoded.
        :type kwargs: ``dict``
        :returns: A dictionary describing the response (see :class:`HttpLib` for
            its structure).
        :rtype: ``dict``
         N/A N/A headers None N/A N/A headers N/A N/A kwargs N/A N/A url N/A url N/A UrlEncoded N/A ? N/A _encode kwargs skip_encode True N/A N/A N/A self request url N/A method headers GET headers N/A post N/A N/A self url headers N/A None kwargs N/A N/A Sends a POST request to a URL.

        :param url: The URL.
        :type url: ``string``
        :param headers: A list of pairs specifying the headers for the HTTP
            response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``).
        :type headers: ``list``
        :param kwargs: Additional keyword arguments (optional). If the argument
            is ``body``, the value is used as the body for the request, and the
            keywords and their arguments will be URL encoded. If there is no
            ``body`` keyword argument, all the keyword arguments are encoded
            into the body of the request in the format ``x-www-form-urlencoded``.
        :type kwargs: ``dict``
        :returns: A dictionary describing the response (see :class:`HttpLib` for
            its structure).
        :rtype: ``dict``
         N/A N/A headers None N/A N/A headers N/A N/A N/A N/A N/A headers append N/A Content-Type application/x-www-form-urlencoded N/A N/A body kwargs N/A N/A body N/A N/A kwargs pop body N/A N/A N/A len kwargs 0 N/A N/A url N/A url N/A UrlEncoded N/A ? N/A _encode kwargs skip_encode True N/A N/A body N/A _encode kwargs N/A message N/A method headers body POST headers body N/A N/A N/A self request url message N/A request N/A N/A self url message N/A kwargs N/A N/A Issues an HTTP request to a URL.

        :param url: The URL.
        :type url: ``string``
        :param message: A dictionary with the format as described in
            :class:`HttpLib`.
        :type message: ``dict``
        :param kwargs: Additional keyword arguments (optional). These arguments
            are passed unchanged to the handler.
        :type kwargs: ``dict``
        :returns: A dictionary describing the response (see :class:`HttpLib` for
            its structure).
        :rtype: ``dict``
         N/A response N/A N/A self handler url message kwargs N/A response N/A record response N/A N/A 400 N/A response status N/A N/A N/A HTTPError response N/A key_value_tuples N/A response headers N/A N/A isinstance N/A response headers dict N/A N/A key_value_tuples N/A N/A N/A response headers items N/A N/A key value key_value_tuples N/A N/A N/A N/A N/A key lower set-cookie N/A N/A N/A _parse_cookies value N/A self _cookies N/A response N/A N/A ResponseReader N/A N/A io RawIOBase N/A N/A This class provides a file-like interface for :class:`httplib` responses.

    The ``ResponseReader`` class is intended to be a layer to unify the different
    types of HTTP libraries used with this SDK. This class also provides a
    preview of the stream and a few useful predicates.
     __init__ N/A N/A self response N/A N/A N/A N/A self _response response N/A N/A self _buffer N/A __str__ N/A N/A self N/A N/A N/A N/A N/A self read N/A empty N/A N/A self N/A N/A N/A Indicates whether there is any more data in the response. N/A N/A N/A N/A self peek 1 N/A property peek N/A N/A self size N/A N/A N/A Nondestructively retrieves a given number of characters.

        The next :meth:`read` operation behaves as though this method was never
        called.

        :param size: The number of characters to retrieve.
        :type size: ``integer``
         N/A c N/A N/A self read size N/A N/A self _buffer N/A N/A self _buffer c N/A c N/A close N/A N/A self N/A N/A N/A Closes this response. N/A N/A N/A N/A self _response close N/A read N/A N/A self size N/A None N/A N/A Reads a given number of characters from the response.

        :param size: The number of characters to read, or "None" to read the
            entire response.
        :type size: ``integer`` or "None"

         N/A r N/A self _buffer N/A N/A self _buffer N/A N/A size None N/A N/A size N/A len r N/A r N/A r N/A N/A N/A self _response read size N/A r N/A readable N/A N/A self N/A N/A N/A  Indicates that the response reader is readable. N/A True N/A readinto N/A N/A self byte_array N/A N/A N/A  Read data into a byte array, upto the size of the byte array.

        :param byte_array: A byte array/memory view to pour bytes into.
        :type byte_array: ``bytearray`` or ``memoryview``

         N/A max_size N/A len byte_array N/A data N/A N/A self read max_size N/A bytes_read N/A len data N/A N/A byte_array N/A bytes_read data N/A bytes_read N/A N/A handler N/A N/A key_file cert_file timeout N/A None None None N/A N/A This class returns an instance of the default HTTP request handler using
    the values you provide.

    :param `key_file`: A path to a PEM (Privacy Enhanced Mail) formatted file containing your private key (optional).
    :type key_file: ``string``
    :param `cert_file`: A path to a PEM (Privacy Enhanced Mail) formatted file containing a certificate chain file (optional).
    :type cert_file: ``string``
    :param `timeout`: The request time-out period, in seconds (optional).
    :type timeout: ``integer`` or "None"
     connect N/A N/A scheme host port N/A N/A N/A kwargs N/A N/A N/A timeout None N/A N/A N/A kwargs N/A timeout timeout N/A N/A scheme http N/A N/A N/A N/A httplib HTTPConnection host port kwargs N/A N/A scheme https N/A N/A N/A key_file None N/A N/A N/A kwargs N/A key_file key_file N/A N/A cert_file None N/A N/A N/A kwargs N/A cert_file cert_file N/A N/A N/A N/A sys version_info N/A 2 7 9 N/A key_file None N/A cert_file None N/A N/A N/A kwargs N/A context N/A N/A ssl _create_unverified_context N/A N/A N/A httplib HTTPSConnection host port kwargs N/A N/A ValueError N/A unsupported scheme: %s scheme N/A request N/A N/A url message N/A kwargs N/A N/A N/A scheme host port path N/A _spliturl url N/A body N/A N/A message get body N/A head N/A Content-Length Host User-Agent Accept N/A str N/A len body host splunk-sdk-python/1.5.0 */* N/A N/A key value N/A message N/A headers N/A N/A N/A head N/A key value N/A method N/A N/A message get method GET N/A connection N/A connect scheme host port N/A N/A N/A N/A N/A connection request method path body head N/A N/A timeout None N/A N/A N/A N/A N/A connection sock settimeout timeout N/A response N/A N/A connection getresponse N/A N/A N/A N/A connection close N/A N/A status reason headers body N/A response status N/A response reason N/A N/A response getheaders N/A ResponseReader response N/A N/A request N/A