diff options
author | JingLu5 <lvjing5@huawei.com> | 2017-03-28 01:43:21 +0000 |
---|---|---|
committer | Jing Lu <lvjing5@huawei.com> | 2017-03-30 09:49:20 +0000 |
commit | 6c0f8306f7bed99905af7a21fc5171642d3c4827 (patch) | |
tree | 7ab553bf4677425ad6fd18089deb7916e90b0a74 /docs/testing/user/userguide/08-api.rst | |
parent | b2a79813f57a94b6565fa8f967d10d295010dfff (diff) |
Refine documentation
Change-Id: I0d3387a520e3decf51bb0f7db53996f148a611d0
Signed-off-by: JingLu5 <lvjing5@huawei.com>
(cherry picked from commit 2347f3977823bfd0c4b1fa832d9046b8a625596b)
Diffstat (limited to 'docs/testing/user/userguide/08-api.rst')
-rw-r--r-- | docs/testing/user/userguide/08-api.rst | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/docs/testing/user/userguide/08-api.rst b/docs/testing/user/userguide/08-api.rst new file mode 100644 index 000000000..1d9ea6d64 --- /dev/null +++ b/docs/testing/user/userguide/08-api.rst @@ -0,0 +1,177 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Huawei Technologies Co.,Ltd and others. + +Yardstick Restful API +====================== + + +Abstract +-------- + +Yardstick support restful API in danube. + + +Available API +------------- + +/yardstick/env/action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to do some work related to environment. For now, we support: + +1. Prepare yardstick environment(Including fetch openrc file, get external network and load images) +2. Start a InfluxDB docker container and config yardstick output to InfluxDB. +3. Start a Grafana docker container and config with the InfluxDB. + +Which API to call will depend on the Parameters. + + +Method: POST + + +Prepare Yardstick Environment +Example:: + + { + 'action': 'prepareYardstickEnv' + } + +This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result. + + +Start and Config InfluxDB docker container +Example:: + + { + 'action': 'createInfluxDBContainer' + } + +This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result. + + +Start and Config Grafana docker container +Example:: + + { + 'action': 'createGrafanaContainer' + } + +This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result. + + +/yardstick/asynctask +^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to get the status of asynchronous task + + +Method: GET + + +Get the status of asynchronous task +Example:: + + http://localhost:8888/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c + +The returned status will be 0(running), 1(finished) and 2(failed). + + +/yardstick/testcases +^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to list all release test cases now in yardstick. + + +Method: GET + + +Get a list of release test cases +Example:: + + http://localhost:8888/yardstick/testcases + + +/yardstick/testcases/release/action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to run a yardstick release test case. + + +Method: POST + + +Run a release test case +Example:: + + { + 'action': 'runTestCase', + 'args': { + 'opts': {}, + 'testcase': 'tc002' + } + } + +This is an asynchronous API. You need to call /yardstick/results to get the result. + + +/yardstick/testcases/samples/action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to run a yardstick sample test case. + + +Method: POST + + +Run a sample test case +Example:: + + { + 'action': 'runTestCase', + 'args': { + 'opts': {}, + 'testcase': 'ping' + } + } + +This is an asynchronous API. You need to call /yardstick/results to get the result. + + +/yardstick/testsuites/action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Description: This API is used to run a yardstick test suite. + + +Method: POST + + +Run a test suite +Example:: + + { + 'action': 'runTestSuite', + 'args': { + 'opts': {}, + 'testcase': 'smoke' + } + } + +This is an asynchronous API. You need to call /yardstick/results to get the result. + + +/yardstick/results +^^^^^^^^^^^^^^^^^^ + + +Description: This API is used to get the test results of certain task. If you call /yardstick/testcases/samples/action API, it will return a task id. You can use the returned task id to get the results by using this API. + + +Get test results of one task +Example:: + + http://localhost:8888/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c + +This API will return a list of test case result |