How to use the circus.commands.base.Command function in circus

To help you get started, we’ve selected a few circus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github circus-tent / circus / circus / commands / quit.py View on Github external
from circus.commands.base import Command


class Quit(Command):
    """\
        Quit the arbiter immediately
        ============================

        When the arbiter receive this command, the arbiter exit.

        ZMQ Message
        -----------

        ::

            {
                "command": "quit",
                "async": False
            }
github circus-tent / circus / circus / commands / kill.py View on Github external
$ circusctl kill  [] [--signum] [--graceful_timeout]

        Options:
        ++++++++

        - : the name of the watcher
        - : integer, the process id
        - : overrides the watcher's stop_signal (number or name)
        - : overrides the watcher's graceful_timeout

    """

    name = "kill"
    properties = ['name']
    options = Command.waiting_options + [
        ('signum', 'signum', None, "overrides the watcher's stop_signal "
                                   "(number or name)"),
        ('graceful_timeout', 'graceful_timeout', None, "overrides the watcher"
                                                       "'s graceful_timeout"),
    ]

    def message(self, *args, **opts):
        if len(args) < 1 or len(args) > 2:
            raise ArgumentError("Invalid number of arguments")

        props = {}
        props['name'] = args[0]
        if len(args) > 1:
            props['pid'] = args[1]
        if opts['signum'] is not None:
            props['signum'] = opts['signum']
github circus-tent / circus / circus / commands / numprocesses.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError


class NumProcesses(Command):
    """\
        Get the number of processes
        ===========================

        Get the number of processes in a watcher or in a arbiter

        ZMQ Message
        -----------

        ::

            {
                "command": "numprocesses",
                "propeties": {
                    "name": ""
                }
github circus-tent / circus / circus / commands / decrproc.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError


class DecrProcess(Command):
    """\
        Decrement the number of processes in a watcher
        ==============================================

        This comment decrement the number of processes in a watcher by -1.

        ZMQ Message
        -----------

        ::

            {
                "command": "decr",
                "propeties": {
                    "name": ""
                    "nb": 
github circus-tent / circus / circus / commands / globaloptions.py View on Github external
from circus.commands.base import Command
from circus.exc import MessageError
from circus.util import convert_opt


_OPTIONS = ('endpoint', 'stats_endpoint', 'pubsub_endpoint',
            'check_delay', 'multicast_endpoint')


class GlobalOptions(Command):
    """\
        Get the arbiter options
        =======================

        This command return the arbiter options

        ZMQ Message
        -----------

        ::

            {
                "command": "globaloptions",
                "properties": {
                    "key1": "val1",
                    ..
github circus-tent / circus / circus / commands / rmwatcher.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError


class RmWatcher(Command):
    """\
        Remove a watcher
        ================

        This command removes a watcher dynamically from the arbiter. The
        watchers are gracefully stopped by default.

        ZMQ Message
        -----------

        ::

            {
                "command": "rm",
                "properties": {
                    "name": "",
github circus-tent / circus / circus / commands / run.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError


class Run(Command):
    """\
        Run a watcher
        ==============================

        This command runs one watcher's process and does not try to control it
        in any way: it's a fire and forget thing.


        ZMQ Message
        -----------

        ::

            {
                "command": "run",
                "properties": {
github circus-tent / circus / circus / commands / reloadconfig.py View on Github external
from circus.commands.base import Command


class ReloadConfig(Command):
    """\
        Reload the configuration file
        =============================

        This command reloads the configuration file, so changes in the
        configuration file will be reflected in the configuration of
        circus.


        ZMQ Message
        -----------

        ::

            {
                "command": "reloadconfig",
github circus-tent / circus / circus / commands / status.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError


class Status(Command):
    """\
        Get the status of a watcher or all watchers
        ===========================================

        This command start get the status of a watcher or all watchers.

        ZMQ Message
        -----------

        ::

            {
                "command": "status",
                "properties": {
                    "name": '",
                }
github circus-tent / circus / circus / commands / options.py View on Github external
from circus.commands.base import Command
from circus.exc import ArgumentError
from circus.util import convert_opt


class Options(Command):
    """\
        Get the value of a watcher option
        =================================

        This command return the watchers options values asked.

        ZMQ Message
        -----------

        ::

            {
                "command": "options",
                "properties": {
                    "name": "nameofwatcher",
                }