Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Admin users represent administrative users that are able to query and change MaxScale's configuration.
Get a single network user. The :name in the URI must be a valid network user name.
Response
Status: 200 OK
Get all network users.
Response
Status: 200 OK
Note: This endpoint has been deprecated and does nothing.
Note: This endpoint has been deprecated and does nothing.
Get all administrative users.
Response
Status: 200 OK
Create a new network user. The request body must define at least the following fields.
data.id
The username
data.type
Type of the object, must be inet
Only admin accounts can perform POST, PUT, DELETE and PATCH requests. If a basic
account performs one of the aforementioned request, the REST API will respond
with a 401 Unauthorized error.
Here is an example request body defining the network user my-user with the password my-password that is allowed to execute only read-only operations.
Response
This enables an existing UNIX account on the system for administrative operations. The request body must define at least the following fields.
data.id
The username
data.type
Type of the object, must be unix
Here is an example request body enabling the UNIX account jdoe for read-only operations.
Response
The :name part of the URI must be a valid user name.
Response
The :name part of the URI must be a valid user name.
Response
Update network user. Currently, only the password can be updated. This
means that the request body must define the data.attributes.password
field.
Here is an example request body that updates the password.
Response
CC BY-SA / Gnu FDL
data.attributes.password
The password for this user
data.attributes.account
Set to admin for administrative users and basic to read-only users
data.attributes.account
Set to admin for administrative users and basic to read-only users
GET /v1/users/inet/:name{
"data": {
"attributes": {
"account": "admin",
"created": "Thu, 20 Jul 2023 15:29:02 GMT",
"last_login": "Thu, 20 Jul 2023 15:29:12 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
},
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
}
}GET /v1/users/inet{
"data": [
{
"attributes": {
"account": "admin",
"created": "Thu, 20 Jul 2023 15:29:02 GMT",
"last_login": "Thu, 20 Jul 2023 15:29:12 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}GET /v1/users/unix/:nameGET /v1/users/unixGET /v1/users{
"data": [
{
"attributes": {
"account": "admin",
"created": "Thu, 20 Jul 2023 15:29:02 GMT",
"last_login": "Thu, 20 Jul 2023 15:29:12 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}POST /v1/users/inet{
"data": {
"id": "my-user", // The user to create
"type": "inet", // The type of the user
"attributes": {
"password": "my-password", // The password to use for the user
"account": "basic" // The type of the account
}
}
}Status: 204 No ContentPOST /v1/users/unix{
"data": {
"id": "jdoe", // Account name
"type": "unix" // Account type
"attributes": {
"account": "basic" // Type of the user account in MaxScale
}
}
}Status: 204 No ContentDELETE /v1/users/inet/:nameStatus: 204 No ContentDELETE /v1/users/unix/:nameStatus: 204 No ContentPATCH /v1/users/inet/:name{
"data": {
"attributes": {
"password": "new-password"
}
}
}Status: 204 No ContentA filter resource represents an instance of a filter inside MaxScale. Multiple services can use the same filter and a single service can use multiple filters.
The :name in all of the URIs must be the name of a filter in MaxScale.
Get a single filter.
Response
Status: 200 OK
Get all filters.
Response
Status: 200 OK
Create a new filter. The posted object must define at least the following fields.
data.id
Name of the filter
data.type
Type of the object, must be filters
All of the filter parameters should be defined at creation time in thedata.atttributes.parameters object.
As the service to filter relationship is ordered (filters are applied in the order they are listed), filter to service relationships cannot be defined at creation time.
The following example defines a request body which creates a new filter.
Response
Filter is created:
Status: 204 No Content
Filter parameters can be updated at runtime if the module supports it. Refer to the individual module documentation for more details on whether it supports runtime configuration and which parameters can be updated.
The following example modifies a filter by changing the match parameter to.*users.*.
Response
Filter is modified:
Status: 204 No Content
The :filter in the URI must map to the name of the filter to be destroyed.
A filter can only be destroyed if no service uses it. This means that thedata.relationships object for the filter must be empty. Note that the service
→ filter relationship cannot be modified from the filters resource and must be
done via the services resource.
This endpoint also supports the force=yes parameter that will unconditionally
delete the filter by first removing it from all services that it uses.
Response
Filter is destroyed:
Status: 204 No Content
CC BY-SA / Gnu FDL
data.atttributes.module
The filter module to use
GET /v1/filters/:name{
"data": {
"attributes": {
"filter_diagnostics": null,
"module": "qlafilter",
"parameters": {
"append": false,
"duration_unit": "ms",
"exclude": null,
"filebase": "/tmp/qla.log",
"flush": true,
"log_data": "date,user,query",
"log_type": "unified",
"match": null,
"module": "qlafilter",
"newline_replacement": " ",
"options": "",
"separator": ",",
"source": null,
"use_canonical_form": false,
"user": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "QLA",
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/QLA/relationships/services/"
}
}
},
"type": "filters"
},
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
}
}GET /v1/filters{
"data": [
{
"attributes": {
"filter_diagnostics": null,
"module": "qlafilter",
"parameters": {
"append": false,
"duration_unit": "ms",
"exclude": null,
"filebase": "/tmp/qla.log",
"flush": true,
"log_data": "date,user,query",
"log_type": "unified",
"match": null,
"module": "qlafilter",
"newline_replacement": " ",
"options": "",
"separator": ",",
"source": null,
"use_canonical_form": false,
"user": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "QLA",
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/QLA/relationships/services/"
}
}
},
"type": "filters"
},
{
"attributes": {
"module": "hintfilter",
"parameters": {
"module": "hintfilter"
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "Hint",
"links": {
"self": "http://localhost:8989/v1/filters/Hint/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/Hint/relationships/services/"
}
}
},
"type": "filters"
}
],
"links": {
"self": "http://localhost:8989/v1/filters/"
}
}POST /v1/filters{
"data": {
"id": "test-filter", // Name of the filter
"type": "filters",
"attributes": {
"module": "qlafilter", // The filter uses the qlafilter module
"parameters": { // Filter parameters
"filebase": "/tmp/qla.log"
}
}
}
}PATCH /v1/filters/:name{
"data": {
"attributes": {
"parameters": {
"match": ".*users.*"
}
}
}
}DELETE /v1/filters/:filterA session is an abstraction of a client connection, any number of related backend connections, a router module session and possibly filter module sessions. Each session is created on a service and each service can have multiple sessions.
Get a single session. :id must be a valid session ID. The session ID is the same that is exposed to the client as the connection ID.
This endpoint also supports the rdns=true parameter, which instructs MaxScale to
perform reverse DNS on the client IP address. As this requires communicating with
an external server, the operation may be expensive.
Response
Status: 200 OK
Get all sessions.
Response
Status: 200 OK
The request body must be a JSON object which represents the new configuration of
the session. The :id must be a valid session ID that is active.
The log_debug, log_info, log_notice, log_warning and log_error boolean
parameters control whether the associated logging level is enabled:
The filters that a session uses can be updated by re-defining the filter relationship of the session. This causes new filter sessions to be opened immediately. The old filter session are closed and replaced with the new filter session the next time the session is idle. The order in which the filters are defined in the request body is the order in which the filters are installed, similar to how the filter relationship for services behaves.
Response
Session is modified:
Status: 204 No Content
This endpoint causes the session to re-read the configuration from the service. As a result of this, all backend connections will be closed and then opened again. All router and filter sessions will be created again which means that for modules that perform something whenever a new module session is opened, this behaves as if a new session was started.
This endpoint can be used to apply configuration changes that were done after the session was started. This can be useful for situations where the client connections live for a long time and connections are not recycled often enough.
Response
Session is was restarted:
Status: 204 No Content
This endpoint does the same thing as the /v1/sessions/:id/restart endpoint
except that it applies to all sessions.
Response
Session is was restarted:
Status: 204 No Content
This endpoint causes the session to be forcefully closed.
Request Parameters
This endpoint supports the following request parameters.
ttl
The time after which the session is killed. If this parameter is not given, the session is killed immediately. This can be used to give the session time to finish the work it is performing before the connection is closed.
Response
Session was killed:
Status: 204 No Content
CC BY-SA / Gnu FDL
GET /v1/sessions/:id{
"data": {
"attributes": {
"client": {
"cipher": ""
},
"connected": "Thu Jul 20 15:29:12 2023",
"connections": [
{
"cipher": "",
"connection_id": 169,
"server": "server1"
},
{
"cipher": "",
"connection_id": 90,
"server": "server2"
}
],
"idle": 0.10000000000000001,
"log": [],
"memory": {
"connection_buffers": 67982,
"exec_metadata": 0,
"last_queries": 0,
"sescmd_history": 369,
"total": 68351,
"variables": 0
},
"parameters": {
"log_error": false,
"log_info": false,
"log_notice": false,
"log_warning": false
},
"port": 45558,
"queries": [],
"remote": "::ffff:127.0.0.1",
"state": "Session started",
"user": "maxuser"
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/sessions/1/relationships/services/"
}
}
},
"type": "sessions"
},
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
}
}GET /v1/sessions{
"data": [
{
"attributes": {
"client": {
"cipher": ""
},
"connected": "Thu Jul 20 15:29:12 2023",
"connections": [
{
"cipher": "",
"connection_id": 169,
"server": "server1"
},
{
"cipher": "",
"connection_id": 90,
"server": "server2"
}
],
"idle": 0.10000000000000001,
"log": [],
"memory": {
"connection_buffers": 67982,
"exec_metadata": 0,
"last_queries": 0,
"sescmd_history": 369,
"total": 68351,
"variables": 0
},
"parameters": {
"log_error": false,
"log_info": false,
"log_notice": false,
"log_warning": false
},
"port": 45558,
"queries": [],
"remote": "::ffff:127.0.0.1",
"state": "Session started",
"user": "maxuser"
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/sessions/1/relationships/services/"
}
}
},
"type": "sessions"
}
],
"links": {
"self": "http://localhost:8989/v1/sessions/"
}
}PATCH /v1/sessions/:id{
"data": {
"attributes": {
"parameters": {
"log_info": true
}
}
}
}{
"data": {
"attributes": {
"relationships": {
"filters": {
"data": [
{ "id": "my-cache-filter" },
{ "id": "my-log-filter" }
]
}
}
}
}
}POST /v1/sessions/:id/restartPOST /v1/sessions/restartDELETE /v1/sessions/:idThe SQL resource represents a database connection.
The following endpoints provide a simple REST API interface for executing SQL queries on servers and services in MaxScale.
This document uses the :id value in the URL to represent a connection ID and
the :query_id to represent a query ID. These values do not need to be manually
added as the relevant links are returned in the request body of each endpoint.
The endpoints use JSON Web Tokens to uniquely identify open SQL connections. A
connection token can be acquired with a POST /v1/sql request and can be used
with the POST /v1/sql/:id/query, GET /v1/sql/:id/results/:query_id andDELETE /v1/sql endpoints. All of these endpoints accept a connection token in
the token parameter of the request:
In addition to request parameters, the token can be stored in cookies in which
case they are automatically used by the REST API. For more information about
token storage in cookies, see the documentation for POST /v1/sql.
All of the endpoints that operate on a single connection support the following
request parameters. The GET /v1/sql and GET /v1/sql/:id endpoints are an
exception as they ignore the current connection token.
token
The connection token to use for the request. If provided, the value is unconditionally used even if a cookie with a valid token exists.
Response
Response contains the requested resource.
Status: 200 OK
Response
Response contains a resource collection with all the open SQL connections.
Status: 200 OK
The request body must be a JSON object consisting of the following fields:
target
The object in MaxScale to connect to. This is a mandatory value and the given value must be the name of a valid server, service or listener in MaxScale.
user
The username to use when creating the connection. This is a mandatory value.
Here is an example request body:
The response will contain the new connection with the token stored atmeta.token. If the request uses the persist=yes request parameter, the token
is stored in cookies instead of the metadata object and the response body will
not contain the token.
The location of the newly created connection will be stored at links.self in
the response body as well as in the Location header.
The token must be given to all subsequent requests that use the connection. It
must be either given in the token parameter of a request or it must be stored
in the cookies. If both a token parameter and a cookie exist at the same time,
the token parameter will be used instead of the cookie.
Request Parameters
This endpoint supports the following request parameters.
persist
Store the connection token in cookies instead of returning it as the response body.
This parameter expects only one value, yes, as its argument. Whenpersist=yes is set, the token is stored in the conn_id_sig_<id> cookie
where the <id> part is replaced by the ID of the connection.
Response
Connection was opened:
Status: 201 Created
Missing or invalid payload:
Status: 400 Bad Request
Response
Connection was closed:
Status: 204 No Content
Missing or invalid connection token:
Status: 400 Bad Request
Reconnects an existing connection. This can also be used if the connection to the backend server was lost due to a network error.
The connection will use the same credentials that were passed to the POST /v1/sql endpoint. The new connection will still have the same ID in the REST
API but will be treated as a new connection by the database. A reconnection
re-initializes the connection and resets the session state. Reconnections cannot
take place while a transaction is open.
Response
Reconnection was successful:
Status: 204 No Content
Reconnection failed or connection is already in use:
Status: 503 Service Unavailable
Missing or invalid connection token:
Status: 400 Bad Request
Clones an existing connection. This is done by opening a new connection using the credentials and configuration from the given connection.
Request Parameters
This endpoint supports the same request parameters as the POST /v1/sql
endpoint.
Response
The response is identical to the one in the POST /v1/sql endpoint. In
addition, this endpoint can return the following responses.
Connection is already in use:
Status: 503 Service Unavailable
Missing or invalid connection token:
Status: 400 Bad Request
The request body must be a JSON object with the value of the sql field set to
the SQL to be executed:
The request body must be a JSON object consisting of the following fields:
sql
The SQL to be executed. If the SQL contain multiple statements, multiple results are returned in the response body.
max_rows
The maximum number of rows returned in the response. By default this is 1000 rows. Setting the value to 0 means no limit. Any extra rows in the result will be discarded.
By default, the complete result is returned in the response body. If the SQL
query returns more than one result, the results array will contain all the
results.
The results array can have three types of objects: resultsets, errors, and OK
responses.
A resultset consists of the data field with the result data stored as a two
dimensional array. The names of the fields are stored in an array in thefields field. These types of results will be returned for any operation that
returns rows (i.e. SELECT statements)
An error consists of an object with the errno field set to the MariaDB error
code, the message field set to the human-readable error message and thesqlstate field set to the current SQLSTATE of the connection.
An OK response is returned for any result that completes successfully but not
return rows (e.g. an INSERT or UPDATE statement). The affected_rows
field contains the number of rows affected by the operation, thelast_insert_id contains the auto-generated ID and the warnings field
contains the number of warnings raised by the operation.
It is also possible for the fields of the error response to be present in the resultset response if the result ended with an error but still generated some data. Usually this happens when query execution is interrupted but a partial result was generated by the server.
Response
Query successfully executed:
Status: 201 Created
Invalid payload or missing connection token:
Status: 400 Bad Request
Fatal connection error:
Status: 503 Service Unavailable
If the API returns this response, the connection to the database server was
lost. The only valid action to take at this point is to close it with theDELETE /v1/sql/:id endpoint.
CC BY-SA / Gnu FDL
password
The password for the user. This is a mandatory value.
db
The default database for the connection. By default the connection will have no default database.
timeout
Connection timeout in seconds. The default connection timeout is 10 seconds. This controls how long the SQL connection creation can take before an error is returned.
max-ageSets the connection token maximum age in seconds. The default ismax-age=28800. Only positive values are accepted and if a non-positive or
a non-integer value is found, the parameter is ignored. Once the token age
exceeds the configured maximum value, the token can no longer be used and a
new connection must be created.
POST /v1/sql/query?token=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqwGET /v1/sql/:id{
"data": {
"id": "5",
"links": {
"related": "http://localhost:8989/v1/sql/5/queries/",
"self": "http://localhost:8989/v1/sql/5/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/5/"
},
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1IiwiZXhwIjoxNjIwMjM1Mzc3LCJpYXQiOjE2MjAyMDY1NzcsImlzcyI6Im14cy1xdWVyeSJ9.2CJ8DsEPbGlvs2DrBUC6FJA64VMSU8kbX1U4FSu2-OY"
}
}GET /v1/sql{
"data": [
{
"id": "10",
"links": {
"related": "http://localhost:8989/v1/sql/10/queries/",
"self": "http://localhost:8989/v1/sql/10/"
},
"type": "sql"
},
{
"id": "11",
"links": {
"related": "http://localhost:8989/v1/sql/11/queries/",
"self": "http://localhost:8989/v1/sql/11/"
},
"type": "sql"
}
],
"links": {
"self": "http://localhost:8989/v1/sql/"
}
}POST /v1/sql{
"user": "jdoe",
"password": "my-s3cret",
"target": "server1",
"db": "test",
"timeout": 15
}{
"data": {
"id": "5",
"attributes": {
"thread_id": 12,
"seconds_idle": 5
}
"links": {
// The "related" endpoint is the URL to the query endpoint for this connection.
"related": "http://localhost:8989/v1/sql/5/queries/",
"self": "http://localhost:8989/v1/sql/5/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/5/"
},
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1IiwiZXhwIjoxNjIwMjM1Mzc3LCJpYXQiOjE2MjAyMDY1NzcsImlzcyI6Im14cy1xdWVyeSJ9.2CJ8DsEPbGlvs2DrBUC6FJA64VMSU8kbX1U4FSu2-OY"
}
}DELETE /v1/sql/:idPOST /v1/sql/:id/reconnectPOST /v1/sql/:id/clonePOST /v1/sql/:id/queries{
"sql": "SELECT * FROM test.t1",
"max_rows": 1000
}{
"data": {
"attributes": {
"results": [
{
"data": [
[
1
],
[
2
],
[
3
]
],
"fields": [
"id"
]
}
],
"sql": "select * from t1"
},
"id": "9-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/9/queries/9-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"errno": 1064,
"message": "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table t1' at line 1",
"sqlstate": "42000"
}
],
"sql": "select syntax_error from table t1"
},
"id": "4-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/4/queries/4-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"affected_rows": 0,
"last_insert_id": 0,
"warnings": 0
}
],
"sql": "drop table t1"
},
"id": "6-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/6/queries/6-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"affected_rows": 0,
"last_insert_id": 0,
"warnings": 0
}
],
"sql": "drop table t1"
},
"id": "6-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/6/queries/6-1/"
}
}The :name in all of the URIs must be the name of a monitor in MaxScale.
Get a single monitor.
Response
Status: 200 OK
Get all monitors.
Response
Status: 200 OK
Create a new monitor. The request body must define at least the following fields.
data.id
Name of the monitor
data.type
Type of the object, must be monitors
data.attributes.module
The monitor module to use
data.attributes.parameters.user
The to use
data.attributes.parameters.password
The to use
All monitor parameters can be defined at creation time.
The following example defines a request body which creates a new monitor and assigns two servers to be monitored by it. It also defines a custom value for the monitor_interval parameter.
Response
Monitor is created:
Status: 204 No Content
The request body must be a valid JSON document representing the modified monitor.
The following standard server parameter can be modified.
In addition to these standard parameters, the monitor specific parameters can also be modified. Refer to the monitor module documentation for details on these parameters.
Response
Monitor is modified:
Status: 204 No Content
Invalid request body:
Status: 400 Bad Request
The request body must be a JSON object that defines only the data field. The value of the data field must be an array of relationship objects that define the id and type fields of the relationship. This object will replace the existing relationships of the monitor.
The following is an example request and request body that defines a single server relationship for a monitor.
All relationships for a monitor can be deleted by sending an empty array as the data field value. The following example removes all servers from a monitor.
Response
Monitor relationships modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
Destroy a created monitor. The monitor must not have relationships to any servers in order to be destroyed.
This endpoint also supports the force=yes parameter that will unconditionally delete the monitor by first unlinking it from all servers that it uses.
Response
Monitor is deleted:
Status: 204 No Content
Monitor could not be deleted:
Status: 400 Bad Request
Stops a started monitor.
Response
Monitor is stopped:
Status: 204 No Content
Starts a stopped monitor.
Response
Monitor is started:
Status: 204 No Content
CC BY-SA / Gnu FDL
GET /v1/monitors/:name{
"data": {
"attributes": {
"module": "mariadbmon",
"monitor_diagnostics": {
"master": "server1",
"master_gtid_domain_id": 0,
"primary": null,
"server_info": [
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server1",
"read_only": false,
"server_id": 3000,
"slave_connections": [],
"state_details": null
},
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server2",
"read_only": false,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"master_server_name": "server1",
"seconds_behind_master": 0,
"slave_io_running": "Yes",
"slave_sql_running": "Yes"
}
],
"state_details": null
}
],
"state": "Idle"
},
"parameters": {
"assume_unique_hostnames": true,
"auto_failover": false,
"auto_rejoin": false,
"backend_connect_attempts": 1,
"backend_connect_timeout": "3000ms",
"backend_read_timeout": "3000ms",
"backend_write_timeout": "3000ms",
"cooperative_monitoring_locks": "none",
"cs_admin_api_key": null,
"cs_admin_base_path": "/cmapi/0.4.0",
"cs_admin_port": 8640,
"demotion_sql_file": null,
"disk_space_check_interval": "0ms",
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"failcount": 5,
"failover_timeout": "90000ms",
"handle_events": true,
"journal_max_age": "28800000ms",
"maintenance_on_low_disk_space": true,
"mariadb-backup_parallel": 1,
"mariadb-backup_use_memory": "1G",
"master_conditions": "primary_monitor_master",
"master_failure_timeout": "10000ms",
"module": "mariadbmon",
"monitor_interval": "5000ms",
"password": "*****",
"promotion_sql_file": null,
"rebuild_port": 4444,
"replication_master_ssl": false,
"replication_password": "*****",
"replication_user": "maxuser",
"script": null,
"script_max_replication_lag": -1,
"script_timeout": "90000ms",
"servers_no_promotion": null,
"slave_conditions": "",
"ssh_check_host_key": true,
"ssh_keyfile": null,
"ssh_port": 22,
"ssh_timeout": "10000ms",
"ssh_user": null,
"switchover_on_low_disk_space": false,
"switchover_timeout": "90000ms",
"type": "monitor",
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 4
},
"id": "MariaDB-Monitor",
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
},
"relationships": {
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/servers/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/services/"
}
}
},
"type": "monitors"
},
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
}
}GET /v1/monitors{
"data": [
{
"attributes": {
"module": "mariadbmon",
"monitor_diagnostics": {
"master": "server1",
"master_gtid_domain_id": 0,
"primary": null,
"server_info": [
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server1",
"read_only": false,
"server_id": 3000,
"slave_connections": [],
"state_details": null
},
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server2",
"read_only": false,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"master_server_name": "server1",
"seconds_behind_master": 0,
"slave_io_running": "Yes",
"slave_sql_running": "Yes"
}
],
"state_details": null
}
],
"state": "Idle"
},
"parameters": {
"assume_unique_hostnames": true,
"auto_failover": false,
"auto_rejoin": false,
"backend_connect_attempts": 1,
"backend_connect_timeout": "3000ms",
"backend_read_timeout": "3000ms",
"backend_write_timeout": "3000ms",
"cooperative_monitoring_locks": "none",
"cs_admin_api_key": null,
"cs_admin_base_path": "/cmapi/0.4.0",
"cs_admin_port": 8640,
"demotion_sql_file": null,
"disk_space_check_interval": "0ms",
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"failcount": 5,
"failover_timeout": "90000ms",
"handle_events": true,
"journal_max_age": "28800000ms",
"maintenance_on_low_disk_space": true,
"mariadb-backup_parallel": 1,
"mariadb-backup_use_memory": "1G",
"master_conditions": "primary_monitor_master",
"master_failure_timeout": "10000ms",
"module": "mariadbmon",
"monitor_interval": "5000ms",
"password": "*****",
"promotion_sql_file": null,
"rebuild_port": 4444,
"replication_master_ssl": false,
"replication_password": "*****",
"replication_user": "maxuser",
"script": null,
"script_max_replication_lag": -1,
"script_timeout": "90000ms",
"servers_no_promotion": null,
"slave_conditions": "",
"ssh_check_host_key": true,
"ssh_keyfile": null,
"ssh_port": 22,
"ssh_timeout": "10000ms",
"ssh_user": null,
"switchover_on_low_disk_space": false,
"switchover_timeout": "90000ms",
"type": "monitor",
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 4
},
"id": "MariaDB-Monitor",
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
},
"relationships": {
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/servers/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/services/"
}
}
},
"type": "monitors"
}
],
"links": {
"self": "http://localhost:8989/v1/monitors/"
}
}POST /v1/monitors{
data: {
"id": "test-monitor", // Name of the monitor
"type": "monitors",
"attributes": {
"module": "mariadbmon", // The monitor uses the mariadbmon module
"parameters": { // Monitor parameters
"monitor_interval": 1000,
"user": "maxuser,
"password": "maxpwd"
}
},
"relationships": { // List of server relationships that this monitor uses
"servers": {
"data": [ // This monitor uses two servers
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
]
}
}
}
}PATCH /v1/monitors/:namePATCH /v1/monitors/:name/relationships/serversPATCH /v1/monitors/my-monitor/relationships/servers
{
data: [
{ "id": "my-server", "type": "servers" }
]
}PATCH /v1/monitors/my-monitor/relationships/servers
{
data: []
}DELETE /v1/monitors/:namePUT /v1/monitors/:name/stopPUT /v1/monitors/:name/startThis document describes the version 1 of the MaxScale REST API.
Although JSON does not define a syntax for comments, some of the JSON examples
have C-style inline comments in them. These comments use // to mark the start
of the comment and extend to the end of the current line.
Read the section of the configuration guide for more details on how to configure the REST API.
The MaxScale REST API uses
authentication with the MaxScale administrative interface users. The default
user is admin:mariadb.
It is highly recommended to enable HTTPS on the MaxScale REST API to make the communication between the client and MaxScale secure. Without it, the passwords can be intercepted from the network traffic. Refer to the for more details on how to enable HTTPS for the MaxScale REST API.
For more details on how administrative interface users are created and managed, refer to the documentation as well as the documentation of the resource.
MaxScale supports authentication via .
The /v1/auth endpoint can be used to generate new tokens which are returned in
the following form.
Note that by default the /auth endpoint requires the connection to be
encrypted (HTTPS) and attempts to use it without encryption will be treated as
an error. To allow use of the /auth endpoint without encryption, useadmin_secure_gui=false.
If the token is used to authenticate users in a web browser, the token can be
optionally stored in cookies. This can be enabled with the persist=yes
parameter in the request:
When the token is stored in the cookies, it will be stored in the token_sig
cookie using the SameSite=Strict and HttpOnly cookie options. This means the
JavaScript context of the browser will not have access to it. This is done to
prevent CSRF attacks.
By default, the generated tokens are valid for 8 hours. The token validity
period can be set with the max-age request parameter:
When max-age is combined with persist, the Max-Age cookie option is
also set to the same value.
To use the token for authentication, the generated token must be presented in the Authorization header with the Bearer authentication scheme. For example, the token above would be used in the following manner:
If MaxScale is restarted, all generated tokens are invalidated.
/auth Request Parameters
The /auth endpoint supports the following request parameters that must be
given in the HTTP query string.
max-age
Sets the token maximum age in seconds. The default is max-age=28800. Only
positive values between 1 and 2147483646 are accepted and if a non-positive
or a non-integer value is found, the parameter is ignored.
persist
The MaxScale REST API provides the following resources. All resources conform to the specification.
In addition to the named resources, the REST API will respond with a HTTP 200 OK
response to GET requests on the root resource (/) as well as the namespace
root resource (/v1/). These can be used for HTTP health checks to determine
whether MaxScale is running.
All of the current resources are in the /v1/ namespace of the MaxScale REST
API. Further additions to the namespace can be added that do not break backwards
compatibility of any existing resources. What this means in practice is that:
No resources or URLs will be removed
The API will be JSON API compliant
Note that this means that the contents of individual resources can change. New fields can be added, old ones can be removed and the meaning of existing fields can change. The aim is to be as backwards compatible as reasonably possible without sacrificing the clarity and functionality of the API.
Since MaxScale 2.4.0, the use of the version prefix /v1/ is optional: if the
prefix is not used, the latest API version is used.
All resources return complete JSON objects. The returned objects can have a_relationships_ field that represents any relations the object has to other objects. This closely resembles the JSON API definition of links.
In the relationships objects, all resources have a self link that points to the resource itself. This allows easy access to the objects pointed by the relationships as the reply URL is included in the response itself.
To create a relationship between two objects, define it in the initial POST
request. To modify the relationships of existing objects, perform a PATCH
request with the new definition of the relevant relationship. To completely
remove all relationships from an object, the data field of the corresponding
relationship object must be set to an empty array.
The following lists the resources and the types of links each resource can have in addition to the self link. Examples of these relationships can be seen in the resource documentation.
services - Service resource
servers
List of servers used by the service
services
List of services used by the service
All the resources that return JSON content also support the following
parameters. Parameters are given in the HTTP query string:https://localhost:8989/v1/servers?pretty=true&fields[servers]=state.
pretty
Pretty-print output.
If this parameter is set to true then the returned objects are formatted
in a more human readable format. If the parameter is set to false then the
returned objects are formatted in a compact format. All resources support
this parameter. The default value for this parameter is true.
fields[TYPE]=field1,field2...
The root object being optional is an extension to the JSONPath specification
that MaxScale implements.
The expr value must be a . Similarly to the other filter
parameter, the comparison is done for each individual object in the data
array of the result.
If the JSONPath expression returns multiple objects, the comparison is done
for each element and if any of them matches, the object is considered to
match. In other words, wildcard JSONPath expressions are ORed together.
If multiple filter[json_path]=expr parameters are found in the request,
all returned values must match all of them. In other words, the filter
parameters are all combined into an AND expression. For example, the
following filter will only return all values whose id field is "srv1 and
the attributes.parameters.port field is 3306:filter[id]=eq("srv1")&filter[attributes.parameters.port]=eq(3306)
page[size]
The number of elements that are returned for resource collections. By
default all elements in the resource collection are returned. The value must
be a valid positive integer, otherwise the parameter is ignored. If
pagination is used, the links object will have pagination links to the
next page if more elements are available.
page[number]
MaxScale 24.02 added support for expressions in the filter request
parameter. Each resource in a resource collection that evaluates to a true value
will be kept in the returned result. All rows that evaluate to false are
removed.
Equality and inequality is defined for all JSON types but ordering is defined only for numbers and strings. The logical operators allow one or more sub-expressions.
The following table lists the supported operations in the filter expressions. In
it, the stored value is marked as S and the literal JSON value in the
expression as V. For the logical operators, the sub-expression is marked asexpr.
Filter Expression Examples
Ranges of values can be defined using an and() expression with the range
limits defined with the ordering operators ge() and le(). To filter the
sessions in MaxScale to ones that have an ID between 50 and 100, the following
filtering expression can be used.
Limiting the result to only the given values can be done with an or()
expression that uses eq() expressions to select the rows to return. To only
return sessions with IDs 1, 5, 10 the following filtering expression can be
used.
Similarly, excluding certain rows from the result can be done by simply
replacing or() with not(). This expression would exclude sessions with the
IDs 1, 5 and 10 from the result.
REST makes use of the HTTP protocols in its aim to provide a natural way to understand the workings of an API. The following request headers are understood by this API.
Authorization
Credentials for authentication. This header should consist of a HTTP Basic
Access authentication type payload which is the base64 encoded value of the
username and password joined by a colon e.g. Base64("maxuser:maxpwd").
Content-Type
All PUT and POST requests must use the Content-Type: application/json media
type and the request body must be a complete and valid JSON representation of a
resource. All PATCH requests must use the Content-Type: application/json media
type and the request body must be a JSON document containing a partial
definition of the modified resource.
Host
The address and port of the server.
If-Match
The request is performed only if the provided ETag value matches the one on the server. This field should be used with PATCH requests to prevent concurrent updates to the same resource.
The value of this header must be a value from the ETag header retrieved from
the same resource at an earlier point in time.
If-Modified-Since
If the content has not changed the server responds with a 304 status code. If the content has changed the server responds with a 200 status code and the requested resource.
The value of this header must be a date value in the format.
If-None-Match
If the content has not changed the server responds with a 304 status code. If the content has changed the server responds with a 200 status code and the requested resource.
The value of this header must be a value from the ETag header retrieved from
the same resource at an earlier point in time.
If-Unmodified-Since
The request is performed only if the requested resource has not been modified since the provided date.
The value of this header must be a date value in the format.
X-HTTP-Method-Override
Some clients only support GET and PUT requests. By providing the string value of
the intended method in the X-HTTP-Method-Override header, a client can, for
example, perform a POST, PATCH or DELETE request with the PUT method
(e.g. X-HTTP-Method-Override: PATCH).
If this header is defined in the request, the current method of the request is replaced with the one in the header. The HTTP method must be in uppercase and it must be one of the methods that the requested resource supports.
Allow
All resources return the Allow header with the supported HTTP methods. For
example the resource /services will always return the Accept: GET, PATCH, PUT
header.
Accept-Patch
All PATCH capable resources return the Accept-Patch: application/json-patch
header.
Date
Returns the RFC 1123 standard form date when the reply was sent. The date is in English and it uses the server's local timezone.
ETag
An identifier for a specific version of a resource. The value of this header changes whenever a resource is modified via the REST API. It will not change if an internal MaxScale event (e.g. server changing state or statistics being updated) causes a change.
When the client sends the If-Match or If-None-Match header, the provided
value should be the value of the ETag header of an earlier GET.
Last-Modified
The date when the resource was last modified in "HTTP-date" format.
Location
If an out of date resource location is requested, a HTTP return code of 3XX with
the Location header is returned. The value of the header contains the new
location of the requested resource as a relative URI.
WWW-Authenticate
The requested authentication method. For example, WWW-Authenticate: Basic
would require basic HTTP authentication.
Mxs-Warning
This header is used for sending generic warnings to clients about actions that were successful and valid but could cause problems in the future. Currently these are used to indicate when a configuration change was made to a static object and an overriding configuraiton is created or when a static object is being deleted at runtime.
The content of the header is the human-readable warning that should be displayed to a user.
Every HTTP response starts with a line with a return code which indicates the outcome of the request. The API uses some of the standard HTTP values:
200 OK
Successful HTTP requests, response has a body.
201 Created
A new resource was created.
This class of status code indicates the client must take additional action to complete the request.
301 Moved Permanently
This and all future requests should be directed to the given URI.
302 Found
The response to the request can be found under another URI using the same method as in the original request.
The 4xx class of status code is when the client seems to have erred. Except when responding to a HEAD request, the body of the response MAY contains a JSON representation of the error.
The error field contains a short error description and the description field contains a more detailed version of the error message.
400 Bad Request
The server cannot or will not process the request due to client error.
401 Unauthorized
Authentication is required. The response includes a WWW-Authenticate header.
The server failed to fulfill an apparently valid request.
500 Internal Server Error
A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
501 Not Implemented
The server either does not recognize the request method, or it lacks the ability to fulfill the request.
The following response headers are not currently in use. Future versions of the API could return them.
206 Partial Content
The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
300 Multiple Choices
Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
CC BY-SA / Gnu FDL
yes, as its argument. Whenpersist=yes is set, the token is stored in the token_sig cookie and the
response is 204 No Content instead of 200 OK.
The token_sig cookie contains the JWT and is stored as a HttpOnly cookie
which prevents access to from JavaScript. This is done to mitigate any
attacks that might leak the token.filters
List of filters used by the service
NOTE: This is an ordered relationship where the order of the filters
defines the order in which they process queries.listeners
List of listeners used by the service
monitors - Monitor resource
servers
List of servers used by the monitor
filters - Filter resource
services
List of services that use this filter
NOTE: This is a one-way relationship that can only be modified from theservices resource.
servers - Server resource
services
List of services that use this server
monitors
List of monitors that use this server
listeners - Listener resource
services
The service that the listener points to
Return a Sparse Fieldset
This parameter controls which fields are returned in the REST API
response. The TYPE value in the fields parameter must be the resource
type that is being retrieved (i.e. the servers in /v1/servers and/v1/server/server1). The value of the parameter must be a comma-separated
list of JSON Pointers that mark which
fields of the object to return. Only fields in objects in the attributes
and relationships objects are inspected. This means that if the path
marked by the JSON Pointer contains an array in it, it will not advance past
this array.
For example, to return only the server state output from the /servers
endpoint, the fields[servers]=state parameter can be used. This would
return only the data.attributes.state part of the resource. To return the
nested value data.attributes.statistics.connections, the corresponding
parameter would be fields[servers]=statistics/connections.
filter=json_ptr=expr
Filter the output of the result
This parameter controls which rows are returned in a REST API response that
returns an array in the data member (i.e. a request to a resource
collection). Requests to individual resources are not filtered.
The argument to the filter parameter must be a key-value pair with a valid JSON Pointer as the key and either a
valid JSON type as the value or a filter-expression. The comparison is done for each
individual object in the data array of the result. If given only a JSON
value, the stored value is compared for equality. If an expression is used,
the expression is evaluated and only rows that match are returned.
For example, if the object stored in data[0] has a value pointed by the
given JSON pointer and that value compares equal to the given JSON value,
the array row is kept in the result. Examples for filtering expression can
be found here.
A practical use for this parameter is to return only sessions for a
particular service. For example, to return sessions for theRW-Split-Router service, thefilter=/relationships/services/data/0/id="RW-Split-Router" parameter can
be used. Note the double quotes around the "RW-Split-Router", they are
required to correctly convert strings into JSON values.
filter[json_path]=expr
Filter based on a JSONPath and a filtering expression.
Similar to the filter parameter that takes a JSON Pointer, this version of
the filter controls which rows are returned in a REST API response for a
resource collection. Requests to individual resources are never filtered.
The value inside the brackets must be a valid JSONPath
expression that MaxScale supports. The currently supported syntax is:
dot notation: $.store.book
bracket notation: $['store']['book']
array values: $.store.book[0]
multiple array values: $.store.book[0,1,2]
array wildcards: $.store.book[*].price
object wildcards: $.store.bicycle.*
optional root object: store.book
How many pages of results to skip. The first page of results starts from 0
and each page has no more than page[size] elements. If defined,page[size] must also be defined, otherwise this parameter is ignored. This
should be considered pseudo-pagination as the results are not guaranteed to
be consistent between requests.
sync
Control configuration synchronization.
If this parameter is set to false then the configuration synchronization
is disabled for this request. This can be used to perform configuration
changes when MaxScale is unable to reach the cluster used to synchronize the
configuration. The modifications to the local configuration will be
overwritten when the next modification to the cluster's configuration is
done which means this should only be used to perform temporary fixes.
ge(json)
S >= V
Numbers and strings
gt(json)
S > V
Numbers and strings
and(expr...)
expr && expr
Expressions
or(expr...)
expr || expr
Expressions
not(expr...)
!expr
Expressions
The request has been accepted for processing, but the processing has not been completed.
204 No Content
Successful HTTP requests, response has no body.
303 See Other
The response to the request can be found under another URI using a GET method.
304 Not Modified
Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.
307 Temporary Redirect
The request should be repeated with another URI but future requests should use the original URI.
308 Permanent Redirect
The request and all future requests should be repeated using another URI.
The request was a valid request, but the client does not have the necessary permissions for the resource.
404 Not Found
The requested resource could not be found.
405 Method Not Allowed
A request method is not supported for the requested resource.
406 Not Acceptable
The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
409 Conflict
Indicates that the request could not be processed because of conflict in the request, such as an edit conflict be tween multiple simultaneous updates.
411 Length Required
The request did not specify the length of its content, which is required by the requested resource.
412 Precondition Failed
The server does not meet one of the preconditions that the requester put on the request.
413 Payload Too Large
The request is larger than the server is willing or able to process.
414 URI Too Long
The URI provided was too long for the server to process.
415 Unsupported Media Type
The request entity has a media type which the server or resource does not support.
422 Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors.
423 Locked
The resource that is being accessed is locked.
428 Precondition Required
The origin server requires the request to be conditional. This error code is
returned when none of the Modified-Since or Match type headers are used.
431 Request Header Fields Too Large
The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.
502 Bad Gateway
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
503 Service Unavailable
The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.
504 Gateway Timeout
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
505 HTTP Version Not Supported
The server does not support the HTTP protocol version used in the request.
506 Variant Also Negotiates
Transparent content negotiation for the request results in a circular reference.
507 Insufficient Storage
The server is unable to store the representation needed to complete the request.
508 Loop Detected
The server detected an infinite loop while processing the request (sent in lieu of 208 Already Reported).
510 Not Extended
Further extensions to the request are required for the server to fulfil it.
407 Proxy Authentication Required
The client must first authenticate itself with the proxy.
408 Request Timeout
The server timed out waiting for the request. According to HTTP specifications: "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
410 Gone
Indicates that the resource requested is no longer available and will not be available again.
416 Range Not Satisfiable
The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
417 Expectation Failed
The server cannot meet the requirements of the Expect request-header field.
421 Misdirected Request
The request was directed at a server that is not able to produce a response.
424 Failed Dependency
The request failed due to failure of a previous request.
426 Upgrade Required
The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
429 Too Many Requests
The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
eq(json)
S == V
All JSON types
ne(json)
S != V
All JSON types
lt(json)
S < V
Numbers and strings
le(json)
S <= V
Numbers and strings
GET /v1/auth{
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqw"
}
}GET /v1/auth?persist=yesGET /v1/auth?max-age=28800Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqwfilter=id=and(ge(50),le(100))filter=id=or(eq(1),eq(5),eq(10))filter=id=not(eq(1),eq(5),eq(10)){
"error": {
"detail" : "The new `/servers/` resource is missing the `port` parameter"
}
}A server resource represents a backend database server.
The :name in all of the URIs must be the name of a server in MaxScale.
Get a single server.
Response
Status: 200 OK
Response
Response contains a resource collection with all servers.
Status: 200 OK
Create a new server by defining the resource. The posted object must define at least the following fields.
data.id
Name of the server
data.type
Type of the object, must be servers
The following is the minimal required JSON object for defining a new server.
The relationships of a server can also be defined at creation time. This allows new servers to be created and immediately taken into use.
Refer to the for a full list of server parameters.
Response
Server created:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
The request body must be a valid JSON document representing the modified server.
In addition to the server , the services and monitors fields of the relationships object can be modified. Removal, addition and modification of the links will change which service and monitors use this server.
For example, removing the first value in the services list in the_relationships_ object from the following JSON document will remove the_server1_ from the service RW-Split-Router.
Removing a service from a server is analogous to removing the server from the service. Both unlink the two objects from each other.
Request for PATCH /v1/servers/server1 that modifies the address of the server:
Request for PATCH /v1/servers/server1 that modifies the server relationships:
If parts of the resource are not defined (e.g. the attributes field in the
above example), those parts of the resource are not modified. All parts that are
defined are interpreted as the new definition of those part of the resource. In
the above example, the relationships of the resource are completely redefined.
Response
Server modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
The :type in the URI must be either services, for service relationships, or monitors, for monitor relationships.
The request body must be a JSON object that defines only the data field. The value of the data field must be an array of relationship objects that define the id and type fields of the relationship. This object will replace the existing relationships of the particular type from the server.
The following is an example request and request body that defines a single service relationship for a server.
All relationships for a server can be deleted by sending an empty array as the_data_ field value. The following example removes the server from all services.
Response
Server relationships modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
A server can only be deleted if it is not used by any services or monitors.
This endpoint also supports the force=yes parameter that will unconditionally
delete the server by first unlinking it from all services and monitors that use
it.
Response
Server is destroyed:
Status: 204 No Content
Server is in use:
Status: 400 Bad Request
This endpoint requires that the state parameter is passed with the
request. The value of state must be one of the following values.
For example, to set the server db-server-1 into maintenance mode, a request to the following URL must be made:
This endpoint also supports the force=yes parameter that will cause all
connections to the server to be closed if state=maintenance is also set. By
default setting a server into maintenance mode will cause connections to be
closed only after the next request is sent.
The following example forcefully closes all connections to server db-server-1 and sets it into maintenance mode:
Response
Server state modified:
Status: 204 No Content
Missing or invalid parameter:
Status: 400 Bad Request
This endpoint requires that the state parameter is passed with the
request. The value of state must be one of the values defined in the_set_ endpoint documentation.
Response
Server state modified:
Status: 204 No Content
Missing or invalid parameter:
Status: 400 Bad Request
CC BY-SA / Gnu FDL
A listener resource represents a listener of a service in MaxScale. All listeners point to a service in MaxScale.
Get a single listener. The :name in the URI must be the name of a listener in MaxScale.
Response
Status: 200 OK
Get all listeners.
Response
Status: 200 OK
Creates a new listener. The request body must define the following fields.
data.id
Name of the listener
data.type
Type of the object, must be listeners
The following is the minimal required JSON object for defining a new listener.
Refer to the for a full list of listener parameters.
Response
Listener is created:
Status: 204 No Content
The request body must be a JSON object which represents a set of new definitions for the listener.
All parameters marked as modifiable at runtime can be modified. Currently, all
TLS/SSL parameters and the connection_init_sql_file and sql_mode parameters
can be modified at runtime.
Parameters that affect the network address or the port the listener listens on cannot be modified at runtime. To modify these parameters, recreate the listener.
Response
Listener is modified:
Status: 204 No Content
The :name must be a valid listener name. When a listener is destroyed, the network port it listens on is available for reuse.
Response
Listener is destroyed:
Status: 204 No Content
Listener cannot be deleted:
Status: 400 Bad Request
Stops a started listener. When a listener is stopped, new connections are no longer accepted and are queued until the listener is started again.
Parameters
This endpoint supports the following parameters:
force=yes
Close all existing connections that were created through this listener.
Response
Listener is stopped:
Status: 204 No Content
Starts a stopped listener.
Response
Listener is started:
Status: 204 No Content
CC BY-SA / Gnu FDL
data.attributes.parameters.address OR data.attributes.parameters.socket
data.attributes.parameters.port
The port to use. Needs
to be defined if the address field is defined.
master
Server is a Master
slave
Server is a Slave
maintenance
Server is put into maintenance
running
Server is up and running
synced
Server is a Galera node
drain
Server is drained of connections
data.attributes.parameters.port OR data.attributes.parameters.socket
The TCP port or UNIX Domain Socket the listener listens on. Only one of the fields can be defined.
data.relationships.services.data
The service relationships data, must define a JSON object with an id value
that defines the service to use and a type value set to services.
GET /v1/servers/:name{
"data": {
"attributes": {
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"last_event": "master_up",
"lock_held": null,
"master_group": null,
"master_id": -1,
"name": "server1",
"node_id": 3000,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3000,
"priority": 0,
"proxy_protocol": false,
"rank": "primary",
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": 0,
"server_id": 3000,
"slave_connections": [],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Master, Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 1,
"time": "0.001000",
"total": 0.00026678900000000002
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 1,
"time": "0.010000",
"total": 0.001274311
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 2,
"total_connections": 1
},
"triggered_at": "Thu, 20 Jul 2023 15:29:02 GMT",
"uptime": 387,
"version_string": "10.5.19-MariaDB-1:10.5.19+maria~ubu2004-log"
},
"id": "server1",
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server1/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server1/relationships/services/"
}
}
},
"type": "servers"
},
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
}
}GET /v1/servers{
"data": [
{
"attributes": {
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"last_event": "master_up",
"lock_held": null,
"master_group": null,
"master_id": -1,
"name": "server1",
"node_id": 3000,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3000,
"priority": 0,
"proxy_protocol": false,
"rank": "primary",
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": 0,
"server_id": 3000,
"slave_connections": [],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Master, Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 1,
"time": "0.001000",
"total": 0.00026678900000000002
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 1,
"time": "0.010000",
"total": 0.001274311
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 2,
"total_connections": 1
},
"triggered_at": "Thu, 20 Jul 2023 15:29:02 GMT",
"uptime": 387,
"version_string": "10.5.19-MariaDB-1:10.5.19+maria~ubu2004-log"
},
"id": "server1",
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server1/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server1/relationships/services/"
}
}
},
"type": "servers"
},
{
"attributes": {
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"last_event": "slave_up",
"lock_held": null,
"master_group": null,
"master_id": 3000,
"name": "server2",
"node_id": 3001,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3001,
"priority": 0,
"proxy_protocol": false,
"rank": "primary",
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": 0,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"master_server_name": "server1",
"seconds_behind_master": 0,
"slave_io_running": "Yes",
"slave_sql_running": "Yes"
}
],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Slave, Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 1,
"time": "0.010000",
"total": 0.0018231790000000001
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 1,
"total_connections": 1
},
"triggered_at": "Thu, 20 Jul 2023 15:29:02 GMT",
"uptime": 387,
"version_string": "10.5.19-MariaDB-1:10.5.19+maria~ubu2004-log"
},
"id": "server2",
"links": {
"self": "http://localhost:8989/v1/servers/server2/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server2/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server2/relationships/services/"
}
}
},
"type": "servers"
}
],
"links": {
"self": "http://localhost:8989/v1/servers/"
}
}POST /v1/servers{
"data": {
"id": "server3",
"type": "servers",
"attributes": {
"parameters": {
"address": "127.0.0.1",
"port": 3003
}
}
}
}{
"data": {
"id": "server4",
"type": "servers",
"attributes": {
"parameters": {
"address": "127.0.0.1",
"port": 3002
}
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
]
},
"monitors": {
"data": [
{
"id": "MySQL-Monitor",
"type": "monitors"
}
]
}
}
}
}PATCH /v1/servers/:name{
"data": {
"attributes": {
"parameters": {
"address": "192.168.0.123"
}
}
}
}{
"data": {
"relationships": {
"services": {
"data": [
{ "id": "Read-Connection-Router", "type": "services" }
]
},
"monitors": {
"data": [
{ "id": "MySQL-Monitor", "type": "monitors" }
]
}
}
}
}PATCH /v1/servers/:name/relationships/:typePATCH /v1/servers/my-db-server/relationships/services
{
data: [
{ "id": "my-rwsplit-service", "type": "services" }
]
}PATCH /v1/servers/my-db-server/relationships/services
{
data: []
}DELETE /v1/servers/:namePUT /v1/servers/:name/setPUT /v1/servers/db-server-1/set?state=maintenancePUT /v1/servers/db-server-1/set?state=maintenance&force=yesPUT /v1/servers/:name/clearGET /v1/listeners/:name{
"data": {
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4006,
"protocol": "MariaDBProtocol",
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
},
"links": {
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/"
}
}GET /v1/listeners{
"data": [
{
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4006,
"protocol": "MariaDBProtocol",
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
},
{
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4008,
"protocol": "MariaDBProtocol",
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"links": {
"self": "http://localhost:8989/v1/listeners/"
}
}POST /v1/listeners{
"data": {
"id": "my-listener",
"type": "listeners",
"attributes": {
"parameters": {
"port": 3306
}
},
"relationships": {
"services": {
"data": [
{"id": "RW-Split-Router", "type": "services"}
]
}
}
}
}PATCH /v1/listeners/:nameDELETE /v1/listeners/:namePUT /v1/listeners/:name/stopPUT /v1/listeners/:name/startThe :name in all of the URIs must be the name of a service in MaxScale.
Get a single service.
Response
Status: 200 OK
Get all services.
Response
Status: 200 OK
Create a new service by defining the resource. The posted object must define at least the following fields.
data.id
Name of the service
data.type
Type of the object, must be services
data.attributes.router
The router module to use
data.attributes.parameters.user
The to use
data.attributes.parameters.password
The to use
The data.attributes.parameters object is used to define router and service
parameters. All configuration parameters that can be defined in the
configuration file can also be added to the parameters object. The exceptions to
this are the type, router, servers and filters parameters which must not
be defined.
As with other REST API resources, the data.relationships field defines the
relationships of the service to other resources. Services can have two types of
relationships: servers and filters relationships.
If the request body defines a valid relationships object, the service is
linked to those resources. For servers, this is equivalent to adding the list of
server names into the servers parameter. For
filters, this is equivalent to adding the filters in thedata.relationships.filters.data array to the filters parameter in the
order they appear. For other services, this is equivalent to adding the list of
server names into the targets parameter.
The following example defines a new service with both a server and a filter relationship.
Response
Service is created:
Status: 204 No Content
A service can only be destroyed if the service uses no servers or filters and
all the listeners pointing to the service have been destroyed. This means that
the data.relationships must be an empty object and data.attributes.listeners
must be an empty array in order for the service to qualify for destruction.
If there are open client connections that use the service when it is destroyed, they are allowed to gracefully close before the service is destroyed. This means that the destruction of a service can be acknowledged via the REST API before the destruction process has fully completed.
To find out whether a service is still in use after it has been destroyed, the sessions resource should be used. If a session for the service is still open, it has not yet been destroyed.
This endpoint also supports the force=yes parameter that will unconditionally
delete the service by first unlinking it from all servers and filters that it
uses.
Response
Service is destroyed:
Status: 204 No Content
The request body must be a JSON object which represents a set of new definitions for the service.
All standard service parameters can be modified. Refer to the service documentation on the details of these parameters.
In addition to the standard service parameters, router parameters can be updated at runtime if the router module supports it. Refer to the individual router documentation for more details on whether the router supports it and which parameters can be updated at runtime.
The following example modifies a service by changing the user parameter to admin.
Response
Service is modified:
Status: 204 No Content
The :type in the URI must be either servers, services or filters, depending on which relationship is being modified.
The request body must be a JSON object that defines only the data field. The value of the data field must be an array of relationship objects that define the id and type fields of the relationship. This object will replace the existing relationships of this type for the service.
Note: The order of the values in the filters relationship will define the
order the filters are set up in. The order in which the filters appear in the
array will be the order in which the filters are applied to each query. Refer
to the filters parameter
for more details.
The following is an example request and request body that defines a single
server relationship for a service that is equivalent to a servers=my-server
parameter.
All relationships for a service can be deleted by sending an empty array as the_data_ field value. The following example removes all servers from a service.
Response
Service relationships modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
Stops a started service.
Parameters
This endpoint supports the following parameters:
force=yes
Close all existing connections that were created through this listener.
Response
Service is stopped:
Status: 204 No Content
Starts a stopped service.
Response
Service is started:
Status: 204 No Content
Reloads the list of database users used for authentication.
Response
Users are reloaded:
Status: 204 No Content
This endpoint is deprecated, use the this listeners endpoint instead.
This endpoint is deprecated, use the this listeners endpoint instead.
This endpoint is deprecated, use the this listeners endpoint instead.
This endpoint is deprecated, use the this listeners endpoint instead.
CC BY-SA / Gnu FDL
GET /v1/services/:name{
"data": {
"attributes": {
"connections": 0,
"listeners": [
{
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4008,
"protocol": "MariaDBProtocol",
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"connection_keepalive": "300000ms",
"connection_timeout": "0ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"idle_session_pool_time": "-1ms",
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": true,
"max_connections": 0,
"max_replication_lag": "0ms",
"max_sescmd_history": 50,
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"router": "readconnroute",
"router_options": "master",
"session_trace": false,
"session_track_trx_state": false,
"strip_db_esc": true,
"type": "service",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null
},
"router": "readconnroute",
"router_diagnostics": {
"queries": 0,
"server_query_statistics": []
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Thu Jul 20 15:29:02 2023",
"state": "Started",
"statistics": {
"active_operations": 0,
"connections": 0,
"failed_auths": 0,
"max_connections": 0,
"routed_packets": 0,
"total_connections": 0
},
"total_connections": 0,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Thu Jul 20 15:29:03 2023"
},
"id": "Read-Connection-Router",
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
},
{
"id": "Hint",
"type": "filters"
}
],
"links": {
"related": "http://localhost:8989/v1/filters/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/filters/"
}
},
"listeners": {
"data": [
{
"id": "Read-Connection-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/listeners/"
}
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/servers/"
}
}
},
"type": "services"
},
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
}
}GET /v1/services{
"data": [
{
"attributes": {
"connections": 1,
"listeners": [
{
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4006,
"protocol": "MariaDBProtocol",
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"causal_reads": "false",
"causal_reads_timeout": "10000ms",
"connection_keepalive": "300000ms",
"connection_timeout": "0ms",
"delayed_retry": false,
"delayed_retry_timeout": "10000ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"idle_session_pool_time": "-1ms",
"lazy_connect": false,
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": false,
"master_failure_mode": "fail_instantly",
"master_reconnection": false,
"max_connections": 0,
"max_sescmd_history": 50,
"max_slave_connections": 255,
"max_slave_replication_lag": "0ms",
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"optimistic_trx": false,
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"retry_failed_reads": true,
"reuse_prepared_statements": false,
"router": "readwritesplit",
"session_trace": false,
"session_track_trx_state": false,
"slave_connections": 255,
"slave_selection_criteria": "LEAST_CURRENT_OPERATIONS",
"strict_multi_stmt": false,
"strict_sp_calls": false,
"strip_db_esc": true,
"transaction_replay": false,
"transaction_replay_attempts": 5,
"transaction_replay_checksum": "full",
"transaction_replay_max_size": 1048576,
"transaction_replay_retry_on_deadlock": false,
"transaction_replay_retry_on_mismatch": false,
"transaction_replay_timeout": "0ms",
"type": "service",
"use_sql_variables_in": "all",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null
},
"router": "readwritesplit",
"router_diagnostics": {
"avg_sescmd_history_length": 0,
"max_sescmd_history_length": 0,
"queries": 2,
"replayed_transactions": 0,
"ro_transactions": 0,
"route_all": 1,
"route_master": 1,
"route_slave": 0,
"rw_transactions": 0,
"server_query_statistics": [
{
"avg_selects_per_session": 0,
"avg_sess_duration": "0ns",
"id": "server1",
"read": 2,
"total": 2,
"write": 0
},
{
"avg_selects_per_session": 0,
"avg_sess_duration": "0ns",
"id": "server2",
"read": 1,
"total": 1,
"write": 0
}
]
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Thu Jul 20 15:29:02 2023",
"state": "Started",
"statistics": {
"active_operations": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"routed_packets": 2,
"total_connections": 1
},
"total_connections": 1,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Thu Jul 20 15:29:03 2023"
},
"id": "RW-Split-Router",
"links": {
"self": "http://localhost:8989/v1/services/RW-Split-Router/"
},
"relationships": {
"listeners": {
"data": [
{
"id": "RW-Split-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/RW-Split-Router/relationships/listeners/"
}
},
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/services/RW-Split-Router/relationships/monitors/"
}
}
},
"type": "services"
},
{
"attributes": {
"connections": 0,
"listeners": [
{
"attributes": {
"parameters": {
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"port": 4008,
"protocol": "MariaDBProtocol",
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"connection_keepalive": "300000ms",
"connection_timeout": "0ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"idle_session_pool_time": "-1ms",
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": true,
"max_connections": 0,
"max_replication_lag": "0ms",
"max_sescmd_history": 50,
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"router": "readconnroute",
"router_options": "master",
"session_trace": false,
"session_track_trx_state": false,
"strip_db_esc": true,
"type": "service",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null
},
"router": "readconnroute",
"router_diagnostics": {
"queries": 0,
"server_query_statistics": []
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Thu Jul 20 15:29:02 2023",
"state": "Started",
"statistics": {
"active_operations": 0,
"connections": 0,
"failed_auths": 0,
"max_connections": 0,
"routed_packets": 0,
"total_connections": 0
},
"total_connections": 0,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Thu Jul 20 15:29:03 2023"
},
"id": "Read-Connection-Router",
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
},
{
"id": "Hint",
"type": "filters"
}
],
"links": {
"related": "http://localhost:8989/v1/filters/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/filters/"
}
},
"listeners": {
"data": [
{
"id": "Read-Connection-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/listeners/"
}
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/servers/"
}
}
},
"type": "services"
}
],
"links": {
"self": "http://localhost:8989/v1/services/"
}
}POST /v1/services{
"data": {
"id": "my-service",
"type": "services",
"attributes": {
"router": "readwritesplit",
"parameters": {
"user": "maxuser",
"password": "maxpwd"
}
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
}
]
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
}
]
}
}
}
}DELETE /v1/services/:namePATCH /v1/services/:name{
"data": {
"attributes": {
"parameters": {
"user": "admin"
}
}
}
}PATCH /v1/services/:name/relationships/:typePATCH /v1/services/my-rw-service/relationships/servers
{
data: [
{ "id": "my-server", "type": "servers" }
]
}PATCH /v1/services/my-rw-service/relationships/servers
{
data: []
}PUT /v1/services/:name/stopPUT /v1/services/:name/startPOST /v1/services/:name/reloadGET /v1/services/:name/listenersGET /v1/services/:name/listeners/:listenerPOST /v1/services/:name/listenersDELETE /v1/services/:service/listeners/:nameThe MaxScale resource represents a MaxScale instance and it is the core on top of which the modules build upon.
Retrieve global information about a MaxScale instance. This includes various file locations, configuration options and version information.
Response
Status: 200 OK
Update MaxScale parameters. The request body must define updated values for the data.attributes.parameters object. The parameters that can be modified are listed in the /v1/maxscale/modules/maxscale endpoint and have the modifiable value set to true.
Response
Parameters modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
Get the information and statistics of a particular thread. The :id in the URI must map to a valid thread number between 0 and the configured value of threads.
Response
Status: 200 OK
Get the information for all threads. Returns a collection of threads resources.
Response
Status: 200 OK
Get information about the current state of logging, enabled log files and the location where the log files are stored.
Note: The parameters in this endpoint are a subset of the parameters in the /v1/maxscale endpoint. Because of this, the parameters in this endpoint are deprecated as of MaxScale 6.0.
Note: In MaxScale 2.5 the log_throttling and ms_timestamp parameters were incorrectly named as throttling and highprecision. In MaxScale 6, the parameter names are now correct which means the parameters declared here aren't fully backwards compatible.
Response
Status: 200 OK
Get the contents of the MaxScale logs. This endpoint was added in MaxScale 6.
To navigate the log, use the prev link to move backwards to older log entries. The latest log entries can be read with the last link.
The entries are sorted in ascending order by the time they were logged. This means that with the default parameters, the latest logged event is the last element in the returned array.
Parameters
This endpoint supports the following parameters:
page[size]
Set number of rows of data to read. By default, 50 rows of data are read from the log.
page[cursor]
Set position from where the log data is retrieved. The default position to retrieve the log data is the end of the log. This value should not be modified by the user and the values returned in the
Response
Status: 200 OK
Stream the contents of the MaxScale logs. This endpoint was added in MaxScale 6.
This endpoint opens a connection and streams the contents of the log to it. Each WebSocket message will contain the JSON representation of the log message. The JSON is formatted in the same way as the values in the log array of the /v1/maxscale/logs/data endpoint:
If the client writes any data to the open socket, it will be treated as an error and the stream is closed.
The WebSocket ping and close commands are not yet supported and will be treated as errors.
When maxlog is used as source of log data, any log messages logged after log rotation will not be sent if the file was moved or truncated. To fetch new events after log rotation, reopen the WebSocket connection.
Parameters
This endpoint supports the following parameters:
page[cursor]
Set position from where the log data is retrieved. The default position to retrieve the log data is the end of the log. To stream data from a known point, first read the data via the /v1/maxscale/logs/data endpoint and then use the id value of the newest log message (i.e. the first value in the log array) to start the stream.
priority
Response
Upgrade started:
Status: 101 Switching Protocols
Client didn't request a WebSocket upgrade:
Status: 426 Upgrade Required
Note: The modification of logging parameters via this endpoint has deprecated in MaxScale 6.0. The parameters should be modified with the /v1/maxscale endpoint instead.
Any PATCH requests done to this endpoint will be redirected to the /v1/maxscale endpoint. Due to the mispelling of the ms_timestamp and log_throttling parameters, this is not fully backwards compatible.
Update logging parameters. The request body must define updated values for the data.attributes.parameters object. All logging parameters can be altered at runtime.
Response
Parameters modified:
Status: 204 No Content
Invalid JSON body:
Status: 400 Bad Request
Flushes any pending messages to disk and reopens the log files. The body of the message is ignored.
Response
Status: 204 No Content
Reloads all TLS certificates for listeners and servers as well as the REST API itself. If the reloading fails, the old certificates will remain in use for the objects that failed to reload. This also causes the JWT signature keys to be reloaded if one of the asymmetric key algorithms is being used. If JWTs are being signed with a random symmetric keys, a new random key is created.
The reloading is not transactional: if a single listener or server fails to reload its certificates, the remaining ones are not reloaded. This means that a failed reload can partially reload certificates. The REST API certificates are only reloaded if all other certificate reloads were successful.
Response
Status: 204 No Content
Retrieve information about a loaded module. The :name must be the name of a valid loaded module or either maxscale or servers.
The maxscale module will display the global configuration options (i.e. everything under the [maxscale] section) as a module.
The servers module displays the server object type and the configuration parameters it accepts as a module.
Any parameter with the modifiable value set to true can be modified at runtime using a PATCH command on the corresponding object endpoint.
Response
Status: 200 OK
Retrieve information about all loaded modules.
This endpoint supports the load=all parameter. When defined, all modules located in the MaxScale module directory (libdir) will be loaded. This allows one to see the parameters of a module before the object is created.
Response
Status: 200 OK
For read-only commands:
For commands that can modify data:
Modules can expose commands that can be called via the REST API. The module resource lists all commands in the data.attributes.commands list. Each value is a command sub-resource identified by its id field and the HTTP method the command uses is defined by the attributes.method field.
The :module in the URI must be a valid name of a loaded module and :command must be a valid command identifier that is exposed by that module. All parameters to the module commands are passed as HTTP request parameters.
Here is an example POST requests to the mariadbmon module command reset-replication with two parameters, the name of the monitor instance and the server name:
Response
Command with output:
Status: 200 OK
The contents of the meta field will contain the output of the module command. This output depends on the command that is being executed. It can contain any valid JSON value.
Command with no output:
Status: 204 No Content
Classify provided statement and return the result.
Response
Status: 200 OK
CC BY-SA / Gnu FDL
linksidpriority
Include messages only from these log levels. The default is to include all messages. The value given should be a comma-separated list of log priorities. The priorities are alert, error, warning, notice, info and debug. Note that the debug log level is only used in debug builds of MaxScale.
Include messages only from these log levels. The default is to include all messages. The value given should be a comma-separated list of log priorities. The priorities are alert, error, warning, notice, info and debug. Note that the debug log level is only used in debug builds of MaxScale.
GET /v1/maxscale{
"data": {
"attributes": {
"activated_at": "Thu, 20 Jul 2023 15:29:02 GMT",
"commit": "d6acc9ed4310d328677803c4dc96e82b2a7afe14",
"config_sync": null,
"parameters": {
"admin_auth": true,
"admin_enabled": true,
"admin_gui": true,
"admin_host": "127.0.0.1",
"admin_jwt_algorithm": "auto",
"admin_jwt_key": null,
"admin_log_auth_failures": true,
"admin_oidc_url": null,
"admin_pam_readonly_service": null,
"admin_pam_readwrite_service": null,
"admin_port": 8989,
"admin_secure_gui": true,
"admin_ssl_ca": null,
"admin_ssl_cert": null,
"admin_ssl_key": null,
"admin_ssl_version": "MAX",
"admin_verify_url": null,
"auth_connect_timeout": "10000ms",
"auth_read_timeout": "10000ms",
"auth_write_timeout": "10000ms",
"auto_tune": [],
"cachedir": "/var/cache/maxscale",
"config_sync_cluster": null,
"config_sync_db": "mysql",
"config_sync_interval": "5000ms",
"config_sync_password": null,
"config_sync_timeout": "10000ms",
"config_sync_user": null,
"connector_plugindir": "/usr/lib64/maxscale/plugin",
"datadir": "/var/lib/maxscale",
"debug": null,
"dump_last_statements": "never",
"execdir": "/usr/bin",
"key_manager": "none",
"language": "/var/lib/maxscale",
"libdir": "/usr/lib64/maxscale",
"load_persisted_configs": true,
"local_address": null,
"log_debug": false,
"log_info": false,
"log_notice": true,
"log_throttling": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"log_warn_super_user": false,
"log_warning": true,
"logdir": "/var/log/maxscale",
"max_auth_errors_until_block": 10,
"max_read_amount": 0,
"maxlog": true,
"module_configdir": "/etc/maxscale.modules.d",
"ms_timestamp": false,
"passive": false,
"persist_runtime_changes": true,
"persistdir": "/var/lib/maxscale/maxscale.cnf.d",
"piddir": "/var/run/maxscale",
"query_classifier": "qc_sqlite",
"query_classifier_args": null,
"query_classifier_cache_size": 5001955123,
"query_retries": 1,
"query_retry_timeout": "5000ms",
"rebalance_period": "0ms",
"rebalance_threshold": 20,
"rebalance_window": 10,
"retain_last_statements": 0,
"session_trace": 0,
"skip_name_resolve": false,
"skip_permission_checks": false,
"sql_mode": "default",
"syslog": false,
"threads": 3,
"users_refresh_interval": "0ms",
"users_refresh_time": "0ms",
"writeq_high_water": 65536,
"writeq_low_water": 1024
},
"process_datadir": "/var/lib/maxscale/data19",
"started_at": "Thu, 20 Jul 2023 15:29:02 GMT",
"system": {
"machine": {
"cores_available": 8,
"cores_physical": 8,
"cores_virtual": 8.0,
"memory_available": 33346367488,
"memory_physical": 33346367488
},
"maxscale": {
"query_classifier_cache_size": 5001955123,
"threads": 3
},
"os": {
"machine": "x86_64",
"nodename": "monolith",
"release": "6.3.12-100.fc37.x86_64",
"sysname": "Linux",
"version": "#1 SMP PREEMPT_DYNAMIC Wed Jul 5 20:09:58 UTC 2023"
}
},
"uptime": 10,
"version": "22.08.6"
},
"id": "maxscale",
"type": "maxscale"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/"
}
}PATCH /v1/maxscaleGET /v1/maxscale/threads/:id{
"data": {
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 34,
"sessions": 0,
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "0",
"links": {
"self": "http://localhost:8989/v1/threads/0/"
},
"type": "threads"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/threads/0/"
}
}GET /v1/maxscale/threads{
"data": [
{
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 35,
"sessions": 0,
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "0",
"links": {
"self": "http://localhost:8989/v1/threads/0/"
},
"type": "threads"
},
{
"attributes": {
"stats": {
"accepts": 1,
"avg_event_queue_length": 1,
"current_descriptors": 8,
"errors": 0,
"hangups": 0,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 3,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 448,
"sessions": 69671,
"total": 70119,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 1,
"misses": 2,
"size": 448
},
"reads": 47,
"sessions": 1,
"total_descriptors": 8,
"writes": 10,
"zombies": 0
}
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/threads/1/"
},
"type": "threads"
},
{
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 34,
"sessions": 0,
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "2",
"links": {
"self": "http://localhost:8989/v1/threads/2/"
},
"type": "threads"
}
],
"links": {
"self": "http://localhost:8989/v1/maxscale/threads/"
}
}GET /v1/maxscale/logs{
"data": {
"attributes": {
"log_file": "/var/log/maxscale/maxscale.log",
"log_priorities": [
"alert",
"error",
"warning",
"notice"
],
"parameters": {
"log_debug": false,
"log_info": false,
"log_notice": true,
"log_throttling": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"log_warning": true,
"maxlog": true,
"ms_timestamp": false,
"syslog": false
}
},
"id": "logs",
"type": "logs"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/logs/"
}
}GET /v1/maxscale/logs/data{
"data": {
"attributes": {
"log": [
{
"id": "37",
"message": "Service 'Read-Connection-Router' started (2/2)",
"priority": "notice",
"timestamp": "2023-07-20 15:29:02"
},
{
"id": "38",
"message": "Read 5 user@host entries from 'server1' for service 'Read-Connection-Router'.",
"priority": "notice",
"timestamp": "2023-07-20 15:29:03"
},
{
"id": "39",
"message": "Read 5 user@host entries from 'server1' for service 'RW-Split-Router'.",
"priority": "notice",
"timestamp": "2023-07-20 15:29:03"
}
],
"log_source": "maxlog"
},
"id": "log_data",
"type": "log_data"
},
"links": {
"last": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bsize%5D=3",
"prev": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bcursor%5D=34&page%5Bsize%5D=3",
"self": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bcursor%5D=40&page%5Bsize%5D=3"
}
}GET /v1/maxscale/logs/stream{
"id": "572",
"message": "MaxScale started with 8 worker threads, each with a stack size of 8388608 bytes.",
"priority": "notice",
"timestamp": "2020-09-25 10:01:29"
}PATCH /v1/maxscale/logsPOST /v1/maxscale/logs/flushPOST /v1/maxscale/tls/reloadGET /v1/maxscale/modules/:name{
"data": {
"attributes": {
"api": "router",
"commands": [],
"description": "A Read/Write splitting router for enhancement read scalability",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": "false",
"description": "Causal reads mode",
"enum_values": [
"false",
"off",
"0",
"true",
"on",
"1",
"none",
"local",
"global",
"fast_global",
"fast",
"universal"
],
"mandatory": false,
"modifiable": true,
"name": "causal_reads",
"type": "enum"
},
{
"default_value": "10000ms",
"description": "Timeout for the slave synchronization",
"mandatory": false,
"modifiable": true,
"name": "causal_reads_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Retry failed writes outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry",
"type": "bool"
},
{
"default_value": "10000ms",
"description": "Timeout for delayed_retry",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Create connections only when needed",
"mandatory": false,
"modifiable": true,
"name": "lazy_connect",
"type": "bool"
},
{
"default_value": false,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "fail_instantly",
"description": "Master failure mode behavior",
"enum_values": [
"fail_instantly",
"fail_on_write",
"error_on_write"
],
"mandatory": false,
"modifiable": true,
"name": "master_failure_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Reconnect to master",
"mandatory": false,
"modifiable": true,
"name": "master_reconnection",
"type": "bool"
},
{
"default_value": 255,
"description": "Maximum number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "max_slave_connections",
"type": "count"
},
{
"default_value": "0ms",
"description": "Maximum allowed slave replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_slave_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Optimistically offload transactions to slaves",
"mandatory": false,
"modifiable": true,
"name": "optimistic_trx",
"type": "bool"
},
{
"default_value": true,
"description": "Automatically retry failed reads outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "retry_failed_reads",
"type": "bool"
},
{
"default_value": false,
"description": "Reuse identical prepared statements inside the same connection",
"mandatory": false,
"modifiable": true,
"name": "reuse_prepared_statements",
"type": "bool"
},
{
"default_value": 255,
"description": "Starting number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "slave_connections",
"type": "count"
},
{
"default_value": "LEAST_CURRENT_OPERATIONS",
"description": "Slave selection criteria",
"enum_values": [
"LEAST_GLOBAL_CONNECTIONS",
"LEAST_ROUTER_CONNECTIONS",
"LEAST_BEHIND_MASTER",
"LEAST_CURRENT_OPERATIONS",
"ADAPTIVE_ROUTING"
],
"mandatory": false,
"modifiable": true,
"name": "slave_selection_criteria",
"type": "enum"
},
{
"default_value": false,
"description": "Lock connection to master after multi-statement query",
"mandatory": false,
"modifiable": true,
"name": "strict_multi_stmt",
"type": "bool"
},
{
"default_value": false,
"description": "Lock connection to master after a stored procedure is executed",
"mandatory": false,
"modifiable": true,
"name": "strict_sp_calls",
"type": "bool"
},
{
"default_value": false,
"description": "Retry failed transactions",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay",
"type": "bool"
},
{
"default_value": 5,
"description": "Maximum number of times to retry a transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_attempts",
"type": "count"
},
{
"default_value": "full",
"description": "Type of checksum to calculate for results",
"enum_values": [
"full",
"result_only",
"no_insert_id"
],
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_checksum",
"type": "enum"
},
{
"default_value": 1048576,
"description": "Maximum size of transaction to retry",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_max_size",
"type": "size"
},
{
"default_value": false,
"description": "Retry transaction on deadlock",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_deadlock",
"type": "bool"
},
{
"default_value": false,
"description": "Retry transaction on checksum mismatch",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_mismatch",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Timeout for transaction replay",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "all",
"description": "Whether to route SQL variable modifications to all servers or only to the master",
"enum_values": [
"all",
"master"
],
"mandatory": false,
"modifiable": true,
"name": "use_sql_variables_in",
"type": "enum"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How ofted idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
}
],
"version": "V1.1.0"
},
"id": "readwritesplit",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/"
},
"type": "modules"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/"
}
}GET /v1/maxscale/modules{
"data": [
{
"attributes": {
"commands": [],
"description": "maxscale",
"maturity": "GA",
"module_type": "maxscale",
"parameters": [
{
"default_value": true,
"description": "Admin interface authentication.",
"mandatory": false,
"modifiable": false,
"name": "admin_auth",
"type": "bool"
},
{
"default_value": true,
"description": "Admin interface is enabled.",
"mandatory": false,
"modifiable": false,
"name": "admin_enabled",
"type": "bool"
},
{
"default_value": true,
"description": "Enable admin GUI.",
"mandatory": false,
"modifiable": false,
"name": "admin_gui",
"type": "bool"
},
{
"default_value": "127.0.0.1",
"description": "Admin interface host.",
"mandatory": false,
"modifiable": false,
"name": "admin_host",
"type": "string"
},
{
"default_value": "auto",
"description": "JWT signature algorithm",
"enum_values": [
"auto",
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512",
"PS256",
"PS384",
"PS512",
"ED25519",
"ED448"
],
"mandatory": false,
"modifiable": false,
"name": "admin_jwt_algorithm",
"type": "enum"
},
{
"description": "Encryption key ID for symmetric signature algorithms. If left empty, MaxScale will generate a random key that is used to sign the JWT.",
"mandatory": false,
"modifiable": false,
"name": "admin_jwt_key",
"type": "string"
},
{
"default_value": true,
"description": "Log admin interface authentication failures.",
"mandatory": false,
"modifiable": true,
"name": "admin_log_auth_failures",
"type": "bool"
},
{
"description": "Extra public certificates used to validate externally signed JWTs",
"mandatory": false,
"modifiable": true,
"name": "admin_oidc_url",
"type": "string"
},
{
"description": "PAM service for read-only users.",
"mandatory": false,
"modifiable": false,
"name": "admin_pam_readonly_service",
"type": "string"
},
{
"description": "PAM service for read-write users.",
"mandatory": false,
"modifiable": false,
"name": "admin_pam_readwrite_service",
"type": "string"
},
{
"default_value": 8989,
"description": "Admin interface port.",
"mandatory": false,
"modifiable": false,
"name": "admin_port",
"type": "int"
},
{
"default_value": "*",
"description": "Allowed hosts for read-only rest-api users.",
"mandatory": false,
"modifiable": false,
"name": "admin_readonly_hosts",
"type": "host pattern list"
},
{
"default_value": "*",
"description": "Allowed hosts for read-only rest-api users.",
"mandatory": false,
"modifiable": false,
"name": "admin_readwrite_hosts",
"type": "host pattern list"
},
{
"default_value": true,
"description": "Only serve GUI over HTTPS.",
"mandatory": false,
"modifiable": false,
"name": "admin_secure_gui",
"type": "bool"
},
{
"description": "Admin SSL CA cert",
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'admin_ssl_ca'",
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_ca_cert",
"type": "path"
},
{
"description": "Admin SSL cert",
"mandatory": false,
"modifiable": true,
"name": "admin_ssl_cert",
"type": "path"
},
{
"description": "Admin SSL key",
"mandatory": false,
"modifiable": true,
"name": "admin_ssl_key",
"type": "path"
},
{
"default_value": "MAX",
"description": "Minimum required TLS protocol version for the REST API",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_version",
"type": "enum"
},
{
"description": "URL for third-party verification of client tokens",
"mandatory": false,
"modifiable": false,
"name": "admin_verify_url",
"type": "string"
},
{
"default_value": "10000ms",
"description": "Connection timeout for fetching user accounts.",
"mandatory": false,
"modifiable": true,
"name": "auth_connect_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "10000ms",
"description": "Read timeout for fetching user accounts (deprecated).",
"mandatory": false,
"modifiable": true,
"name": "auth_read_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "10000ms",
"description": "Write timeout for fetching user accounts (deprecated).",
"mandatory": false,
"modifiable": true,
"name": "auth_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": [],
"description": "Specifies whether a MaxScale parameter whose value depends on a specific global server variable, should automatically be updated to match the variable's current value.",
"mandatory": false,
"modifiable": false,
"name": "auto_tune",
"type": "stringlist"
},
{
"description": "Cluster used for configuration synchronization. If left empty (i.e. value is \"\"), synchronization is not done.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_cluster",
"type": "string"
},
{
"default_value": "mysql",
"description": "Database where the 'maxscale_config' table is created.",
"mandatory": false,
"modifiable": false,
"name": "config_sync_db",
"type": "string"
},
{
"default_value": "5000ms",
"description": "How often to synchronize the configuration.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used for configuration synchronization.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_password",
"type": "password"
},
{
"default_value": "10000ms",
"description": "Timeout for the configuration synchronization operations.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "User account used for configuration synchronization.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_user",
"type": "string"
},
{
"description": "Debug options",
"mandatory": false,
"modifiable": false,
"name": "debug",
"type": "string"
},
{
"default_value": "never",
"description": "In what circumstances should the last statements that a client sent be dumped.",
"enum_values": [
"on_close",
"on_error",
"never"
],
"mandatory": false,
"modifiable": true,
"name": "dump_last_statements",
"type": "enum"
},
{
"default_value": "none",
"description": "Key manager type",
"enum_values": [
"none",
"file",
"kmip",
"vault"
],
"mandatory": false,
"modifiable": true,
"name": "key_manager",
"type": "enum"
},
{
"default_value": true,
"description": "Specifies whether persisted configuration files should be loaded on startup.",
"mandatory": false,
"modifiable": false,
"name": "load_persisted_configs",
"type": "bool"
},
{
"description": "Local address to use when connecting.",
"mandatory": false,
"modifiable": false,
"name": "local_address",
"type": "string"
},
{
"default_value": false,
"description": "Specifies whether debug messages should be logged (meaningful only with debug builds).",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Specifies whether info messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": true,
"description": "Specifies whether notice messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"description": "Limit the amount of identical log messages than can be logged during a certain time period.",
"mandatory": false,
"modifiable": true,
"name": "log_throttling",
"type": "throttling"
},
{
"default_value": false,
"description": "Log a warning when a user with super privilege logs in.",
"mandatory": false,
"modifiable": false,
"name": "log_warn_super_user",
"type": "bool"
},
{
"default_value": true,
"description": "Specifies whether warning messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 10,
"description": "The maximum number of authentication failures that are tolerated before a host is temporarily blocked.",
"mandatory": false,
"modifiable": true,
"name": "max_auth_errors_until_block",
"type": "int"
},
{
"default_value": 0,
"description": "Maximum amount of data read before return to epoll_wait.",
"mandatory": false,
"modifiable": false,
"name": "max_read_amount",
"type": "size"
},
{
"default_value": true,
"description": "Log to MaxScale's own log.",
"mandatory": false,
"modifiable": true,
"name": "maxlog",
"type": "bool"
},
{
"default_value": false,
"description": "Enable or disable high precision timestamps.",
"mandatory": false,
"modifiable": true,
"name": "ms_timestamp",
"type": "bool"
},
{
"default_value": false,
"description": "True if MaxScale is in passive mode.",
"mandatory": false,
"modifiable": true,
"name": "passive",
"type": "bool"
},
{
"default_value": true,
"description": "Persist configurations changes done at runtime.",
"mandatory": false,
"modifiable": false,
"name": "persist_runtime_changes",
"type": "bool"
},
{
"default_value": "qc_sqlite",
"description": "The name of the query classifier to load.",
"mandatory": false,
"modifiable": false,
"name": "query_classifier",
"type": "string"
},
{
"description": "Arguments for the query classifier.",
"mandatory": false,
"modifiable": false,
"name": "query_classifier_args",
"type": "string"
},
{
"default_value": 5001955123,
"description": "Maximum amount of memory used by query classifier cache.",
"mandatory": false,
"modifiable": true,
"name": "query_classifier_cache_size",
"type": "size"
},
{
"default_value": 1,
"description": "Number of times an interrupted query is retried.",
"mandatory": false,
"modifiable": false,
"name": "query_retries",
"type": "int"
},
{
"default_value": "5000ms",
"description": "The total timeout in seconds for any retried queries.",
"mandatory": false,
"modifiable": true,
"name": "query_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "How often should the load of the worker threads be checked and rebalancing be made.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_period",
"type": "duration",
"unit": "ms"
},
{
"default_value": 20,
"description": "If the difference in load between the thread with the maximum load and the thread with the minimum load is larger than the value of this parameter, then work will be moved from the former to the latter.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_threshold",
"type": "int"
},
{
"default_value": 10,
"description": "The load of how many seconds should be taken into account when rebalancing.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_window",
"type": "count"
},
{
"default_value": 0,
"description": "How many statements should be retained for each session for debugging purposes.",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "count"
},
{
"default_value": 0,
"description": "How many log entries are stored in the session specific trace log.",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "count"
},
{
"default_value": false,
"description": "Do not resolve client IP addresses to hostnames during authentication",
"mandatory": false,
"modifiable": true,
"name": "skip_name_resolve",
"type": "bool"
},
{
"default_value": false,
"description": "Skip service and monitor permission checks.",
"mandatory": false,
"modifiable": true,
"name": "skip_permission_checks",
"type": "bool"
},
{
"default_value": "default",
"description": "The query classifier sql mode.",
"enum_values": [
"default",
"oracle"
],
"mandatory": false,
"modifiable": false,
"name": "sql_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Log to syslog.",
"mandatory": false,
"modifiable": true,
"name": "syslog",
"type": "bool"
},
{
"default_value": 8,
"description": "This parameter specifies how many threads will be used for handling the routing.",
"mandatory": false,
"modifiable": false,
"name": "threads",
"type": "count"
},
{
"default_value": "0ms",
"description": "How often the users will be refreshed.",
"mandatory": false,
"modifiable": true,
"name": "users_refresh_interval",
"type": "duration",
"unit": "ms"
},
{
"default_value": "30000ms",
"description": "How often the users can be refreshed.",
"mandatory": false,
"modifiable": true,
"name": "users_refresh_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": 65536,
"description": "High water mark of dcb write queue.",
"mandatory": false,
"modifiable": true,
"name": "writeq_high_water",
"type": "size"
},
{
"default_value": 1024,
"description": "Low water mark of dcb write queue.",
"mandatory": false,
"modifiable": true,
"name": "writeq_low_water",
"type": "size"
}
],
"version": "22.08.6"
},
"id": "maxscale",
"links": {
"self": "http://localhost:8989/v1/modules/maxscale/"
},
"type": "modules"
},
{
"attributes": {
"commands": [],
"description": "servers",
"maturity": "GA",
"module_type": "servers",
"parameters": [
{
"description": "Server address",
"mandatory": false,
"modifiable": true,
"name": "address",
"type": "string"
},
{
"description": "Server authenticator (deprecated)",
"mandatory": false,
"modifiable": false,
"name": "authenticator",
"type": "string"
},
{
"description": "Server disk space threshold",
"mandatory": false,
"modifiable": true,
"name": "disk_space_threshold",
"type": "disk_space_limits"
},
{
"default_value": 0,
"description": "Server extra port",
"mandatory": false,
"modifiable": true,
"name": "extra_port",
"type": "count"
},
{
"default_value": 0,
"description": "Maximum routing connections",
"mandatory": false,
"modifiable": true,
"name": "max_routing_connections",
"type": "count"
},
{
"description": "Monitor password",
"mandatory": false,
"modifiable": true,
"name": "monitorpw",
"type": "password"
},
{
"description": "Monitor user",
"mandatory": false,
"modifiable": true,
"name": "monitoruser",
"type": "string"
},
{
"default_value": "0ms",
"description": "Maximum time that a connection can be in the pool",
"mandatory": false,
"modifiable": true,
"name": "persistmaxtime",
"type": "duration",
"unit": "ms"
},
{
"default_value": 0,
"description": "Maximum size of the persistent connection pool",
"mandatory": false,
"modifiable": true,
"name": "persistpoolmax",
"type": "count"
},
{
"default_value": 3306,
"description": "Server port",
"mandatory": false,
"modifiable": true,
"name": "port",
"type": "count"
},
{
"default_value": 0,
"description": "Server priority",
"mandatory": false,
"modifiable": true,
"name": "priority",
"type": "int"
},
{
"description": "Server protocol (deprecated)",
"mandatory": false,
"modifiable": false,
"name": "protocol",
"type": "string"
},
{
"default_value": false,
"description": "Enable proxy protocol",
"mandatory": false,
"modifiable": true,
"name": "proxy_protocol",
"type": "bool"
},
{
"default_value": "primary",
"description": "Server rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"description": "Server UNIX socket",
"mandatory": false,
"modifiable": true,
"name": "socket",
"type": "string"
},
{
"default_value": false,
"description": "Enable TLS for server",
"mandatory": false,
"modifiable": true,
"name": "ssl",
"type": "bool"
},
{
"description": "TLS certificate authority",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'ssl_ca'",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca_cert",
"type": "path"
},
{
"description": "TLS public certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert",
"type": "path"
},
{
"default_value": 9,
"description": "TLS certificate verification depth",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert_verify_depth",
"type": "count"
},
{
"description": "TLS cipher list",
"mandatory": false,
"modifiable": true,
"name": "ssl_cipher",
"type": "string"
},
{
"description": "TLS private key",
"mandatory": false,
"modifiable": true,
"name": "ssl_key",
"type": "path"
},
{
"default_value": false,
"description": "Verify TLS peer certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_certificate",
"type": "bool"
},
{
"default_value": false,
"description": "Verify TLS peer host",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_host",
"type": "bool"
},
{
"default_value": "MAX",
"description": "Minimum TLS protocol version",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": true,
"name": "ssl_version",
"type": "enum"
},
{
"default_value": "server",
"description": "Object type",
"mandatory": false,
"modifiable": false,
"name": "type",
"type": "string"
}
],
"version": "22.08.6"
},
"id": "servers",
"links": {
"self": "http://localhost:8989/v1/modules/servers/"
},
"type": "modules"
},
{
"attributes": {
"api": "filter",
"commands": [],
"description": "A hint parsing filter",
"maturity": "Alpha",
"module_type": "Filter",
"parameters": [],
"version": "V1.0.0"
},
"id": "hintfilter",
"links": {
"self": "http://localhost:8989/v1/modules/hintfilter/"
},
"type": "modules"
},
{
"attributes": {
"api": "authenticator",
"commands": [],
"description": "Standard MySQL/MariaDB authentication (mysql_native_password)",
"maturity": "GA",
"module_type": "Authenticator",
"parameters": null,
"version": "V2.1.0"
},
"id": "MariaDBAuth",
"links": {
"self": "http://localhost:8989/v1/modules/MariaDBAuth/"
},
"type": "modules"
},
{
"attributes": {
"api": "monitor",
"commands": [
{
"attributes": {
"arg_max": 3,
"arg_min": 2,
"description": "Rebuild a server with mariadb-backup. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Target server",
"required": true,
"type": "SERVER"
},
{
"description": "Source server (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "async-rebuild-server",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-rebuild-server/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Set ColumnStore cluster readwrite. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-set-readwrite",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-set-readwrite/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Set ColumnStore cluster read-only. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-set-readonly",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-set-readonly/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Stop ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-stop-cluster",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-stop-cluster/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Start ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-start-cluster",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-start-cluster/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Get ColumnStore cluster status. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-cs-get-status",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-get-status/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Get ColumnStore cluster status.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "cs-get-status",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/cs-get-status/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 3,
"description": "Remove a node from a ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Hostname/IP of node to remove from ColumnStore cluster",
"required": true,
"type": "STRING"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-remove-node",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-remove-node/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 3,
"description": "Add a node to a ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Hostname/IP of node to add to ColumnStore cluster",
"required": true,
"type": "STRING"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-add-node",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-add-node/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Cancel the last scheduled command.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "cancel-cmd",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/cancel-cmd/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Fetch result of the last scheduled command.",
"method": "GET",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "fetch-cmd-result",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/fetch-cmd-result/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Release any held server locks for 1 minute. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-release-locks",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-release-locks/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Release any held server locks for 1 minute.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "release-locks",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/release-locks/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 1,
"description": "Delete slave connections, delete binary logs and set up replication (dangerous). Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Master server (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Target data directory (optional)",
"required": false,
"type": "[STRING]"
}
]
},
"id": "async-reset-replication",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-reset-replication/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 1,
"description": "Delete slave connections, delete binary logs and set up replication (dangerous)",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Master server (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "reset-replication",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/reset-replication/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Rejoin server to a cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Joining server",
"required": true,
"type": "SERVER"
}
]
},
"id": "async-rejoin",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-rejoin/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Rejoin server to a cluster",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Joining server",
"required": true,
"type": "SERVER"
}
]
},
"id": "rejoin",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/rejoin/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Schedule master failover. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-failover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-failover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Perform master failover",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "failover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/failover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Schedule master switchover. Does not wait for completion",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "New master (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Current master (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "async-switchover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-switchover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Perform master switchover",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "New master (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Current master (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "switchover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/switchover/"
},
"type": "module_command"
}
],
"description": "A MariaDB Master/Slave replication monitor",
"maturity": "GA",
"module_type": "Monitor",
"parameters": [
{
"default_value": true,
"description": "Assume that hostnames are unique",
"mandatory": false,
"modifiable": true,
"name": "assume_unique_hostnames",
"type": "bool"
},
{
"default_value": false,
"description": "Enable automatic server failover",
"mandatory": false,
"modifiable": true,
"name": "auto_failover",
"type": "bool"
},
{
"default_value": false,
"description": "Enable automatic server rejoin",
"mandatory": false,
"modifiable": true,
"name": "auto_rejoin",
"type": "bool"
},
{
"default_value": "none",
"description": "Cooperative monitoring type",
"enum_values": [
"none",
"majority_of_running",
"majority_of_all"
],
"mandatory": false,
"modifiable": true,
"name": "cooperative_monitoring_locks",
"type": "enum"
},
{
"description": "The API key used in communication with the ColumnStore admin daemon.",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_api_key",
"type": "string"
},
{
"default_value": "/cmapi/0.4.0",
"description": "The base path to be used when accessing the ColumnStore administrative daemon. If, for instance, a daemon URL is https://localhost:8640/cmapi/0.4.0/node/start then the admin_base_path is \"/cmapi/0.4.0\".",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_base_path",
"type": "string"
},
{
"default_value": 8640,
"description": "Port of the ColumnStore administrative daemon.",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_port",
"type": "count"
},
{
"description": "Path to SQL file that is executed during node demotion",
"mandatory": false,
"modifiable": true,
"name": "demotion_sql_file",
"type": "path"
},
{
"default_value": false,
"description": "Enable read_only on all slave servers",
"mandatory": false,
"modifiable": true,
"name": "enforce_read_only_slaves",
"type": "bool"
},
{
"default_value": false,
"description": "Enforce a simple topology",
"mandatory": false,
"modifiable": true,
"name": "enforce_simple_topology",
"type": "bool"
},
{
"default_value": false,
"description": "Disable read_only on the current master server",
"mandatory": false,
"modifiable": true,
"name": "enforce_writable_master",
"type": "bool"
},
{
"default_value": 5,
"description": "Number of failures to tolerate before failover occurs",
"mandatory": false,
"modifiable": true,
"name": "failcount",
"type": "count"
},
{
"default_value": "90000ms",
"description": "Timeout for failover",
"mandatory": false,
"modifiable": true,
"name": "failover_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Manage server-side events",
"mandatory": false,
"modifiable": true,
"name": "handle_events",
"type": "bool"
},
{
"default_value": true,
"description": "Put the server into maintenance mode when it runs out of disk space",
"mandatory": false,
"modifiable": true,
"name": "maintenance_on_low_disk_space",
"type": "bool"
},
{
"default_value": 1,
"description": "mariadb-backup thread count.",
"mandatory": false,
"modifiable": true,
"name": "mariadb-backup_parallel",
"type": "int"
},
{
"default_value": "1G",
"description": "mariadb-backup buffer pool size.",
"mandatory": false,
"modifiable": true,
"name": "mariadb-backup_use_memory",
"type": "string"
},
{
"default_value": "primary_monitor_master",
"description": "Conditions that the master servers must meet",
"enum_values": [
"none",
"connecting_slave",
"connected_slave",
"running_slave",
"primary_monitor_master"
],
"mandatory": false,
"modifiable": true,
"name": "master_conditions",
"type": "enum_mask"
},
{
"default_value": "10000ms",
"description": "Master failure timeout",
"mandatory": false,
"modifiable": true,
"name": "master_failure_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Path to SQL file that is executed during node promotion",
"mandatory": false,
"modifiable": true,
"name": "promotion_sql_file",
"type": "path"
},
{
"default_value": 4444,
"description": "Listen port used for transferring server backup.",
"mandatory": false,
"modifiable": true,
"name": "rebuild_port",
"type": "count"
},
{
"default_value": false,
"description": "Enable SSL when configuring replication",
"mandatory": false,
"modifiable": true,
"name": "replication_master_ssl",
"type": "bool"
},
{
"description": "Password for the user that is used for replication",
"mandatory": false,
"modifiable": true,
"name": "replication_password",
"type": "password"
},
{
"description": "User used for replication",
"mandatory": false,
"modifiable": true,
"name": "replication_user",
"type": "string"
},
{
"default_value": -1,
"description": "Replication lag limit at which the script is run",
"mandatory": false,
"modifiable": true,
"name": "script_max_replication_lag",
"type": "int"
},
{
"description": "List of servers that are never promoted",
"mandatory": false,
"modifiable": true,
"name": "servers_no_promotion",
"type": "serverlist"
},
{
"default_value": "",
"description": "Conditions that the slave servers must meet",
"enum_values": [
"linked_master",
"running_master",
"writable_master",
"primary_monitor_master",
"none"
],
"mandatory": false,
"modifiable": true,
"name": "slave_conditions",
"type": "enum_mask"
},
{
"default_value": true,
"description": "Is SSH host key check enabled.",
"mandatory": false,
"modifiable": true,
"name": "ssh_check_host_key",
"type": "bool"
},
{
"description": "SSH keyfile. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": false,
"name": "ssh_keyfile",
"type": "path"
},
{
"default_value": 22,
"description": "SSH port. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": true,
"name": "ssh_port",
"type": "count"
},
{
"default_value": "10000ms",
"description": "SSH connection and command timeout",
"mandatory": false,
"modifiable": true,
"name": "ssh_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "SSH username. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": false,
"name": "ssh_user",
"type": "string"
},
{
"default_value": false,
"description": "Perform a switchover when a server runs out of disk space",
"mandatory": false,
"modifiable": true,
"name": "switchover_on_low_disk_space",
"type": "bool"
},
{
"default_value": "90000ms",
"description": "Timeout for switchover",
"mandatory": false,
"modifiable": true,
"name": "switchover_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Verify master failure",
"mandatory": false,
"modifiable": true,
"name": "verify_master_failure",
"type": "bool"
},
{
"default_value": 1,
"description": "Number of connection attempts to make to a server",
"mandatory": false,
"modifiable": true,
"name": "backend_connect_attempts",
"type": "count"
},
{
"default_value": "3000ms",
"description": "Connection timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_connect_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "3000ms",
"description": "Read timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_read_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "3000ms",
"description": "Write timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "How often the disk space is checked",
"mandatory": false,
"modifiable": true,
"name": "disk_space_check_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Disk space threshold",
"mandatory": false,
"modifiable": true,
"name": "disk_space_threshold",
"type": "string"
},
{
"default_value": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"description": "Events that cause the script to be called",
"enum_values": [
"all",
"master_down",
"master_up",
"slave_down",
"slave_up",
"server_down",
"server_up",
"synced_down",
"synced_up",
"donor_down",
"donor_up",
"lost_master",
"lost_slave",
"lost_synced",
"lost_donor",
"new_master",
"new_slave",
"new_synced",
"new_donor"
],
"mandatory": false,
"modifiable": true,
"name": "events",
"type": "enum_mask"
},
{
"default_value": "28800000ms",
"description": "The time the on-disk cached server states are valid for",
"mandatory": false,
"modifiable": true,
"name": "journal_max_age",
"type": "duration",
"unit": "ms"
},
{
"default_value": "2000ms",
"description": "How often the servers are monitored",
"mandatory": false,
"modifiable": true,
"name": "monitor_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to monitor the servers",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"description": "Script to run whenever an event occurs",
"mandatory": false,
"modifiable": true,
"name": "script",
"type": "string"
},
{
"default_value": "90000ms",
"description": "Timeout for the script",
"mandatory": false,
"modifiable": true,
"name": "script_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "List of servers to use",
"mandatory": false,
"modifiable": true,
"name": "servers",
"type": "serverlist"
},
{
"description": "Username used to monitor the servers",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
}
],
"version": "V1.5.0"
},
"id": "mariadbmon",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/"
},
"type": "modules"
},
{
"attributes": {
"api": "protocol",
"commands": [],
"description": "The client to MaxScale MySQL protocol implementation",
"maturity": "GA",
"module_type": "Protocol",
"parameters": [
{
"default_value": "::",
"description": "Listener address",
"mandatory": false,
"modifiable": false,
"name": "address",
"type": "string"
},
{
"description": "Listener authenticator",
"mandatory": false,
"modifiable": false,
"name": "authenticator",
"type": "string"
},
{
"description": "Authenticator options",
"mandatory": false,
"modifiable": false,
"name": "authenticator_options",
"type": "string"
},
{
"description": "Path to connection initialization SQL",
"mandatory": false,
"modifiable": true,
"name": "connection_init_sql_file",
"type": "path"
},
{
"default_value": 0,
"description": "Listener port",
"mandatory": false,
"modifiable": false,
"name": "port",
"type": "count"
},
{
"default_value": "MariaDBProtocol",
"description": "Listener protocol to use",
"mandatory": false,
"modifiable": false,
"name": "protocol",
"type": "module"
},
{
"description": "Service to which the listener connects to",
"mandatory": true,
"modifiable": false,
"name": "service",
"type": "service"
},
{
"description": "Listener UNIX socket",
"mandatory": false,
"modifiable": false,
"name": "socket",
"type": "string"
},
{
"default_value": "default",
"description": "SQL parsing mode",
"enum_values": [
"default",
"oracle"
],
"mandatory": false,
"modifiable": true,
"name": "sql_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Enable TLS for server",
"mandatory": false,
"modifiable": true,
"name": "ssl",
"type": "bool"
},
{
"description": "TLS certificate authority",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'ssl_ca'",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca_cert",
"type": "path"
},
{
"description": "TLS public certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert",
"type": "path"
},
{
"default_value": 9,
"description": "TLS certificate verification depth",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert_verify_depth",
"type": "count"
},
{
"description": "TLS cipher list",
"mandatory": false,
"modifiable": true,
"name": "ssl_cipher",
"type": "string"
},
{
"description": "TLS certificate revocation list",
"mandatory": false,
"modifiable": true,
"name": "ssl_crl",
"type": "string"
},
{
"description": "TLS private key",
"mandatory": false,
"modifiable": true,
"name": "ssl_key",
"type": "path"
},
{
"default_value": false,
"description": "Verify TLS peer certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_certificate",
"type": "bool"
},
{
"default_value": false,
"description": "Verify TLS peer host",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_host",
"type": "bool"
},
{
"default_value": "MAX",
"description": "Minimum TLS protocol version",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": true,
"name": "ssl_version",
"type": "enum"
},
{
"description": "Path to user and group mapping file",
"mandatory": false,
"modifiable": true,
"name": "user_mapping_file",
"type": "path"
}
],
"version": "V1.1.0"
},
"id": "MariaDBProtocol",
"links": {
"self": "http://localhost:8989/v1/modules/MariaDBProtocol/"
},
"type": "modules"
},
{
"attributes": {
"api": "query_classifier",
"commands": [],
"description": "Query classifier using sqlite.",
"maturity": "GA",
"module_type": "QueryClassifier",
"parameters": null,
"version": "V1.0.0"
},
"id": "qc_sqlite",
"links": {
"self": "http://localhost:8989/v1/modules/qc_sqlite/"
},
"type": "modules"
},
{
"attributes": {
"api": "filter",
"commands": [
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Show unified log file as a JSON array",
"method": "GET",
"parameters": [
{
"description": "Filter to read logs from",
"required": true,
"type": "FILTER"
},
{
"description": "Start reading from this line",
"required": false,
"type": "[STRING]"
},
{
"description": "Stop reading at this line (exclusive)",
"required": false,
"type": "[STRING]"
}
]
},
"id": "log",
"links": {
"self": "http://localhost:8989/v1/modules/qlafilter/log/"
},
"type": "module_command"
}
],
"description": "A simple query logging filter",
"maturity": "GA",
"module_type": "Filter",
"parameters": [
{
"default_value": true,
"description": "Append new entries to log files instead of overwriting them",
"mandatory": false,
"modifiable": true,
"name": "append",
"type": "bool"
},
{
"default_value": "ms",
"description": "Duration in milliseconds (ms) or microseconds (us)",
"enum_values": [
"ms",
"milliseconds",
"us",
"microseconds"
],
"mandatory": false,
"modifiable": true,
"name": "duration_unit",
"type": "enum"
},
{
"description": "Exclude queries matching this pattern from the log",
"mandatory": false,
"modifiable": true,
"name": "exclude",
"type": "regex"
},
{
"description": "The basename of the output file",
"mandatory": true,
"modifiable": true,
"name": "filebase",
"type": "string"
},
{
"default_value": false,
"description": "Flush log files after every write",
"mandatory": false,
"modifiable": true,
"name": "flush",
"type": "bool"
},
{
"default_value": "date,user,query",
"description": "Type of data to log in the log files",
"enum_values": [
"service",
"session",
"date",
"user",
"query",
"reply_time",
"total_reply_time",
"default_db",
"num_rows",
"reply_size",
"transaction",
"transaction_time",
"num_warnings",
"error_msg",
"server",
"command"
],
"mandatory": false,
"modifiable": true,
"name": "log_data",
"type": "enum_mask"
},
{
"default_value": "session",
"description": "The type of log file to use",
"enum_values": [
"session",
"unified",
"stdout"
],
"mandatory": false,
"modifiable": true,
"name": "log_type",
"type": "enum_mask"
},
{
"description": "Only log queries matching this pattern",
"mandatory": false,
"modifiable": true,
"name": "match",
"type": "regex"
},
{
"default_value": " ",
"description": "Value used to replace newlines",
"mandatory": false,
"modifiable": true,
"name": "newline_replacement",
"type": "string"
},
{
"default_value": "",
"description": "Regular expression options",
"enum_values": [
"case",
"ignorecase",
"extended"
],
"mandatory": false,
"modifiable": true,
"name": "options",
"type": "enum_mask"
},
{
"default_value": ",",
"description": "Defines the separator between elements of a log entry",
"mandatory": false,
"modifiable": true,
"name": "separator",
"type": "string"
},
{
"description": "Log queries only from this network address",
"mandatory": false,
"modifiable": true,
"name": "source",
"type": "string"
},
{
"default_value": false,
"description": "Write queries in canonical form",
"mandatory": false,
"modifiable": true,
"name": "use_canonical_form",
"type": "bool"
},
{
"description": "Log queries only from this user",
"mandatory": false,
"modifiable": true,
"name": "user",
"type": "string"
}
],
"version": "V1.1.1"
},
"id": "qlafilter",
"links": {
"self": "http://localhost:8989/v1/modules/qlafilter/"
},
"type": "modules"
},
{
"attributes": {
"api": "router",
"commands": [],
"description": "A connection based router to load balance based on connections",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": true,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Maximum acceptable replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": "running",
"description": "A comma separated list of server roles",
"enum_values": [
"master",
"slave",
"running",
"synced"
],
"mandatory": false,
"modifiable": true,
"name": "router_options",
"type": "enum_mask"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How ofted idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
}
],
"version": "V2.0.0"
},
"id": "readconnroute",
"links": {
"self": "http://localhost:8989/v1/modules/readconnroute/"
},
"type": "modules"
},
{
"attributes": {
"api": "router",
"commands": [],
"description": "A Read/Write splitting router for enhancement read scalability",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": "false",
"description": "Causal reads mode",
"enum_values": [
"false",
"off",
"0",
"true",
"on",
"1",
"none",
"local",
"global",
"fast_global",
"fast",
"universal"
],
"mandatory": false,
"modifiable": true,
"name": "causal_reads",
"type": "enum"
},
{
"default_value": "10000ms",
"description": "Timeout for the slave synchronization",
"mandatory": false,
"modifiable": true,
"name": "causal_reads_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Retry failed writes outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry",
"type": "bool"
},
{
"default_value": "10000ms",
"description": "Timeout for delayed_retry",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Create connections only when needed",
"mandatory": false,
"modifiable": true,
"name": "lazy_connect",
"type": "bool"
},
{
"default_value": false,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "fail_instantly",
"description": "Master failure mode behavior",
"enum_values": [
"fail_instantly",
"fail_on_write",
"error_on_write"
],
"mandatory": false,
"modifiable": true,
"name": "master_failure_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Reconnect to master",
"mandatory": false,
"modifiable": true,
"name": "master_reconnection",
"type": "bool"
},
{
"default_value": 255,
"description": "Maximum number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "max_slave_connections",
"type": "count"
},
{
"default_value": "0ms",
"description": "Maximum allowed slave replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_slave_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Optimistically offload transactions to slaves",
"mandatory": false,
"modifiable": true,
"name": "optimistic_trx",
"type": "bool"
},
{
"default_value": true,
"description": "Automatically retry failed reads outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "retry_failed_reads",
"type": "bool"
},
{
"default_value": false,
"description": "Reuse identical prepared statements inside the same connection",
"mandatory": false,
"modifiable": true,
"name": "reuse_prepared_statements",
"type": "bool"
},
{
"default_value": 255,
"description": "Starting number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "slave_connections",
"type": "count"
},
{
"default_value": "LEAST_CURRENT_OPERATIONS",
"description": "Slave selection criteria",
"enum_values": [
"LEAST_GLOBAL_CONNECTIONS",
"LEAST_ROUTER_CONNECTIONS",
"LEAST_BEHIND_MASTER",
"LEAST_CURRENT_OPERATIONS",
"ADAPTIVE_ROUTING"
],
"mandatory": false,
"modifiable": true,
"name": "slave_selection_criteria",
"type": "enum"
},
{
"default_value": false,
"description": "Lock connection to master after multi-statement query",
"mandatory": false,
"modifiable": true,
"name": "strict_multi_stmt",
"type": "bool"
},
{
"default_value": false,
"description": "Lock connection to master after a stored procedure is executed",
"mandatory": false,
"modifiable": true,
"name": "strict_sp_calls",
"type": "bool"
},
{
"default_value": false,
"description": "Retry failed transactions",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay",
"type": "bool"
},
{
"default_value": 5,
"description": "Maximum number of times to retry a transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_attempts",
"type": "count"
},
{
"default_value": "full",
"description": "Type of checksum to calculate for results",
"enum_values": [
"full",
"result_only",
"no_insert_id"
],
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_checksum",
"type": "enum"
},
{
"default_value": 1048576,
"description": "Maximum size of transaction to retry",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_max_size",
"type": "size"
},
{
"default_value": false,
"description": "Retry transaction on deadlock",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_deadlock",
"type": "bool"
},
{
"default_value": false,
"description": "Retry transaction on checksum mismatch",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_mismatch",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Timeout for transaction replay",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "all",
"description": "Whether to route SQL variable modifications to all servers or only to the master",
"enum_values": [
"all",
"master"
],
"mandatory": false,
"modifiable": true,
"name": "use_sql_variables_in",
"type": "enum"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How ofted idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
}
],
"version": "V1.1.0"
},
"id": "readwritesplit",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/"
},
"type": "modules"
}
],
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/"
}
}GET /v1/maxscale/modules/:module/:commandPOST /v1/maxscale/modules/:module/:commandPOST /v1/maxscale/modules/mariadbmon/reset-replication?MariaDB-Monitor&server1{
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/mariadbmon/reset-replication"
},
"meta": [ // Output of module command (module dependent)
{
"name": "value"
}
]
}GET /v1/maxscale/query_classifier/classify?sql=<statement>GET /v1/maxscale/query_classifier/classify?sql=SELECT+1{
"data": {
"attributes": {
"canonical": "SELECT ?",
"fields": [],
"functions": [],
"has_where_clause": false,
"operation": "QUERY_OP_SELECT",
"parse_result": "QC_QUERY_PARSED",
"type_mask": "QUERY_TYPE_READ"
},
"id": "classify",
"type": "classify"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/query_classifier/classify/"
}
}