async fn scale(
    State(app): State<App>,
    Json(payload): Json<ScaleRequest>,
) -> Result<Json<ScaleResponse>, AppError> {
    let handles: Vec<_> = payload
        .deployments
        .into_iter()
        .map(|d| {
            let s = app.scaler.clone();
            tokio::spawn(async move {
                match s.scale(&d.namespace, &d.name, d.size).await {
                    Ok(()) => "".to_string(),
                    Err(err) => err.to_string(),
                }
            })
        })
        .collect();

    let scale_result = future::join_all(handles)
        .await
        .into_iter()
        .map(Result::unwrap)
        .collect();
    Ok(Json(ScaleResponse { scale_result }))
}
To test or force scale in particular cluster use:
$ curl -X POST -H "Content-Type: application/json" --data '{"deployments": [{"namespace": "prover-red", "name": "witness-vector-generator-spec-9-f", "size":0},{"namespace": "prover-red", "name": "witness-vector-generator-spec-9-c", "size":0}]}' <ip>:8081/scale
prover/crates/bin/prover_autoscaler/src/agent.rs