API - JSON QueryAllTests

Overview

The QueryAllTests method allows a JSON RPC client to view the current status of all Test Runs in progress on the N2SVCD.

The following Test Runs will NOT be included:

  1. A Test Run which was previously Cancelled by a CancelTest.
  2. A Test Run for which a QueryTest was made after completion.

Note: The N2SVCD does not have a permanent record of Test Runs. If the N2SVCD process is restarted, then it all Test Runs in progress will be lost.

Request Parameters

The QueryAllTests method has no parameters.

Parameter Type Description
_[none]_

Example Request

Here is an example QueryAllTests request.

{
    "jsonrpc" : "2.0",
    "id" : 1,
    "method" : "QueryAllTests"
}

Successful Response

The QueryAllTests result is an object with the following attributes.

Attribute Type Description
time_now Array The "now" system time on the N2SVCD node.
[0] Integer The "now" epoch seconds.
[1] Integer The "now" epoch microseconds.
tests Array Array of objects, one for each test run in progress.

Each object in the tests array has a subset of the attributes that are returned for the QueryTest and CancelTest methods.

Attribute Type Description
run_id String The unique run identifier assigned to this run.
completed Integer 0 (completed) or 1 (in progress).
time_start Array Test run start time on the N2SVCD node.
[0] Integer The "time_start" epoch seconds.
[1] Integer The "time_start" epoch microseconds.
time_finish Array Test run start finish on the N2SVCD node (if the run is completed).
[0] Integer The "time_finish" epoch seconds.
[1] Integer The "time_finish" epoch microseconds.
duration Float Test run duration in seconds (if the run is completed).
counts Object Object with test instance counts.
.started Integer Number of instances started.
.finished Integer Number of instances finished (passed, failed, and aborted).
.failed Integer Number of instances completed with a failed non-mandatory check.
.aborted Integer Number of instances aborted by a failed mandatory check.
.cancelled Integer Number of instances cancelled by user-requested cancellation of the run.

Example Successful Response

Here is a possible successful QueryAllTests response.

{
    "jsonrpc" : "2.0",
    "id" : "2",
    "result" : {
        "time_now" : [
            1389735579,
            109988
        ],
        "tests" : [
            {
                "run_id" : "tr_3869",
                "completed" : 1,
                "time_start" : [
                    1389735566,
                    218548
                ],
                "time_finish" : [
                    1389735566,
                    224129
                ],
                "counts" : {
                    "started" : 1,
                    "finished" : 1,
                    "failed" : 0,
                    "aborted" : 0,
                    "cancelled" : 0
                }
            },
            {
                "run_id" : "tr_9146",
                "completed" : 1,
                "time_start" : [
                    1389735579,
                    105764
                ],
                "time_finish" : [
                    1389735579,
                    109644
                ],
                "counts" : {
                    "started" : 1,
                    "finished" : 1,
                    "failed" : 0,
                    "aborted" : 0,
                    "cancelled" : 0
                }
            }
        ]
    }
}