Skip to main content

api

REST API for querying simulation data and controlling the datacenter topology.

Access

URLDescription
http://localhost:3001/docsAPI Documentation (Swagger)
http://localhost:3001/redocAPI Documentation (ReDoc)
http://localhost:3001/healthHealth check endpoint

Endpoints

GET /health

Service health status.

GET /api/power

Query aligned power data from simulation and actual consumption.

Parameters:

NameTypeDefaultDescription
interval_secondsint60Sampling interval
start_timedatetime-Start time filter (optional)

Returns: Timeseries of timestamp, simulated_power, actual_power

GET /api/carbon_emission

Query carbon emission data based on power draw and grid carbon intensity.

Parameters:

NameTypeDefaultDescription
interval_secondsint60Sampling interval
start_timedatetime-Start time filter (optional)

Returns: Timeseries of timestamp, carbon_emission

PUT /api/topology

Update the simulated datacenter topology.

Publishes the new topology to sim.topology Kafka topic. The simulator will use this topology for future simulations.

Data Sources

The API reads from:

  • data/<RUN_ID>/simulator/agg_results.parquet - Simulation results
  • workload/<WORKLOAD>/consumption.parquet - Actual power data

Logs

make logs-api