21 Commits

Author SHA1 Message Date
Markus Mäkelä
befb25a14a
MXS-1929: Add parameters to maxctrl create monitor
The parameters for the monitor can now be defined when the monitor is
created. This makes the filter, monitor and service creation consistent.
2018-08-23 15:46:46 +03:00
Markus Mäkelä
50c20e79ee
MXS-1929: Reject promise on invalid input
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.
2018-08-09 12:56:52 +03:00
Markus Mäkelä
25bc385db2
MXS-1929: Check presence of filter parameters
The parameters were made optional as not all filters require parameters.
2018-08-09 12:54:10 +03:00
Markus Mäkelä
8cb3a85afd
MXS-1929: Fix MaxCtrl errors
The filter parameters were a mandatory argument even for filters that
don't need parameters. Also fixed the usage information.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
3f338c8672
MXS-1929: Add create/destroy filter commands
Added the creation and destruction commands for filters to MaxCtrl.
2018-07-31 09:41:10 +03:00
Markus Mäkelä
fb3101f7c4
MXS-1929: Improve JSON type error messages
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.
2018-07-31 09:41:10 +03:00
Markus Mäkelä
146fe76c7a
MXS-1929: Add create/destroy service MaxCtrl commands
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.
2018-07-31 09:41:07 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
f102a563e9 Add explicit usage to each command
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.
2017-09-28 12:40:51 +03:00
Markus Mäkelä
b5202a99f4 Move create TLS parameters to common section
The TLS parameters are now shared by both servers and listeners.
2017-09-11 12:49:11 +03:00
Markus Mäkelä
c34bc24a8b MXS-1390: Fix create user documentation
The documentation stated that the users are created with administrative
privileges by default when in fact they were created with read-only
privileges.
2017-09-07 10:02:14 +03:00
Markus Mäkelä
c8490df566 MXS-1390: Add detailed MaxCtrl documentation
Added a more detailed description for commands that needed it.
2017-09-07 10:02:14 +03:00
Markus Mäkelä
0d8e51c8f1 Move create monitor options under the correct header
The options were under the generic options header instead of the monitor
creation one.
2017-09-07 10:02:14 +03:00
Markus Mäkelä
6ee7ed6a38 MXS-1354: Add creation of basic/admin users to maxctrl
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.
2017-08-18 10:28:21 +03:00
Markus Mäkelä
5edfe3040e MXS-1300: Return a rejected promise for unknown commands
When an unknow command is executed, the core should return a rejected
promise.
2017-07-23 08:21:00 +03:00
Markus Mäkelä
cf8028a5ce MXS-1300: Un-modularize the core
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.
2017-07-23 08:21:00 +03:00
Markus Mäkelä
9e688772cc MXS-1300: Make the MaxCtrl core a Node.js module
The core is now a module that is loaded by the command line client. This
allows the core library to be reused for testing.
2017-07-18 11:37:18 +03:00
Markus Mäkelä
3255d58e70 MXS-1300: Take the refactored core into use
The refactored maxctrl function is now in use.
2017-07-18 11:37:18 +03:00
Markus Mäkelä
d938dcc701 MXS-1300: Make output optional
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.
2017-07-18 11:37:18 +03:00
Markus Mäkelä
816e317485 MXS-1300: Make MaxCtrl more like a library
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.
2017-07-18 11:37:18 +03:00
Markus Mäkelä
d59d3ab638 MXS-1300: Combine REST API and MaxCtrl tests
The REST API tests are now located under the maxctrl directory. This
allows both tests to use the same framework for testing.
2017-07-18 11:37:18 +03:00