Commit Graph

126 Commits

Author SHA1 Message Date
5de91e737d MXS-1929: Extend create/destroy MaxCtrl tests
Added creation and destruction tests for services and filters. They don't
cover the assignment of filters to services as that is not yet
implemented.
2018-07-31 09:41:10 +03:00
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
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
9e9f0b5959 MXS-1929: Fix typo in maxctrl help output
Also split the sentence to make it clearer to read.
2018-07-31 09:41:09 +03:00
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
6c59da77fb Merge branch '2.2' into develop 2018-07-26 11:27:09 +03:00
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
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
f1905d33b1 Fix MaxCtrl list servers test
The test did not expect GTIDs to be displayed.
2018-07-09 12:10:36 +03:00
bfd3d2975d Merge branch '2.2' into develop 2018-07-06 14:56:19 +03:00
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
44ef4912e8 Merge branch '2.2' into develop 2018-07-03 21:13:41 +03:00
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
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
6278f27ab6 Merge branch '2.2' into develop 2018-06-20 10:26:29 +03:00
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
96ed651466 Merge branch '2.2' into develop 2018-06-11 11:28:36 +03:00
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
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
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
b6eff12334 Merge branch '2.2' into develop 2018-05-07 09:57:47 +03:00
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
4a0df97e02 Merge branch '2.2' into develop 2018-05-04 10:18:48 +03:00
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
658329b648 Merge branch '2.2' into develop 2018-05-03 10:00:44 +03:00
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
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
490d8c0963 Merge branch '2.2' into develop 2018-04-30 12:38:19 +03:00
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
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
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
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
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
957f9865d6 Update MaxCtrl documentation
Updated MaxCtrl documentation.
2018-04-17 09:34:12 +03:00
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
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
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
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
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
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
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
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
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
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
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
823fe902d4 Add passive to help alter maxscale output
The command was missing from the help output.
2018-02-08 12:35:04 +02:00
ab0ea417ae Fix typo in maxctrl/CMakeLists.txt
The correct command is `message`.
2018-01-30 07:56:48 +02:00
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
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
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