This document describes the current stable version of Celery (4.2). For development docs, go here.

celery.bin.amqp

The celery amqp command.

class celery.bin.amqp.AMQPAdmin(*args, **kwargs)[source]

The celery celery amqp utility.

Shell

alias of AMQShell

connect(conn=None)[source]
note(m)[source]
run()[source]
class celery.bin.amqp.AMQShell(*args, **kwargs)[source]

AMQP API Shell.

Parameters:
  • connect (Callable) – Function used to connect to the server. Must return kombu.Connection object.
  • silent (bool) – If enabled, the commands won’t have annoying output not relevant when running in non-shell mode.
amqp = {u'basic.ack': <celery.bin.amqp.Spec object at 0x7f4e800411d0>, u'basic.get': <celery.bin.amqp.Spec object at 0x7f4e80041150>, u'basic.publish': <celery.bin.amqp.Spec object at 0x7f4e80041190>, u'exchange.declare': <celery.bin.amqp.Spec object at 0x7f4e801cb050>, u'exchange.delete': <celery.bin.amqp.Spec object at 0x7f4e80034fd0>, u'queue.bind': <celery.bin.amqp.Spec object at 0x7f4e80041050>, u'queue.declare': <celery.bin.amqp.Spec object at 0x7f4e80041090>, u'queue.delete': <celery.bin.amqp.Spec object at 0x7f4e800410d0>, u'queue.purge': <celery.bin.amqp.Spec object at 0x7f4e80041110>}

Map of AMQP API commands and their Spec.

builtins = {u'EOF': u'do_exit', u'exit': u'do_exit', u'help': u'do_help'}

Map of built-in command names -> method names

chan = None
completenames(text, *ignored)[source]

Return all commands starting with text, for tab-completion.

conn = None
counter = 1
default(line)[source]
dispatch(cmd, arglist)[source]

Dispatch and execute the command.

Look-up order is: builtins -> amqp.

display_command_help(cmd, short=False)[source]
do_exit(*args)[source]

The ‘exit’ command.

do_help(*args)[source]
get_amqp_api_command(cmd, arglist)[source]

Get AMQP command wrapper.

With a command name and a list of arguments, convert the arguments to Python values and find the corresponding method on the AMQP channel object.

Returns:of (method, processed_args) pairs.
Return type:Tuple
get_names()[source]
identchars = u'.'
inc_counter = count(2)
needs_reconnect = False
note(m)[source]

Say something to the user. Disabled if silent.

onecmd(line)[source]

Parse line and execute command.

parseline(parts)[source]

Parse input line.

Returns:
of three items:
(command_name, arglist, original_line)
Return type:Tuple
prompt
prompt_fmt = u'{self.counter}> '
respond(retval)[source]

What to do with the return value of a command.

say(m)[source]
class celery.bin.amqp.Spec(*args, **kwargs)[source]

AMQP Command specification.

Used to convert arguments to Python values and display various help and tool-tips.

Parameters:
args = None

List of arguments this command takes. Should contain (argument_name, argument_type) tuples.

coerce(index, value)[source]

Coerce value for argument at index.

format_arg(name, type, default_value=None)[source]
format_response(response)[source]

Format the return value of this command in a human-friendly way.

format_signature()[source]
returns = None

Helpful human string representation of what this command returns. May be None, to signify the return type is unknown.

str_args_to_python(arglist)[source]

Process list of string arguments to values according to spec.

Example

>>> spec = Spec([('queue', str), ('if_unused', bool)])
>>> spec.str_args_to_python('pobox', 'true')
('pobox', True)
class celery.bin.amqp.amqp(app=None, get_app=None, no_color=False, stdout=None, stderr=None, quiet=False, on_error=None, on_usage_error=None)[source]

AMQP Administration Shell.

Also works for non-AMQP transports (but not ones that store declarations in memory).

Examples

$ # start shell mode
$ celery amqp
$ # show list of commands
$ celery amqp help

$ celery amqp exchange.delete name
$ celery amqp queue.delete queue
$ celery amqp queue.delete queue yes yes
run(*args, **options)[source]