MXS-1220: Add output for module commands
The module commands can now produce JSON formatted output which is passed to the caller. The output should conform to the JSON API as closely as possible. Currently, the REST API wraps all JSON produced by module commands inside a meta-object of the following type: { "meta": <output of module command> } This allows the output to be JSON API conformant without modifying the modules and allows incremental updates to code.
This commit is contained in:
@ -1717,7 +1717,8 @@ static void callModuleCommand(DCB *dcb, char *domain, char *id, char *v3,
|
||||
|
||||
if (arg)
|
||||
{
|
||||
if (!modulecmd_call_command(cmd, arg))
|
||||
// TODO: Print output instead of passing a writable DCB to the command
|
||||
if (!modulecmd_call_command(cmd, arg, NULL))
|
||||
{
|
||||
dcb_printf(dcb, "Error: %s\n", modulecmd_get_error());
|
||||
}
|
||||
|
Reference in New Issue
Block a user