Module ImportFrom alias alias Expr Str Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias Import alias identifier Expr Call AttributeLoad NameLoad attr Import alias Import alias Import alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Dict Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Return AttributeLoad NameLoad attr decorator_list NameLoad decorator_list Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Dict Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Return For TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Return NameLoad Assign NameStore Call NameLoad If CompareIsNot NameLoad NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr TupleLoad NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Return If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad If CompareEq Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Num body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr NameLoad body For NameStore NameLoad body If Call AttributeLoad NameLoad attr body Continue Expr Call AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Lambda arguments args NameParam defaults BinOpMult BinOpDiv Call NameLoad NameLoad Num NameLoad TryExcept body If CompareIn Str NameLoad body Assign NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Str If CompareLt NameLoad Num body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Return Call NameLoad NameLoad orelse Return Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore TupleLoad TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr CompareNotIn Str NameLoad CompareNotIn Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str Assign NameStore ListComp SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num comprehension NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body For NameStore NameLoad body For TupleStore NameStore NameStore AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Return TupleLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list Assign TupleStore NameStore NameStore Call NameLoad NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq Call NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index Num orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Assign TupleStore NameStore NameStore NameLoad Return Call SubscriptLoad NameLoad Index NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Num ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Return Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad If BoolOpAnd CompareIn Str NameLoad UnaryOpNot Call NameLoad SubscriptLoad NameLoad Index Str NameLoad body Assign SubscriptStore NameLoad Index Str ListLoad SubscriptLoad NameLoad Index Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad orelse Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Index Str If NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Str Assign NameStore Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Num Return Assign NameStore Dict Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Num Return Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad If CompareNotIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Num Return TryExcept body Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Index SubscriptLoad NameLoad Index Str Index SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Num Return ExceptHandler type TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num Return Assign NameStore Dict Str ListLoad Dict Str Str Str Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr If UnaryOpNot BoolOpOr CompareIn Str NameLoad BoolOpAnd CompareIn Str NameLoad CompareIn Str NameLoad CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Break TryExcept body Assign NameStore Yield Call Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Break ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr Dict Str Str Str SubscriptLoad NameLoad Index Str Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore Dict If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Call NameLoad NameLoad Assign NameStore ListLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str Str While BoolOpOr CompareGt Call NameLoad NameLoad Num CompareGt Call NameLoad NameLoad Num body While BoolOpAnd CompareLt Call NameLoad NameLoad NameLoad CompareGt Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str ListLoad NameLoad Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Continue Assign NameStore Yield Call NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Break Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad TryExcept body Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Str TupleLoad Call AttributeLoad NameLoad attr Str Dict handlers ExceptHandler type NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareNotIn Str NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore NameLoad If SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str keyword NameLoad If CompareIsNot NameLoad NameLoad body Expr Yield NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str keyword ListLoad NameLoad keyword NameLoad Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign NameStore Call NameLoad ListLoad NameLoad Str Str Assign NameStore Dict While NameLoad body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad Assign NameStore Yield Call NameLoad BinOpAdd ListLoad NameLoad NameLoad If CompareIn NameLoad NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index SubscriptLoad SubscriptLoad NameLoad Index Str Index Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str TryExcept body Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str handlers ExceptHandler type NameLoad body Pass If CompareEq Call NameLoad NameLoad Num body Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Str ListLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad ListLoad SubscriptLoad NameLoad Index Str Str Str Assign NameStore NameLoad While NameLoad body TryExcept body Assign NameStore Yield Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad keyword SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str handlers ExceptHandler type NameLoad body If UnaryOpNot NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Str ListLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad ListLoad SubscriptLoad NameLoad Index Str Str Str Assign NameStore NameLoad Continue If CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Dict Dict body Continue Assign NameStore NameLoad Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Str TupleLoad Call AttributeLoad NameLoad attr Str Dict Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore BinOpAdd SubscriptLoad NameLoad Index Str Str TryExcept body Assign NameStore Yield Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad Raise Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str handlers ExceptHandler type NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return Assign AttributeStore NameLoad attr ListLoad Dict Str Str Str Str BoolOpOr NameLoad Str Str Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return For NameStore AttributeLoad NameLoad attr body If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Str Continue If CompareNotEq Call AttributeLoad NameLoad attr Str Str body Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Return Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return If NameLoad body Assign AttributeStore NameLoad attr ListLoad Dict Str Str Str Str NameLoad Str orelse Assign AttributeStore NameLoad attr ListLoad Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Num Expr Call AttributeLoad NameLoad attr While NameLoad body TryExcept body Assign NameStore Yield Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Break decorator_list AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return Assign NameStore Str If NameLoad body AugAssignAdd NameStore NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str Str AttributeLoad NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body If CompareIn NameLoad NameLoad body Return NameLoad orelse If CompareEq NameLoad Str body Return NameLoad orelse If CompareEq NameLoad NameLoad body Return NameLoad decorator_list
N/A __future__ absolute_import print_function N/A 
A non-blocking REST API for Salt
================================

.. py:currentmodule:: salt.netapi.rest_tornado.saltnado

:depends:   - tornado Python module

:configuration: All authentication is done through Salt's :ref:`external auth
    <acl-eauth>` system which requires additional configuration not described
    here.


In order to run rest_tornado with the salt-master
add the following to the Salt master config file.

.. code-block:: yaml

    rest_tornado:
        # can be any port
        port: 8000
        # address to bind to (defaults to 0.0.0.0)
        address: 0.0.0.0
        # socket backlog
        backlog: 128
        ssl_crt: /etc/pki/api/certs/server.crt
        # no need to specify ssl_key if cert and key
        # are in one single file
        ssl_key: /etc/pki/api/certs/server.key
        debug: False
        disable_ssl: False
        webhook_disable_auth: False
        cors_origin: null

.. _rest_tornado-auth:

Authentication
--------------

Authentication is performed by passing a session token with each request.
Tokens are generated via the :py:class:`SaltAuthHandler` URL.

The token may be sent in one of two ways:

* Include a custom header named :mailheader:`X-Auth-Token`.
* Sent via a cookie. This option is a convenience for HTTP clients that
  automatically handle cookie support (such as browsers).

.. seealso:: You can bypass the session handling via the :py:class:`RunSaltAPIHandler` URL.

CORS
----

rest_tornado supports Cross-site HTTP requests out of the box. It is by default
deactivated and controlled by the `cors_origin` config key.

You can allow all origins by settings `cors_origin` to `*`.

You can allow only one origin with this configuration:

.. code-block:: yaml

    rest_tornado:
        cors_origin: http://salt.yourcompany.com

You can also be more specific and select only a few allowed origins by using
a list. For example:

.. code-block:: yaml

    rest_tornado:
        cors_origin:
            - http://salt.yourcompany.com
            - http://salt-preprod.yourcampany.com

The format for origin are full URL, with both scheme and port if not standard.

In this case, rest_tornado will check if the Origin header is in the allowed
list if it's the case allow the origin. Else it will returns nothing,
effectively preventing the origin to make request.

For reference, CORS is a mechanism used by browser to allow (or disallow)
requests made from browser from a different origin than salt-api. It's
complementary to Authentication and mandatory only if you plan to use
a salt client developed as a Javascript browser application.

Usage
-----

Commands are sent to a running Salt master via this module by sending HTTP
requests to the URLs detailed below.

.. admonition:: Content negotiation

    This REST interface is flexible in what data formats it will accept as well
    as what formats it will return (e.g., JSON, YAML, x-www-form-urlencoded).

    * Specify the format of data in the request body by including the
      :mailheader:`Content-Type` header.
    * Specify the desired data format for the response body with the
      :mailheader:`Accept` header.

Data sent in :http:method:`post` and :http:method:`put` requests  must be in
the format of a list of lowstate dictionaries. This allows multiple commands to
be executed in a single HTTP request.

.. glossary::

    lowstate
        A dictionary containing various keys that instruct Salt which command
        to run, where that command lives, any parameters for that command, any
        authentication credentials, what returner to use, etc.

        Salt uses the lowstate data format internally in many places to pass
        command data between functions. Salt also uses lowstate for the
        :ref:`LocalClient() <python-api>` Python API interface.

The following example (in JSON format) causes Salt to execute two commands::

    [{
        "client": "local",
        "tgt": "*",
        "fun": "test.fib",
        "arg": ["10"]
    },
    {
        "client": "runner",
        "fun": "jobs.lookup_jid",
        "jid": "20130603122505459265"
    }]

Multiple commands in a Salt API request will be executed in serial and makes
no gaurantees that all commands will run. Meaning that if test.fib (from the
example above) had an exception, the API would still execute "jobs.lookup_jid".

Responses to these lowstates are an in-order list of dicts containing the
return data, a yaml response could look like::

    - ms-1: true
      ms-2: true
    - ms-1: foo
      ms-2: bar

In the event of an exception while executing a command the return for that lowstate
will be a string, for example if no minions matched the first lowstate we would get
a return like::

    - No minions matched the target. No command was sent, no jid was assigned.
    - ms-1: true
      ms-2: true

.. admonition:: x-www-form-urlencoded

    Sending JSON or YAML in the request body is simple and most flexible,
    however sending data in urlencoded format is also supported with the
    caveats below. It is the default format for HTML forms, many JavaScript
    libraries, and the :command:`curl` command.

    For example, the equivalent to running ``salt '*' test.ping`` is sending
    ``fun=test.ping&arg&client=local&tgt=*`` in the HTTP request body.

    Caveats:

    * Only a single command may be sent per HTTP request.
    * Repeating the ``arg`` parameter multiple times will cause those
      parameters to be combined into a single list.

      Note, some popular frameworks and languages (notably jQuery, PHP, and
      Ruby on Rails) will automatically append empty brackets onto repeated
      parameters. E.g., ``arg=one``, ``arg=two`` will be sent as ``arg[]=one``,
      ``arg[]=two``. This is not supported; send JSON or YAML instead.


.. |req_token| replace:: a session token from :py:class:`~SaltAuthHandler`.
.. |req_accept| replace:: the desired response format.
.. |req_ct| replace:: the format of the request body.

.. |res_ct| replace:: the format of the response body; depends on the
    :mailheader:`Accept` request header.

.. |200| replace:: success
.. |400| replace:: bad request
.. |401| replace:: authentication required
.. |406| replace:: requested Content-Type not available
.. |500| replace:: internal server error
 N/A time N/A math N/A fnmatch N/A logging copy copy collections defaultdict N/A cgi N/A yaml N/A tornado.httpserver N/A tornado.ioloop N/A tornado.web N/A tornado.gen tornado.concurrent Future zmq.eventloop ioloop N/A salt.ext.six six N/A N/A N/A ioloop install N/A salt.netapi N/A salt.utils N/A salt.utils.event salt.utils.event tagify N/A salt.client N/A salt.runner N/A salt.auth salt.exceptions EauthAuthenticationError N/A json N/A N/A N/A salt utils import_json N/A logger N/A N/A logging getLogger SaltClientsMixIn N/A object N/A N/A 
    MixIn class to container all of the salt clients that the API needs
     N/A __saltclients None saltclients N/A N/A self N/A N/A N/A N/A N/A SaltClientsMixIn __saltclients None N/A N/A local_client N/A N/A N/A salt client get_local_client mopts N/A N/A self application opts N/A N/A SaltClientsMixIn __saltclients N/A local local_batch local_async runner runner_async N/A local_client run_job N/A local_client cmd_batch N/A local_client run_job N/A N/A N/A N/A salt runner RunnerClient opts N/A N/A self application opts cmd_async None N/A N/A SaltClientsMixIn __saltclients N/A property N/A N/A AUTH_TOKEN_HEADER X-Auth-Token N/A AUTH_COOKIE_NAME session_id TimeoutException N/A Exception N/A N/A N/A Any N/A Future N/A N/A 
    Future that wraps other futures to "block" until one is done
     __init__ N/A N/A self futures N/A N/A N/A N/A N/A N/A super Any self __init__ N/A future futures N/A N/A N/A N/A future add_done_callback N/A self done_callback N/A done_callback N/A N/A self future N/A N/A N/A N/A N/A N/A self done N/A N/A N/A N/A self set_result future N/A N/A EventListener N/A object N/A N/A 
    Class responsible for listening to the salt master event bus and updating
    futures. This is the core of what makes this async, this allows us to do
    non-blocking work in the main processes and "wait" for an event to happen
     __init__ N/A N/A self mod_opts opts N/A N/A N/A N/A self mod_opts mod_opts N/A N/A self opts opts N/A N/A self event N/A N/A N/A N/A salt utils event get_event master N/A opts N/A sock_dir N/A opts N/A transport opts opts listen True io_loop N/A N/A N/A N/A tornado ioloop IOLoop current N/A N/A self tag_map N/A defaultdict list N/A N/A self request_map N/A defaultdict list N/A N/A self timeout_map N/A N/A N/A N/A N/A self event set_event_handler N/A self _handle_event_socket_recv N/A clean_timeout_futures N/A N/A self request N/A N/A N/A 
        Remove all futures that were waiting for request `request` since it is done waiting
         N/A N/A request N/A self request_map N/A N/A N/A N/A tag future N/A N/A self request_map N/A request N/A N/A N/A N/A self _timeout_future tag future N/A N/A future N/A self timeout_map N/A N/A N/A N/A N/A N/A N/A N/A tornado ioloop IOLoop current remove_timeout N/A N/A self timeout_map N/A future N/A N/A N/A self timeout_map N/A future N/A N/A N/A self request_map N/A request N/A get_event N/A N/A self request tag callback timeout N/A None None N/A N/A 
        Get an event (async of course) return a future that will get it later
         N/A N/A request _finished N/A N/A future N/A Future N/A N/A N/A future set_exception N/A TimeoutException N/A future N/A future N/A Future N/A N/A callback None N/A handle_future N/A N/A future N/A N/A N/A N/A N/A N/A N/A N/A N/A tornado ioloop IOLoop current add_callback callback future N/A N/A N/A N/A future add_done_callback handle_future N/A N/A N/A N/A N/A self tag_map N/A tag append future N/A N/A N/A N/A N/A self request_map N/A request append N/A tag future N/A timeout N/A N/A timeout_future N/A N/A N/A N/A N/A N/A tornado ioloop IOLoop current call_later timeout N/A self _timeout_future tag future N/A N/A N/A self timeout_map N/A future timeout_future N/A future N/A _timeout_future N/A N/A self tag future N/A N/A N/A 
        Timeout a specific future
         N/A N/A tag N/A self tag_map N/A N/A N/A N/A N/A N/A future done N/A N/A N/A N/A future set_exception N/A TimeoutException N/A N/A N/A N/A N/A self tag_map N/A tag remove future N/A N/A N/A len N/A N/A self tag_map N/A tag 0 N/A N/A N/A N/A self tag_map N/A tag N/A _handle_event_socket_recv N/A N/A self raw N/A N/A N/A 
        Callback for events on the event sub socket
         N/A N/A mtag data N/A N/A N/A self event unpack raw N/A N/A self event serial N/A N/A tag_prefix futures N/A N/A six iteritems N/A self tag_map N/A N/A N/A N/A mtag startswith tag_prefix N/A N/A future futures N/A N/A N/A N/A future done N/A N/A N/A N/A N/A future set_result N/A data tag data mtag N/A N/A N/A N/A N/A self tag_map N/A tag_prefix remove future N/A N/A future N/A self timeout_map N/A N/A N/A N/A N/A N/A N/A N/A tornado ioloop IOLoop current remove_timeout N/A N/A self timeout_map N/A future N/A N/A N/A self timeout_map N/A future N/A N/A get_batch_size N/A N/A batch num_minions N/A N/A N/A 
    Return the batch size that you should have
        batch: string
        num_minions: int

     N/A partition N/A N/A N/A x N/A N/A N/A N/A float x 100.0 num_minions N/A N/A N/A N/A % batch N/A N/A res N/A partition N/A float N/A N/A batch strip % N/A N/A res 1 N/A N/A N/A int N/A N/A math ceil res N/A N/A N/A int res N/A N/A N/A int batch N/A N/A N/A ValueError N/A N/A N/A print N/A N/A Invalid batch data sent: {0}
Data must be in the formof %10, 10% or 3 format batch N/A BaseSaltAPIHandler N/A N/A N/A tornado web RequestHandler SaltClientsMixIn N/A N/A ct_out_map N/A N/A application/json N/A json dumps N/A application/x-yaml N/A yaml safe_dump _verify_client N/A N/A self low N/A N/A N/A 
        Verify that the client is in fact one we have
         N/A N/A N/A client low N/A N/A N/A low get client N/A self saltclients N/A N/A N/A N/A self set_status 400 N/A N/A N/A self write 400 Invalid Client: Client not found in salt clients N/A N/A N/A self finish N/A False N/A True N/A initialize N/A N/A self N/A N/A N/A 
        Initialize the handler before requests are called
         N/A N/A N/A hasattr N/A self application event_listener N/A N/A N/A N/A logger critical init a listener N/A N/A N/A self application event_listener N/A EventListener N/A N/A self application mod_opts N/A N/A self application opts N/A token N/A N/A self N/A N/A N/A 
        The token used for the request
         N/A N/A AUTH_TOKEN_HEADER N/A N/A self request headers N/A N/A N/A N/A N/A self request headers N/A AUTH_TOKEN_HEADER N/A N/A N/A N/A self get_cookie AUTH_COOKIE_NAME N/A property _verify_auth N/A N/A self N/A N/A N/A 
        Boolean whether the request is auth'd
         N/A N/A N/A self token N/A bool N/A N/A N/A N/A self application auth get_tok N/A self token N/A prepare N/A N/A self N/A N/A N/A 
        Run before get/posts etc. Pre-flight checks:
            - verify that we can speak back to them (compatible accept header)
         N/A accept_header N/A N/A N/A N/A self request headers get Accept */* N/A parsed_accept_header N/A N/A N/A N/A cgi parse_header h N/A 0 N/A h N/A N/A accept_header split , find_acceptable_content_type N/A N/A parsed_accept_header N/A N/A N/A media_range parsed_accept_header N/A N/A N/A content_type dumper N/A self ct_out_map N/A N/A N/A N/A fnmatch fnmatch content_type media_range N/A N/A N/A content_type dumper N/A N/A None None N/A N/A N/A content_type dumper N/A find_acceptable_content_type parsed_accept_header N/A N/A content_type N/A N/A N/A N/A self send_error 406 N/A N/A self content_type content_type N/A N/A self dumper dumper N/A N/A self start N/A N/A time time N/A N/A self connected True N/A N/A self lowstate N/A N/A self _get_lowstate N/A timeout_futures N/A N/A self N/A N/A N/A 
        timeout a session
         N/A N/A N/A N/A N/A self application event_listener clean_timeout_futures self N/A on_finish N/A N/A self N/A N/A N/A 
        When the job has been done, lets cleanup
         N/A N/A N/A self timeout_futures N/A on_connection_close N/A N/A self N/A N/A N/A 
        If the client disconnects, lets close out
         N/A N/A N/A self finish N/A serialize N/A N/A self data N/A N/A N/A 
        Serlialize the output based on the Accept header
         N/A N/A N/A self set_header Content-Type N/A self content_type N/A N/A N/A self dumper data N/A _form_loader N/A N/A self _ N/A N/A N/A 
        function to get the data from the urlencoded forms
        ignore the data passed in and just get the args from wherever they are
         N/A data N/A N/A N/A key val N/A N/A six iteritems N/A N/A self request arguments N/A N/A N/A N/A len val 1 N/A N/A N/A data N/A key N/A val N/A 0 N/A N/A N/A data N/A key val N/A data N/A deserialize N/A N/A self data N/A N/A N/A 
        Deserialize the data based on request content type headers
         N/A ct_in_map N/A application/x-www-form-urlencoded application/json application/x-yaml text/yaml text/plain N/A self _form_loader N/A json loads N/A yaml safe_load N/A yaml safe_load N/A json loads N/A N/A N/A header N/A N/A cgi parse_header N/A N/A N/A self request headers N/A Content-Type N/A N/A value parameters header N/A N/A N/A ct_in_map N/A value data N/A N/A N/A KeyError N/A N/A N/A N/A self send_error 406 N/A N/A ValueError N/A N/A N/A N/A self send_error 400 N/A _get_lowstate N/A N/A self N/A N/A N/A 
        Format the incoming data into a lowstate object
         N/A N/A N/A N/A self request body N/A N/A N/A data N/A N/A self deserialize N/A N/A self request body N/A N/A self raw_data N/A copy data N/A N/A N/A arg data N/A N/A isinstance N/A data N/A arg list N/A N/A N/A data N/A arg N/A N/A data N/A arg N/A N/A N/A isinstance data list N/A N/A lowstate N/A data N/A N/A lowstate data N/A lowstate N/A set_default_headers N/A N/A self N/A N/A N/A 
        Set default CORS headers
         N/A mod_opts N/A N/A self application mod_opts N/A N/A N/A mod_opts get cors_origin N/A N/A origin N/A N/A N/A N/A self request headers get Origin N/A allowed_origin N/A _check_cors_origin origin N/A mod_opts N/A cors_origin N/A allowed_origin N/A N/A N/A N/A self set_header Access-Control-Allow-Origin allowed_origin N/A options N/A N/A self N/A args kwargs N/A N/A 
        Return CORS headers for preflight requests
         N/A request_headers N/A N/A N/A N/A self request headers get Access-Control-Request-Headers N/A allowed_headers N/A N/A request_headers split , N/A N/A N/A self set_header Access-Control-Allow-Headers N/A N/A , join allowed_headers N/A N/A N/A self set_header Access-Control-Expose-Headers X-Auth-Token N/A N/A N/A self set_header Access-Control-Allow-Methods OPTIONS, GET, POST N/A N/A N/A self set_status 204 N/A N/A N/A self finish N/A N/A SaltAuthHandler N/A BaseSaltAPIHandler N/A N/A 
    Handler for login requests
     get N/A N/A self N/A N/A N/A 
        All logins are done over post, this is a parked enpoint

        .. http:get:: /login

            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -i localhost:8000/login

        .. code-block:: http

            GET /login HTTP/1.1
            Host: localhost:8000
            Accept: application/json

        **Example response:**

        .. code-block:: http

            HTTP/1.1 401 Unauthorized
            Content-Type: application/json
            Content-Length: 58

            {"status": "401 Unauthorized", "return": "Please log in"}
         N/A N/A N/A self set_status 401 N/A N/A N/A self set_header WWW-Authenticate Session N/A ret N/A status return 401 Unauthorized Please log in N/A N/A N/A self write N/A N/A self serialize ret N/A post N/A N/A self N/A N/A N/A 
        :ref:`Authenticate  <rest_tornado-auth>` against Salt's eauth system

        .. http:post:: /login

            :reqheader X-Auth-Token: |req_token|
            :reqheader Accept: |req_accept|
            :reqheader Content-Type: |req_ct|

            :form eauth: the eauth backend configured for the user
            :form username: username
            :form password: password

            :status 200: |200|
            :status 400: |400|
            :status 401: |401|
            :status 406: |406|
            :status 500: |500|

        **Example request:**

        .. code-block:: bash

            curl -si localhost:8000/login \
                    -H "Accept: application/json" \
                    -d username='saltuser' \
                    -d password='saltpass' \
                    -d eauth='pam'

        .. code-block:: http

            POST / HTTP/1.1
            Host: localhost:8000
            Content-Length: 42
            Content-Type: application/x-www-form-urlencoded
            Accept: application/json

            username=saltuser&password=saltpass&eauth=pam

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Type: application/json
            Content-Length: 206
            X-Auth-Token: 6d1b722e
            Set-Cookie: session_id=6d1b722e; expires=Sat, 17 Nov 2012 03:23:52 GMT; Path=/

            {"return": {
                "token": "6d1b722e",
                "start": 1363805943.776223,
                "expire": 1363849143.776224,
                "user": "saltuser",
                "eauth": "pam",
                "perms": [
                    "grains.*",
                    "status.*",
                    "sys.*",
                    "test.*"
                ]
            }}
         N/A N/A N/A request_payload N/A N/A self deserialize N/A N/A self request body N/A N/A N/A isinstance request_payload dict N/A N/A N/A N/A self send_error 400 N/A N/A creds N/A username password eauth N/A request_payload N/A username N/A request_payload N/A password N/A request_payload N/A eauth N/A N/A N/A KeyError N/A N/A N/A N/A self send_error 400 N/A N/A token N/A N/A N/A N/A self application auth mk_token creds N/A N/A token token N/A N/A N/A N/A self send_error 401 N/A N/A N/A N/A perms N/A N/A N/A N/A N/A self application opts N/A external_auth N/A N/A token N/A eauth N/A N/A token N/A name N/A N/A N/A KeyError N/A N/A N/A N/A self send_error 401 N/A N/A N/A N/A AttributeError IndexError N/A N/A N/A N/A logging debug N/A N/A Configuration for external_auth malformed for eauth '{0}', and user '{1}'. format N/A N/A token get eauth N/A N/A token get name exc_info True N/A N/A N/A self send_error 500 N/A N/A ret N/A return N/A N/A token expire start user eauth perms N/A token N/A token N/A token N/A expire N/A token N/A start N/A token N/A name N/A token N/A eauth perms N/A N/A N/A self write N/A N/A self serialize ret N/A N/A SaltAPIHandler N/A BaseSaltAPIHandler SaltClientsMixIn N/A N/A 
    Main API handler for base "/"
     get N/A N/A self N/A N/A N/A 
        An enpoint to determine salt-api capabilities

        .. http:get:: /

            :reqheader Accept: |req_accept|

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -i localhost:8000

        .. code-block:: http

            GET / HTTP/1.1
            Host: localhost:8000
            Accept: application/json

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Type: application/json
            Content-Legnth: 83

            {"clients": ["local", "local_batch", "local_async", "runner", "runner_async"], "return": "Welcome"}
         N/A ret N/A clients return N/A list N/A N/A N/A self saltclients keys Welcome N/A N/A N/A self write N/A N/A self serialize ret N/A post N/A N/A self N/A N/A N/A 
        Send one or more Salt commands (lowstates) in the request body

        .. http:post:: /

            :reqheader X-Auth-Token: |req_token|
            :reqheader Accept: |req_accept|
            :reqheader Content-Type: |req_ct|

            :resheader Content-Type: |res_ct|

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

            :term:`lowstate` data describing Salt commands must be sent in the
            request body.

        **Example request:**

        .. code-block:: bash

            curl -si https://localhost:8000 \
                    -H "Accept: application/x-yaml" \
                    -H "X-Auth-Token: d40d1e1e" \
                    -d client=local \
                    -d tgt='*' \
                    -d fun='test.ping' \
                    -d arg

        .. code-block:: http

            POST / HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml
            X-Auth-Token: d40d1e1e
            Content-Length: 36
            Content-Type: application/x-www-form-urlencoded

            fun=test.ping&arg&client=local&tgt=*

        **Example response:**
        Responses are an in-order list of the lowstate's return data. In the
        event of an exception running a command the return will be a string
        instead of a mapping.

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 200
            Allow: GET, HEAD, POST
            Content-Type: application/x-yaml

            return:
            - ms-0: true
                ms-1: true
                ms-2: true
                ms-3: true
                ms-4: true

        .. admonition:: multiple commands
            Note that if multiple :term:`lowstate` structures are sent, the Salt
            API will execute them in serial, and will not stop execution upon failure
            of a previous job. If you need to have commands executed in order and
            stop on failure please use compount-command-execution.

         N/A N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A N/A N/A self disbatch N/A N/A N/A tornado web asynchronous disbatch N/A N/A self N/A N/A N/A 
        Disbatch all lowstates to the appropriate clients
         N/A ret N/A N/A low N/A self lowstate N/A N/A N/A N/A N/A self _verify_client low N/A N/A N/A N/A N/A N/A self token None N/A token low N/A N/A N/A low N/A token N/A self token N/A N/A N/A N/A token low N/A N/A username low N/A password low N/A eauth low N/A N/A N/A N/A ret append Failed to authenticate N/A N/A N/A N/A chunk_ret N/A N/A N/A getattr self N/A N/A _disbatch_{0} format N/A low N/A client low N/A N/A N/A ret append chunk_ret N/A N/A N/A EauthAuthenticationError N/A exc N/A N/A N/A N/A ret append Failed to authenticate N/A N/A N/A Exception N/A ex N/A N/A N/A N/A ret append N/A N/A Unexpected exception while handling request: {0} format ex N/A N/A N/A logger error Unexpected exception while handling request: exc_info True N/A N/A N/A self write N/A N/A self serialize N/A return ret N/A N/A N/A self finish N/A N/A N/A tornado gen coroutine _disbatch_local_batch N/A N/A self chunk N/A N/A N/A 
        Disbatch local client batched commands
         N/A f_call N/A N/A N/A salt utils format_call N/A N/A self saltclients N/A local_batch chunk N/A ping_ret N/A N/A N/A self _disbatch_local N/A tgt fun expr_form N/A chunk N/A tgt test.ping N/A N/A f_call N/A kwargs N/A expr_form N/A chunk_ret N/A N/A N/A N/A isinstance ping_ret dict N/A N/A N/A N/A N/A tornado gen Return chunk_ret N/A minions N/A list N/A N/A ping_ret keys N/A maxflight N/A get_batch_size N/A N/A f_call N/A kwargs N/A batch N/A len minions N/A inflight_futures N/A N/A N/A N/A f_call N/A kwargs N/A expr_form list N/A N/A N/A N/A len minions 0 N/A N/A len inflight_futures 0 N/A N/A N/A N/A N/A len inflight_futures maxflight N/A N/A len minions 0 N/A N/A minion_id N/A N/A minions pop 0 N/A batch_chunk N/A dict chunk N/A N/A batch_chunk N/A tgt N/A minion_id N/A N/A batch_chunk N/A expr_form list N/A future N/A N/A self _disbatch_local batch_chunk N/A N/A N/A inflight_futures append future N/A N/A N/A len inflight_futures 0 N/A N/A N/A finished_future N/A N/A Any inflight_futures N/A N/A N/A b_ret N/A N/A finished_future result N/A N/A N/A TimeoutException N/A N/A N/A N/A N/A chunk_ret update b_ret N/A N/A N/A inflight_futures remove finished_future N/A N/A N/A N/A tornado gen Return chunk_ret N/A N/A N/A tornado gen coroutine _disbatch_local N/A N/A self chunk N/A N/A N/A 
        Dispatch local client commands
         N/A chunk_ret N/A N/A f_call N/A N/A N/A salt utils format_call N/A N/A self saltclients N/A local chunk N/A N/A N/A pub_data N/A N/A N/A self saltclients N/A local N/A N/A f_call get args N/A N/A N/A f_call get kwargs N/A N/A N/A N/A EauthAuthenticationError N/A N/A N/A N/A N/A tornado gen Return Not authorized to run this job N/A N/A jid pub_data N/A N/A N/A N/A N/A tornado gen Return No minions matched the target. No command was sent, no jid was assigned. N/A minions_remaining N/A pub_data N/A minions N/A syndic_min_wait None N/A N/A N/A N/A self application opts N/A order_masters N/A N/A syndic_min_wait N/A N/A N/A tornado gen sleep N/A N/A N/A self application opts N/A syndic_wait N/A job_not_running N/A N/A self job_not_running N/A pub_data N/A jid N/A chunk N/A tgt N/A N/A f_call N/A kwargs N/A expr_form minions_remaining minions_remaining N/A N/A syndic_min_wait None N/A N/A N/A syndic_min_wait N/A chunk_ret N/A N/A N/A self all_returns N/A pub_data N/A jid finish_futures N/A job_not_running minions_remaining minions_remaining N/A N/A N/A N/A tornado gen Return chunk_ret N/A N/A N/A tornado gen coroutine all_returns N/A N/A self jid finish_futures minions_remaining N/A None None N/A N/A 
        Return a future which will complete once all returns are completed
        (according to minions_remaining), or one of the passed in "finish_futures" completes
         N/A N/A finish_futures None N/A N/A finish_futures N/A N/A N/A minions_remaining None N/A N/A minions_remaining N/A N/A ret_tag N/A tagify N/A jid ret job N/A chunk_ret N/A N/A True N/A N/A ret_event N/A N/A N/A N/A self application event_listener get_event self tag ret_tag N/A f N/A N/A Any N/A N/A ret_event finish_futures N/A N/A f finish_futures N/A N/A N/A N/A N/A tornado gen Return chunk_ret N/A event N/A N/A f result N/A N/A chunk_ret N/A N/A N/A event N/A data N/A id N/A N/A event N/A data N/A return N/A N/A N/A N/A N/A minions_remaining remove N/A N/A event N/A data N/A id N/A N/A N/A ValueError N/A N/A N/A N/A N/A len minions_remaining 0 N/A N/A N/A N/A N/A tornado gen Return chunk_ret N/A N/A N/A tornado gen coroutine job_not_running N/A N/A self jid tgt tgt_type minions_remaining N/A None N/A N/A 
        Return a future which will complete once jid (passed in) is no longer
        running on tgt
         N/A N/A minions_remaining None N/A N/A minions_remaining N/A N/A ping_pub_data N/A N/A N/A self saltclients N/A local tgt saltutil.find_job N/A jid expr_form tgt_type N/A ping_tag N/A tagify N/A N/A ping_pub_data N/A jid ret job N/A minion_running False N/A True N/A N/A N/A N/A event N/A N/A N/A N/A N/A self application event_listener get_event self tag ping_tag timeout N/A N/A N/A self application opts N/A gather_job_timeout N/A N/A N/A TimeoutException N/A N/A N/A minion_running N/A N/A N/A N/A N/A tornado gen Return True N/A N/A ping_pub_data N/A N/A N/A self saltclients N/A local tgt saltutil.find_job N/A jid expr_form tgt_type N/A ping_tag N/A tagify N/A N/A ping_pub_data N/A jid ret job N/A minion_running False N/A N/A N/A N/A N/A N/A event N/A data get return N/A N/A N/A N/A N/A minion_running True N/A id_ N/A N/A event N/A data N/A id N/A N/A id_ minions_remaining N/A N/A N/A N/A minions_remaining append N/A N/A event N/A data N/A id N/A N/A N/A tornado gen coroutine _disbatch_local_async N/A N/A self chunk N/A N/A N/A 
        Disbatch local client_async commands
         N/A f_call N/A N/A N/A salt utils format_call N/A N/A self saltclients N/A local_async chunk N/A pub_data N/A N/A N/A self saltclients N/A local_async N/A N/A f_call get args N/A N/A N/A f_call get kwargs N/A N/A N/A N/A N/A tornado gen Return pub_data N/A N/A N/A tornado gen coroutine _disbatch_runner N/A N/A self chunk N/A N/A N/A 
        Disbatch runner client commands
         N/A pub_data N/A N/A N/A self saltclients N/A runner chunk N/A tag N/A N/A pub_data N/A tag /ret N/A N/A N/A event N/A N/A N/A N/A N/A self application event_listener get_event self tag tag N/A N/A N/A N/A tornado gen Return N/A N/A event N/A data N/A return N/A N/A N/A TimeoutException N/A N/A N/A N/A N/A tornado gen Return Timeout waiting for runner to execute N/A N/A N/A tornado gen coroutine _disbatch_runner_async N/A N/A self chunk N/A N/A N/A 
        Disbatch runner client_async commands
         N/A pub_data N/A N/A N/A self saltclients N/A runner chunk N/A N/A N/A N/A tornado gen Return pub_data N/A N/A N/A tornado gen coroutine N/A MinionSaltAPIHandler N/A SaltAPIHandler N/A N/A 
    A convenience endpoint for minion related functions
     get N/A N/A self mid N/A None N/A N/A 
        A convenience URL for getting lists of minions or getting minion
        details

        .. http:get:: /minions/(mid)

            :reqheader X-Auth-Token: |req_token|
            :reqheader Accept: |req_accept|

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -i localhost:8000/minions/ms-3

        .. code-block:: http

            GET /minions/ms-3 HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 129005
            Content-Type: application/x-yaml

            return:
            - ms-3:
                grains.items:
                    ...
         N/A N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A N/A self lowstate N/A N/A client tgt fun local N/A mid * grains.items N/A N/A N/A self disbatch N/A N/A N/A tornado web asynchronous post N/A N/A self N/A N/A N/A 
        Start an execution command and immediately return the job id

        .. http:post:: /minions

            :reqheader X-Auth-Token: |req_token|
            :reqheader Accept: |req_accept|
            :reqheader Content-Type: |req_ct|

            :resheader Content-Type: |res_ct|

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

            :term:`lowstate` data describing Salt commands must be sent in the
            request body. The ``client`` option will be set to
            :py:meth:`~salt.client.LocalClient.local_async`.

        **Example request:**

        .. code-block:: bash

            curl -sSi localhost:8000/minions \
                -H "Accept: application/x-yaml" \
                -d tgt='*' \
                -d fun='status.diskusage'

        .. code-block:: http

            POST /minions HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml
            Content-Length: 26
            Content-Type: application/x-www-form-urlencoded

            tgt=*&fun=status.diskusage

        **Example response:**

        .. code-block:: http

            HTTP/1.1 202 Accepted
            Content-Length: 86
            Content-Type: application/x-yaml

            return:
            - jid: '20130603122505459265'
              minions: [ms-4, ms-3, ms-2, ms-1, ms-0]
         N/A N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A low N/A self lowstate N/A N/A N/A client low N/A N/A N/A low N/A client local_async N/A N/A N/A N/A N/A low get client local_async N/A N/A N/A N/A self set_status 400 N/A N/A N/A self write We don't serve your kind here N/A N/A N/A self finish N/A N/A N/A N/A self disbatch N/A N/A N/A tornado web asynchronous N/A JobsSaltAPIHandler N/A SaltAPIHandler N/A N/A 
    A convenience endpoint for job cache data
     get N/A N/A self jid N/A None N/A N/A 
        A convenience URL for getting lists of previously run jobs or getting
        the return from a single job

        .. http:get:: /jobs/(jid)

            List jobs or show a single job from the job cache.

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -i localhost:8000/jobs

        .. code-block:: http

            GET /jobs HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 165
            Content-Type: application/x-yaml

            return:
            - '20121130104633606931':
                Arguments:
                - '3'
                Function: test.fib
                Start Time: 2012, Nov 30 10:46:33.606931
                Target: jerry
                Target-type: glob

        **Example request:**

        .. code-block:: bash

            curl -i localhost:8000/jobs/20121130104633606931

        .. code-block:: http

            GET /jobs/20121130104633606931 HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 73
            Content-Type: application/x-yaml

            info:
            - Arguments:
                - '3'
                Function: test.fib
                Minions:
                - jerry
                Start Time: 2012, Nov 30 10:46:33.606931
                Target: '*'
                Target-type: glob
                User: saltdev
                jid: '20121130104633606931'
            return:
            - jerry:
                - - 0
                - 1
                - 1
                - 2
                - 6.9141387939453125e-06
         N/A N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A jid N/A N/A N/A self lowstate N/A N/A fun jid client jobs.list_job jid runner N/A N/A N/A self lowstate N/A N/A fun client jobs.list_jobs runner N/A N/A N/A self disbatch N/A N/A N/A tornado web asynchronous N/A RunSaltAPIHandler N/A SaltAPIHandler N/A N/A 
    Endpoint to run commands without normal session handling
     post N/A N/A self N/A N/A N/A 
        Run commands bypassing the :ref:`normal session handling
        <rest_cherrypy-auth>`

        .. http:post:: /run

            This entry point is primarily for "one-off" commands. Each request
            must pass full Salt authentication credentials. Otherwise this URL
            is identical to the :py:meth:`root URL (/) <LowDataAdapter.POST>`.

            :term:`lowstate` data describing Salt commands must be sent in the
            request body.

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -sS localhost:8000/run \
                -H 'Accept: application/x-yaml' \
                -d client='local' \
                -d tgt='*' \
                -d fun='test.ping' \
                -d username='saltdev' \
                -d password='saltdev' \
                -d eauth='pam'

        .. code-block:: http

            POST /run HTTP/1.1
            Host: localhost:8000
            Accept: application/x-yaml
            Content-Length: 75
            Content-Type: application/x-www-form-urlencoded

            client=local&tgt=*&fun=test.ping&username=saltdev&password=saltdev&eauth=pam

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 73
            Content-Type: application/x-yaml

            return:
            - ms-0: true
                ms-1: true
                ms-2: true
                ms-3: true
                ms-4: true
         N/A N/A N/A self disbatch N/A N/A N/A tornado web asynchronous N/A EventsSaltAPIHandler N/A SaltAPIHandler N/A N/A 
    Expose the Salt event bus

    The event bus on the Salt master exposes a large variety of things, notably
    when executions are started on the master and also when minions ultimately
    return their results. This URL provides a real-time window into a running
    Salt infrastructure.

    .. seealso:: :ref:`events`
     get N/A N/A self N/A N/A N/A 
        An HTTP stream of the Salt master event bus

        This stream is formatted per the Server Sent Events (SSE) spec. Each
        event is formatted as JSON.

        .. http:get:: /events

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|

        **Example request:**

        .. code-block:: bash

            curl -NsS localhost:8000/events

        .. code-block:: http

            GET /events HTTP/1.1
            Host: localhost:8000

        **Example response:**

        .. code-block:: http

            HTTP/1.1 200 OK
            Connection: keep-alive
            Cache-Control: no-cache
            Content-Type: text/event-stream;charset=utf-8

            retry: 400
            data: {'tag': '', 'data': {'minions': ['ms-4', 'ms-3', 'ms-2', 'ms-1', 'ms-0']}}

            data: {'tag': '20130802115730568475', 'data': {'jid': '20130802115730568475', 'return': True, 'retcode': 0, 'success': True, 'cmd': '_return', 'fun': 'test.ping', 'id': 'ms-1'}}

        The event stream can be easily consumed via JavaScript:

        .. code-block:: javascript

            # Note, you must be authenticated!
            var source = new EventSource('/events');
            source.onopen = function() { console.debug('opening') };
            source.onerror = function(e) { console.debug('error!', e) };
            source.onmessage = function(e) { console.debug(e.data) };

        Or using CORS:

        .. code-block:: javascript

            var source = new EventSource('/events', {withCredentials: true});

        Some browser clients lack CORS support for the ``EventSource()`` API. Such
        clients may instead pass the :mailheader:`X-Auth-Token` value as an URL
        parameter:

        .. code-block:: bash

            curl -NsS localhost:8000/events/6d1b722e

        It is also possible to consume the stream via the shell.

        Records are separated by blank lines; the ``data:`` and ``tag:``
        prefixes will need to be removed manually before attempting to
        unserialize the JSON.

        curl's ``-N`` flag turns off input buffering which is required to
        process the stream incrementally.

        Here is a basic example of printing each event as it comes in:

        .. code-block:: bash

            curl -NsS localhost:8000/events |\
                    while IFS= read -r line ; do
                        echo $line
                    done

        Here is an example of using awk to filter events based on tag:

        .. code-block:: bash

            curl -NsS localhost:8000/events |\
                    awk '
                        BEGIN { RS=""; FS="\\n" }
                        $1 ~ /^tag: salt\/job\/[0-9]+\/new$/ { print $0 }
                    '
            tag: salt/job/20140112010149808995/new
            data: {"tag": "salt/job/20140112010149808995/new", "data": {"tgt_type": "glob", "jid": "20140112010149808995", "tgt": "jerry", "_stamp": "2014-01-12_01:01:49.809617", "user": "shouse", "arg": [], "fun": "test.ping", "minions": ["jerry"]}}
            tag: 20140112010149808995
            data: {"tag": "20140112010149808995", "data": {"fun_args": [], "jid": "20140112010149808995", "return": true, "retcode": 0, "success": true, "cmd": "_return", "_stamp": "2014-01-12_01:01:49.819316", "fun": "test.ping", "id": "jerry"}}
         N/A N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A N/A N/A self set_header Content-Type text/event-stream N/A N/A N/A self set_header Cache-Control no-cache N/A N/A N/A self set_header Connection keep-alive N/A N/A N/A self write N/A N/A retry: {0}
 format 400 N/A N/A N/A self flush N/A True N/A N/A N/A N/A event N/A N/A N/A N/A N/A self application event_listener get_event self N/A N/A N/A self write N/A N/A tag: {0}
 format N/A N/A event get tag N/A N/A N/A self write N/A N/A data: {0}

 format N/A N/A json dumps event N/A N/A N/A self flush N/A N/A N/A TimeoutException N/A N/A N/A N/A N/A tornado gen coroutine N/A WebhookSaltAPIHandler N/A SaltAPIHandler N/A N/A 
    A generic web hook entry point that fires an event on Salt's event bus

    External services can POST data to this URL to trigger an event in Salt.
    For example, Amazon SNS, Jenkins-CI or Travis-CI, or GitHub web hooks.

    .. note:: Be mindful of security

        Salt's Reactor can run any code. A Reactor SLS that responds to a hook
        event is responsible for validating that the event came from a trusted
        source and contains valid data.

        **This is a generic interface and securing it is up to you!**

        This URL requires authentication however not all external services can
        be configured to authenticate. For this reason authentication can be
        selectively disabled for this URL. Follow best practices -- always use
        SSL, pass a secret key, configure the firewall to only allow traffic
        from a known source, etc.

    The event data is taken from the request body. The
    :mailheader:`Content-Type` header is respected for the payload.

    The event tag is prefixed with ``salt/netapi/hook`` and the URL path is
    appended to the end. For example, a ``POST`` request sent to
    ``/hook/mycompany/myapp/mydata`` will produce a Salt event with the tag
    ``salt/netapi/hook/mycompany/myapp/mydata``.

    The following is an example ``.travis.yml`` file to send notifications to
    Salt of successful test runs:

    .. code-block:: yaml

        language: python
        script: python -m unittest tests
        after_success:
            - 'curl -sS http://saltapi-url.example.com:8000/hook/travis/build/success -d branch="${TRAVIS_BRANCH}" -d commit="${TRAVIS_COMMIT}"'

    .. seealso:: :ref:`events`, :ref:`reactor`
     post N/A N/A self tag_suffix N/A None N/A N/A 
        Fire an event in Salt with a custom event tag and data

        .. http:post:: /hook

            :status 200: |200|
            :status 401: |401|
            :status 406: |406|
            :status 413: request body is too large

        **Example request:**

        .. code-block:: bash

            curl -sS localhost:8000/hook -d foo='Foo!' -d bar='Bar!'

        .. code-block:: http

            POST /hook HTTP/1.1
            Host: localhost:8000
            Content-Length: 16
            Content-Type: application/x-www-form-urlencoded

            foo=Foo&bar=Bar!

        **Example response**:

        .. code-block:: http

            HTTP/1.1 200 OK
            Content-Length: 14
            Content-Type: application/json

            {"success": true}

        As a practical example, an internal continuous-integration build
        server could send an HTTP POST request to the URL
        ``http://localhost:8000/hook/mycompany/build/success`` which contains
        the result of a build and the SHA of the version that was built as
        JSON. That would then produce the following event in Salt that could be
        used to kick off a deployment via Salt's Reactor::

            Event fired at Fri Feb 14 17:40:11 2014
            *************************
            Tag: salt/netapi/hook/mycompany/build/success
            Data:
            {'_stamp': '2014-02-14_17:40:11.440996',
                'headers': {
                    'X-My-Secret-Key': 'F0fAgoQjIT@W',
                    'Content-Length': '37',
                    'Content-Type': 'application/json',
                    'Host': 'localhost:8000',
                    'Remote-Addr': '127.0.0.1'},
                'post': {'revision': 'aa22a3c4b2e7', 'result': True}}

        Salt's Reactor could listen for the event:

        .. code-block:: yaml

            reactor:
              - 'salt/netapi/hook/mycompany/build/*':
                - /srv/reactor/react_ci_builds.sls

        And finally deploy the new build:

        .. code-block:: yaml

            {% set secret_key = data.get('headers', {}).get('X-My-Secret-Key') %}
            {% set build = data.get('post', {}) %}

            {% if secret_key == 'F0fAgoQjIT@W' and build.result == True %}
            deploy_my_app:
              cmd.state.sls:
                - tgt: 'application*'
                - arg:
                  - myapp.deploy
                - kwarg:
                    pillar:
                      revision: {{ revision }}
            {% endif %}
         N/A disable_auth N/A N/A N/A N/A self application mod_opts get webhook_disable_auth N/A N/A N/A disable_auth N/A N/A N/A self _verify_auth N/A N/A N/A N/A self redirect /login N/A N/A tag salt/netapi/hook N/A tag_suffix N/A N/A tag tag_suffix N/A N/A self event N/A N/A N/A N/A salt utils event get_event master N/A N/A N/A self application opts N/A sock_dir N/A N/A N/A self application opts N/A transport opts N/A N/A self application opts listen False N/A ret N/A N/A N/A self event fire_event N/A post get headers N/A self raw_data N/A dict N/A N/A self request query_arguments N/A dict N/A N/A self request headers tag N/A N/A N/A self write N/A N/A self serialize N/A success ret N/A N/A _check_cors_origin N/A N/A origin allowed_origins N/A N/A N/A 
    Check if an origin match cors allowed origins
     N/A N/A isinstance allowed_origins list N/A N/A N/A origin allowed_origins N/A N/A origin N/A N/A N/A allowed_origins * N/A N/A allowed_origins N/A N/A N/A allowed_origins origin N/A N/A allowed_origins N/A