Skip to content

Session Control API

Martin Konopka edited this page Apr 23, 2018 · 3 revisions

Get current recording details

GET /api/session/recording

Returns details about the current recording, if it is running, including:

  • State of the current recording: None, Open, Preparing, Running, Processing, Completed.
  • Id of the recording - used for data access.
  • Timestamp when the recording started.
  • Current step of the recording.
  • Session Definition used to start the recording

Request

  • Parameters: None.
  • Body: None.

Response

Examples

Example 1: Session recording is running and was started from the example session definition.

$ curl -X GET http://localhost:55555/api/session/recording/ 

{
    "id": "2018-03-31T04_03_11",
    "state": "Running",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "LaunchProgram",
    "definition": { /* Session Definition object */ }
}

Example 2: No session recording is running.

$ curl -X GET http://localhost:55555/api/session/recording/ 

null

Get current recording status

GET /api/session/recording/status

Returns only the status of the current recording, if it is running. If no recording is running, informs about no recording running.

Request

  • Parameters: None.
  • Body: None.

Response

Examples

Session recording is running and was started from the example session definition.

$ curl -X GET http://localhost:55555/api/session/recording/status

"Running"

Get current recording identifier

GET /api/session/recording/id

Returns only the identifier of the current recording, if it is running. If no recording is running, returns null. Identifier is used for accessing data during and after the recording.

Request

  • Parameters: None.
  • Body: None.

Response

Examples

Session recording is running and was started from the example session definition.

$ curl -X GET http://localhost:55555/api/session/recording/id 

"2018-03-31T04_03_11"

Start new recording

POST /api/session/recording/open

Starts a new session recording from the definition sent in the request. If another recording is already running, it is stopped and overwritten with this new recording.

Request

Response

  • SessionRecordingInfo object with information about newly open recording, if the definition was valid. If there is Welcome step defined for the recording, the session will be in Open state after opening. But, if Welcome step is ignored, it will automatically transition to the Preparing state; or Recording state, if no Pre-Session steps are defined.

Examples

Start new recording with sample session definttion.

$ curl -X POST \ 
       -H 'Content-Type: application/json' \
       --data '{ /* Session Definition JSON */ }' \
       http://localhost:55555/api/session/recording/open

{
    "id": "2018-03-31T04_03_11",
    "state": "Open",
    "startedAt": "2018-03-31T04:03:13.2172596",
    "isFinished": false,
    "currentStep": "LaunchProgram",
    "definition": { /* Session Definition object */ }
}

Stop recording

POST /api/session/recording/clear

Stops the current recording, if is running.

Request

  • Parameters: None.
  • Body: None.

Response

Empty.

Examples

$ curl -X POST \
       --data '' \
       http://localhost:55555/api/session/recording/clear
Clone this wiki locally