Service commands
Introduction
Service commands are used to manage the agent, receive logs, update, etc. These commands
- Created based on user actions in the White Server administrative panel or by the White Server task scheduler
- Have the same structure as requests from the aggregator to the agent
- They are displayed in the White Server administrative panel in the same way as tasks from aggregators.
The agent sends a GetTask method request via RPC (remote procedure call) and receives a service task in response. After preparing the answer, the agent sends it via RPC using AnswerTask.
Example of interaction:
- The aggregator sent a CancelOrder request
- The agent will retrieve the params data array from this request via the GetTask operation
- The agent will return the response via the AnswerTask
- From AnswerTask, the contents of the taskResponse array will go to the aggregator in an asynchronous response, to the taskResponse data array as well.
RPC
RPC is a remote procedure call. A common url is used for sending requests for agents and monitors — https://{{serverName}}/wsagent/api/v2/agents/rpc
RPC Request Structure
The structure of requests from agents and monitors is the same, as are the server responses.
Request format
JSON
|
Parameter | Type | Mandatory | Description |
---|---|---|---|
taskType | string | yes | Task type. It can be
|
params | no | Payload data array. Corresponds to the params request model for the aggregator. |
Successful response:
JSON
|
Response with error
JSON
|
GetTask
GetTask — task receiving type.
Parameter | Type | Mandatory | Description |
---|---|---|---|
Parameter | Type | Mandatory | Description |
-taskGuid | guid | yes | Unique code for this task. Used when receiving a task via the queue |
-taskType | string enum | yes | Task type |
-objectId | int | no | Restaurant code in the licensing system:
|
-pluggedSystemId | string | no | The identifier of the system being plugged in, such as the NetName of the r_keeper server. Taken from the pluggedSystems:systemName field in the response to the GetAgentInfo model |
-timeout | int | no | Agent response time in seconds |
-aggregatorId | int | no | The code of the aggregator in the licensing system that created the task |
-params | json object | no | The data array corresponds to the params request model for the aggregator |
AnswerTask
AnswerTask — the type of task that returns the answer.
JSON
{
"rpcTaskType":"AnswerTask",
"params":{
"taskGuid":"guid",
"taskResponse":{
}
}
}
{
"rpcTaskType": "AnswerTask"
}
JSON
{
"result": {
}
}
JSON
{
"error": {
"wsError": {
"code": "string",
"text": "string"
}
}
}