118 Commits

Author SHA1 Message Date
Markus Mäkelä
f1905d33b1
Fix MaxCtrl list servers test
The test did not expect GTIDs to be displayed.
2018-07-09 12:10:36 +03:00
Markus Mäkelä
bfd3d2975d
Merge branch '2.2' into develop 2018-07-06 14:56:19 +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ä
44ef4912e8
Merge branch '2.2' into develop 2018-07-03 21:13:41 +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
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
6278f27ab6
Merge branch '2.2' into develop 2018-06-20 10:26:29 +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ä
96ed651466
Merge branch '2.2' into develop 2018-06-11 11:28:36 +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ä
6d1c0e5ba6
MXS-1417: Add drain server command to MaxCtrl
The `drain server` commands removes a server from all services and waits
until all the connections for it are closed. Once the server is no longer
in use, it will be set into maintenance mode and put back into the
services where it was removed from.
2018-05-22 17:46:26 +03:00
Markus Mäkelä
a60f55e375
MXS-553: Display connections and their IDs in MaxCtrl
The `show sessions` output now displays the servers each session is
connected to along with their connections IDs. The output format of the
data is not the most compact representation but it should make it
relatively easy to parse.
2018-05-22 17:46:25 +03:00
Markus Mäkelä
b6eff12334
Merge branch '2.2' into develop 2018-05-07 09:57:47 +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ä
4a0df97e02
Merge branch '2.2' into develop 2018-05-04 10:18:48 +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ä
658329b648
Merge branch '2.2' into develop 2018-05-03 10:00:44 +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ä
490d8c0963
Merge branch '2.2' into develop 2018-04-30 12:38:19 +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ä
fff727e0c2
MXS-1782: Take getCollectionAsResource into use
Each `show` type command that takes a resource name now also has a version
that prints all resources of that type.

Added test cases for newly added commands.
2018-04-17 09:43:57 +03:00
Markus Mäkelä
87ce1f6dab
MXS-1782: Separate resource fetching and processing
The requesting of a resource and the processing was integrated into one
function. Moving the processing part into a separate function allows easy
processing of resource collections.

This refactoring made the creation of the getCollectionAsResource function
possible. It enables `show` type commands for resouce collections
(servers, services etc.).
2018-04-17 09:43:57 +03:00
Markus Mäkelä
32fdc3d454
MXS-1782: Add listener state to REST API
The state of each individual listener is now displayed in the REST
API. Created common functions for printing the listener state and took
them into use. Added the new state into MaxCtrl output.
2018-04-17 09:43:57 +03:00
Markus Mäkelä
f8a91fb272
MXS-1782: Add show threads to MaxCtrl
Provides same output in MaxCtrl that is in MaxAdmin.
2018-04-17 09:43:56 +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