signature stringlengths 8 3.44k | body stringlengths 0 1.41M | docstring stringlengths 1 122k | id stringlengths 5 17 |
|---|---|---|---|
def __init__(self, on=None, device=None, stats_server=None, gateway=None): | super(RouterTunTap, self).__init__()<EOL>if on is not None:<EOL><INDENT>value = [device or '<STR_LIT>', on]<EOL>if stats_server:<EOL><INDENT>value.append(stats_server)<EOL>if gateway:<EOL><INDENT>value.append(gateway)<EOL><DEDENT><DEDENT>self._set_aliased('<STR_LIT>', '<STR_LIT:U+0020>'.join(value), multi=True)<EOL><DEDENT> | Passing params will create a router device.
:param str|unicode on: Socket file.
:param str|unicode device: Device name.
:param str|unicode stats_server: Router stats server address to run at.
:param str|unicode gateway: Gateway address. | f13062:c15:m0 |
def set_basic_params(self, use_credentials=None, stats_server=None): | self._set_aliased('<STR_LIT>', use_credentials)<EOL>self._set_aliased('<STR_LIT>', stats_server)<EOL>return self<EOL> | :param str|unicode use_credentials: Enable check of SCM_CREDENTIALS for tuntap client/server.
:param str|unicode stats_server: Router stats server address to run at. | f13062:c15:m1 |
def register_route(self, src, dst, gateway): | self._set_aliased('<STR_LIT>', '<STR_LIT:U+0020>'.join((src, dst, gateway)), multi=True)<EOL>return self<EOL> | Adds a routing rule to the tuntap router.
:param str|unicode src: Source/mask.
:param str|unicode dst: Destination/mask.
:param str|unicode gateway: Gateway address. | f13062:c15:m2 |
def device_connect(self, socket, device_name): | self._set_aliased('<STR_LIT>', '<STR_LIT>' % (device_name, socket))<EOL>return self<EOL> | Add a tuntap device to the instance.
To be used in a vassal.
:param str|unicode socket: Router socket.
Example: `/run/tuntap_router.socket`.
:param str|unicode device_name: Device.
Example: `uwsgi0`. | f13062:c15:m3 |
def device_add_rule(self, direction, action, src, dst, target=None): | value = [direction, src, dst, action]<EOL>if target:<EOL><INDENT>value.append(target)<EOL><DEDENT>self._set_aliased('<STR_LIT>', '<STR_LIT:U+0020>'.join(value), multi=True)<EOL>return self<EOL> | Adds a tuntap device rule.
To be used in a vassal.
:param str|unicode direction: Direction:
* in
* out.
:param str|unicode action: Action:
* allow
* deny
* route
* gateway.
:param str|unicode src: Source/mask.
:param str|unicode dst: Destination/mask.
:param str|unicode target: Depends on action.
* Route / Gateway: Accept addr:port | f13062:c15:m4 |
def add_firewall_rule(self, direction, action, src=None, dst=None): | value = [action]<EOL>if src:<EOL><INDENT>value.extend((src, dst))<EOL><DEDENT>self._set_aliased('<STR_LIT>' % direction.lower(), '<STR_LIT:U+0020>'.join(value), multi=True)<EOL>return self<EOL> | Adds a firewall rule to the router.
The TunTap router includes a very simple firewall for governing vassal's traffic.
The first matching rule stops the chain, if no rule applies, the policy is "allow".
:param str|unicode direction: Direction:
* in
* out
:param str|unicode action: Action:
* allow
* deny
:param str|unicode src: Source/mask.
:param str|unicode dst: Destination/mask | f13062:c15:m5 |
def set_basic_params(<EOL>self, version=AUTO, python_home=None, enable_threads=None, search_path=None,<EOL>python_binary=None, tracebacker_path=None, plugin_dir=None, os_env_reload=None,<EOL>optimization_level=None): | self._set_name(version)<EOL>self._section.workers.set_thread_params(enable=enable_threads)<EOL>self._set('<STR_LIT>', tracebacker_path)<EOL>self._set('<STR_LIT>', python_binary)<EOL>self._set('<STR_LIT>', python_home)<EOL>self._set('<STR_LIT>', search_path, multi=True)<EOL>self._set('<STR_LIT>', os_env_reload, cast=bool)<EOL>self._set('<STR_LIT>', optimization_level)<EOL>self._section.set_plugins_params(search_dirs=plugin_dir)<EOL>return self._section<EOL> | :param str|unicode|int version: Python version plugin supports.
Example:
* 3 - version 3
* <empty> - version 2
* <default> - version deduced by uwsgiconf
:param str|unicode python_home: Set python executable directory - PYTHONHOME/virtualenv.
:param str|unicode search_path: Add directory (or an .egg or a glob) to the Python search path.
.. note:: This can be specified up to 64 times.
:param str|unicode python_binary: Set python program name.
:param str|unicode tracebacker_path: Enable the uWSGI Python tracebacker.
http://uwsgi-docs.readthedocs.io/en/latest/Tracebacker.html
:param str|unicode plugin_dir: Directory to search for plugin.
:param bool enable_threads: Enable threads in the embedded languages.
This will allow to spawn threads in your app.
.. warning:: Threads will simply *not work* if this option is not enabled.
There will likely be no error, just no execution of your thread code.
:param bool os_env_reload: Force ``os.environ`` reloading for every request.
Used to allow setting of ``UWSGI_SETENV`` for Python applications.
:param int optimization_level: Python optimization level (see ``-O`` argument).
.. warning:: This may be dangerous for some apps. | f13063:c0:m0 |
def _set_name(self, version=AUTO): | name = '<STR_LIT>'<EOL>if version:<EOL><INDENT>if version is AUTO:<EOL><INDENT>version = sys.version_info[<NUM_LIT:0>]<EOL>if version == <NUM_LIT:2>:<EOL><INDENT>version = '<STR_LIT>'<EOL><DEDENT><DEDENT>name = '<STR_LIT>' % (name, version)<EOL><DEDENT>self.name = name<EOL> | Returns plugin name. | f13063:c0:m1 |
def set_app_args(self, *args): | if args:<EOL><INDENT>self._set('<STR_LIT>', '<STR_LIT:U+0020>'.join(args))<EOL><DEDENT>return self._section<EOL> | Sets ``sys.argv`` for python apps.
Examples:
* pyargv="one two three" will set ``sys.argv`` to ``('one', 'two', 'three')``.
:param args: | f13063:c0:m3 |
def set_wsgi_params(self, module=None, callable_name=None, env_strategy=None): | module = module or '<STR_LIT>'<EOL>if '<STR_LIT:/>' in module:<EOL><INDENT>self._set('<STR_LIT>', module, condition=module)<EOL><DEDENT>else:<EOL><INDENT>self._set('<STR_LIT>', module, condition=module)<EOL><DEDENT>self._set('<STR_LIT>', callable_name)<EOL>self._set('<STR_LIT>', env_strategy)<EOL>return self._section<EOL> | Set wsgi related parameters.
:param str|unicode module:
* load .wsgi file as the Python application
* load a WSGI module as the application.
.. note:: The module (sans ``.py``) must be importable, ie. be in ``PYTHONPATH``.
Examples:
* mypackage.my_wsgi_module -- read from `application` attr of mypackage/my_wsgi_module.py
* mypackage.my_wsgi_module:my_app -- read from `my_app` attr of mypackage/my_wsgi_module.py
:param str|unicode callable_name: Set WSGI callable name. Default: application.
:param str|unicode env_strategy: Strategy for allocating/deallocating
the WSGI env, can be:
* ``cheat`` - preallocates the env dictionary on uWSGI startup and clears it
after each request. Default behaviour for uWSGI <= 2.0.x
* ``holy`` - creates and destroys the environ dictionary at each request.
Default behaviour for uWSGI >= 2.1 | f13063:c0:m4 |
def eval_wsgi_entrypoint(self, code): | self._set('<STR_LIT>', code)<EOL>return self._section<EOL> | Evaluates Python code as WSGI entry point.
:param str|unicode code: | f13063:c0:m5 |
def set_autoreload_params(self, scan_interval=None, ignore_modules=None): | self._set('<STR_LIT>', scan_interval)<EOL>self._set('<STR_LIT>', ignore_modules, multi=True)<EOL>return self._section<EOL> | Sets autoreload related parameters.
:param int scan_interval: Seconds. Monitor Python modules' modification times to trigger reload.
.. warning:: Use only in development.
:param list|st|unicode ignore_modules: Ignore the specified module during auto-reload scan. | f13063:c0:m6 |
def register_module_alias(self, alias, module_path, after_init=False): | command = '<STR_LIT>' if after_init else '<STR_LIT>'<EOL>self._set(command, '<STR_LIT>' % (alias, module_path), multi=True)<EOL>return self._section<EOL> | Adds an alias for a module.
http://uwsgi-docs.readthedocs.io/en/latest/PythonModuleAlias.html
:param str|unicode alias:
:param str|unicode module_path:
:param bool after_init: add a python module alias after uwsgi module initialization | f13063:c0:m7 |
def import_module(self, modules, shared=False, into_spooler=False): | if all((shared, into_spooler)):<EOL><INDENT>raise ConfigurationError('<STR_LIT>')<EOL><DEDENT>if into_spooler:<EOL><INDENT>command = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>command = '<STR_LIT>' if shared else '<STR_LIT>'<EOL><DEDENT>self._set(command, modules, multi=True)<EOL>return self._section<EOL> | Imports a python module.
:param list|str|unicode modules:
:param bool shared: Import a python module in all of the processes.
This is done after fork but before request processing.
:param bool into_spooler: Import a python module in the spooler.
http://uwsgi-docs.readthedocs.io/en/latest/Spooler.html | f13063:c0:m8 |
def run_module(self, module): | self._set('<STR_LIT>', module)<EOL>return self._section<EOL> | Runs a Python script in the uWSGI environment.
:param str|unicode module: | f13063:c0:m9 |
def set_basic_params(<EOL>self, exit_if_none=None, max_per_worker=None, single_interpreter=None, no_default=None,<EOL>manage_script_name=None): | self._set('<STR_LIT>', exit_if_none, cast=bool)<EOL>self._set('<STR_LIT>', max_per_worker)<EOL>self._set('<STR_LIT>', single_interpreter, cast=bool)<EOL>self._set('<STR_LIT>', no_default, cast=bool)<EOL>self._set('<STR_LIT>', manage_script_name, cast=bool)<EOL>return self._section<EOL> | :param bool exit_if_none: Exit if no app can be loaded.
:param int max_per_worker: Set the maximum number of per-worker applications.
:param bool single_interpreter: Do not use multiple interpreters (where available).
Some of the supported languages (such as Python) have the concept of "multiple interpreters".
By default every app is loaded in a new python interpreter (that means a pretty-well isolated
namespace for each app). If you want all of the app to be loaded in the same python vm,
use the this option.
:param bool no_default: Do not automatically fallback to default app. By default, the first loaded app
is mounted as the "default one". That app will be served when no mountpoint matches.
:param bool manage_script_name: You can to instruct uWSGI to map specific apps in the so called "mountpoint"
and rewrite SCRIPT_NAME and PATH_INFO automatically. See .mount().
The WSGI standard dictates that SCRIPT_NAME is the variable used to select a specific application. | f13064:c0:m0 |
def mount(self, mountpoint, app, into_worker=False): | <EOL>self._set('<STR_LIT>' if into_worker else '<STR_LIT>', '<STR_LIT>' % (mountpoint, app), multi=True)<EOL>return self._section<EOL> | Load application under mountpoint.
Example:
* .mount('', 'app0.py') -- Root URL part
* .mount('/app1', 'app1.py') -- URL part
* .mount('/pinax/here', '/var/www/pinax/deploy/pinax.wsgi')
* .mount('the_app3', 'app3.py') -- Variable value: application alias (can be set by ``UWSGI_APPID``)
* .mount('example.com', 'app2.py') -- Variable value: Hostname (variable set in nginx)
* http://uwsgi-docs.readthedocs.io/en/latest/Nginx.html#hosting-multiple-apps-in-the-same-process-aka-managing-script-name-and-path-info
:param str|unicode mountpoint: URL part, or variable value.
.. note:: In case of URL part you may also want to set ``manage_script_name`` basic param to ``True``.
.. warning:: In case of URL part a trailing slash may case problems in some cases
(e.g. with Django based projects).
:param str|unicode app: App module/file.
:param bool into_worker: Load application under mountpoint
in the specified worker or after workers spawn. | f13064:c0:m1 |
def switch_into_lazy_mode(self, affect_master=None): | self._set('<STR_LIT>' if affect_master else '<STR_LIT>', True, cast=bool)<EOL>return self._section<EOL> | Load apps in workers instead of master.
This option may have memory usage implications
as Copy-on-Write semantics can not be used.
.. note:: Consider using ``touch_chain_reload`` option in ``workers`` basic params
for lazy apps reloading.
:param bool affect_master: If **True** only workers will be
reloaded by uWSGI's reload signals; the master will remain alive.
.. warning:: uWSGI configuration changes are not picked up on reload by the master. | f13064:c0:m2 |
def set_basic_params(self, queue_size=None, freebind=None, default_socket_type=None): | self._set('<STR_LIT>', queue_size)<EOL>self._set('<STR_LIT>', freebind, cast=bool)<EOL>self._set('<STR_LIT>', default_socket_type)<EOL>return self._section<EOL> | :param int queue_size: Also known as a backlog. Every socket has an associated queue
where request will be put waiting for a process to became ready to accept them.
When this queue is full, requests will be rejected.
Default: 100 (an average value chosen by the maximum value allowed by default
by your kernel).
.. note:: The maximum value is system/kernel dependent. Before increasing it you may
need to increase your kernel limit too.
:param bool freebind: Put socket in freebind mode.
Allows binding to non-existent network addresses.
.. note:: Linux only.
:param str|unicode default_socket_type: Force the socket type as default.
See ``.socket_types``. | f13065:c0:m1 |
def set_socket_params(<EOL>self, send_timeout=None, keep_alive=None, no_defer_accept=None,<EOL>buffer_send=None, buffer_receive=None): | self._set('<STR_LIT>', send_timeout)<EOL>self._set('<STR_LIT>', keep_alive, cast=bool)<EOL>self._set('<STR_LIT>', no_defer_accept, cast=bool)<EOL>self._set('<STR_LIT>', buffer_send)<EOL>self._set('<STR_LIT>', buffer_receive)<EOL>return self._section<EOL> | Sets common socket params.
:param int send_timeout: Send (write) timeout in seconds.
:param bool keep_alive: Enable TCP KEEPALIVEs.
:param bool no_defer_accept: Disable deferred ``accept()`` on sockets
by default (where available) uWSGI will defer the accept() of requests until some data
is sent by the client (this is a security/performance measure).
If you want to disable this feature for some reason, specify this option.
:param int buffer_send: Set SO_SNDBUF (bytes).
:param int buffer_receive: Set SO_RCVBUF (bytes). | f13065:c0:m2 |
def set_unix_socket_params(self, abstract=None, permissions=None, owner=None, umask=None): | self._set('<STR_LIT>', abstract, cast=bool)<EOL>self._set('<STR_LIT>', permissions)<EOL>self._set('<STR_LIT>', owner)<EOL>self._set('<STR_LIT>', umask)<EOL>return self._section<EOL> | Sets Unix-socket related params.
:param bool abstract: Force UNIX socket into abstract mode (Linux only).
:param str permissions: UNIX sockets are filesystem objects that obey
UNIX permissions like any other filesystem object.
You can set the UNIX sockets' permissions with this option if your webserver
would otherwise have no access to the uWSGI socket. When used without a parameter,
the permissions will be set to 666. Otherwise the specified chmod value will be used.
:param str|unicode owner: Chown UNIX sockets.
:param str|unicode umask: Set UNIX socket umask. | f13065:c0:m3 |
def set_bsd_socket_params(self, port_reuse=None): | self._set('<STR_LIT>', port_reuse, cast=bool)<EOL>return self._section<EOL> | Sets BSD-sockets related params.
:param bool port_reuse: Enable REUSE_PORT flag on socket to allow multiple
instances binding on the same address (BSD only). | f13065:c0:m4 |
def register_socket(self, socket): | sockets = self._sockets<EOL>for socket in listify(socket):<EOL><INDENT>uses_shared = isinstance(socket.address, SocketShared)<EOL>if uses_shared:<EOL><INDENT>shared_socket = socket.address <EOL>if shared_socket not in sockets:<EOL><INDENT>self.register_socket(shared_socket)<EOL><DEDENT>socket.address = self._get_shared_socket_idx(shared_socket)<EOL><DEDENT>socket.address = self._section.replace_placeholders(socket.address)<EOL>self._set(socket.name, socket, multi=True)<EOL>socket._contribute_to_opts(self)<EOL>bound_workers = socket.bound_workers<EOL>if bound_workers:<EOL><INDENT>self._set(<EOL>'<STR_LIT>', '<STR_LIT>' % (len(sockets), '<STR_LIT:U+002C>'.join(map(str, bound_workers))),<EOL>multi=True)<EOL><DEDENT>if not uses_shared:<EOL><INDENT>sockets.append(socket)<EOL><DEDENT><DEDENT>return self._section<EOL> | Registers the given socket(s) for further use.
:param Socket|list[Socket] socket: Socket type object. See ``.sockets``. | f13065:c0:m6 |
def set_ssl_params(<EOL>self, verbose_errors=None,<EOL>sessions_cache=None, sessions_timeout=None, session_context=None,<EOL>raw_options=None, dir_tmp=None, client_cert_var=None): | self._set('<STR_LIT>', verbose_errors, cast=bool)<EOL>self._set('<STR_LIT>', sessions_cache, cast=bool if isinstance(sessions_cache, bool) else None)<EOL>self._set('<STR_LIT>', sessions_timeout)<EOL>for option in listify(raw_options):<EOL><INDENT>self._set('<STR_LIT>', option, multi=True)<EOL><DEDENT>self._set('<STR_LIT>', dir_tmp)<EOL>self._set('<STR_LIT>', session_context, plugin='<STR_LIT:http>')<EOL>self._set('<STR_LIT>', client_cert_var, plugin='<STR_LIT:http>')<EOL>return self._section<EOL> | :param bool verbose_errors: Be verbose about SSL errors.
:param str|unicode|bool sessions_cache: Use uWSGI cache for ssl sessions storage.
Accepts either bool or cache name string.
* http://uwsgi.readthedocs.io/en/latest/SSLScaling.html
.. warning:: Please be sure to configure cache before setting this.
:param int sessions_timeout: Set SSL sessions timeout in seconds. Default: 300.
:param str|unicode session_context: Session context identifying string. Can be set to static shared value
to avoid session rejection.
Default: a value built from the HTTP server address.
* http://uwsgi.readthedocs.io/en/latest/SSLScaling.html#setup-2-synchronize-caches-of-different-https-routers
:param int|list[int] raw_options: Set a raw ssl option by its numeric value.
:param str|unicode dir_tmp: Store ssl-related temp files (e.g. pem data) in the specified directory.
:param str|unicode client_cert_var: Export uWSGI variable ``HTTPS_CC`` containing the raw client certificate. | f13065:c0:m7 |
def set_sni_params(self, name, cert, key, ciphers=None, client_ca=None, wildcard=False): | command = '<STR_LIT>'<EOL>if wildcard:<EOL><INDENT>command += '<STR_LIT>'<EOL><DEDENT>args = [item for item in (cert, key, ciphers, client_ca) if item is not None]<EOL>self._set(command, '<STR_LIT>' % (name, '<STR_LIT:U+002C>'.join(args)))<EOL>return self._section<EOL> | Allows setting Server Name Identification (virtual hosting for SSL nodes) params.
* http://uwsgi.readthedocs.io/en/latest/SNI.html
:param str|unicode name: Node/server/host name.
:param str|unicode cert: Certificate file.
:param str|unicode key: Private key file.
:param str|unicode ciphers: Ciphers [alias] string.
Example:
* DEFAULT
* HIGH
* DHE, EDH
* https://www.openssl.org/docs/man1.1.0/apps/ciphers.html
:param str|unicode client_ca: Client CA file for client-based auth.
.. note: You can prepend ! (exclamation mark) to make client certificate
authentication mandatory.
:param bool wildcard: Allow regular expressions in ``name`` (used for wildcard certificates). | f13065:c0:m8 |
def set_sni_dir_params(self, dir, ciphers=None): | self._set('<STR_LIT>', dir)<EOL>self._set('<STR_LIT>', ciphers)<EOL>return self._section<EOL> | Enable checking for cert/key/client_ca file in the specified directory
and create a sni/ssl context on demand.
Expected filenames:
* <sni-name>.crt
* <sni-name>.key
* <sni-name>.ca - this file is optional
* http://uwsgi.readthedocs.io/en/latest/SNI.html#massive-sni-hosting
:param str|unicode dir:
:param str|unicode ciphers: Ciphers [alias] string.
Example:
* DEFAULT
* HIGH
* DHE, EDH
* https://www.openssl.org/docs/man1.1.0/apps/ciphers.html | f13065:c0:m9 |
def set_basic_params(self, no_expire=None, expire_scan_interval=None, report_freed=None): | self._set('<STR_LIT>', no_expire, cast=bool)<EOL>self._set('<STR_LIT>', report_freed, cast=bool)<EOL>self._set('<STR_LIT>', expire_scan_interval)<EOL>return self._section<EOL> | :param bool no_expire: Disable auto sweep of expired items.
Since uWSGI 1.2, cache item expiration is managed by a thread in the master process,
to reduce the risk of deadlock. This thread can be disabled
(making item expiry a no-op) with the this option.
:param int expire_scan_interval: Set the frequency (in seconds) of cache sweeper scans. Default: 3.
:param bool report_freed: Constantly report the cache item freed by the sweeper.
.. warning:: Use only for debug. | f13066:c0:m0 |
def add_item(self, key, value, cache_name=None): | cache_name = cache_name or '<STR_LIT>'<EOL>value = '<STR_LIT>' % (cache_name, key, value)<EOL>self._set('<STR_LIT>', value.strip(), multi=True)<EOL>return self._section<EOL> | Add an item into the given cache.
This is a commodity option (mainly useful for testing) allowing you
to store an item in a uWSGI cache during startup.
:param str|unicode key:
:param value:
:param str|unicode cache_name: If not set, default will be used. | f13066:c0:m1 |
def add_file(self, filepath, gzip=False, cache_name=None): | command = '<STR_LIT>'<EOL>if gzip:<EOL><INDENT>command += '<STR_LIT>'<EOL><DEDENT>cache_name = cache_name or '<STR_LIT>'<EOL>value = '<STR_LIT>' % (cache_name, filepath)<EOL>self._set(command, value.strip(), multi=True)<EOL>return self._section<EOL> | Load a static file in the cache.
.. note:: Items are stored with the filepath as is (relative or absolute) as the key.
:param str|unicode filepath:
:param bool gzip: Use gzip compression.
:param str|unicode cache_name: If not set, default will be used. | f13066:c0:m2 |
def add_cache(<EOL>self, name, max_items, expires=None, store=None, store_sync_interval=None, store_delete=None,<EOL>hash_algo=None, hash_size=None, key_size=None, udp_clients=None, udp_servers=None,<EOL>block_size=None, block_count=None, sync_from=None, mode_bitmap=None, use_lastmod=None,<EOL>full_silent=None, full_purge_lru=None): | value = KeyValue(<EOL>locals(),<EOL>keys=[<EOL>'<STR_LIT:name>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:store>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>],<EOL>aliases={<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>},<EOL>bool_keys=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'],<EOL>list_keys=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>'],<EOL>)<EOL>self._set('<STR_LIT>', value, multi=True)<EOL>return self._section<EOL> | Creates cache. Default mode: single block.
.. note:: This uses new generation ``cache2`` option available since uWSGI 1.9.
.. note:: When at least one cache is configured without ``full_purge_lru``
and the master is enabled a thread named "the cache sweeper" is started.
Its main purpose is deleting expired keys from the cache.
If you want auto-expiring you need to enable the master.
:param str|unicode name: Set the name of the cache. Must be unique in an instance.
:param int max_items: Set the maximum number of cache items.
.. note:: Effective number of items is **max_items - 1** -
the first item of the cache is always internally used as "NULL/None/undef".
:param int expires: The number of seconds after the object is no more valid
(and will be removed by the cache sweeper when ``full_purge_lru`` is not set.
:param str|unicode store: Set the filename for the persistent storage.
If it doesn't exist, the system assumes an empty cache and the file will be created.
:param int store_sync_interval: Set the number of seconds after which msync() is called
to flush memory cache on disk when in persistent mode.
By default it is disabled leaving the decision-making to the kernel.
:param bool store_delete: uWSGI, by default, will not start if a cache file exists
and the store file does not match the configured items/blocksize.
Setting this option will make uWSGI delete the existing file upon mismatch
and create a new one.
:param str|unicode hash_algo: Set the hash algorithm used in the hash table. Current options are:
* djb33x (default)
* murmur2
:param int hash_size: This is the size of the hash table in bytes.
Generally 65536 (the default) is a good value.
.. note:: Change it only if you know what you are doing
or if you have a lot of collisions in your cache.
:param int key_size: Set the maximum size of a key, in bytes. Default: 2048.
:param str|unicode|list udp_clients: List of UDP servers which will receive UDP cache updates.
:param str|unicode |list udp_servers: List of UDP addresses on which to bind the cache
to wait for UDP updates.
:param int block_size: Set the size (in bytes) of a single block.
.. note:: It's a good idea to use a multiple of 4096 (common memory page size).
:param int block_count: Set the number of blocks in the cache. Useful only in bitmap mode,
otherwise the number of blocks is equal to the maximum number of items.
:param str|unicode|list sync_from: List of uWSGI addresses which the cache subsystem will connect to
for getting a full dump of the cache. It can be used for initial cache synchronization.
The first node sending a valid dump will stop the procedure.
:param bool mode_bitmap: Enable (more versatile but relatively slower) bitmap mode.
http://uwsgi-docs.readthedocs.io/en/latest/Caching.html#single-block-faster-vs-bitmaps-slower
.. warning:: Considered production ready only from uWSGI 2.0.2.
:param bool use_lastmod: Enabling will update last_modified_at timestamp of each cache
on every cache item modification. Enable it if you want to track this value
or if other features depend on it. This value will then be accessible via the stats socket.
:param bool full_silent: By default uWSGI will print warning message on every cache set operation
if the cache is full. To disable this warning set this option.
.. note:: Available since 2.0.4.
:param bool full_purge_lru: Allows the caching framework to evict Least Recently Used (LRU)
item when you try to add new item to cache storage that is full.
.. note:: ``expires`` argument will be ignored. | f13066:c0:m3 |
def set_basic_params(<EOL>self, static_dir=None, index_file=None, mime_file=None, skip_ext=None, transfer_mode=None): | if static_dir == self.DIR_DOCUMENT_ROOT:<EOL><INDENT>self._set('<STR_LIT>', True, cast=bool)<EOL><DEDENT>else:<EOL><INDENT>self._set('<STR_LIT>', static_dir, multi=True)<EOL><DEDENT>self._set('<STR_LIT>', index_file, multi=True)<EOL>self._set('<STR_LIT>', mime_file, multi=True)<EOL>self._set('<STR_LIT>', skip_ext, multi=True)<EOL>self._set('<STR_LIT>', skip_ext, multi=True)<EOL>return self._section<EOL> | :param str|unicode|list[str|unicode] static_dir: Check for static files in the specified directory.
.. note:: Use ``DIR_DOCUMENT_ROOT`` constant to serve files under ``DOCUMENT_ROOT``.
:param str|unicode|list[str|unicode] index_file: Search for specified file if a directory is requested.
Example: ``index.html``
:param str|unicode|list[str|unicode] mime_file: Set mime types file path to extend uWSGI builtin list.
Default: ``/etc/mime.types`` or ``/etc/apache2/mime.types``.
:param str|unicode|list[str|unicode] skip_ext: Skip specified extension from static file checks.
Example: add ``.php`` to not serve it as static.
:param str|unicode transfer_mode: Set static file serving (transfer) mode.
See ``.transfer_modes``.
.. note:: Another option is to specify ``count_offload`` in ``.workers.set_thread_params()``. | f13067:c0:m0 |
def register_static_map(self, mountpoint, target, retain_resource_path=False, safe_target=False): | command = '<STR_LIT>'<EOL>if retain_resource_path:<EOL><INDENT>command += '<STR_LIT:2>'<EOL><DEDENT>self._set(command, '<STR_LIT>' % (mountpoint, target), multi=True)<EOL>if safe_target:<EOL><INDENT>self._set('<STR_LIT>', target, multi=True)<EOL><DEDENT>return self._section<EOL> | Allows mapping mountpoint to a static directory (or file).
* http://uwsgi.readthedocs.io/en/latest/StaticFiles.html#mode-3-using-static-file-mount-points
:param str|unicode mountpoint:
:param str|unicode target:
:param bool retain_resource_path: Append the requested resource to the docroot.
Example: if ``/images`` maps to ``/var/www/img`` requested ``/images/logo.png`` will be served from:
* ``True``: ``/var/www/img/images/logo.png``
* ``False``: ``/var/www/img/logo.png``
:param bool safe_target: Skip security checks if the file is under the specified path.
Whether to consider resolved (real) target a safe one to serve from.
* http://uwsgi.readthedocs.io/en/latest/StaticFiles.html#security | f13067:c0:m1 |
def add_expiration_rule(self, criterion, value, timeout, use_mod_time=False): | command = '<STR_LIT>'<EOL>separator = '<STR_LIT:U+0020>'<EOL>if criterion != self.expiration_criteria.FILENAME:<EOL><INDENT>command += '<STR_LIT>' % criterion<EOL><DEDENT>if criterion == self.expiration_criteria.MIME_TYPE:<EOL><INDENT>separator = '<STR_LIT:=>'<EOL><DEDENT>if use_mod_time:<EOL><INDENT>command += '<STR_LIT>'<EOL><DEDENT>for value in listify(value):<EOL><INDENT>self._set(command, '<STR_LIT>' % (value, separator, timeout), multi=True)<EOL><DEDENT>return self._section<EOL> | Adds statics expiration rule based on a criterion.
:param str|unicode criterion: Criterion (subject) to base expiration on.
See ``.expiration_criteria``.
:param str|unicode|list[str|unicode] value: Value to test criteria upon.
.. note:: Usually a regular expression.
:param int timeout: Number of seconds to expire after.
:param bool use_mod_time: Base on file modification time instead of the current time. | f13067:c0:m2 |
def set_paths_caching_params(self, timeout=None, cache_name=None): | self._set('<STR_LIT>', timeout)<EOL>self._set('<STR_LIT>', cache_name)<EOL>return self._section<EOL> | Use the uWSGI caching subsystem to store mappings from URI to filesystem paths.
* http://uwsgi.readthedocs.io/en/latest/StaticFiles.html#caching-paths-mappings-resolutions
:param int timeout: Amount of seconds to put resolved paths in the uWSGI cache.
:param str|unicode cache_name: Cache name to use for static paths. | f13067:c0:m3 |
def set_basic_params(self, msg_size=None, cheap=None, anti_loop_timeout=None): | self._set('<STR_LIT>', msg_size)<EOL>self._set('<STR_LIT>', cheap, cast=bool)<EOL>self._set('<STR_LIT>', anti_loop_timeout)<EOL>return self._section<EOL> | :param int msg_size: Set the max size of an alarm message in bytes. Default: 8192.
:param bool cheap: Use main alarm thread rather than create dedicated
threads for curl-based alarms
:param int anti_loop_timeout: Tune the anti-loop alarm system. Default: 3 seconds. | f13069:c0:m1 |
def print_alarms(self): | self._set('<STR_LIT>', True, cast=bool)<EOL>return self._section<EOL> | Print out enabled alarms. | f13069:c0:m2 |
def register_alarm(self, alarm): | for alarm in listify(alarm):<EOL><INDENT>if alarm not in self._alarms:<EOL><INDENT>self._set('<STR_LIT>', alarm, multi=True)<EOL>self._alarms.append(alarm)<EOL><DEDENT><DEDENT>return self._section<EOL> | Register (create) an alarm.
:param AlarmType|list[AlarmType] alarm: Alarm. | f13069:c0:m3 |
def alarm_on_log(self, alarm, matcher, skip=False): | self.register_alarm(alarm)<EOL>value = '<STR_LIT>' % (<EOL>'<STR_LIT:U+002C>'.join(map(attrgetter('<STR_LIT>'), listify(alarm))),<EOL>matcher)<EOL>self._set('<STR_LIT>' if skip else '<STR_LIT>', value)<EOL>return self._section<EOL> | Raise (or skip) the specified alarm when a log line matches the specified regexp.
:param AlarmType|list[AlarmType] alarm: Alarm.
:param str|unicode matcher: Regular expression to match log line.
:param bool skip: | f13069:c0:m4 |
def alarm_on_fd_ready(self, alarm, fd, message, byte_count=None): | self.register_alarm(alarm)<EOL>value = fd<EOL>if byte_count:<EOL><INDENT>value += '<STR_LIT>' % byte_count<EOL><DEDENT>value += '<STR_LIT>' % message<EOL>for alarm in listify(alarm):<EOL><INDENT>self._set('<STR_LIT>', '<STR_LIT>' % (alarm.alias, value), multi=True)<EOL><DEDENT>return self._section<EOL> | Triggers the alarm when the specified file descriptor is ready for read.
This is really useful for integration with the Linux eventfd() facility.
Pretty low-level and the basis of most of the alarm plugins.
* http://uwsgi-docs.readthedocs.io/en/latest/Changelog-1.9.7.html#alarm-fd
:param AlarmType|list[AlarmType] alarm: Alarm.
:param str|unicode fd: File descriptor.
:param str|unicode message: Message to send.
:param int byte_count: Files to read. Default: 1 byte.
.. note:: For ``eventfd`` set 8. | f13069:c0:m5 |
def alarm_on_queue_full(self, alarm): | self.register_alarm(alarm)<EOL>for alarm in listify(alarm):<EOL><INDENT>self._set('<STR_LIT>', alarm.alias, multi=True)<EOL><DEDENT>return self._section<EOL> | Raise the specified alarm when the socket backlog queue is full.
:param AlarmType|list[AlarmType] alarm: Alarm. | f13069:c0:m6 |
def alarm_on_segfault(self, alarm): | self.register_alarm(alarm)<EOL>for alarm in listify(alarm):<EOL><INDENT>self._set('<STR_LIT>', alarm.alias, multi=True)<EOL><DEDENT>return self._section<EOL> | Raise the specified alarm when the segmentation fault handler is executed.
Sends a backtrace.
:param AlarmType|list[AlarmType] alarm: Alarm. | f13069:c0:m7 |
def __init__(<EOL>self, name, oid=None, alias_for=None, collector=None,<EOL>initial_value=None, collect_interval=None, reset_after_push=None): | self.name = name<EOL>if alias_for:<EOL><INDENT>self.type_str = MetricTypeAlias.type_str<EOL>self.type_id = MetricTypeAlias.type_id<EOL>if isinstance(alias_for, Metric):<EOL><INDENT>alias_for = alias_for.name<EOL><DEDENT><DEDENT>if self.type_id == MetricTypeAlias.type_id and not alias_for:<EOL><INDENT>raise ConfigurationError('<STR_LIT>')<EOL><DEDENT>type_str = self.type_str<EOL>value = KeyValue(<EOL>filter_locals(locals(), drop=['<STR_LIT:name>']),<EOL>aliases={'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT:type>', '<STR_LIT>': '<STR_LIT>'}<EOL>)<EOL>super(Metric, self).__init__(value)<EOL> | :param str|unicode name: Metric name.
.. note:: Only numbers, letters, underscores, dashes and dots.
:param str|unicode alias_for: If set metric will be a simple alias for the specified one.
:param str|unicode oid: Metric OID.
Required for SNMP.
* http://uwsgi-docs.readthedocs.io/en/latest/Metrics.html#oid-assigment-for-plugins
:param Collector collector: Collector to be used. If not set it is considered that the value must
be updated manually from applications using the metrics API.
* http://uwsgi-docs.readthedocs.io/en/latest/Metrics.html#api
:param int initial_value: Set the metric to a specific value on startup.
:param int collect_interval: How ofter the metric should be gathered. In seconds.
:param bool reset_after_push: Reset the metric to zero (or the configured initial_value)
after it's been pushed. | f13070:c0:m0 |
def accepting(): | Called to notify the master that the worker is accepting requests,
this is required for ``touch_chain_reload`` to work.
:rtype: None | f13072:m0 | |
def add_cron(signal, minute, hour, day, month, weekday): | Adds cron. The interface to the uWSGI signal cron facility. The syntax is
.. note:: The last 5 arguments work similarly to a standard crontab,
but instead of "*", use -1, and instead of "/2", "/3", etc. use -2 and -3, etc.
:param int signal: Signal to raise.
:param int minute: Minute 0-59. Defaults to `each`.
:param int hour: Hour 0-23. Defaults to `each`.
:param int day: Day of the month number 1-31. Defaults to `each`.
:param int month: Month number 1-12. Defaults to `each`.
:param int weekday: Day of a the week number. Defaults to `each`.
0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday
4 - Thursday 5 - Friday 6 - Saturday
:rtype: bool
:raises ValueError: If unable to add cron rule. | f13072:m1 | |
def add_file_monitor(signal, filename): | Maps a specific file/directory modification event to a signal.
:param int signal: Signal to raise.
:param str|unicode filename: File or a directory to watch for its modification.
:rtype: None
:raises ValueError: If unable to register monitor. | f13072:m2 | |
def add_ms_timer(signal, period): | Add a microsecond resolution timer.
:param int signal: Signal to raise.
:param int period: The interval (microseconds) at which to raise the signal.
:rtype: None
:raises ValueError: If unable to add timer. | f13072:m3 | |
def add_rb_timer(signal, period, repeat=<NUM_LIT:0>): | Add a red-black timer.
:param int signal: Signal to raise.
:param int period: The interval (seconds) at which the signal is raised.
:param int repeat: How many times to repeat. Default: 0 - infinitely.
:rtype: None
:raises ValueError: If unable to add timer. | f13072:m4 | |
def add_timer(signal, period): | Add timer.
:param int signal: Signal to raise.
:param int period: The interval (seconds) at which to raise the signal.
:rtype: None
:raises ValueError: If unable to add timer. | f13072:m5 | |
def add_var(name, value): | Registers custom request variable.
Can be used for better integration with the internal routing subsystem.
:param str|unicode name:
:param str|unicode value:
:rtype: bool
:raises ValueError: If buffer size is not enough. | f13072:m6 | |
def alarm(name, message): | Issues the given alarm with the given message.
:param str|unicode name:
:param str|unicode message: Message to pass to alarm.
:rtype: None | f13072:m7 | |
def async_connect(socket): | Issues socket connection. And returns a file descriptor.
* http://uwsgi.readthedocs.io/en/latest/Async.html
:param str|unicode socket:
:rtype: int | f13072:m8 | |
def async_sleep(seconds): | Suspends handling the current request and passes control to the next async core.
* http://uwsgi.readthedocs.io/en/latest/Async.html
:param seconds: Sleep time, in seconds.
:rtype None: | f13072:m9 | |
def cache_clear(cache): | Clears cache with the given name.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: None | f13072:m10 | |
def cache_dec(key, value=<NUM_LIT:1>, expires=None, cache=None): | Decrements the specified key value by the specified value.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m11 | |
def cache_del(key, cache=None): | Deletes the given cached key from the cache.
:param str|unicode key: The cache key to delete.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: None | f13072:m12 | |
def cache_div(key, value=<NUM_LIT:2>, expires=None, cache=None): | Divides the specified key value by the specified value.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m13 | |
def cache_exists(key, cache=None): | Checks whether there is a value in the cache associated with the given key.
:param str|unicode key: The cache key to check.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m14 | |
def cache_get(key, cache=None): | Gets a value from the cache.
.. warning:: Bytes are returned for Python 3.
:param str|unicode key: The cache key to get value for.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bytes|str | f13072:m15 | |
def cache_inc(key, value=<NUM_LIT:1>, expires=None, cache=None): | Increments the specified key value by the specified value.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m16 | |
def cache_keys(cache=None): | Returns a list of keys available in cache.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: list
:raises ValueError: If cache is unavailable. | f13072:m17 | |
def cache_mul(key, value=<NUM_LIT:2>, expires=None, cache=None): | Multiplies the specified key value by the specified value.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m18 | |
def cache_num(key, cache=None): | Gets the 64bit number from the specified item.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.9.html#math-for-cache
:param str|unicode key: The cache key to get value for.
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: int|long | f13072:m19 | |
def cache_set(key, value, expires=None, cache=None): | Sets the specified key value.
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m20 | |
def cache_update(key, value, expires=None, cache=None): | Updates the specified key value.
:param str|unicode key:
:param int value:
:param int expires: Expire timeout (seconds).
:param str|unicode cache: Cache name with optional address (if @-syntax is used).
:rtype: bool | f13072:m21 | |
def call(func_name, *args): | Performs an [RPC] function call with the given arguments.
.. warning:: Bytes are returned for Python 3.
:param str|unicode func_name: Function name to call
with optional address (if @-syntax is used).
:param list[str|bytes] args:
:rtype: bytes|str | f13072:m22 | |
def chunked_read(timeout): | Reads chunked input.
.. warning:: Bytes are returned for Python 3.
* http://uwsgi.readthedocs.io/en/latest/Chunked.html
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.13.html#chunked-input-api
:param int timeout: Wait timeout (seconds).
:rtype: bytes|str
:raises IOError: If unable to receive chunked part. | f13072:m23 | |
def chunked_read_nb(): | Reads chunked input without blocking.
.. warning:: Bytes are returned for Python 3.
* http://uwsgi.readthedocs.io/en/latest/Chunked.html
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.13.html#chunked-input-api
:rtype: bytes|str
:raises IOError: If unable to receive chunked part. | f13072:m24 | |
def cl(): | Returns current post content length.
:rtype: int|long | f13072:m25 | |
def close(fd): | Closes the given file descriptor.
:param int fd: File descriptor.
:rtype: None | f13072:m26 | |
def connect(socket, timeout=<NUM_LIT:0>): | Connects to the socket.
:param str|unicode socket: Socket name.
:param int timeout: Timeout (seconds).
:rtype: int | f13072:m27 | |
def connection_fd(): | Returns current request file descriptor.
:rtype: int | f13072:m28 | |
def disconnect(): | Drops current connection.
:rtype: None | f13072:m29 | |
def embedded_data(symbol_name): | Reads a symbol from the uWSGI binary image.
* http://uwsgi.readthedocs.io/en/latest/Embed.html
.. warning:: Bytes are returned for Python 3.
:param str|unicode symbol_name: The symbol name to extract.
:rtype: bytes|str
:raises ValueError: If symbol is unavailable. | f13072:m30 | |
def extract(fname): | Extracts file contents.
.. warning:: Bytes are returned for Python 3.
:param str|unicode fname:
:rtype: bytes|str | f13072:m31 | |
def farm_get_msg(): | Reads a mule farm message.
* http://uwsgi.readthedocs.io/en/latest/Embed.html
.. warning:: Bytes are returned for Python 3.
:rtype: bytes|str|None
:raises ValueError: If not in a mule | f13072:m32 | |
def farm_msg(farm, message): | Sends a message to the given farm.
:param str|unicode farm: Farm name to send message to.
:param str|unicode message:
:rtype: None | f13072:m33 | |
def get_logvar(name): | Return user-defined log variable contents.
* http://uwsgi.readthedocs.io/en/latest/LogFormat.html#user-defined-logvars
.. warning:: Bytes are returned for Python 3.
:param str|unicode name:
:rtype: bytes|str | f13072:m34 | |
def green_schedule(): | Switches to another green thread.
.. note:: Alias for ``suspend``.
* http://uwsgi.readthedocs.io/en/latest/Async.html#suspend-resume
:type: bool | f13072:m35 | |
def suspend(): | Suspends handling of current coroutine/green thread and passes control
to the next async core.
* http://uwsgi.readthedocs.io/en/latest/Async.html#suspend-resume
:type: bool | f13072:m36 | |
def i_am_the_lord(legion_name): | Returns flag indicating whether you are the lord
of the given legion.
* http://uwsgi.readthedocs.io/en/latest/Legion.html#legion-api
:param str|unicode legion_name:
:rtype: bool | f13072:m37 | |
def i_am_the_spooler(): | Returns flag indicating whether you are the Spooler.
:rtype: bool | f13072:m38 | |
def in_farm(name): | Returns flag indicating whether you are (mule) belong
to the given farm.
:param str|unicode name: Farm name.
:rtype: bool | f13072:m39 | |
def is_a_reload(): | Returns flag indicating whether reloading mechanics is used.
:rtype: bool | f13072:m40 | |
def is_connected(fd): | Checks the given file descriptor.
:param int fd: File descriptor
:rtype: bool | f13072:m41 | |
def is_locked(lock_num=<NUM_LIT:0>): | Checks for the given lock.
.. note:: Lock 0 is always available.
:param int lock_num: Lock number.
:rtype: bool
:raises ValueError: For Spooler or invalid lock number | f13072:m42 | |
def listen_queue(socket_num): | Returns listen queue (backlog size) of the given socket.
:param int socket_num: Socket number.
:rtype: bool
:raises ValueError: If socket is not found | f13072:m43 | |
def lock(lock_num=<NUM_LIT:0>): | Sets the given lock.
.. note:: Lock 0 is always available.
:param int lock_num: Lock number.
:rtype: None
:raises ValueError: For Spooler or invalid lock number | f13072:m44 | |
def log(message): | Logs a message.
:param str|unicode message:
:rtype: bool | f13072:m45 | |
def log_this_request(): | Instructs uWSGI to log current request data.
:rtype: None | f13072:m46 | |
def logsize(): | Returns current log size.
:rtype|long | f13072:m47 | |
def loop(): | Returns current event loop name or None if loop is not set.
:rtype: st|unicode|None | f13072:m48 | |
def lord_scroll(legion_name): | Returns a Lord scroll for the Legion.
* http://uwsgi.readthedocs.io/en/latest/Legion.html#lord-scroll-coming-soon
:param str|unicode legion_name:
:rtype: bool | f13072:m49 | |
def masterpid(): | Return the process identifier (PID) of the uWSGI master process.
:rtype: int | f13072:m50 | |
def mem(): | Returns memory usage tuple of ints: (rss, vsz).
:rtype: tuple | f13072:m51 | |
def metric_dec(key, value=<NUM_LIT:1>): | Decrements the specified metric key value by the specified value.
:param str|unicode key:
:param int value:
:rtype: bool | f13072:m52 | |
def metric_div(key, value=<NUM_LIT:1>): | Divides the specified metric key value by the specified value.
:param str|unicode key:
:param int value:
:rtype: bool | f13072:m53 | |
def metric_inc(key, value=<NUM_LIT:1>): | Increments the specified metric key value by the specified value.
:param str|unicode key:
:param int value:
:rtype: bool | f13072:m54 | |
def metric_mul(key, value=<NUM_LIT:1>): | Multiplies the specified metric key value by the specified value.
:param str|unicode key:
:param int value:
:rtype: bool | f13072:m55 | |
def metric_get(key): | Returns metric value by key.
:param str|unicode key:
:rtype: int|long | f13072:m56 | |
def metric_set(key, value): | Sets metric value.
:param str|unicode key:
:param int|long value:
:rtype: bool | f13072:m57 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.