18 Commits

Author SHA1 Message Date
Markus Mäkelä
d96a8b1773
Remove call to pingCluster with only one server
If only one server is used, the amount of requests can be reduced from a
minimum of two to a minimum of one. In most cases this cuts down the
response time in half.
2018-07-03 01:58:43 +03:00
Markus Mäkelä
43cfa5eab5
Fix TSV output in MaxCtrl
The output in --tsv mode could break the TSV format if newlines or tabs
were included in the data.
2018-05-07 09:57:08 +03:00
Markus Mäkelä
2df47d8999
Read MaxCtrl password from stdin when none provided
When the -p parameter is given without an argument, the password is read
from the command line. This allows passwords to be given to MaxCtrl in a
safer manner.
2018-03-06 13:35:14 +02:00
Markus Mäkelä
d133ebf32d
Remove ANSI color codes when --tsv is defined
When TSV output is requested, the output should not contain the ANSI color
codes. This appears to be a "feature" of the table generation library but
it is quite simple to work around.
2018-02-20 09:59:05 +02:00
Markus Mäkelä
f4af4fa038
MXS-1656: Rename misleading functions
The function getResource had two different implementations that did very
different things. The newer version, that returns the raw JSON object that
represents a resource, was renamed to getJson.
2018-02-20 09:59:05 +02:00
Markus Mäkelä
558ea4babe
MXS-1656: Split resource collection functions into smaller parts
Split the getCollection function into smaller, reusable parts. This is
needed to display the GTID information in `list servers`.
2018-02-20 09:59:03 +02:00
Markus Mäkelä
5716f0b210
Add support for self-signed certificates to MaxCtrl
MaxCtrl now supports explicit paths for certificates and optional server
certificate verification. This allows testing by using a self-signed
certificate with the server certificate verification turned off.
2018-02-13 14:54:32 +02:00
Markus Mäkelä
8e4c6a9eee
Use HTTPS also for pings
If HTTPS requests are used, the pings should also be done with HTTPS.
2018-02-13 12:55:34 +02:00
Markus Mäkelä
c6f7f22117 Use comma separated lists in MaxCtrl options
Using commas instead of spaces prevents a the misinterpretation of
commands as hostnames. If the `--hosts` option was given just before a
command, it would consume the commands as arguments to the `--hosts` list.
2018-01-10 13:00:31 +02:00
Markus Mäkelä
cbe58b5355 MXS-620: Add start/stop maxscale to MaxCtrl
The commands allow all services in MaxScale to be either stopped or
started.
2017-08-22 21:15:12 +03:00
Markus Mäkelä
f422e92496 MXS-1300: Return output instead of printing it
The `execute` command now returns the output of the command instead of
printint it. This allows the tests to actually test the output of the
commands instead manually verifying that it is correct. It also allows the
library part to be used as an actual library that only returns data.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
db531fb2e2 MXS-1300: Improve MaxCtrl HTTP error messages
The messages now show where the request failed and what was
requested. This should help resolve both develper and end-user problems.

Also fixed the missing logging of the output string in the `parse`
callback of the main function and cleaned up the POSTed server body.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
e133e758a6 MXS-1300: Fix deletion of monitors
The monitors should only be reused if they have the same name and they use
the same module. This way the only difference is in configuration.

Fixed MaxCtrl detection of bad options and altered monitor creation test
to expect correct results. Also improved some of the error messages.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
3bd13cded6 MXS-1300: Fix minor MaxCtrl bugs
Fixed unresolved promises, wrong resources being requested and enabled
strict mode so unknown arguments are not ignored.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
ba5a321ec3 MXS-1300: Improve overall error handling
All errors are now returned as rejected Promises. This will make the error
reporting more consistent with the tested output as well as the actual
output.

Added more tests for error cases and fixed minor argument processing bugs.
2017-07-23 08:21:00 +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ä
53789f3b4b MXS-1300: Fix logging and maxscale alteration
The alterations to logging and maxscale were sending malformed JSON to
MaxScale. Boolean values weren't converted to JSON booleans but were sent
as strings.
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