Skip to main content

Create cluster

To create a new cluster, you need to log in.

Request Structure:

http://<cluster>:<port>/api/claster/create

Post data:

access_token = <access_token>

The response from the server:

{
 "msg": "Cluster created successfully",
 "status": "success",
 "error": ""
}

Errors:

-cluster already created

Example:

import requests
import json

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

path = 'cluster/create'
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)