Cluster status

Cluster status

Returns the status of all nodes in the cluster with load parameters and additional information.

Request Structure:

http://<cluster>:<port>/api/cluster/status

Post data:

access_token = <access_token>

The response from the server:

{
 "msg": {
  "status": "OK",
  "errors": [],
  "nodes": {
   "node-2.docluster.com": {
    "config_version": 3,
    "cpu_percent": 1.8,
    "memory_percent": 24.3,
    "memory_available": "739.6M",
    "memory_used": "83.4M",
    "memory_total": "976.4M",
    "errors": [],
    "status": "success"
   },
   "node-3.docluster.com": {
    "config_version": 3,
    "cpu_percent": 1.6,
    "memory_percent": 23.7,
    "memory_available": "744.7M",
    "memory_used": "78.4M",
    "memory_total": "976.4M",
    "errors": [],
    "status": "success"
   },
   "node-4.docluster.com": {
    "config_version": 3,
    "cpu_percent": 1.6,
    "memory_percent": 23.7,
    "memory_available": "744.6M",
    "memory_used": "78.4M",
    "memory_total": "976.4M",
    "errors": [],
    "status": "success"
   }
  }
 },
 "status": "success",
 "error": ""
}

Errors:

-<X> MNG nodes are not online

Example:

import requests
import json

api_url = "http://<IP>:<PORT>/api/"
access_token = 'BLABLALBA'

path = 'cluster/status'
data = {}

def send(path, data):
    data['access_token'] = access_token
    send = requests.post(url=api_url + path, data=data)
    print(send.text)
    
send(path, data)

 


Revision #1
Created 6 May 2022 13:47:44 by Ruslan
Updated 6 May 2022 13:49:55 by Ruslan