Apply impairment
http://localhost/v1/impairments/{direction}Served over the Unix socket /run/chaosd/chaosd.sock
Programs an impairment onto a direction and returns the post-apply AppliedState. Apply takes ownership of the port unconditionally: it replaces whatever stack was there.
Every field of the body is independent. Set as many as needed and they compose into a single qdisc stack. All durations are nanoseconds, percentages are in [0, 100], and correlation and probability are in [0.0, 1.0].
If the kernel rounds or rejects a value, the response carries a divergence list describing the difference.
Path parameters
directionstringRequiredThe direction to operate on. Each direction is configured independently. An unknown value returns 400.
port1port2Request
application/jsonThis endpoint expects an Impairment object.
The complete shaping state of one direction. Omitted fields are not applied.
latencyLatencyOptionalConstant or stochastic one-way delay, distinguished by kind.
lossLossOptionalPacket loss, distinguished by model.
rateRateOptionalToken-bucket rate ceiling, backed by tbf.
queueQueueOptionalA bounded pfifo queue at the bottom of the stack.
duplicationDuplicationOptionalreorderingReorderingOptionalcorruptionCorruptionOptionalResponse
200 · application/jsonPost-apply state. Returns an AppliedState object.
directionstringRequiredport1port2impairmentImpairmentRequiredThe complete shaping state of one direction. Omitted fields are not applied.
divergencelist of DivergenceOptionalDifferences between requested and applied state. Omitted when empty.
captured_atinteger <int64>RequiredMonotonic timestamp in nanoseconds. The ordering source of truth.
captured_at_wallinteger <int64>RequiredWall-clock time in nanoseconds since the Unix epoch, for human correlation only.
Errors
Unknown direction or malformed body.
Permission denied. The daemon lacks CAP_NET_ADMIN.
The backend cannot apply this configuration, for example Gilbert-Elliott loss or the paretonormal distribution in this release, or the kernel rejected it.
Backend or I/O error.
