108 Commits

Author SHA1 Message Date
Markus Mäkelä
e73301ad71
Update NPM packages
Updated packages for MaxCtrl and the REST API tests.
2018-09-26 11:08:24 +03:00
Markus Mäkelä
40c4614ed1
Update mocha
Updated mocha to latest version for maxctrl and REST API test suites.
2018-09-19 20:32:39 +03:00
Markus Mäkelä
643480240c
Simplify MaxCtrl version extraction
Instead of using the correct version in in-source builds, a dummy file is
copied in place. This removes the need to explicitly include the
VERSION.cmake file.
2018-09-12 22:09:37 +03:00
Markus Mäkelä
31f6d49ddb
Add symbolic VERSION file
The VERSION.cmake file defines which VERSION.cmake file is included. By
changing the file that it points to, the version can be changed without it
affecting other parts of the code that use it.
2018-09-10 15:11:18 +03:00
Markus Mäkelä
d68f20b75b
Also copy version files for MaxCtrl builds
When MaxCtrl is being built, the source is copied into the build directory
to prevent polluting the source tree with node_modules. This means that
any relative references MaxCtrl builds make outside of the maxctrl
directory must be copied to the build directory.
2018-07-24 09:51:46 +03:00
Markus Mäkelä
8d9ccce2dd
Fix in-source build of MaxCtrl
The npm install command must generate the version.js file in order for the
in-source builds to work.
2018-07-17 13:05:52 +03:00
Markus Mäkelä
f5110209f7
MXS-1942: Use MaxScale version in MaxCtrl
Displaying the MaxScale version helps identify which package the
executable was bundled with. As the MaxCtrl source is a part of MaxScale,
there's no need for separate versioning.
2018-07-05 12:47:28 +03:00
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ä
6df0804e70
Add missing tls-passphrase documentation
The tls-passphrase was not documented in MaxCtrl. Also regenerated the
documentation.
2018-06-18 11:32:28 +03:00
Markus Mäkelä
283a6d564e
Update MaxCtrl dependencies
Updated various npm dependencies of MaxCtrl. Also updated the testing
docker-compose image to use 10.2.
2018-06-11 09:17:02 +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ä
8b5221e13a
Fix error message when no command is given
The error message when no commad was given referred to the unknown command
[""]. Due to the way the command was printed, it was quite confusing.
2018-05-03 10:48:32 +03:00
Markus Mäkelä
e10b62e246
Add package-lock.json to maxctrl
The npm package-lock.json file locks down the dependencies to certain
versions.
2018-05-03 09:50:46 +03:00
Markus Mäkelä
bc21a28741
Add sum helper to api command
Calculating sums for values is useful for monitoring and scripting
purposes.
2018-05-03 09:50:45 +03:00
Markus Mäkelä
1e700ab9ba
MXS-1832: Return 1 on failure
If MaxScale responds with an error, MaxCtrl now returns 1.
2018-04-30 09:46:26 +03:00
Markus Mäkelä
957f9865d6
Update MaxCtrl documentation
Updated MaxCtrl documentation.
2018-04-17 09:34:12 +03:00
Markus Mäkelä
5855b307bd
Add raw REST API calls to MaxCtrl
Being able to perform raw REST API calls that leverage the value
extraction capabilities of Node.js gives more control to the end user. It
also doubles as a handy tool for creating scripts that only require one
particular value from the REST API.
2018-04-17 09:34:11 +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ä
b8df0dfc02
Print actual command on bad command
When a bad command is given, print the actual command.
2018-03-06 13:35:14 +02:00
Markus Mäkelä
a608b95414
MXS-1656: Add simple test case
Test that `list servers` works with both monitored and unmonitored
servers. The test doesn't check that the GTID is present as the test setup
uses file and position based replication.
2018-02-20 09:59:05 +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ä
5806a27f9a
MXS-1656: Request each monitor only once
When the servers were iterated, each related monitor was requested. This
caused as many requests for monitors as there are servers.

By creating a set of unique monitor names and requesting them once, we
avoid the redundant requests from the monitor.
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ä
ee3612da42
MXS-1656: Add GTID field to list servers
Added the `GTID` field to make it easier to track GTID values of the
servers. This is done by requesting the related monitors for each server
and injecting an extra parameter into the server resource.
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ä
823fe902d4
Add passive to help alter maxscale output
The command was missing from the help output.
2018-02-08 12:35:04 +02:00
Markus Mäkelä
ab0ea417ae Fix typo in maxctrl/CMakeLists.txt
The correct command is `message`.
2018-01-30 07:56:48 +02:00
Markus Mäkelä
9b5d4d129e MXS-1630: Combine MaxCtrl into the main package
Added MaxCtrl to the core package. Removed the old packages from build
scripts.
2018-01-29 11:23:00 +02:00
Markus Mäkelä
ccebf38bc0 Update test configuration files
Updated the REST API and MaxCtrl configuration files with new object
names. Updated tests with new object names.
2018-01-22 15:29:21 +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ä
396b81f336 Fix in-source builds
The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
2017-11-22 18:40:18 +02:00
Markus Mäkelä
a96c8e1326 Install explicit version of pkg
The installed version of `pkg` was not locked a specific release.
2017-11-07 12:03:09 +02:00
Markus Mäkelä
3a78b716b8 Merge branch '2.2' into 2.2-mrm 2017-10-30 11:06:34 +02:00
Markus Mäkelä
938484a73e Allow remote server to be used for maxctrl test suite
The test suite now works with remote servers and is now fully integrated
to the regression test suite.
2017-10-12 13:16:12 +03:00
Markus Mäkelä
47b1004134 Add proper cluster testing scripts
The scripts start MaxScale processes on two different servers. The support
framework for the tests is in place but the tests themselves still need to
be modified to allow the use of non-localhost addresses.
2017-10-12 13:16:12 +03:00
Markus Mäkelä
36dfcd4319 Add MaxCtrl test for start/stop maxscale
Added the missing test case for starting and stopping MaxScale.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
0614b2ac00 Update MaxCtrl documentation
Fixed the usage help for each command.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
13265876a9 Add MaxCtrl test for start/stop maxscale
Added the missing test case for starting and stopping MaxScale.
2017-10-09 13:12:30 +03:00
Markus Mäkelä
80892c1657 Update MaxCtrl documentation
Fixed the usage help for each command.
2017-10-09 13:12:30 +03:00
Johan Wikman
89d1f81e37 Merge branch '2.2' into 2.2-mrm 2017-09-28 15:19:20 +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ä
ef2ee38ccf MXS-1446: Store more detailed event information
The timestamp of the last change from passive to active is now
tracked. This, with the timestamps of the last master_down and master_up
events, allows detection of cases when MaxScale was failed over but the
failover was not done.

Currently, only a warning is logged if no new master has appeared within
90 seconds of a master_down event and MaxScale was set to active from
passive.

The last event and when the event was triggered is now shown for all
servers. The latest change from passive to active is also shown.
2017-09-27 19:32:58 +03:00
Markus Mäkelä
118da6c645 Add missing configuration documentation
The admin_log_auth_failures parameter was not documented.
2017-09-26 14:16:45 +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ä
d2b474e021 Fix enabled admin users being shown as basic users
The enabled admins for the Linux users were shown as basic users. This was
caused by the separation of the two admin types.

Added tests that check that enabled Linux accounts show the correct type
in the output.
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ä
d480fe97f6 MXS-1390: Update MaxCtrl documentation
Updated documentation generation script and regenerated documentation. Now
all command documentation is generated by using the output of the `help`
commands.
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