Quorum nodes

To add or remove cluster nodes to the quorum.

add node

Request Structure:

http://<cluster>:<port>/api/quorum/add

Post data:

access_token = <access_token>
node = <node-name>

The response from the server:

{
 "msg": {},
 "status": "success",
 "error": ""
}

Errors:

-node already in quorum
-node is not in cluster

Example:

import requests
import json

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

path = 'quorum/nodes/add'
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)

 

delete node

Request Structure:

http://<cluster>:<port>/api/quorum/delete

Post data:

access_token = <access_token>
node = <node-name>

The response from the server:

{
 "msg": {},
 "status": "success",
 "error": ""
}

Errors:

-can not delete master node
-node is not in cluster
-node is not in quorum

Example:

import requests
import json

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

path = 'quorum/nodes/delete'
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:51:50 by Ruslan
Updated 6 May 2022 14:02:29 by Ruslan