API - JSON CancelTest

Overview

The CancelTest method allows a JSON RPC client to cancel a Test Run which is currently executing on the N2SVCD.

The following Test Runs can NOT be cancelled:

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

Request Parameters

The CancelTest method has a single parameter:

Parameter Type Description
run_id String The Test Run ID of a previously started Test Run.

Example Request

Here is an example CancelTest request.

{
    "jsonrpc" : "2.0",
    "id" : 1,
    "method" : "CancelTest",
    "params" : {
        "run_id" : "tr_9538"
    }
}

Successful Response

The CancelTest result is an object with the same structure as the response from the QueryTest, with one additional optional top-level attribute.

Attribute Type Description
* * _All attributes as per the QueryTest response.
cancelled Integer 1 (run was cancelled), or 0 (run had already completed).

Please refer to the QueryTest documentation for the full list and description of other response attributes.

Note: A test instance may be counted as both “failed” and “cancelled” if a non-mandatory check failed and the instance was cancelled before completing.

Example Successful Response

Here is a possible successful CancelTest response.

{
    "jsonrpc" : "2.0",
    "id" : "2",
    "result" : {
        "run_id" : "tr_6081",
        "completed" : 1,
        "cancelled" : 1,
        "time_now" : [
            1389739798,
            462224
        ],
        "time_start" : [
            1389739798,
            454215
        ],
        "time_finish" : [
            1389739798,
            462214
        ],
        "duration" : 0.007999,
        "counts" : {
            "started" : 1,
            "finished" : 1,
            "aborted" : 0,
            "failed" : 0,
            "cancelled" : 1
        },
        "first_call_summary" : {
            "time_start" : [
                1389739798,
                454379
            ],
            "idx" : "0",
            "time_finish" : [
                1389739798,
                462145
            ],
            "duration" : 0.007766
        },
        "first_fails" : [],
        "first_aborts" : [],
        "globals" : {},
        "buckets" : [
            {
                "num_calls_started" : 1,
                "num_calls_finished" : 1
            }
        ]
    }
}