eda-ws-client Script that initiates an insecure WebSocket connection to EDA, periodically sending messages at a defined interval to retrieve telemetry data from EDB.
The intention of this script is not to duplicate the edactl query features and or provide a full e2e application, this script is just for educational and demo purpose.
- Go version 1.22 or higher (may work with other versions)
- Tested on EDA 24.12.1/2 (using new Keycloak authentication)
- Linux machine (can be compiled for other operating systems)
git clone <repository_url>
cd eda-ws-clientModify the variables in config.json to match your setup. Pay special attention to:
serverURL,authURL, andapiBaseURL:<EDA_IP>:<Port>client_secret: Can be obtained from Keycloak. For more details on obtaining the Keycloak secret, refer to the official documentation.usernameandpassword: Your authentication credentials.namespace: Define the namespace.query: Define any EQL query you want to retrieve.messageinterval: How often telemetry data should be queried in seconds.
{
"serverURL": "wss://<EDA-IP>:<EDA-PORT>/events",
"authURL": "https://<EDA-IP>:<EDA-PORT>/core/httpproxy/v1/keycloak/realms/eda/protocol/openid-connect/token",
"username": "<EDA-USERNAME>",
"password": "<EDA-PASWD>",
"apiBaseURL": "https://<EDA-IP>:<EDA-PORT>core/query/v1/eql",
"query": ".namespace.node.srl.interface.traffic-rate where (.namespace.node.name = 'leaf1' and .namespace.node.srl.interface.name = 'ethernet-1/1')",
"client_id": "eda",
"client_secret": "<EDA-CLIENT>",
"messageinterval": 0.5
}go run client.goThe output will be displayed in the terminal screen.