From 4f5fdf094827f8517511a57c8eb2d82bfaa2a701 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 23 Jun 2014 18:03:34 +0200 Subject: [PATCH] Improve archives syntax creation. Change-Id: I8309731294c245202ca207204cf83fcce0721837 --- specs/juno/gnocchi.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/specs/juno/gnocchi.rst b/specs/juno/gnocchi.rst index 0bebd9c..18aac0e 100644 --- a/specs/juno/gnocchi.rst +++ b/specs/juno/gnocchi.rst @@ -98,12 +98,16 @@ The proposed API is: * `POST /v1/entity`:: - -> {"archives": [[1, 3600], [3600, 720]]} + -> {"archives": [{"lifespan": 3600, "points": 1000}, + {"lifespan": "1 year", "interval": 60}, + {"points": 1000, "interval": 60}]} <- 201 Created Location: /v1/entity/ - Create an entity with 2 archives, one storing one point every second - for an hour, and one storing one point every hour for 30 days. + Create an entity storing: + - 1000 points over an hour + - a point every minute over a year + - 1000 points with a point every minute. The uuid of the entity is returned. * `POST /v1/entity//measures`:: @@ -151,7 +155,7 @@ The proposed API is: -> { "id": , "started_at": "2013-01-01 12:23:12", "project_id": "foobar", - "entities": { "cpu.util": {'archives': [[1, 60]]} }, + "entities": { "cpu.util": {"archives": [{"lifespan": 3600, "points": 1000}]} }, "user_id": "foobaz"} <- { "id": , "started_at": "2013-01-01 12:23:12",