ScreenLock from WebAPI and CLI
-
Hey guys, a few days ago I started testing Veyon and its features. I was mainly interested in testing the web API and the veyon-cli, and I've been trying them out.
My goal was to be able to lock a computer screen in the lab from the admin. However, I can't get it to work. The CLI command 'veyon-cli feature start ScreenLock <host address>' tells me that the feature name or UID is incorrect (I also tried the UID from the 'veyon-cli feature show' command). So I decided to try the web API. The problem I have with the API is that the documentation apparently doesn't mention how to specify the host to lock the screen on.Estaba probando la api con el siguiente codigo de python (es solo de prueba):
from flask import Flask, request, jsonify import requests app = Flask(__name__) VEYON_API_URL = "http://localhost:11080/api/v1" ConnectionUID = "" # Autenticaci贸n @app.route("/authentication", methods=["GET"]) def authentication(): global ConnectionUID data = { "method": "0c69b301-81b4-42d6-8fae-128cdd113314", "credentials": { "keyname": "admin_key", "keydata": read_private_key() } } response = requests.post(f"{VEYON_API_URL}/authentication/localhost", json=data) ConnectionUID = response.json()["connection-uid"] # print(ConnectionUID) return jsonify(response.json()), response.status_code # Iniciar una funci贸n (Ejemplo: ScreenLock) @app.route("/get_features", methods=["GET"]) def get_features(): global ConnectionUID headers = { "Connection-Uid": ConnectionUID } response = requests.get(f"{VEYON_API_URL}/feature", headers=headers) return jsonify(response.json()), response.status_code # Iniciar una funci贸n (Ejemplo: ScreenLock) @app.route("/screen_lock", methods=["POST"]) def screen_lock(): global ConnectionUID headers = { "Connection-Uid": ConnectionUID } data = request.json response = requests.put(f"{VEYON_API_URL}/feature/ccb535a2-1d24-4cc1-a709-8b47d2b2ac79", headers=headers, json=data) return jsonify(response.json()), response.status_code # Lectura de la private key def read_private_key(): with open("admin_key_private_key.pem", "r") as file: return file.read() if __name__ == "__main__": app.run(debug=True, port=3000)Docs:

I'm using veyon 4.9.4 and I'd like to know what I'm doing wrong or if I'm misunderstood that these functions can be performed from the admin. Thank you for your help in advance.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 馃挆
Register Login