bin.amqp

The celery amqp command.

Module Contents

Classes

Spec(self,*args,**kwargs) AMQP Command specification.
AMQShell(self,*args,**kwargs) AMQP API Shell.
AMQPAdmin(self,*args,**kwargs) The celery celery amqp utility.
amqp() AMQP Administration Shell.

Functions

dump_message(message)
format_declare_queue(ret)
main()
class Spec(*args, **kwargs)

AMQP Command specification.

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

Arguments:
args (Sequence): see args. returns (str): see returns.
__init__(*args, **kwargs)
coerce(index, value)

Coerce value for argument at index.

str_args_to_python(arglist)

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)
format_response(response)

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

format_arg(name, type, default_value=None)
format_signature()
dump_message(message)
format_declare_queue(ret)
class AMQShell(*args, **kwargs)

AMQP API Shell.

Arguments:
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.
_prepare_spec(conn)
__init__(*args, **kwargs)
note(m)

Say something to the user. Disabled if silent.

say(m)
get_amqp_api_command(cmd, arglist)

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:
Tuple: of (method, processed_args) pairs.
do_exit(*args)

The ‘exit’ command.

display_command_help(cmd, short=False)
do_help(*args)
default(line)
get_names()
completenames(text, *ignored)

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

dispatch(cmd, arglist)

Dispatch and execute the command.

Look-up order is: builtins -> amqp.

parseline(parts)

Parse input line.

Returns:
Tuple: of three items:
(command_name, arglist, original_line)
onecmd(line)

Parse line and execute command.

respond(retval)

What to do with the return value of a command.

_reconnect()

Re-establish connection to the AMQP server.

prompt()
class AMQPAdmin(*args, **kwargs)

The celery celery amqp utility.

__init__(*args, **kwargs)
connect(conn=None)
run()
note(m)
class amqp

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)
main()