This document describes an older version of Celery (2.1). For the latest stable version please go here.

caqmadm: AMQP API Command-line Shell - celery.bin.camqadm

camqadm

class celery.bin.camqadm.AMQPAdmin(*args, **kwargs)

The celery camqadm utility.

connect(conn=None)
run()
say(m)
class celery.bin.camqadm.AMQShell(*args, **kwargs)

AMQP API Shell.

Parameters:
  • connect – Function used to connect to the server, must return connection object.
  • silent – If True, the commands won’t have annoying output not relevant when running in non-shell mode.
amqp

Mapping of AMQP API commands and their Spec.

amqp = {'queue.declare': <celery.bin.camqadm.Spec object at 0x65cb150>, 'queue.purge': <celery.bin.camqadm.Spec object at 0x65cb910>, 'exchange.delete': <celery.bin.camqadm.Spec object at 0x65cbb50>, 'basic.publish': <celery.bin.camqadm.Spec object at 0x65cb290>, 'basic.ack': <celery.bin.camqadm.Spec object at 0x65cb850>, 'exchange.declare': <celery.bin.camqadm.Spec object at 0x65cbe10>, 'queue.delete': <celery.bin.camqadm.Spec object at 0x65cb110>, 'queue.bind': <celery.bin.camqadm.Spec object at 0x65cb6d0>, 'basic.get': <celery.bin.camqadm.Spec object at 0x65cb5d0>}
builtins = {'exit': 'do_exit', 'EOF': 'do_exit', 'help': 'do_help'}
chan = None
completenames(text, *ignored)

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

conn = None
counter = 1
default(line)
dispatch(cmd, argline)

Dispatch and execute the command.

Lookup order is: builtins -> amqp.

display_command_help(cmd, short=False)
do_exit(*args)

The "exit" command.

do_help(*args)
get_amqp_api_command(cmd, arglist)

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:tuple of (method, processed_args).

Example:

>>> get_amqp_api_command("queue.delete", ["pobox", "yes", "no"])
(<bound method Channel.queue_delete of
 <amqplib.client_0_8.channel.Channel object at 0x...>>,
 ('testfoo', True, False))
get_names()
identchars = '.'
inc_counter = <method-wrapper 'next' of itertools.count object at 0x706fbd8>
needs_reconnect = False
onecmd(line)

Parse line and execute command.

parseline(line)

Parse input line.

Returns:tuple of three items: (command_name, arglist, original_line)

E.g:

>>> parseline("queue.delete A 'B' C")
("queue.delete", "A 'B' C", "queue.delete A 'B' C")
prompt
prompt_fmt = '%d> '
respond(retval)

What to do with the return value of a command.

say(m)

Say something to the user. Disabled if silent`.

class celery.bin.camqadm.Spec(*args, **kwargs)

AMQP Command specification.

Used to convert arguments to Python values and display various help and tooltips.

Parameters:
  • args – see args.
  • returns – see returns.
coerce(index, value)

Coerce value for argument at index.

E.g. if args is [("is_active", bool)]:

>>> coerce(0, "False")
False
format_arg(name, type, default_value=None)
format_response(response)

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

format_signature()
str_args_to_python(arglist)

Process list of string arguments to values according to spec.

e.g:

>>> spec = Spec([("queue", str), ("if_unused", bool)])
>>> spec.str_args_to_python("pobox", "true")
("pobox", True)
celery.bin.camqadm.camqadm(*args, **options)
celery.bin.camqadm.dump_message(message)
celery.bin.camqadm.format_declare_queue(ret)
celery.bin.camqadm.main()
celery.bin.camqadm.parse_options(arguments)

Parse the available options to celeryd.

celery.bin.camqadm.say(m)

Previous topic

celeryctl - celery.bin.celeryctl

Next topic

Celeryd Multi Tool - celery.bin.celeryd_multi

This Page