System config
get|save|read config
get - Returns the current configuration
save - Writes the configuration to a file and changes the configuration number to 1 up. Returns the current configuration
read - Read a configuration from a file. Returns the current configuration.
Request Structure:
http://<cluster>:<port>/api/system/config/<get|save|read>
Post data:
access_token = <access_token>
The response from the server:
{
"msg": {
"version": 2,
"system": {
"users": {
"admin": {
"password": "21232f297a57a5a743894a0e4a801fc3"
}
}
},
"cluster": {
"name": "DoCluster",
"nodes": {
"node-2.docluster.com": {
"machine": "x86_64",
"API_key": "ippowcalrksmufirthcntewujgndhy",
"MNG_IP": "192.168.129.82"
},
"node-3.docluster.com": {
"machine": "x86_64",
"API_key": "ikdeiwnlhtswnxxuybfssxzoknhiyb",
"MNG_IP": "192.168.129.83"
},
"node-4.docluster.com": {
"machine": "x86_64",
"API_key": "rwlozmuxekgqxahwzxsenbdmgaejvy",
"MNG_IP": "192.168.129.84"
}
}
},
"quorum": {
"nodes": [
"node-2.docluster.com",
"node-3.docluster.com",
"node-4.docluster.com"
]
}
},
"status": "success",
"error": ""
}
{
"version": 2,
"system": {
"users": {
"admin": {
"password": "21232f297a57a5a743894a0e4a801fc3"
}
}
},
"cluster": {
"name": "DoCluster",
"nodes": {
"node-2.docluster.com": {
"machine": "x86_64",
"API_key": "ippowcalrksmufirthcntewujgndhy",
"MNG_IP": "192.168.129.82"
},
"node-3.docluster.com": {
"machine": "x86_64",
"API_key": "ikdeiwnlhtswnxxuybfssxzoknhiyb",
"MNG_IP": "192.168.129.83"
},
"node-4.docluster.com": {
"machine": "x86_64",
"API_key": "rwlozmuxekgqxahwzxsenbdmgaejvy",
"MNG_IP": "192.168.129.84"
}
}
},
"quorum": {
"nodes": [
"node-2.docluster.com",
"node-3.docluster.com",
"node-4.docluster.com"
]
}
}
Errors:
Example:
import requests
import json
api_url = "http://<IP>:<PORT>/api/"
access_token = 'BLABLALBA'
path = 'system/config/<get|save|read>'
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)