Skip to content

RexConnectServer Response Format

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

Written for version 0.5.0.

JSON Responses

The RexConnectServer provides responses in the following JSON format:

{
  "i": "1234",
  "s": "9876",
  "t": 50,
  "e": null,
  "c": [
    {
      "i": "cmd-0",
      "t": 20,
      "e": null,
      "r": [
        {
          "TestId": 765,
          "Name": "My Test Node"
        },
        {
          "TestId": 766,
          "Name": "Another Node"
        }
      ]
    },
    {
      "i": "cmd-1",
      "t": 10,
      "e": null,
      "r": [
          "My Test Node",
          "Another Node"
      ]
    },
    {
      "i": "cmd-2",
      "t": 10,
      "k": 123,
      "e": null,
      "r": [
          765,
          766
      ]
    }
  ]
}

Documentation

The relevant Java classes are TcpResponse and TcpResponseCommand. Request properties:

  • String i -- The request ID; present if provided with the request.
  • String s -- The session ID; present when the request opens/continues a session without closing it.
  • long t -- The request's execution time, in milliseconds; present unless omitted via the request's option.
  • String e -- Information about an error or exception that occurs at the request level.
  • List<TcpResponseCommand> c -- The response data for each of the request's commands.
    • String i -- The command ID; present if provided with the request command.
    • long t -- The command's execution time, in milliseconds; present unless omitted via the request command's option.
    • int k -- The cache key for the cached information. This will be present for query commands which choose to cache their script string.
    • String e -- Information about an error or exception that occurs at the command level.
    • List<Object> r -- The list of command results; present unless omitted via the request command's option. This list supports various and/or mixed data types. For example, it might return a list of nodes in JSON format, a single string, and/or a list of strings.