Skip to main content

update_policy

Function update_policy 

Source
async fn update_policy(
    __arg0: State<Arc<SharedState>>,
    __arg1: Path<String>,
    __arg2: Json<PolicyConfig>,
) -> impl IntoResponse
Expand description

PUT /api/policies/{name} — upserts a policy from the JSON body (the path name overrides any name in the body), then revalidates and recompiles all route graphs. Returns {"status": "updated"} on success.

Errors: 400 Bad Request if the resulting configuration fails validation/recompilation (the previous compiled routes stay active).