The client control API gives the user the ability to apply different commands
to connected clients (e.g. disconnect a client). These commands can be requested
via the plugins control API. A controlling client can publish requests to
$CONTROL/cedalo/client-control/v1
and the related response message will be published
by the plugin on $CONTROL/cedalo/client-control/v1/response
.
Note: Using this plugin requires a valid license. All commands will return an error if it is expired or could not be read.
Accepts the following message:
Example of an disconnectClient request.
{
"commands": [
{
"command": "disconnectClient",
"clientid": "my-client",
"correlationData": "716cc776-d044-4772-b991-d9b55e2e034c"
}
]
}
Examples of an subscribeClient request.
{
"commands": [
{
"command": "subscribeClient",
"clientid": "my-client",
"topic": "/sensors/1/#",
"qos": 0,
"options": {
"no_local": false,
"retain_as_published": false,
"send_retain": "always"
},
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152"
}
]
}
{
"commands": [
{
"command": "unsubscribeClient",
"clientid": "my-client",
"topic": "/sensors/1/#",
"correlationData": "37a6e977-2b4f-4431-83f7-5bd93b35c152"
}
]
}
Accepts the following message:
{
"responses": [
{
"command": "disconnectClient",
"data": {},
"correlationData": "716cc776-d044-4772-b991-d9b55e2e034c"
}
]
}
{
"responses": [
{
"command": "subscribeClient",
"data": {},
"correlationData": "716cc776-d044-4772-b991-d9b55e2e034c"
}
]
}
{
"responses": [
{
"command": "unsubscribeClient",
"data": {},
"correlationData": "716cc776-d044-4772-b991-d9b55e2e034c"
}
]
}
Example of an error response message.
{
"responses": [
{
"command": "disconnectClient",
"error": "Client not found",
"correlationData": "716cc776-d044-4772-b991-d9b55e2e034c"
}
]
}
This is an optional value to be able to identify the relation between request and response. The plugin will add the provided value in the response message.