The basic format of a request message is like following:
{
"id" : "<ID of the message>",
"type" : "<Type of the message>",
"replyTo" : "<Route to the receiver>",
"dataset" : "<Name of the target dataset>",
"body" : <Body of the message>
}
idtypereplyTo<hostname>:<port>/<tag>, for example: localhost:24224/output.replyTo, then the response message will be thrown away.datasetbodynull.The basic format of a response message is like following:
{
"type" : "<Type of the message>",
"inReplyTo" : "<ID of the related request message>",
"statusCode" : <Status code>,
"body" : <Body of the message>,
"errors" : <Errors from nodes>
}
typeinReplyTostatusCodeStatus codes of responses are similar to HTTP’s one. Possible values:
200 and other 2xx statusesbodynull.errorsThis information will appear only when the command is distributed to multiple volumes and they returned errors. Otherwise, the response message will have no errors field. For more details, see the “Error response” section.
Some commands can return an error response.
An error response has the type same to a regular response, but it has different statusCode and body. General type of the error is indicated by the statusCode, and details are reported as the body.
If a command is distributed to multiple volumes and they return errors, then the response message will have an error field. All errors from all nodes are stored to the field, like:
{
"type" : "add.result",
"inReplyTo" : "...",
"statusCode" : 400,
"body" : {
"name": "UnknownTable",
"message": ...
},
"errors" : {
"/path/to/the/node1" : {
"statusCode" : 400,
"body" : {
"name": "UnknownTable",
"message": ...
}
},
"/path/to/the/node2" : {
"statusCode" : 400,
"body" : {
"name": "UnknownTable",
"message": ...
}
}
}
}
In this case, one of all errors will be exported as the main message body, as a representative.
Status codes of error responses are similar to HTTP’s one. Possible values:
400 and other 4xx statuses500 and other 5xx statusesThe basic format of the body of an error response is like following:
{
"name" : "<Type of the error>",
"message" : "<Human readable details of the error>",
"detail" : <Other extra information for the error, in various formats>
}
If there is no detail, detial can be missing.
There are some general error types for any command.
MissingDatasetParameterdataset. The status code is 400.UnknownDataset404.UnknownTypetype. The status code is 400.