Validate your first scenario¶
Install RAES, validate a small SDL file, and print its name. You need Python 3.11 or newer.
Install RAES¶
Create a virtual environment and install the published package:
python -m venv .venv
source .venv/bin/activate
python -m pip install raes
On Windows PowerShell, activate the environment with
.venv\Scripts\Activate.ps1.
Save the scenario¶
Copy this file to first-scenario.sdl.yaml:
name: first-scenario
description: A small network with one Linux host.
nodes:
lab-network:
type: Switch
web:
type: VM
os: linux
resources:
ram: 2 GiB
cpu: 1
infrastructure:
lab-network:
count: 1
properties:
cidr: 10.0.0.0/24
gateway: 10.0.0.1
web:
count: 1
links:
- lab-network
The nodes section declares the network and host. The infrastructure
section asks a backend for one instance of each and links the host to the
network.
Validate the file¶
Run:
python - <<'PY'
from pathlib import Path
from raes import parse_sdl_file
scenario = parse_sdl_file(Path("first-scenario.sdl.yaml"))
print(f"Validated {scenario.name} with {len(scenario.nodes)} nodes.")
PY
If validation succeeds, the command prints:
Validated first-scenario with 2 nodes.
RAES has checked the file’s structure and current semantic rules. It has not created infrastructure. Continue with the first-scenario tutorial to inspect and format the scenario.