If a value that is not of key-value format was given to the create
commands, the code previously threw an exception. This causes tests to
misbehave so changing it to a rejected promise is more appropriate.
If an invalid value or type is given to the REST API, having the expected
type as well as the given type make problem resolution easier.
Also added a value check into MaxCtrl for listener ports.
Added commands for creating and destroying services. The create command
allows server and filter relationships to be defined but they are not yet
processed by MaxScale. This will be done once the use of filters is made
dynamic.
The yargs framework combined with the pkg packaging causes the executable
name to be mangled on installation. For this reason, the usage should be
explicitly added to each command.
The documentation stated that the users are created with administrative
privileges by default when in fact they were created with read-only
privileges.
The type of the created user can now be specified with the --type option.
Expanded tests that cover the user creation. Also added a test case that
checks that basic users are only allowed to read through the REST API.
Making the core a module proved to bring more problems than it solved. For
the sake of simplicity in installation and code coverage reporting, the
core is now completely contained in the `lib/` directory.
Also added preliminary coverage reporting with nyc.
Minor refactoring to the core library to allow multiple calls from within
the same program.
Added --quiet option to silence output so that tests aren't so
verbose. Currently this only works on UNIX based systems.
All invocations into the common helper functions are now done through the
`maxctrl` function. This allows the program arguments to be passed to the
core as a parameter instead of reading them from global variables.
This helps with the implicit initialization that was done when the yargs
library was required which caused duplicated output.
Refactored the core functions so that they only process the argument
vector. The parsing of the argument vector is done in maxctrl.js where it
is more appropriate.