From afc977b97644c459f97c642ff5e05ba3735a2324 Mon Sep 17 00:00:00 2001 From: Lena Novokshonova Date: Thu, 25 Sep 2014 14:16:39 +0400 Subject: [PATCH] Correct JSON-based query examples in documentation Need to formulate GET query parameters in JSON, but "-d" in curl implies a POST request. Change-Id: I71a8204282ff88b07a9dfdde3f3812e7073acc33 Closes-bug: 1362591 --- doc/source/webapi/v2.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/webapi/v2.rst b/doc/source/webapi/v2.rst index c24ed5b85..7ca235f21 100644 --- a/doc/source/webapi/v2.rst +++ b/doc/source/webapi/v2.rst @@ -245,16 +245,16 @@ the CPU utilization for a given instance (identified by *resource_id*):: JSON based example:: - curl -H 'X-Auth-Token: ' -H 'Content-Type: application/json' \ - -d '{"q":[{"field": "timestamp","op": "ge","value":"2013-04-01T13:34:17"}]}' \ - http://localhost:8777/v2/meters + curl -X GET -H "X-Auth-Token: " -H "Content-Type: application/json" + -d '{"q": [{"field": "timestamp", "op": "ge", "value": "2014-04-01T13:34:17"}]}' + http://localhost:8777/v2/meters/instance JSON based example with multiple filters:: - curl -H 'X-Auth-Token: ' -H 'Content-Type: application/json' \ - -d '{"q":[{"field": "timestamp","op": "ge","value":"2013-04-01T13:34:17"},'\ - "'{"field": "project_id","op": "eq","value":"8d6057bc-5b90-4296-afe0-84acaa2ef909"}]}' \ - http://localhost:8777/v2/meters/instance + curl -X GET -H "X-Auth-Token: " -H "Content-Type: application/json" + -d '{"q": [{"field": "timestamp", "op": "ge", "value": "2014-04-01T13:34:17"}, + {"field": "resource_id", "op": "eq", "value": "4da2b992-0dc3-4a7c-a19a-d54bf918de41"}]}' + http://localhost:8777/v2/meters/instance .. _functional-examples: