HTTP API:
curl -X POST localhost:6666/proxies -H "Content-Type: application/json" -d '{ "name": "raft_core_1", "listen": "[::]:17001", "upstream": "core1:17000", "enabled": true}'
CLI:
toxiproxy-cli -h localhost:6666 create --listen '[::]:17001' --upstream core1:17000 raft_core_1
HTTP API:
curl -X POST localhost:6666/proxies -H "Content-Type: application/json" -d '{ "name": "raft_core_2", "listen": "[::]:27001", "upstream": "core2:27000", "enabled": true}'
CLI:
toxiproxy-cli -h localhost:6666 create --listen '[::]:27001' --upstream core2:27000 raft_core_2
HTTP API:
curl -X POST localhost:6666/proxies -H "Content-Type: application/json" -d '{ "name": "raft_core_3", "listen": "[::]:37001", "upstream": "core3:37000", "enabled": true}'
CLI:
toxiproxy-cli -h localhost:6666 create --listen '[::]:37001' --upstream core3:37000 raft_core_3
HTTP API:
curl -X POST localhost:6666/populate \
-H "Content-Type: application/json" \
-d '[
{ "name": "raft_core_1", "listen": "[::]:17001", "upstream": "core1:17000", "enabled": true},
{ "name": "raft_core_2", "listen": "[::]:27001", "upstream": "core2:27000", "enabled": true},
{ "name": "raft_core_3", "listen": "[::]:37001", "upstream": "core3:37000", "enabled": true}
]'
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_1 -H "Content-Type: application/json" -d '{"listen": "[::]:17001", "upstream": "core1:17000", "enabled": false}'
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_2 -H "Content-Type: application/json" -d '{"listen": "[::]:27001", "upstream": "core2:27000", "enabled": false}'
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_3 -H "Content-Type: application/json" -d '{"listen": "[::]:37001", "upstream": "core2:37000", "enabled": false}'
HTTP API:
curl -X DELETE localhost:6666/proxies/raft_core_X -H "Content-Type: application/json"
CLI:
toxiproxy-cli -h localhost:6666 delete raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "latency", "attributes":{"latency":30000,"jitter":1000}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t latency -a latency=30000 -a jitter=1000 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "bandwidth", "attributes":{"rate":10}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t bandwidth -a rate=50000 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "slow_close", "attributes":{"delay":20000}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t slow_close -a delay=20000 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "timeout", "attributes":{"timeout":10000}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t timeout -a timeout=10000 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "reset_peer", "attributes":{"timeout":1000}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t reset_peer -a timeout=10000 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "slicer", "attributes":{"average_size":100, "size_variation":10,"delay":100}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t slicer -a average_size=100 -a size_variation=10 -a delay=100 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics -H "Content-Type: application/json" -d '{ "type": "limit_data", "attributes":{"bytes":100}, "stream":"upstream"}'
CLI:
toxiproxy-cli -h localhost:6666 toxic add -t limit_data -a average_size=100 -a bytes=100 --upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/proxies/raft_core_X/toxics/latency_upstream -H "Content-Type: application/json" -d '{ "type": "latency", "attributes":{"latency":20000,"jitter":800}}'
CLI:
toxiproxy-cli -h localhost:6666 toxic update -n latency_upstream -a latency=50000 raft_core_X
HTTP API:
curl -X DELETE localhost:6666/proxies/raft_core_X/toxics/latency_upstream
CLI:
toxiproxy-cli -h localhost:6666 toxic delete -n latency_upstream raft_core_X
HTTP API:
curl -X POST localhost:6666/reset