Module commands
Introduced in MaxScale 2.1, the module commands are special, module-specific commands. They allow the modules to expand beyond the capabilities of the module API. Currently, only MaxAdmin implements an interface to the module commands.
All registered module commands can be shown with maxadmin list commands
and
they can be executed with maxadmin call command <module> <name> ARGS...
whereis the name of the module and is the name of the command.ARGS is a command specific list of arguments.
Developer reference
The module command API is defined in the modulecmd.h header. It consists of various functions to register and call module commands. Read the function documentation in the header for more details.
The following example registers the module command my_command for modulemy_module.
The array my_args of type modulecmd_arg_type_t is used to tell what kinds of arguments the command expects. The first argument is a boolean and the second argument is an optional string.
Arguments are passed to the parsing function as an array of void pointers. They are interpreted as the types the command expects.
When the module command is executed, the argv parameter for themy_simple_cmd contains the parsed arguments received from the caller of the command.
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?