def get_official_client(username, password):
    """
    Get official vantage6 client.

    :param username:
    :param password:
    :return:
    """
    client = Client(_HOST, _PORT)
    client.authenticate(username, password)
    client.setup_encryption(None)

    return client
        # print the results per node
        for result in results:
            node_id = result.get("node")
            print("-" * 80)
            print(f"Results from node = {node_id}")
            print(result.get("result"))


# central server configuration
host = "http://192.168.37.1"
port = 5000
collaboration_id = 3

# 1. authenticate to the central server
client = Client(host=host, port=port, path="/api")
client.setup_encryption(None)
client.authenticate("root", "admin")

# 2. connect to websocket interface
bearer_token = client.token
socket = SocketIO(host,
                  port=port,
                  headers={"Authorization": f"Bearer {bearer_token}"})

# subscribe to the websocket channel.
taskNamespace = socket.define(TasksNamespace, "/tasks")
taskNamespace.emit("join_room", f"collaboration_{collaboration_id}")

# input for the dsummary Docker image (algorithm)
input_ = {
    "master": "true",
Exemple #3
0
 def setup_client() -> Client:
     client = Client(HOST, PORT)
     client.authenticate(FAKE_USERNAME, FAKE_PASSWORD)
     client.setup_encryption(None)
     return client