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,
"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": 3,
"backend_read_timeout": 3,
"backend_write_timeout": 3,
"cooperative_monitoring_locks": "none",
"demotion_sql_file": null,
"detect_replication_lag": false,
"detect_stale_master": null,
"detect_stale_slave": null,
"detect_standalone_master": null,
"disk_space_check_interval": 0,
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all",
"failcount": 5,
"failover_timeout": 90,
"handle_events": true,
"ignore_external_masters": false,
"journal_max_age": 28800,
"maintenance_on_low_disk_space": true,
"master_conditions": "primary_monitor_master",
"master_failure_timeout": 10,
"module": "mariadbmon",
"monitor_interval": 5000,
"password": "*****",
"promotion_sql_file": null,
"replication_master_ssl": false,
"replication_password": null,
"replication_user": null,
"script": null,
"script_max_replication_lag": -1,
"script_timeout": 90,
"servers_no_promotion": null,
"slave_conditions": "none",
"switchover_on_low_disk_space": false,
"switchover_timeout": 90,
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 3
},
"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,
"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": 3,
"backend_read_timeout": 3,
"backend_write_timeout": 3,
"cooperative_monitoring_locks": "none",
"demotion_sql_file": null,
"detect_replication_lag": false,
"detect_stale_master": null,
"detect_stale_slave": null,
"detect_standalone_master": null,
"disk_space_check_interval": 0,
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all",
"failcount": 5,
"failover_timeout": 90,
"handle_events": true,
"ignore_external_masters": false,
"journal_max_age": 28800,
"maintenance_on_low_disk_space": true,
"master_conditions": "primary_monitor_master",
"master_failure_timeout": 10,
"module": "mariadbmon",
"monitor_interval": 5000,
"password": "*****",
"promotion_sql_file": null,
"replication_master_ssl": false,
"replication_password": null,
"replication_user": null,
"script": null,
"script_max_replication_lag": -1,
"script_timeout": 90,
"servers_no_promotion": null,
"slave_conditions": "none",
"switchover_on_low_disk_space": false,
"switchover_timeout": 90,
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 3
},
"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/start