Update Resources-MaxScale.md
Updated the responses and added missing resources.
This commit is contained in:
@ -16,32 +16,103 @@ GET /maxscale
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
{
|
{
|
||||||
"config": "/etc/maxscale.cnf",
|
"links": {
|
||||||
"cachedir": "/var/cache/maxscale/",
|
"self": "http://localhost:8989/v1/maxscale/"
|
||||||
"datadir": "/var/lib/maxscale/"
|
},
|
||||||
"libdir": "/usr/lib64/maxscale/",
|
"data": {
|
||||||
"piddir": "/var/run/maxscale/",
|
"attributes": {
|
||||||
"execdir": "/usr/bin/",
|
"parameters": {
|
||||||
"languagedir": "/var/lib/maxscale/",
|
"libdir": "/usr/lib64/maxscale",
|
||||||
"user": "maxscale",
|
"datadir": "/var/lib/maxscale",
|
||||||
|
"process_datadir": "/var/lib/maxscale/data16218",
|
||||||
|
"cachedir": "/var/cache/maxscale",
|
||||||
|
"configdir": "/etc",
|
||||||
|
"config_persistdir": "/var/lib/maxscale/maxscale.cnf.d",
|
||||||
|
"module_configdir": "/etc/maxscale.modules.d",
|
||||||
|
"piddir": "/var/run/maxscale",
|
||||||
|
"logdir": "/var/log/maxscale",
|
||||||
|
"langdir": "/var/lib/maxscale",
|
||||||
|
"execdir": "/usr/bin",
|
||||||
|
"connector_plugindir": "/var/lib/plugin",
|
||||||
"threads": 4,
|
"threads": 4,
|
||||||
"version": "2.1.0",
|
"auth_connect_timeout": 3,
|
||||||
"commit": "12e7f17eb361e353f7ac413b8b4274badb41b559"
|
"auth_read_timeout": 1,
|
||||||
"started": "Wed, 31 Aug 2016 23:29:26 +0300"
|
"auth_write_timeout": 2,
|
||||||
|
"skip_permission_checks": false,
|
||||||
|
"syslog": true,
|
||||||
|
"maxlog": true,
|
||||||
|
"log_to_shm": false,
|
||||||
|
"query_classifier": ""
|
||||||
|
},
|
||||||
|
"version": "2.1.3",
|
||||||
|
"commit": "a32aa6c16236d2d8830e1286ea3aa4dba19174ec",
|
||||||
|
"started_at": "Wed, 17 May 2017 05:33:46 GMT",
|
||||||
|
"uptime": 19
|
||||||
|
},
|
||||||
|
"id": "maxscale",
|
||||||
|
"type": "maxscale"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
|
|
||||||
## Get thread information
|
## Get thread information
|
||||||
|
|
||||||
Get detailed information and statistics about the threads.
|
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`.
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /maxscale/threads/:id
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
|
||||||
|
`Status: 200 OK`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/maxscale/threads/0"
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"id": "0",
|
||||||
|
"type": "threads",
|
||||||
|
"attributes": {
|
||||||
|
"stats": {
|
||||||
|
"reads": 2,
|
||||||
|
"writes": 0,
|
||||||
|
"errors": 0,
|
||||||
|
"hangups": 0,
|
||||||
|
"accepts": 0,
|
||||||
|
"blocking_polls": 180,
|
||||||
|
"event_queue_length": 1,
|
||||||
|
"max_event_queue_length": 1,
|
||||||
|
"max_exec_time": 0,
|
||||||
|
"max_queue_time": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/threads/0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Supported Request Parameter
|
||||||
|
|
||||||
|
- `pretty`
|
||||||
|
|
||||||
|
## Get information for all threads
|
||||||
|
|
||||||
|
Get the informatino for all threads. Returns a collection of threads resources.
|
||||||
|
|
||||||
```
|
```
|
||||||
GET /maxscale/threads
|
GET /maxscale/threads
|
||||||
@ -49,34 +120,97 @@ GET /maxscale/threads
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
{
|
{
|
||||||
"load_average": {
|
"links": {
|
||||||
"historic": 1.05,
|
"self": "http://localhost:8989/v1/maxscale/threads/"
|
||||||
"current": 1.00,
|
|
||||||
"1min": 0.00,
|
|
||||||
"5min": 0.00,
|
|
||||||
"15min": 0.00
|
|
||||||
},
|
},
|
||||||
"threads": [
|
"data": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": "0",
|
||||||
"state": "processing",
|
"type": "threads",
|
||||||
"file_descriptors": 1,
|
"attributes": {
|
||||||
"event": [
|
"stats": {
|
||||||
"in",
|
"reads": 1,
|
||||||
"out"
|
"writes": 0,
|
||||||
],
|
"errors": 0,
|
||||||
"run_time": 300
|
"hangups": 0,
|
||||||
|
"accepts": 0,
|
||||||
|
"blocking_polls": 116,
|
||||||
|
"event_queue_length": 1,
|
||||||
|
"max_event_queue_length": 1,
|
||||||
|
"max_exec_time": 0,
|
||||||
|
"max_queue_time": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/threads/0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": "1",
|
||||||
"state": "polling",
|
"type": "threads",
|
||||||
"file_descriptors": 0,
|
"attributes": {
|
||||||
"event": [],
|
"stats": {
|
||||||
"run_time": 0
|
"reads": 1,
|
||||||
|
"writes": 0,
|
||||||
|
"errors": 0,
|
||||||
|
"hangups": 0,
|
||||||
|
"accepts": 0,
|
||||||
|
"blocking_polls": 116,
|
||||||
|
"event_queue_length": 1,
|
||||||
|
"max_event_queue_length": 1,
|
||||||
|
"max_exec_time": 0,
|
||||||
|
"max_queue_time": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/threads/1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2",
|
||||||
|
"type": "threads",
|
||||||
|
"attributes": {
|
||||||
|
"stats": {
|
||||||
|
"reads": 1,
|
||||||
|
"writes": 0,
|
||||||
|
"errors": 0,
|
||||||
|
"hangups": 0,
|
||||||
|
"accepts": 0,
|
||||||
|
"blocking_polls": 116,
|
||||||
|
"event_queue_length": 1,
|
||||||
|
"max_event_queue_length": 1,
|
||||||
|
"max_exec_time": 0,
|
||||||
|
"max_queue_time": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/threads/2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3",
|
||||||
|
"type": "threads",
|
||||||
|
"attributes": {
|
||||||
|
"stats": {
|
||||||
|
"reads": 1,
|
||||||
|
"writes": 0,
|
||||||
|
"errors": 0,
|
||||||
|
"hangups": 0,
|
||||||
|
"accepts": 0,
|
||||||
|
"blocking_polls": 116,
|
||||||
|
"event_queue_length": 1,
|
||||||
|
"max_event_queue_length": 1,
|
||||||
|
"max_exec_time": 0,
|
||||||
|
"max_queue_time": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/threads/3"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -84,7 +218,7 @@ Status: 200 OK
|
|||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
|
|
||||||
## Get logging information
|
## Get logging information
|
||||||
|
|
||||||
@ -97,35 +231,35 @@ GET /maxscale/logs
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
{
|
{
|
||||||
"logdir": "/var/log/maxscale/",
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/maxscale/logs/"
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"attributes": {
|
||||||
|
"parameters": {
|
||||||
|
"highprecision": false,
|
||||||
"maxlog": true,
|
"maxlog": true,
|
||||||
"syslog": false,
|
"syslog": true,
|
||||||
"log_levels": {
|
"throttling": {
|
||||||
"error": true,
|
"count": 10,
|
||||||
"warning": true,
|
"suppress_ms": 10000,
|
||||||
"notice": true,
|
"window_ms": 1000
|
||||||
"info": false,
|
}
|
||||||
"debug": false
|
}
|
||||||
},
|
},
|
||||||
"log_augmentation": {
|
"id": "logs",
|
||||||
"function": true
|
"type": "logs"
|
||||||
},
|
}
|
||||||
"log_throttling": {
|
|
||||||
"limit": 8,
|
|
||||||
"window": 2000,
|
|
||||||
"suppression": 10000
|
|
||||||
},
|
|
||||||
"last_flushed": "Wed, 31 Aug 2016 23:29:26 +0300"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
|
|
||||||
## Flush and rotate log files
|
## Flush and rotate log files
|
||||||
|
|
||||||
@ -152,27 +286,25 @@ GET /maxscale/tasks
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
[
|
```javascript
|
||||||
{
|
{
|
||||||
"name": "Load Average",
|
"links": {
|
||||||
"type": "repeated",
|
"self": "http://localhost:8989/v1/maxscale/tasks/"
|
||||||
"frequency": 10,
|
},
|
||||||
"next_due": "Fri Sep 9 14:12:37 2016"
|
"data": [] // No tasks active
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
|
|
||||||
## Get loaded modules
|
## Get loaded modules
|
||||||
|
|
||||||
Retrieve information about all loaded modules. This includes version, API and
|
Retrieve information about a loaded module. This includes version, API and
|
||||||
maturity information.
|
maturity information as well as all the parameters that the module defines.
|
||||||
|
|
||||||
```
|
```
|
||||||
GET /maxscale/modules
|
GET /maxscale/modules
|
||||||
@ -180,37 +312,158 @@ GET /maxscale/modules
|
|||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
|
||||||
```
|
`Status: 200 OK`
|
||||||
Status: 200 OK
|
|
||||||
|
|
||||||
[
|
```javascript
|
||||||
{
|
{
|
||||||
"name": "MySQLBackend",
|
"links": {
|
||||||
"type": "Protocol",
|
"self": "http://localhost:8989/v1/maxscale/modules/"
|
||||||
"version": "V2.0.0",
|
|
||||||
"api_version": "1.1.0",
|
|
||||||
"maturity": "GA"
|
|
||||||
},
|
},
|
||||||
{
|
"data": {
|
||||||
"name": "qlafilter",
|
"id": "readwritesplit",
|
||||||
"type": "Filter",
|
"type": "module",
|
||||||
"version": "V1.1.1",
|
"attributes": {
|
||||||
"api_version": "1.1.0",
|
"module_type": "Router",
|
||||||
"maturity": "GA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "readwritesplit",
|
|
||||||
"type": "Router",
|
|
||||||
"version": "V1.1.0",
|
"version": "V1.1.0",
|
||||||
"api_version": "1.0.0",
|
"description": "A Read/Write splitting router for enhancement read scalability",
|
||||||
"maturity": "GA"
|
"api": "router",
|
||||||
|
"status": "GA",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "use_sql_variables_in",
|
||||||
|
"type": "enum",
|
||||||
|
"default_value": "all",
|
||||||
|
"enum_values": [
|
||||||
|
"all",
|
||||||
|
"master"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "slave_selection_criteria",
|
||||||
|
"type": "enum",
|
||||||
|
"default_value": "LEAST_CURRENT_OPERATIONS",
|
||||||
|
"enum_values": [
|
||||||
|
"LEAST_GLOBAL_CONNECTIONS",
|
||||||
|
"LEAST_ROUTER_CONNECTIONS",
|
||||||
|
"LEAST_BEHIND_MASTER",
|
||||||
|
"LEAST_CURRENT_OPERATIONS"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "master_failure_mode",
|
||||||
|
"type": "enum",
|
||||||
|
"default_value": "fail_instantly",
|
||||||
|
"enum_values": [
|
||||||
|
"fail_instantly",
|
||||||
|
"fail_on_write",
|
||||||
|
"error_on_write"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "max_slave_replication_lag",
|
||||||
|
"type": "int",
|
||||||
|
"default_value": "-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "max_slave_connections",
|
||||||
|
"type": "string",
|
||||||
|
"default_value": "255"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "retry_failed_reads",
|
||||||
|
"type": "bool",
|
||||||
|
"default_value": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "disable_sescmd_history",
|
||||||
|
"type": "bool",
|
||||||
|
"default_value": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "max_sescmd_history",
|
||||||
|
"type": "count",
|
||||||
|
"default_value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "strict_multi_stmt",
|
||||||
|
"type": "bool",
|
||||||
|
"default_value": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "master_accept_reads",
|
||||||
|
"type": "bool",
|
||||||
|
"default_value": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "connection_keepalive",
|
||||||
|
"type": "count",
|
||||||
|
"default_value": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/modules/readwritesplit"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported Request Parameter
|
#### Supported Request Parameter
|
||||||
|
|
||||||
- `fields`
|
- `pretty`
|
||||||
- `range`
|
|
||||||
|
|
||||||
TODO: Add epoll statistics and rest of the supported methods.
|
## Get all loaded modules
|
||||||
|
|
||||||
|
Retrieve information about all loaded modules.
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /maxscale/modules
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
|
||||||
|
`Status: 200 OK`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/maxscale/modules/"
|
||||||
|
},
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "qc_sqlite",
|
||||||
|
"type": "module",
|
||||||
|
"attributes": {
|
||||||
|
"module_type": "QueryClassifier",
|
||||||
|
"version": "V1.0.0",
|
||||||
|
"description": "Query classifier using sqlite.",
|
||||||
|
"api": "query_classifier",
|
||||||
|
"status": "Beta",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/modules/qc_sqlite"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "MySQLAuth",
|
||||||
|
"type": "module",
|
||||||
|
"attributes": {
|
||||||
|
"module_type": "Authenticator",
|
||||||
|
"version": "V1.1.0",
|
||||||
|
"description": "The MySQL client to MaxScale authenticator implementation",
|
||||||
|
"api": "authenticator",
|
||||||
|
"status": "GA",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"self": "http://localhost:8989/v1/modules/MySQLAuth"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Supported Request Parameter
|
||||||
|
|
||||||
|
- `pretty`
|
||||||
|
Reference in New Issue
Block a user