Skip to main content

Automation

Peresvet ST can be integrated into repeatable tests and CI/CD: scripts can copy, start, and stop tasks without rebuilding each scenario manually in the web interface.

REST API

The complete controller HTTP request reference is published separately in the API documentation.

The API is available on the controller port, usually 8080, and uses JWT authentication (a token in cookies after sign-in). It exposes the same operations as the UI for tasks, agents, networks, users, and groups. Any HTTP client can be used, including curl, Postman, or Python requests.

Python Automation

For repeatable testing, export a task as a Python archive. The archive contains the selected task configuration and a ready-to-use REST API client that can create a copy of the task, start it, stop it, or wait for completion without manual configuration in the web interface.

To export, open Parameters → Export Task to Python on the task page. The controller downloads an archive named peresvet-st-task-<ID>-python.zip. To move a task with its library dependencies but without scripts, see Report Export and Task Import.

The archive contains:

FilePurpose
task_config.jsonTask configuration prepared for creating a new task through the API
client.pySmall Python client for authentication and task operations
run.pyCommand-line wrapper for common actions: create, update, start, stop, wait for completion, and retrieve task state
requirements.txtPython client dependencies
metadata.jsonSource task and export-time metadata

Minimal working-directory setup:

mkdir peresvet-st-task-6168-python
unzip peresvet-st-task-6168-python.zip -d peresvet-st-task-6168-python
cd peresvet-st-task-6168-python

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Before running the client, specify the controller URL and credentials of a user authorized to create and start tasks:

export SYSTEM_TRACE_URL="http://controller.example:8080"
export SYSTEM_TRACE_EMAIL="user@example.com"
export SYSTEM_TRACE_PASSWORD="password"

Example of a complete workflow that creates a task from the exported configuration, starts it immediately, and waits for a final status:

python run.py create --start --wait

Individual commands can be used in pipelines or external scripts:

python run.py create
python run.py start 123 --wait
python run.py stop 123
python run.py finish 123
python run.py get 123

If credentials cannot be stored in environment variables, pass them as command options:

python run.py --base-url "http://controller.example:8080" \
--email "user@example.com" \
--password "password" \
create --start --wait

The Python export uses the same public REST API as the web interface (API reference). The archive does not contain passwords or access tokens; authentication occurs when the script starts. You can also download the archive directly through GET /v1/tasks/{id}/export/python. The response is a ZIP file containing the same scripts and task configuration.