The REST API provides easy access to view the cluster topology, as shown in the following example
GET 'https://localhost:8090/api/v2/manager/cluster/topology'
The response will be wrapped inside a ClusterTopologyPayload and look something like the following:
{
"payloadType": "ClusterTopologyPayload",
"payloadVersion": "1",
"payload": {
"topology": "CLUSTERED_MASTER_SLAVE",
"name": "usa",
"services": [
{
"name": "east",
"role": "slave",
"datasources": [
{
"name": "db4",
"role": "relay"
},
{
"name": "db5",
"role": "slave"
},
{
"name": "db6",
"role": "slave"
}
]
},
{
"name": "west",
"role": "master",
"datasources": [
{
"name": "db1",
"role": "master"
},
{
"name": "db2",
"role": "slave"
},
{
"name": "db3",
"role": "slave"
}
]
}
],
"routers": [
{
"name": "db1",
"connections": {
"active": 0,
"created": 0
}
},
{
"name": "db2",
"connections": {
"active": 0,
"created": 0
}
},
{
"name": "db3",
"connections": {
"active": 0,
"created": 0
}
},
{
"name": "db4",
"connections": {
"active": 0,
"created": 0
}
},
{
"name": "db5",
"connections": {
"active": 0,
"created": 0
}
},
{
"name": "db6",
"connections": {
"active": 0,
"created": 0
}
}
]
}
}
It's also possible to omit the routers from the topology output, using the following call:
GET https://localhost:8090/api/v2/manager/cluster/topology?includeRouters=no