Faults
See Chaos and faults for what each rule field does. Changing faults needs the admin role.
| Call | What it does |
|---|---|
GET /api/faults | The universe’s rules, in order. |
PUT /api/faults | Replaces all rules with the list you send. Answers with the rules. |
GET /api/faults/scenarios | The scenario library: each with id, provider, name, description and its rule. |
POST /api/faults/scenarios/{id} | Adds that scenario as an enabled rule at the end of the list. Optional body: {"match": "@yourcompany.test", "window": {…}}. Answers with all rules. 404 for an unknown scenario. |
A rule:
{ "name": "Thursday outage", "kind": "error", "stage": "rcpt", "match": "@harbor.test", "rate": 1, "code": 451, "enhanced": "4.3.2", "message": "System not accepting network messages", "delay_ms": 0, "window": { "days": "thu", "from": "14:00", "to": "15:00", "tz": "America/Chicago" }, "enabled": true}Rules added from a scenario also carry scenario, its id.
With the SDKs:
| Call | JavaScript | Python |
|---|---|---|
GET /api/faults | mail.faults.list() | mail.faults.list() |
PUT /api/faults | mail.faults.set(rules), mail.faults.clear() | mail.faults.set(rules), mail.faults.clear() |
GET /api/faults/scenarios | mail.faults.scenarios() | mail.faults.scenarios() |
POST /api/faults/scenarios/{id} | mail.faults.add(FaultScenario.GmailRate, { match }) | mail.faults.add(FaultScenario.GMAIL_RATE, match=…) |
FaultKind, FaultStage and FaultScenario name the values of kind, stage and scenario.
Greylisting, rate limits, drops, windows and scenarios need the chaos profiles feature of your plan. Enabling one without it answers 402.