Skip to content

RexConnectServer Request Format

Zach Kinstner edited this page Sep 3, 2013 · 6 revisions

Written for version 0.5.0.

JSON Requests

The RexConnectServer accepts TCP requests in the following JSON format:

{
  "i": "1234",
  "s": "9876",
  "o": 1,
  "c": [
    {
      "i": "cmd-0",
      "c": "query",
      "a": [
        "g.addVertex([TestId:765]);"
      ]
    },
    {
      "i": "cmd-1",
      "e": [ "cmd-0" ],
      "o": 3,
      "c": "query",
      "a": [
        "g.V.count();"
      ]
    }
  ]
}

Documentation

The relevant Java classes are TcpRequest and TcpRequestCommand. Request properties:

  • String i -- (Optional) The client's request ID, included with the response.
  • String s -- (Optional) The session ID to continue an open session across multiple responses.
  • Byte o -- (Optional) Request-level options. See the "Request Options" table below.
  • List<TcpRequestCommand> c -- The list of commands to execute.
    • String i -- (Optional) The command's ID, which is applied to the command response.
    • String[] e -- (Optional) The list of command IDs to check for conditional execution.
    • Byte o -- (Optional) Command-level options. See the "Command Options" table below.
    • String c -- The command to execute.
    • List<String> a -- The list of command arguments.

Options

To build a request/command "options" value, sum the desired options shown below. For example, to omit both timer and results from a command response, send the value 3 (0x01 + 0x02).

Request Options

Hex Number Option
0x01 1 Omit timer value from the request response.

Command Options

Hex Number Option
0x01 1 Omit timer value from the command response.
0x02 2 Omit results data from the command response.