From 031e38fbecdcbbe37d24be03ba517f7699bc8ad7 Mon Sep 17 00:00:00 2001 From: Glyph Date: Fri, 24 Oct 2014 17:02:13 -0700 Subject: [PATCH] Documentation for time endpoint. --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index c38401ad29..0da7de2d80 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,27 @@ node, for 20 seconds: `{"loadBalancer": {"name": "a-new-loadbalancer2", "protocol": "HTTP", "virtualIps": [{"type": "PUBLIC"}], "metadata": [{"key": "lb_pending_update", "value": 20}], "nodes": []}}` +## Mimic Control APIs ## + +When any of Mimic's included plugins schedule a timeout, you will need to cause +Mimic's internal clock to advance for any of those timeouts to fire. + +You can do this with the `tick` endpoint, like so: + + curl -s -XPOST -d '{"amount": 1.0}' http://localhost:8900/mimic/v1.1/tick | python -m json.tool + +which should result in output like this: + + { + "advanced": 1.0, + "now": "1970-01-01T00:00:04.000000Z" + } + +Note that Mimic begins its timekeeping when all time began, in 1970. +If you would prefer to advance Mimic to something resembling the present day instead, a command like this right after Mimic starts up will do that: + + curl -s -XPOST -d '{"amount": '"$(date +%s)"'}' http://localhost:8900/mimic/v1.1/tick | python -m json.tool + ## Mimic does not: ## * support XML