Kuksa VISS Client
kuksa.val is a part of the opensource project eclipse kuksa.
More about kuksa.val can be found under the root README.md.
Installation
pip install kuksa-viss-client
Test client
kuksa_viss_client is a command-line test client.
After you have installed the kuksa-viss-client package via pip you can run the test client directly by executing
$ kuksa_viss_client
The jwt tokens for testing can either be found under kuksa_certificates/jwt or you can also use following command inside kuksa_viss_client to find the via pip installed certificate directory.
Test Client> printTokenDir
Refer help for further information
VSS Client> help -v
Documented commands (use 'help -v' for verbose/'help <topic>' for details):
Communication Set-up Commands
================================================================================
authorize Authorize the client to interact with the server
connect
disconnect Disconnect from the VSS Server
getServerAddress Gets the IP Address for the VSS Server
setServerAddress Sets the IP Address for the VSS Server
Info Commands
================================================================================
info Show summary info of the client
printTokenDir Show token directory
version Show version of the client
Kuksa Interaction Commands
================================================================================
getMetaData Get MetaData of the path
getValue Get the value of a path
setValue Set the value of a path
updateMetaData Update MetaData of a given path
updateVISSTree Update VISS Tree Entry
Using the testclient, it is also possible to update and extend the VSS data structure. More details can be found here.
Docker
You can build a docker image of the testclient using the Dockerfile. Not the most effcient way to pack a small python script, but it is easy to get started. The Dockerfile needs to be executed on the parent directory (so it include the needed certificates and pip package configuration).
To run the builded image:
docker run --rm -it --net=host <image-id-from docker-build>
--rm ensures we do not keep the docker continer lying aroind after closing the vss-testclient and --net=host makes sure you can reach locally running kuksa.val-server or kuksa-val docker with port forwarding on the host using the default 127.0.0.1 address.
Python SDK
If you would like to develop your own kuksa.val client,
you can use the python sdk to interact with the kuksa.val server in a very easy way.
Usage
import the sdk
>>> import kuksa_viss_client
>>> kuksa_viss_client.__version__
'<your version, e.g. 0.1.7>'
Setup a thread to connect with the kuksa.val server.
The following properties for the connection can be configured:
ipdefault: "127.0.0.1"portdefault: 8090insecuredefault:Falsecacertificatedefault: "../kuksa_certificates/CA.pem"certificatedefault: "../kuksa_certificates/Client.pem"keydefault: "../kuksa_certificates/Client.key"
>>> config = {}
>>> client = kuksa_viss_client.KuksaClientThread(config)
>>>
>>> # Start the client thread to connect with configured server
>>> client.start()
>>>
>>> # Close the connection and stop the client thread
>>> client.stop()
You have the following methods to interact with the kuksa.val server:
# Do authorization by passing a jwt token or a token file
def authorize(self, token, timeout = 2)
# Update VISS Tree Entry
def updateVISSTree(self, jsonStr, timeout = 5)
# Update Meta Data of a given path
def updateMetaData(self, path, jsonStr, timeout = 5)
# Get Meta Data of a given path
def getMetaData(self, path, timeout = 1)
# Set value to a given path
def setValue(self, path, value, timeout = 1)
# Get value to a given path
def getValue(self, path, timeout = 5)
# Subscribe value changes of to a given path.
# The given callback function will be called then, if the given path is updated:
# updateMessage = await webSocket.recv()
# callback(updateMessage)
def subscribe(self, path, callback, timeout = 5)
Metadata
Release files for kuksa-viss-client 0.1.8.post77
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kuksa_viss_client-0.1.8.post77.tar.gz | 2.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kuksa_viss_client-0.1.8.post77-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.4 MB
Release files / kuksa_viss_client-0.1.8.post77.tar.gz
| Download URL | kuksa_viss_client-0.1.8.post77.tar.gz |
|---|---|
| Size | 2.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a3f1eef6bba8c3e09628e04a237221c5df9df9ca22fedc398ac5b33e07d6dd3
|
|
BLAKE2b-256 checksum How to use checksums |
55555997ba382710f06d3b3334523be30e6ac6119a8b3c3dd7a1e555cc635f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / kuksa_viss_client-0.1.8.post77-py3-none-any.whl
| Download URL | kuksa_viss_client-0.1.8.post77-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6657a974439dbfa1069e2cc237e9fff05aad0748b371b0372d89fa571f4d7f2
|
|
BLAKE2b-256 checksum How to use checksums |
bf46009a8b6e74dae1b25cbbbf4ca0382d727b19de01734f8df932f2aa627ea2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|