Module Expr Str ImportFrom alias Import alias Import alias FunctionDef arguments args defaults body Expr Str ImportFrom alias Import alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore BoolOpOr NameLoad Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Return NameLoad decorator_list Assign NameStore Call NameLoad
N/A N/A 
Deployment
==========

The ``rest_cherrypy`` netapi module is a standard Python WSGI app. It can be
deployed one of two ways.

:program:`salt-api` using the CherryPy server
---------------------------------------------

The default configuration is to run this module using :program:`salt-api` to
start the Python-based CherryPy server. This server is lightweight,
multi-threaded, encrypted with SSL, and should be considered production-ready.

Using a WSGI-compliant web server
---------------------------------

This module may be deployed on any WSGI-compliant server such as Apache with
mod_wsgi or Nginx with FastCGI, to name just two (there are many).

Note, external WSGI servers handle URLs, paths, and SSL certs directly. The
``rest_cherrypy`` configuration options are ignored and the ``salt-api`` daemon
does not need to be running at all. Remember Salt authentication credentials
are sent in the clear unless SSL is being enforced!

An example Apache virtual host configuration::

    <VirtualHost *:80>
        ServerName example.com
        ServerAlias *.example.com

        ServerAdmin webmaster@example.com

        LogLevel warn
        ErrorLog /var/www/example.com/logs/error.log
        CustomLog /var/www/example.com/logs/access.log combined

        DocumentRoot /var/www/example.com/htdocs

        WSGIScriptAlias / /path/to/salt/netapi/rest_cherrypy/wsgi.py
    </VirtualHost>

 __future__ absolute_import N/A os N/A cherrypy bootstrap_app N/A N/A N/A N/A N/A 
    Grab the opts dict of the master config by trying to import Salt
     salt.netapi.rest_cherrypy app N/A salt.config N/A __opts__ N/A N/A N/A salt config client_config N/A N/A N/A os environ get SALT_MASTER_CONFIG /etc/salt/master N/A N/A N/A app get_app __opts__ N/A get_application N/A N/A N/A args N/A N/A 
    Returns a WSGI application function. If you supply the WSGI app and config
    it will use that, otherwise it will try to obtain them from a local Salt
    installation
     N/A opts_tuple args wsgi_app N/A N/A environ start_response N/A N/A N/A N/A root _ conf N/A opts_tuple N/A bootstrap_app N/A N/A N/A N/A cherrypy config update N/A environment embedded N/A N/A N/A N/A cherrypy tree mount root / conf N/A N/A N/A cherrypy tree environ start_response N/A N/A wsgi_app N/A N/A application N/A get_application