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>",
"timeout" : <Seconds to wait for the result>,
"targetRole" : "<Name of the target role>",
"body" : <Body of the message>
}
id
type
replyTo
<hostname>:<port>/<tag>
, for example: localhost:24224/output
.replyTo
, then the response message will be thrown away.dataset
timeout
0.5
.60
(means one minute)targetRole
targetRole
or the special value "any"
will be processed by the receiver node with any role.null
, "any"
, or one of following role:
"service-provider"
"absorb-source"
"absorb-destination"
null
body
null
.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>
}
type
inReplyTo
statusCode
Status codes of responses are similar to HTTP’s one. Possible values:
200
and other 2xx
statusesbody
null
.errors
This 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.
MissingDatasetParameter
dataset
. The status code is 400
.UnknownDataset
404
.UnknownType
type
. The status code is 400
.