signature stringlengths 8 3.44k | body stringlengths 0 1.41M | docstring stringlengths 1 122k | id stringlengths 5 17 |
|---|---|---|---|
def __init__(self, timeout): | super(ActionSetHarakiri, self).__init__(timeout)<EOL> | :param int timeout: | f13051:c29:m0 |
def __init__(self, dir): | super(ActionDirChange, self).__init__(dir)<EOL> | :param str|unicode dir: Directory to change into. | f13051:c30:m0 |
def __init__(self, app): | super(ActionSetVarUwsgiAppid, self).__init__(app)<EOL> | :param str|unicode app: Application ID. | f13051:c31:m0 |
def __init__(self, user): | super(ActionSetVarRemoteUser, self).__init__(user)<EOL> | :param str|unicode user: Username. | f13051:c32:m0 |
def __init__(self, dir): | super(ActionSetVarUwsgiHome, self).__init__(dir)<EOL> | :param str|unicode dir: Directory to make a new home. | f13051:c33:m0 |
def __init__(self, value): | super(ActionSetVarUwsgiScheme, self).__init__(value)<EOL> | :param str|unicode value: | f13051:c34:m0 |
def __init__(self, name): | super(ActionSetVarScriptName, self).__init__(name)<EOL> | :param str|unicode name: Script name | f13051:c35:m0 |
def __init__(self, name): | super(ActionSetVarRequestMethod, self).__init__(name)<EOL> | :param str|unicode name: Method name. | f13051:c36:m0 |
def __init__(self, value): | super(ActionSetVarRequestUri, self).__init__(value)<EOL> | :param str|unicode value: URI | f13051:c37:m0 |
def __init__(self, value): | super(ActionSetVarRemoteAddr, self).__init__(value)<EOL> | :param str|unicode value: Address. | f13051:c38:m0 |
def __init__(self, value): | super(ActionSetVarPathInfo, self).__init__(value)<EOL> | :param str|unicode value: New info. | f13051:c39:m0 |
def __init__(self, value): | super(ActionSetVarDocumentRoot, self).__init__(value)<EOL> | :param str|unicode value: | f13051:c40:m0 |
def __init__(self, name): | super(ActionSetUwsgiProcessName, self).__init__(name)<EOL> | :param str|unicode name: New process name. | f13051:c41:m0 |
def __init__(self, fpath): | super(ActionSetScriptFile, self).__init__(fpath)<EOL> | :param str|unicode fpath: File path. | f13051:c43:m0 |
def __init__(self, subject, negate=False): | self._subject = subject<EOL>self.negate = negate<EOL>super(SubjectCustom, self).__init__()<EOL> | :param Var|str|unicode subject: Handwritten subject or a Var heir representing it.
:param bool negate: Use to negate subject for rule.
.. note:: You can also use tilde (~) instead of this argument for nagation. | f13052:c1:m0 |
def exists(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject exists in the filesystem. | f13052:c1:m3 |
def isfile(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is a file. | f13052:c1:m4 |
def isdir(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is a directory. | f13052:c1:m5 |
def islink(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is a link. | f13052:c1:m6 |
def isexec(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is an executable file. | f13052:c1:m7 |
def islord(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is a Legion Lord. | f13052:c1:m8 |
def contains_ipv4(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is ip v4. | f13052:c1:m9 |
def contains_ipv6(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is ip v6. | f13052:c1:m10 |
def eq(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject is equal to the specified pattern. | f13052:c1:m11 |
def ge(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject is greater than or equal to the specified pattern. | f13052:c1:m12 |
def le(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject is less than or equal to the specified pattern. | f13052:c1:m13 |
def gt(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject is greater than the specified pattern. | f13052:c1:m14 |
def lt(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject is less than the specified pattern. | f13052:c1:m15 |
def startswith(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject starts with the specified pattern. | f13052:c1:m16 |
def endswith(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject ends with the specified pattern. | f13052:c1:m17 |
def matches(self, regexp): | return self._setup('<STR_LIT>', regexp)<EOL> | Check if the subject matches the specified regexp. | f13052:c1:m18 |
def isempty(self): | return self._setup('<STR_LIT>')<EOL> | Check if the subject is empty. | f13052:c1:m19 |
def contains(self, val): | return self._setup('<STR_LIT>', val)<EOL> | Check if the subject contains the specified pattern. | f13052:c1:m20 |
def __init__(self, address, bound_workers=None, modifier=None): | self.address = address<EOL>self.bound_workers = listify(bound_workers or [])<EOL>self._make_section_like()<EOL>if modifier:<EOL><INDENT>self._set('<STR_LIT>' % self.name, modifier.code)<EOL>submod = modifier.submod<EOL>if submod:<EOL><INDENT>self._set('<STR_LIT>' % self.name, modifier.submod)<EOL><DEDENT><DEDENT>super(Socket, self).__init__()<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c0:m0 |
def __init__(self, address, http11=False, bound_workers=None, modifier=None): | if http11:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(SocketHttp, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
:param bool http11: Keep-Alive support. If set the server will try to maintain
the connection opened if a bunch of rules are respected.
This is not a smart http 1.1 parser (to avoid parsing the whole response)
but assumes the developer is generating the right headers.
This has been added to support RTSP protocol for video streaming.
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c2:m0 |
def __init__(self, address, cert, key, ciphers=None, client_ca=None, bound_workers=None, modifier=None): | super(SocketHttps, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL>args = [cert, key]<EOL>if ciphers or client_ca:<EOL><INDENT>args.extend([ciphers or '<STR_LIT>', client_ca or '<STR_LIT>'])<EOL><DEDENT>self.args.extend(args)<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
: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 str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c3:m0 |
def __init__(self, address, persistent=False, bound_workers=None, modifier=None): | if persistent:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(SocketUwsgi, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
:param bool persistent: Use persistent uwsgi protocol (puwsgi).
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c4:m0 |
def __init__(self, address, nph=False, bound_workers=None, modifier=None): | if nph:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(SocketFastcgi, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
:param bool nph: Use NPH mode ("no-parsed-header" - bypass the server completely by sending
the complete HTTP header directly to the browser).
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c7:m0 |
def __init__(self, address, nph=False, bound_workers=None, modifier=None): | if nph:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(SocketScgi, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL> | :param str|unicode|SocketShared address: Address ([host]:port or socket file) to bind socket to.
:param bool nph: Use NPH mode ("no-parsed-header" - bypass the server completely by sending
the complete HTTP header directly to the browser).
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c8:m0 |
def __init__(self, address, undeferred=False, bound_workers=None, modifier=None): | if undeferred:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(SocketShared, self).__init__(address, bound_workers=bound_workers, modifier=modifier)<EOL> | :param str|unicode address: Address ([host]:port or socket file) to bind socket to.
:param bool undeferred: Use shared socket undeferred mode.
:param str|unicode|int|list bound_workers: Map socket to specific workers.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map
specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
:param Modifier modifier: Socket routing modifier. | f13053:c10:m0 |
@classmethod<EOL><INDENT>def _get_code_str(cls, src):<DEDENT> | return str(src) if src is not None else '<STR_LIT>'<EOL> | :param src:
:rtype: str|unicode | f13054:c0:m1 |
@submod.getter<EOL><INDENT>def submod(self):<DEDENT> | return self._get_code_str(self._submod)<EOL> | Modifier 2 value.
:rtype: str|unicode | f13054:c0:m3 |
def register_metric(self, metric): | for metric in listify(metric):<EOL><INDENT>self._set('<STR_LIT>', metric, multi=True)<EOL><DEDENT>return self._section<EOL> | Officially Registered Metrics:
* ``worker`` 3 - exports information about workers.
Example: worker.1.requests **[or 3.1.1]** reports the number of requests served by worker 1.
* ``plugin`` 4 - namespace for metrics automatically added by plugins.
Example: plugins.foo.bar
* ``core`` 5 - namespace for general instance information.
* ``router`` 6 - namespace for corerouters.
Example: router.http.active_sessions
* ``socket`` 7 - namespace for sockets.
Example: socket.0.listen_queue
* ``mule`` 8 - namespace for mules.
Example: mule.1.signals
* ``spooler`` 9 - namespace for spoolers.
Example: spooler.1.signals
* ``system`` 10 - namespace for system metrics, like loadavg or free memory.
:param Metric|list[Metric] metric: Metric object. | f13056:c0:m0 |
def set_metrics_params(self, enable=None, store_dir=None, restore=None, no_cores=None): | self._set('<STR_LIT>', enable, cast=bool)<EOL>self._set('<STR_LIT>', self._section.replace_placeholders(store_dir))<EOL>self._set('<STR_LIT>', restore, cast=bool)<EOL>self._set('<STR_LIT>', no_cores, cast=bool)<EOL>return self._section<EOL> | Sets basic Metrics subsystem params.
uWSGI metrics subsystem allows you to manage "numbers" from your apps.
When enabled, the subsystem configures a vast amount of metrics
(like requests per-core, memory usage, etc) but, in addition to this,
you can configure your own metrics, such as the number of active users or, say,
hits of a particular URL, as well as the memory consumption of your app or the whole server.
* http://uwsgi.readthedocs.io/en/latest/Metrics.html
* SNMP Integration - http://uwsgi.readthedocs.io/en/latest/Metrics.html#snmp-integration
:param bool enable: Enables the subsystem.
:param str|unicode store_dir: Directory to store metrics.
The metrics subsystem can expose all of its metrics in the form
of text files in a directory. The content of each file is the value
of the metric (updated in real time).
.. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}/metrics/
See ``Section.project_name`` and ``Section.runtime_dir``.
:param bool restore: Restore previous metrics from ``store_dir``.
When you restart a uWSGI instance, all of its metrics are reset.
Use the option to force the metric subsystem to read-back the values
from the metric directory before starting to collect values.
:param bool no_cores: Disable generation of cores-related metrics. | f13056:c0:m1 |
def set_metrics_threshold(self, name, value, check_interval=None, reset_to=None, alarm=None, alarm_message=None): | if alarm is not None and isinstance(alarm, AlarmType):<EOL><INDENT>self._section.alarms.register_alarm(alarm)<EOL>alarm = alarm.alias<EOL><DEDENT>value = KeyValue(<EOL>locals(),<EOL>aliases={<EOL>'<STR_LIT:name>': '<STR_LIT:key>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>},<EOL>)<EOL>self._set('<STR_LIT>', value, multi=True)<EOL>return self._section<EOL> | Sets metric threshold parameters.
:param str|unicode name: Metric name.
:param int value: Threshold value.
:param int reset_to: Reset value to when threshold is reached.
:param int check_interval: Threshold check interval in seconds.
:param str|unicode|AlarmType alarm: Alarm to trigger when threshold is reached.
:param str|unicode alarm_message: Message to pass to alarm. If not set metrics name is passed. | f13056:c0:m2 |
def set_stats_params(<EOL>self, address=None, enable_http=None,<EOL>minify=None, no_cores=None, no_metrics=None, push_interval=None): | self._set('<STR_LIT>', address)<EOL>self._set('<STR_LIT>', enable_http, cast=bool)<EOL>self._set('<STR_LIT>', minify, cast=bool)<EOL>self._set('<STR_LIT>', no_cores, cast=bool)<EOL>self._set('<STR_LIT>', no_metrics, cast=bool)<EOL>self._set('<STR_LIT>', push_interval)<EOL>return self._section<EOL> | Enables stats server on the specified address.
* http://uwsgi.readthedocs.io/en/latest/StatsServer.html
:param str|unicode address: Address/socket to make stats available on.
Examples:
* 127.0.0.1:1717
* /tmp/statsock
* :5050
:param bool enable_http: Server stats over HTTP.
Prefixes stats server json output with http headers.
:param bool minify: Minify statistics json output.
:param bool no_cores: Disable generation of cores-related stats.
:param bool no_metrics: Do not include metrics in stats output.
:param int push_interval: Set the default frequency of stats pushers in seconds/ | f13056:c0:m3 |
def register_stats_pusher(self, pusher): | for pusher in listify(pusher):<EOL><INDENT>self._set('<STR_LIT>', pusher, multi=True)<EOL><DEDENT>return self._section<EOL> | Registers a pusher to be used for pushing statistics to various remotes/locals.
:param Pusher|list[Pusher] pusher: | f13056:c0:m4 |
def enable_snmp(self, address, community_string): | self._set('<STR_LIT>', address)<EOL>self._set('<STR_LIT>', community_string)<EOL>return self._section<EOL> | Enables SNMP.
uWSGI server embeds a tiny SNMP server that you can use to integrate
your web apps with your monitoring infrastructure.
* http://uwsgi.readthedocs.io/en/latest/SNMP.html
.. note:: SNMP server is started in the master process after dropping the privileges.
If you want it to listen on a privileged port, you can either use Capabilities on Linux,
or use the ``as-root`` option to run the master process as root.
:param str|unicode address: UDP address to bind to.
Examples:
* 192.168.1.1:2222
:param str|unicode community_string: SNMP instance identifier to address it. | f13056:c0:m5 |
def set_basic_params(self, count=None, thunder_lock=None, lock_engine=None): | self._set('<STR_LIT>', thunder_lock, cast=bool)<EOL>self._set('<STR_LIT>', lock_engine)<EOL>self._set('<STR_LIT>', count)<EOL>return self._section<EOL> | :param int count: Create the specified number of shared locks.
:param bool thunder_lock: Serialize accept() usage (if possible)
Could improve performance on Linux with robust pthread mutexes.
http://uwsgi.readthedocs.io/en/latest/articles/SerializingAccept.html
:param str|unicode lock_engine: Set the lock engine.
Example:
- ipcsem | f13057:c0:m0 |
def set_ipcsem_params(self, ftok=None, persistent=None): | self._set('<STR_LIT>', ftok)<EOL>self._set('<STR_LIT>', persistent, cast=bool)<EOL>return self._section<EOL> | Sets ipcsem lock engine params.
:param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates.
:param bool persistent: Do not remove ipcsem's on shutdown. | f13057:c0:m1 |
def lock_file(self, fpath, after_setup=False, wait=False): | command = '<STR_LIT>' if wait else '<STR_LIT>'<EOL>if after_setup:<EOL><INDENT>command = '<STR_LIT>' % command<EOL><DEDENT>self._set(command, fpath)<EOL>return self._section<EOL> | Locks the specified file.
:param str|unicode fpath: File path.
:param bool after_setup:
True - after logging/daemon setup
False - before starting
:param bool wait:
True - wait if locked
False - exit if locked | f13057:c0:m2 |
def set_basic_params(<EOL>self, enable=None, name=None, no_orphans=None, as_root=None,<EOL>subproc_check_interval=None, fifo_file=None): | self._set('<STR_LIT>', enable, cast=bool)<EOL>self._set('<STR_LIT>', name)<EOL>self._set('<STR_LIT>', no_orphans)<EOL>self._set('<STR_LIT>', as_root)<EOL>self._set('<STR_LIT>', subproc_check_interval)<EOL>self._set('<STR_LIT>', self._section.replace_placeholders(fifo_file), multi=True)<EOL>return self._section<EOL> | :param bool enable: Enable uWSGI master process.
:param str|unicode master_enabled: Set master process name to given value.
:param bool no_orphans: Automatically kill workers if master dies (can be dangerous for availability).
:param bool as_root: Leave master process running as root.
:param int subproc_check_interval: Set the interval (in seconds) of master checks. Default: 1
The master process makes a scan of subprocesses, etc. every N seconds.
.. warning:: You can increase this time if you need to, but it's DISCOURAGED.
:param str|unicode fifo_file: Enables the master FIFO.
.. note:: Placeholders can be used to build paths, e.g.: {project_runtime_dir}.fifo
See ``Section.project_name`` and ``Section.runtime_dir``.
Instead of signals, you can tell the master to create a UNIX named pipe (FIFO)
that you may use to issue commands to the master.
Up to 10 different FIFO files supported. By default the first specified is bound (mapped as '0').
* http://uwsgi.readthedocs.io/en/latest/MasterFIFO.html#the-master-fifo
.. note:: Since 1.9.17 | f13058:c0:m0 |
def set_exit_events(self, no_workers=None, idle=None, reload=None, sig_term=None): | self._set('<STR_LIT>', no_workers, cast=bool)<EOL>self._set('<STR_LIT>', reload, cast=bool)<EOL>self._set('<STR_LIT>', sig_term, cast=bool)<EOL>self.set_idle_params(exit=idle)<EOL>return self._section<EOL> | Do exit on certain events
:param bool no_workers: Shutdown uWSGI when no workers are running.
:param bool idle: Shutdown uWSGI when idle.
:param bool reload: Force exit even if a reload is requested.
:param bool sig_term: Exit on SIGTERM instead of brutal workers reload.
.. note:: Before 2.1 SIGTERM reloaded the stack while SIGINT/SIGQUIT shut it down. | f13058:c0:m1 |
def set_exception_handling_params(self, handler=None, catch=None, no_write_exception=None): | self._set('<STR_LIT>', handler, multi=True)<EOL>self._set('<STR_LIT>', catch, cast=bool)<EOL>self._set('<STR_LIT>', no_write_exception, cast=bool)<EOL>return self._section<EOL> | Exception handling related params.
:param str|unicode|list[str|unicode] handler: Register one or more exception handling C-functions.
:param bool catch: Catch exceptions and report them as http output (including stack trace and env params).
.. warning:: Use only for testing purposes.
:param bool no_write_exception: Disable exception generation on write()/writev().
.. note:: This can be combined with ``logging.set_filters(write_errors=False, sigpipe=False)``.
.. note: Currently available for Python. | f13058:c0:m2 |
def set_idle_params(self, timeout=None, exit=None): | self._set('<STR_LIT>', timeout)<EOL>self._set('<STR_LIT>', exit, cast=bool)<EOL>return self._section<EOL> | Activate idle mode - put uWSGI in cheap mode after inactivity timeout.
:param int timeout: Inactivity timeout in seconds.
:param bool exit: Shutdown uWSGI when idle. | f13058:c0:m3 |
def set_reload_params(self, mercy=None, exit=None): | self._set('<STR_LIT>', mercy)<EOL>self.set_exit_events(reload=exit)<EOL>return self._section<EOL> | Set reload related params.
:param int mercy: Set the maximum time (in seconds) we wait
for workers and other processes to die during reload/shutdown.
:param bool exit: Force exit even if a reload is requested. | f13058:c0:m4 |
def add_cron_task(<EOL>self, command, weekday=None, month=None, day=None, hour=None, minute=None,<EOL>legion=None, unique=None, harakiri=None): | rule = KeyValue(<EOL>locals(),<EOL>keys=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'],<EOL>aliases={'<STR_LIT>': '<STR_LIT>'},<EOL>bool_keys=['<STR_LIT>'],<EOL>)<EOL>self._set('<STR_LIT>', ('<STR_LIT>' % (rule, command)).strip(), multi=True)<EOL>return self._section<EOL> | Adds a cron task running the given command on the given schedule.
http://uwsgi.readthedocs.io/en/latest/Cron.html
HINTS:
* Use negative values to say `every`:
hour=-3 stands for `every 3 hours`
* Use - (minus) to make interval:
minute='13-18' stands for `from minute 13 to 18`
.. note:: We use cron2 option available since 1.9.11.
:param str|unicode command: Command to execute on schedule (with or without path).
:param int|str|unicode weekday: Day of a the week number. Defaults to `each`.
0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday
4 - Thursday 5 - Friday 6 - Saturday
:param int|str|unicode month: Month number 1-12. Defaults to `each`.
:param int|str|unicode day: Day of the month number 1-31. Defaults to `each`.
:param int|str|unicode hour: Hour 0-23. Defaults to `each`.
:param int|str|unicode minute: Minute 0-59. Defaults to `each`.
:param str|unicode legion: Set legion (cluster) name to use this cron command against.
Such commands are only executed by legion lord node.
:param bool unique: Marks command as unique. Default to not unique.
Some commands can take a long time to finish or just hang doing their thing.
Sometimes this is okay, but there are also cases when running multiple instances
of the same command can be dangerous.
:param int harakiri: Enforce a time limit (in seconds) on executed commands.
If a command is taking longer it will be killed. | f13058:c0:m5 |
def attach_process_classic(self, command_or_pid_path, background, control=False, for_legion=False): | prefix = '<STR_LIT>' if for_legion else '<STR_LIT>'<EOL>if '<STR_LIT>' in command_or_pid_path:<EOL><INDENT>if background:<EOL><INDENT>self._set(prefix + '<STR_LIT>', command_or_pid_path, multi=True)<EOL><DEDENT>else:<EOL><INDENT>self._set(prefix + '<STR_LIT>', command_or_pid_path, multi=True)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if background:<EOL><INDENT>raise ConfigurationError('<STR_LIT>')<EOL><DEDENT>if control:<EOL><INDENT>self._set('<STR_LIT>', command_or_pid_path, multi=True)<EOL><DEDENT>else:<EOL><INDENT>self._set(prefix + '<STR_LIT>', command_or_pid_path, multi=True)<EOL><DEDENT><DEDENT>return self._section<EOL> | Attaches a command/daemon to the master process optionally managed by a pidfile.
This will allow the uWSGI master to control/monitor/respawn this process.
.. note:: This uses old classic uWSGI means of process attaching
To have more control use ``.attach_process()`` method (requires uWSGI 2.0+)
http://uwsgi-docs.readthedocs.io/en/latest/AttachingDaemons.html
:param str|unicode command_or_pid_path:
:param bool background: Must indicate whether process is in background.
:param bool control: Consider this process a control: when the daemon dies, the master exits.
.. note:: pidfile managed processed not supported.
:param bool for_legion: Legion daemons will be executed only on the legion lord node,
so there will always be a single daemon instance running in each legion.
Once the lord dies a daemon will be spawned on another node.
.. note:: uWSGI 1.9.9+ required. | f13058:c0:m6 |
def attach_process(<EOL>self, command, for_legion=False, broken_counter=None, pidfile=None, control=None, daemonize=None,<EOL>touch_reload=None, signal_stop=None, signal_reload=None, honour_stdin=None,<EOL>uid=None, gid=None, new_pid_ns=None, change_dir=None): | rule = KeyValue(<EOL>locals(),<EOL>keys=[<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<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>},<EOL>bool_keys=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>'],<EOL>list_keys=['<STR_LIT>'],<EOL>)<EOL>prefix = '<STR_LIT>' if for_legion else '<STR_LIT>'<EOL>self._set(prefix + '<STR_LIT>', rule, multi=True)<EOL>return self._section<EOL> | Attaches a command/daemon to the master process.
This will allow the uWSGI master to control/monitor/respawn this process.
http://uwsgi-docs.readthedocs.io/en/latest/AttachingDaemons.html
:param str|unicode command: The command line to execute.
:param bool for_legion: Legion daemons will be executed only on the legion lord node,
so there will always be a single daemon instance running in each legion.
Once the lord dies a daemon will be spawned on another node.
:param int broken_counter: Maximum attempts before considering a daemon "broken".
:param str|unicode pidfile: The pidfile path to check (enable smart mode).
:param bool control: If True, the daemon becomes a `control` one:
if it dies the whole uWSGI instance dies.
:param bool daemonize: Daemonize the process (enable smart2 mode).
:param list|str|unicode touch_reload: List of files to check:
whenever they are 'touched', the daemon is restarted
:param int signal_stop: The signal number to send to the daemon when uWSGI is stopped.
:param int signal_reload: The signal number to send to the daemon when uWSGI is reloaded.
:param bool honour_stdin: The signal number to send to the daemon when uWSGI is reloaded.
:param str|unicode|int uid: Drop privileges to the specified uid.
.. note:: Requires master running as root.
:param str|unicode|int gid: Drop privileges to the specified gid.
.. note:: Requires master running as root.
:param bool new_pid_ns: Spawn the process in a new pid namespace.
.. note:: Requires master running as root.
.. note:: Linux only.
:param str|unicode change_dir: Use chdir() to the specified directory
before running the command. | f13058:c0:m7 |
def set_basic_params(<EOL>self, touch_reload=None, priority=None, vacuum=None, binary_path=None, honour_stdin=None): | self._set('<STR_LIT>', touch_reload, multi=True)<EOL>self._set('<STR_LIT>', priority)<EOL>self._set('<STR_LIT>', vacuum, cast=bool)<EOL>self._set('<STR_LIT>', binary_path)<EOL>self._set('<STR_LIT>', honour_stdin, cast=bool)<EOL>return self._section<EOL> | :param str|list touch_reload: Reload uWSGI if the specified file or directory is modified/touched.
:param int priority: Set processes/threads priority (``nice``) value.
:param bool vacuum: Try to remove all of the generated files/sockets
(UNIX sockets and pidfiles) upon exit.
:param str|unicode binary_path: Force uWSGI binary path.
If you do not have uWSGI in the system path you can force its path with this option
to permit the reloading system and the Emperor to easily find the binary to execute.
:param bool honour_stdin: Do not remap stdin to ``/dev/null``.
By default, ``stdin`` is remapped to ``/dev/null`` on uWSGI startup.
If you need a valid stdin (for debugging, piping and so on) use this option. | f13061:c0:m1 |
def set_memory_params(self, ksm_interval=None, no_swap=None): | self._set('<STR_LIT>', ksm_interval)<EOL>self._set('<STR_LIT>', no_swap, cast=bool)<EOL>return self._section<EOL> | Set memory related parameters.
:param int ksm_interval: Kernel Samepage Merging frequency option, that can reduce memory usage.
Accepts a number of requests (or master process cycles) to run page scanner after.
.. note:: Linux only.
* http://uwsgi.readthedocs.io/en/latest/KSM.html
:param bool no_swap: Lock all memory pages avoiding swapping. | f13061:c0:m2 |
def daemonize(self, log_into, after_app_loading=False): | self._set('<STR_LIT>' if after_app_loading else '<STR_LIT>', log_into)<EOL>return self._section<EOL> | Daemonize uWSGI.
:param str|unicode log_into: Logging destination:
* File: /tmp/mylog.log
* UPD: 192.168.1.2:1717
.. note:: This will require an UDP server to manage log messages.
Use ``networking.register_socket('192.168.1.2:1717, type=networking.SOCK_UDP)``
to start uWSGI UDP server.
:param str|unicode bool after_app_loading: Whether to daemonize after
or before applications loading. | f13061:c0:m3 |
def change_dir(self, to, after_app_loading=False): | self._set('<STR_LIT>' if after_app_loading else '<STR_LIT>', to)<EOL>return self._section<EOL> | Chdir to specified directory before or after apps loading.
:param str|unicode to: Target directory.
:param bool after_app_loading:
*True* - after load
*False* - before load | f13061:c0:m4 |
def set_owner_params(self, uid=None, gid=None, add_gids=None, set_asap=False): | prefix = '<STR_LIT>' if set_asap else '<STR_LIT>'<EOL>self._set(prefix + '<STR_LIT>', uid)<EOL>self._set(prefix + '<STR_LIT>', gid)<EOL>self._set('<STR_LIT>', add_gids, multi=True)<EOL>self.owner = [uid, gid]<EOL>return self._section<EOL> | Set process owner params - user, group.
:param str|unicode|int uid: Set uid to the specified username or uid.
:param str|unicode|int gid: Set gid to the specified groupname or gid.
:param list|str|unicode|int add_gids: Add the specified group id to the process credentials.
This options allows you to add additional group ids to the current process.
You can specify it multiple times.
:param bool set_asap: Set as soon as possible.
Setting them on top of your vassal file will force the instance to setuid()/setgid()
as soon as possible and without the (theoretical) possibility to override them. | f13061:c0:m5 |
def get_owner(self, default=True): | uid, gid = self.owner<EOL>if not uid and default:<EOL><INDENT>uid = os.getuid()<EOL><DEDENT>if not gid and default:<EOL><INDENT>gid = os.getgid()<EOL><DEDENT>return uid, gid<EOL> | Return (User ID, Group ID) tuple
:param bool default: Whether to return default if not set.
:rtype: tuple[int, int] | f13061:c0:m6 |
def set_hook(self, phase, action): | self._set('<STR_LIT>' % phase, action, multi=True)<EOL>return self._section<EOL> | Allows setting hooks (attaching actions) for various uWSGI phases.
:param str|unicode phase: See constants in ``.phases``.
:param str|unicode|list|HookAction|list[HookAction] action: | f13061:c0:m7 |
def set_hook_touch(self, fpath, action): | self._set('<STR_LIT>', '<STR_LIT>' % (fpath, action), multi=True)<EOL>return self._section<EOL> | Allows running certain action when the specified file is touched.
:param str|unicode fpath: File path.
:param str|unicode|list|HookAction|list[HookAction] action: | f13061:c0:m8 |
def set_hook_after_request(self, func): | self._set('<STR_LIT>', func, multi=True)<EOL>return self._section<EOL> | Run the specified function/symbol (C level) after each request.
:param str|unicode func: | f13061:c0:m9 |
def set_on_exit_params(self, skip_hooks=None, skip_teardown=None): | self._set('<STR_LIT>', skip_hooks, cast=bool)<EOL>self._set('<STR_LIT>', skip_teardown, cast=bool)<EOL>return self._section<EOL> | Set params related to process exit procedure.
:param bool skip_hooks: Skip ``EXIT`` phase hook.
.. note:: Ignored by the master.
:param bool skip_teardown: Allows skipping teardown (finalization) processes for some plugins.
.. note:: Ignored by the master.
Supported by:
* Perl
* Python | f13061:c0:m10 |
def run_command_on_event(self, command, phase=phases.ASAP): | self._set('<STR_LIT>' % phase, command, multi=True)<EOL>return self._section<EOL> | Run the given command on a given phase.
:param str|unicode command:
:param str|unicode phase: See constants in ``Phases`` class. | f13061:c0:m11 |
def run_command_on_touch(self, command, target): | self._set('<STR_LIT>', '<STR_LIT>' % (target, command), multi=True)<EOL>return self._section<EOL> | Run command when the specified file is modified/touched.
:param str|unicode command:
:param str|unicode target: File path. | f13061:c0:m12 |
def set_pid_file(self, fpath, before_priv_drop=True, safe=False): | command = '<STR_LIT>'<EOL>if not before_priv_drop:<EOL><INDENT>command += '<STR_LIT:2>'<EOL><DEDENT>if safe:<EOL><INDENT>command = '<STR_LIT>' + command<EOL><DEDENT>self._set(command, fpath)<EOL>return self._section<EOL> | Creates pidfile before or after privileges drop.
:param str|unicode fpath: File path.
:param bool before_priv_drop: Whether to create pidfile before privileges are dropped.
.. note:: Vacuum is made after privileges drop, so it may not be able
to delete PID file if it was created before dropping.
:param bool safe: The safe-pidfile works similar to pidfile
but performs the write a little later in the loading process.
This avoids overwriting the value when app loading fails,
with the consequent loss of a valid PID number. | f13061:c0:m13 |
def set_naming_params(self, autonaming=None, prefix=None, suffix=None, name=None): | self._set('<STR_LIT>', autonaming, cast=bool)<EOL>self._set('<STR_LIT>' % ('<STR_LIT>' if prefix and prefix.endswith('<STR_LIT:U+0020>') else '<STR_LIT>'), prefix)<EOL>self._set('<STR_LIT>', suffix)<EOL>self._set('<STR_LIT>', name)<EOL>return self._section<EOL> | Setups processes naming parameters.
:param bool autonaming: Automatically set process name to something meaningful.
Generated process names may be 'uWSGI Master', 'uWSGI Worker #', etc.
:param str|unicode prefix: Add prefix to process names.
:param str|unicode suffix: Append string to process names.
:param str|unicode name: Set process names to given static value. | f13061:c0:m14 |
def __init__(self, on=None): | self._make_section_like()<EOL>command = self.on_command or self.alias<EOL>self._set(command, on)<EOL>super(RouterBase, self).__init__()<EOL> | :param SocketShared|str|unicode on: Activates the router on the given address. | f13062:c0:m1 |
def set_basic_params(<EOL>self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,<EOL>cheap_mode=None, stats_server=None): | self._set_aliased('<STR_LIT>', workers)<EOL>self._set_aliased('<STR_LIT>', zerg_server)<EOL>self._set_aliased('<STR_LIT>', fallback_node)<EOL>self._set_aliased('<STR_LIT>', concurrent_events)<EOL>self._set_aliased('<STR_LIT>', cheap_mode, cast=bool)<EOL>self._set_aliased('<STR_LIT>', stats_server)<EOL>return self<EOL> | :param int workers: Number of worker processes to spawn.
:param str|unicode zerg_server: Attach the router to a zerg server.
:param str|unicode fallback_node: Fallback to the specified node in case of error.
:param int concurrent_events: Set the maximum number of concurrent events router can manage.
Default: system dependent.
:param bool cheap_mode: Enables cheap mode. When the router is in cheap mode,
it will not respond to requests until a node is available.
This means that when there are no nodes subscribed, only your local app (if any) will respond.
When all of the nodes go down, the router will return in cheap mode.
:param str|unicode stats_server: Router stats server address to run at. | f13062:c1:m0 |
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None): | self._set_aliased('<STR_LIT>', harakiri)<EOL>self._set_aliased('<STR_LIT>', timeout_socket)<EOL>self._set_aliased('<STR_LIT>', retry_delay)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60.
:param int retry_delay: Retry connections to dead static nodes after the specified
amount of seconds. Default: 30. | f13062:c1:m1 |
def __init__(self, sockets_dir): | if '<STR_LIT:%s>' in sockets_dir:<EOL><INDENT>self.name = '<STR_LIT>'<EOL><DEDENT>super(ForwarderPath, self).__init__(sockets_dir)<EOL> | :param str|unicode sockets_dir: UNIX sockets directory.
Allows %s to denote key (domain). | f13062:c3:m0 |
def __init__(self, script, func, modifier=None): | modifier = modifier or ModifierWsgi<EOL>super(ForwarderCode, self).__init__(modifier.code, script, func)<EOL> | :param str|unicode script: Script (module for Python) name to get function from.
:param str|unicode func: Function name.
:param Modifier modifier: Routing modifier. | f13062:c4:m0 |
def __init__(self, cache_name=None): | super(ForwarderCache, self).__init__(cache_name)<EOL> | :param str|unicode cache_name: Cache name to use. | f13062:c5:m0 |
def __init__(self, socket): | super(ForwarderSocket, self).__init__(socket)<EOL> | :param str|unicode socket: Socket filepath. | f13062:c6:m0 |
def __init__(self, address): | super(ForwarderSubscriptionServer, self).__init__(address)<EOL> | :param str|unicode address: Address (including port) to run the subscription server on. | f13062:c7:m0 |
def __init__(self, on=None, forward_to=None): | super(_RouterWithForwarders, self).__init__(on)<EOL>if forward_to is not None:<EOL><INDENT>if isinstance(forward_to, Forwarder):<EOL><INDENT>value = '<STR_LIT:%s>' % forward_to<EOL>self._set_aliased(forward_to.name, value, multi=True)<EOL><DEDENT>else:<EOL><INDENT>self._set_aliased('<STR_LIT:to>', forward_to, multi=True)<EOL><DEDENT><DEDENT> | Activates the router on the given address.
:param SocketShared|str|unicode on: Activates the router on the given address.
:param Forwarder|str|unicode|list[str|unicode] forward_to: Where to forward requests.
Expects a forwarder instance or one or more node names. | f13062:c8:m0 |
def set_basic_params(<EOL>self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,<EOL>cheap_mode=None, stats_server=None, quiet=None, buffer_size=None): | super(_RouterWithForwarders, self).set_basic_params(**filter_locals(locals(), drop=[<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>]))<EOL>self._set_aliased('<STR_LIT>', quiet, cast=bool)<EOL>self._set_aliased('<STR_LIT>', buffer_size)<EOL>return self<EOL> | :param int workers: Number of worker processes to spawn.
:param str|unicode zerg_server: Attach the router to a zerg server.
:param str|unicode fallback_node: Fallback to the specified node in case of error.
:param int concurrent_events: Set the maximum number of concurrent events router can manage.
Default: system dependent.
:param bool cheap_mode: Enables cheap mode. When the router is in cheap mode,
it will not respond to requests until a node is available.
This means that when there are no nodes subscribed, only your local app (if any) will respond.
When all of the nodes go down, the router will return in cheap mode.
:param str|unicode stats_server: Router stats server address to run at.
:param bool quiet: Do not report failed connections to instances.
:param int buffer_size: Set the internal buffer max size - size of a request (request-body excluded),
this generally maps to the size of request headers. Default: 4096 bytes (4k) / page size.
The amount of variables you can add per-request is limited by the uwsgi packet buffer ().
You can increase it up to 65535 (64k) with this option.
.. note: If you receive a bigger request (for example with big cookies or query string)
so that "invalid request block size" is logged in your logs you may need to increase it.
It is a security measure too, so adapt to your app needs instead of maxing it out.
:param forward_to: Forward request to the given node. | f13062:c8:m1 |
def set_basic_params(<EOL>self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,<EOL>cheap_mode=None, stats_server=None, quiet=None, buffer_size=None,<EOL>keepalive=None, resubscribe_addresses=None): | super(RouterHttp, self).set_basic_params(**filter_locals(locals(), drop=[<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>]))<EOL>self._set_aliased('<STR_LIT>', keepalive)<EOL>self._set_aliased('<STR_LIT>', resubscribe_addresses, multi=True)<EOL>return self<EOL> | :param int workers: Number of worker processes to spawn.
:param str|unicode zerg_server: Attach the router to a zerg server.
:param str|unicode fallback_node: Fallback to the specified node in case of error.
:param int concurrent_events: Set the maximum number of concurrent events router can manage.
Default: system dependent.
:param bool cheap_mode: Enables cheap mode. When the router is in cheap mode,
it will not respond to requests until a node is available.
This means that when there are no nodes subscribed, only your local app (if any) will respond.
When all of the nodes go down, the router will return in cheap mode.
:param str|unicode stats_server: Router stats server address to run at.
:param bool quiet: Do not report failed connections to instances.
:param int buffer_size: Set internal buffer size in bytes. Default: page size.
:param int keepalive: Allows holding the connection open even if the request has a body.
* http://uwsgi.readthedocs.io/en/latest/HTTP.html#http-keep-alive
.. note:: See http11 socket type for an alternative.
:param str|unicode|list[str|unicode] resubscribe_addresses: Forward subscriptions
to the specified subscription server. | f13062:c9:m0 |
def set_connections_params(<EOL>self, harakiri=None, timeout_socket=None, retry_delay=None, timeout_headers=None, timeout_backend=None): | super(RouterHttp, self).set_connections_params(<EOL>**filter_locals(locals(), ['<STR_LIT>', '<STR_LIT>']))<EOL>self._set_aliased('<STR_LIT>', timeout_headers)<EOL>self._set_aliased('<STR_LIT>', timeout_backend)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds).
Used to set the SPDY timeout. This is the maximum amount of inactivity after
the SPDY connection is closed.
Default: 60.
:param int retry_delay: Retry connections to dead static nodes after the specified
amount of seconds. Default: 30.
:param int timeout_headers: Defines the timeout (seconds) while waiting for http headers.
Default: `socket_timeout`.
:param int timeout_backend: Defines the timeout (seconds) when connecting to backend instances.
Default: `socket_timeout`. | f13062:c9:m1 |
def set_manage_params(<EOL>self, chunked_input=None, chunked_output=None, gzip=None, websockets=None, source_method=None,<EOL>rtsp=None, proxy_protocol=None): | self._set_aliased('<STR_LIT>', chunked_input, cast=bool)<EOL>self._set_aliased('<STR_LIT>', chunked_output, cast=bool)<EOL>self._set_aliased('<STR_LIT>', gzip, cast=bool)<EOL>self._set_aliased('<STR_LIT>', websockets, cast=bool)<EOL>self._set_aliased('<STR_LIT>', source_method, cast=bool)<EOL>self._set_aliased('<STR_LIT>', rtsp, cast=bool)<EOL>self._set_aliased('<STR_LIT>', proxy_protocol, cast=bool)<EOL>return self<EOL> | Allows enabling various automatic management mechanics.
* http://uwsgi.readthedocs.io/en/latest/Changelog-1.9.html#http-router-keepalive-auto-chunking-auto-gzip-and-transparent-websockets
:param bool chunked_input: Automatically detect chunked input requests and put the session in raw mode.
:param bool chunked_output: Automatically transform output to chunked encoding
during HTTP 1.1 keepalive (if needed).
:param bool gzip: Automatically gzip content if uWSGI-Encoding header is set to gzip,
but content size (Content-Length/Transfer-Encoding) and Content-Encoding are not specified.
:param bool websockets: Automatically detect websockets connections and put the session in raw mode.
:param bool source_method: Automatically put the session in raw mode for `SOURCE` HTTP method.
* http://uwsgi.readthedocs.io/en/latest/Changelog-2.0.5.html#icecast2-protocol-helpers
:param bool rtsp: Allow the HTTP router to detect RTSP and chunked requests automatically.
:param bool proxy_protocol: Allows the HTTP router to manage PROXY1 protocol requests,
such as those made by Haproxy or Amazon Elastic Load Balancer (ELB). | f13062:c9:m2 |
def set_owner_params(self, uid=None, gid=None): | self._set_aliased('<STR_LIT>', uid)<EOL>self._set_aliased('<STR_LIT>', gid)<EOL>return self<EOL> | Drop http router privileges to specified user and group.
:param str|unicode|int uid: Set uid to the specified username or uid.
:param str|unicode|int gid: Set gid to the specified groupname or gid. | f13062:c9:m3 |
def __init__(<EOL>self, on, cert, key, ciphers=None, client_ca=None, session_context=None, use_spdy=None,<EOL>export_cert_var=None): | on = KeyValue(<EOL>filter_locals(locals(), drop=['<STR_LIT>']),<EOL>aliases={'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'},<EOL>bool_keys=['<STR_LIT>'],<EOL>)<EOL>super(_RouterWithForwarders, self).__init__(on)<EOL>self._set_aliased('<STR_LIT>', session_context)<EOL> | Binds https router to run on the given address.
:param SocketShared|str|unicode on: Activates the router on the given address.
: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 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 bool use_spdy: Use SPDY.
:param bool export_cert_var: Export uwsgi variable `HTTPS_CC` containing the raw client certificate. | f13062:c10:m0 |
def __init__(self, on, cert, key, forward_to=None, ciphers=None, client_ca=None, session_context=None, use_sni=None): | on = KeyValue(<EOL>filter_locals(locals(), drop=['<STR_LIT>', '<STR_LIT>']),<EOL>aliases={'<STR_LIT>': '<STR_LIT>'},<EOL>)<EOL>self._set_aliased('<STR_LIT>', session_context)<EOL>self._set_aliased('<STR_LIT>', use_sni, cast=bool)<EOL>super(RouterSsl, self).__init__(on, forward_to)<EOL> | Activates the router on the given address.
:param SocketShared|str|unicode on: Activates the router on the given address.
:param str|unicode cert: Certificate file.
:param str|unicode key: Private key file.
:param Forwarder|str|unicode|list[str|unicode] forward_to: Where to forward requests.
Expects a forwarder instance or one or more node names.
: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.
: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 bool use_sni: Use SNI to route requests. | f13062:c11:m0 |
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None): | super(RouterSsl, self).set_connections_params(**filter_locals(locals(), ['<STR_LIT>']))<EOL>self._set_aliased('<STR_LIT>', retry_max)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60.
:param int retry_delay: Retry connections to dead static nodes after the specified
amount of seconds. Default: 30.
:param int retry_max: Maximum number of retries/fallbacks to other nodes. Default: 3. | f13062:c11:m1 |
def set_basic_params(<EOL>self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,<EOL>cheap_mode=None, stats_server=None, quiet=None, buffer_size=None,<EOL>fallback_nokey=None, subscription_key=None, emperor_command_socket=None): | super(RouterFast, self).set_basic_params(**filter_locals(locals(), [<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>]))<EOL>self._set_aliased('<STR_LIT>', fallback_nokey, cast=bool)<EOL>self._set_aliased('<STR_LIT>', subscription_key)<EOL>self._set_aliased('<STR_LIT>', emperor_command_socket)<EOL>return self<EOL> | :param int workers: Number of worker processes to spawn.
:param str|unicode zerg_server: Attach the router to a zerg server.
:param str|unicode fallback_node: Fallback to the specified node in case of error.
:param int concurrent_events: Set the maximum number of concurrent events router can manage.
Default: system dependent.
:param bool cheap_mode: Enables cheap mode. When the router is in cheap mode,
it will not respond to requests until a node is available.
This means that when there are no nodes subscribed, only your local app (if any) will respond.
When all of the nodes go down, the router will return in cheap mode.
:param str|unicode stats_server: Router stats server address to run at.
:param bool quiet: Do not report failed connections to instances.
:param int buffer_size: Set internal buffer size in bytes. Default: page size.
:param bool fallback_nokey: Move to fallback node even if a subscription key is not found.
:param str|unicode subscription_key: Skip uwsgi parsing and directly set a key.
:param str|unicode emperor_command_socket: Set the emperor command socket that will receive spawn commands.
See `.empire.set_emperor_command_params()`. | f13062:c12:m0 |
def set_resubscription_params(self, addresses=None, bind_to=None): | self._set_aliased('<STR_LIT>', addresses, multi=True)<EOL>self._set_aliased('<STR_LIT>', bind_to)<EOL>return self<EOL> | You can specify a dgram address (udp or unix) on which all of the subscriptions
request will be forwarded to (obviously changing the node address to the router one).
The system could be useful to build 'federated' setup.
* http://uwsgi.readthedocs.io/en/latest/Changelog-2.0.1.html#resubscriptions
:param str|unicode|list[str|unicode] addresses: Forward subscriptions to the specified subscription server.
:param str|unicode|list[str|unicode] bind_to: Bind to the specified address when re-subscribing. | f13062:c12:m1 |
def set_connections_params(self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, defer=None): | super(RouterFast, self).set_connections_params(**filter_locals(locals(), ['<STR_LIT>', '<STR_LIT>']))<EOL>self._set_aliased('<STR_LIT>', retry_max)<EOL>self._set_aliased('<STR_LIT>', defer)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60.
:param int retry_delay: Retry connections to dead static nodes after the specified
amount of seconds. Default: 30.
:param int retry_max: Maximum number of retries/fallbacks to other nodes. Default: 3
:param int defer: Defer connection delay, seconds. Default: 5. | f13062:c12:m2 |
def set_postbuffering_params(self, size=None, store_dir=None): | self._set_aliased('<STR_LIT>', size)<EOL>self._set_aliased('<STR_LIT>', store_dir)<EOL>return self<EOL> | Sets buffering params.
Web-proxies like nginx are "buffered", so they wait til the whole request (and its body)
has been read, and then it sends it to the backends.
:param int size: The size (in bytes) of the request body after which the body will
be stored to disk (as a temporary file) instead of memory.
:param str|unicode store_dir: Put buffered files to the specified directory. Default: TMPDIR, /tmp/ | f13062:c12:m3 |
def set_owner_params(self, uid=None, gid=None): | self._set_aliased('<STR_LIT>', uid)<EOL>self._set_aliased('<STR_LIT>', gid)<EOL>return self<EOL> | Drop http router privileges to specified user and group.
:param str|unicode|int uid: Set uid to the specified username or uid.
:param str|unicode|int gid: Set gid to the specified groupname or gid. | f13062:c12:m4 |
def set_connections_params(<EOL>self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, use_xclient=None): | super(RouterRaw, self).set_connections_params(**filter_locals(locals(), ['<STR_LIT>', '<STR_LIT>']))<EOL>self._set_aliased('<STR_LIT>', retry_max)<EOL>self._set_aliased('<STR_LIT>', use_xclient)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60.
:param int retry_delay: Retry connections to dead static nodes after the specified
amount of seconds. Default: 30.
:param int retry_max: Maximum number of retries/fallbacks to other nodes. Default: 3.
:param bool use_xclient: Use the xclient protocol to pass the client address. | f13062:c13:m0 |
def __init__(self, on=None, undeferred=False): | router_name = self.alias<EOL>if undeferred:<EOL><INDENT>router_name = '<STR_LIT>'<EOL><DEDENT>self.on_command = router_name<EOL>super(RouterForkPty, self).__init__(on)<EOL> | Binds router to run on the given address.
:param SocketShared|str|unicode on: Activates the router on the given address.
:param bool undeferred: Run router in undeferred mode. | f13062:c14:m0 |
def set_basic_params(<EOL>self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,<EOL>cheap_mode=None, stats_server=None, run_command=None): | super(RouterForkPty, self).set_basic_params(**filter_locals(locals(), ['<STR_LIT>']))<EOL>self._set_aliased('<STR_LIT>', run_command)<EOL>return self<EOL> | :param int workers: Number of worker processes to spawn.
:param str|unicode zerg_server: Attach the router to a zerg server.
:param str|unicode fallback_node: Fallback to the specified node in case of error.
:param int concurrent_events: Set the maximum number of concurrent events router can manage.
Default: system dependent.
:param bool cheap_mode: Enables cheap mode. When the router is in cheap mode,
it will not respond to requests until a node is available.
This means that when there are no nodes subscribed, only your local app (if any) will respond.
When all of the nodes go down, the router will return in cheap mode.
:param str|unicode stats_server: Router stats server address to run at.
:param str|unicode run_command: Run the specified command
on every connection. Default: /bin/sh. | f13062:c14:m1 |
def set_connections_params(self, harakiri=None, timeout_socket=None): | self._set_aliased('<STR_LIT>', harakiri)<EOL>self._set_aliased('<STR_LIT>', timeout_socket)<EOL>return self<EOL> | Sets connection-related parameters.
:param int harakiri: Set gateway harakiri timeout (seconds).
:param int timeout_socket: Node socket timeout (seconds). Default: 60. | f13062:c14:m2 |
def set_window_params(self, cols=None, rows=None): | self._set_aliased('<STR_LIT>', cols)<EOL>self._set_aliased('<STR_LIT>', rows)<EOL>return self<EOL> | Sets pty window params.
:param int cols:
:param int rows: | f13062:c14:m3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.