Cluster
curl -sSXPOST 'user:pass@node01:4200/_sql?pretty' -d '{"stmt":"select name from sys.cluster"}' | jq
{
"cols": [
"name"
],
"rows": [
[
"mycluster"
]
],
"rowcount": 1,
"duration": 0.653828
}
Health
curl -sSXPOST 'user:pass@node01:4200/_sql?pretty' -d '{"stmt":"select health,count(*) qty from sys.health group by health"}' | jq
{
"cols": [
"health",
"qty"
],
"rows": [
[
"GREEN",
24
]
],
"rowcount": 1,
"duration": 1.107071
}
Nodes
curl -sSXPOST 'user:pass@node01:4200/_sql?pretty' -d '{"stmt":"select hostname from sys.nodes order by hostname"}' | jq
{
"cols": [
"hostname"
],
"rows": [
[
"node01"
],
[
"node02"
],
[
"node03"
]
],
"rowcount": 3,
"duration": 2.470829
}
Allocation
curl -sSXPOST 'user:pass@node01:4200/_sql?pretty' -d '{"stmt":"select decisions[2]['\''node_name'\''] node,count(*) qty from sys.allocations group by decisions[2]['\''node_name'\'']"}' | jq
{
"cols": [
"node",
"qty"
],
"rows": [
[
"node01",
48
],
[
"node02",
48
],
[
"node03",
48
]
],
"rowcount": 3,
"duration": 8.945432
}