1 .. This work is licensed under a Creative Commons Attribution 4.0 International
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, Huawei Technologies Co.,Ltd and others.
14 Yardstick support restful API since Danube.
23 Description: This API is used to prepare Yardstick test environment.
24 For Euphrates, it supports:
26 1. Prepare yardstick test environment, including setting the
27 ``EXTERNAL_NETWORK`` environment variable, load Yardstick VM images and
29 2. Start an InfluxDB Docker container and config Yardstick output to InfluxDB;
30 3. Start a Grafana Docker container and config it with the InfluxDB.
32 Which API to call will depend on the parameters.
38 Prepare Yardstick test environment
42 'action': 'prepare_env'
45 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
49 Start and config an InfluxDB docker container
53 'action': 'create_influxdb'
56 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
60 Start and config a Grafana docker container
64 'action': 'create_grafana'
67 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
74 Description: This API is used to get the status of asynchronous tasks
80 Get the status of asynchronous tasks
83 http://<SERVER IP>:<PORT>/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
85 The returned status will be 0(running), 1(finished) and 2(failed).
89 <SERVER IP>: The ip of the host where you start your yardstick container
90 <PORT>: The outside port of port mapping which set when you start start yardstick container
96 Description: This API is used to list all released Yardstick test cases.
102 Get a list of released test cases
105 http://<SERVER IP>:<PORT>/yardstick/testcases
108 /yardstick/testcases/release/action
109 -----------------------------------
111 Description: This API is used to run a Yardstick released test case.
117 Run a released test case
121 'action': 'run_test_case',
124 'testcase': 'opnfv_yardstick_tc002'
128 This is an asynchronous API. You need to call ``/yardstick/results`` to get the
132 /yardstick/testcases/samples/action
133 -----------------------------------
135 Description: This API is used to run a Yardstick sample test case.
141 Run a sample test case
145 'action': 'run_test_case',
152 This is an asynchronous API. You need to call ``/yardstick/results`` to get
156 /yardstick/testcases/<testcase_name>/docs
157 -----------------------------------------
159 Description: This API is used to the documentation of a certain released test
166 Get the documentation of a certain test case
169 http://<SERVER IP>:<PORT>/yardstick/taskcases/opnfv_yardstick_tc002/docs
172 /yardstick/testsuites/action
173 ----------------------------
175 Description: This API is used to run a Yardstick test suite.
185 'action': 'run_test_suite',
188 'testsuite': 'opnfv_smoke'
192 This is an asynchronous API. You need to call /yardstick/results to get the
196 /yardstick/tasks/<task_id>/log
197 ------------------------------
199 Description: This API is used to get the real time log of test case execution.
205 Get real time of test case execution
208 http://<SERVER IP>:<PORT>/yardstick/tasks/14795be8-f144-4f54-81ce-43f4e3eab33f/log?index=0
214 Description: This API is used to get the test results of tasks. If you call
215 /yardstick/testcases/samples/action API, it will return a task id. You can use
216 the returned task id to get the results by using this API.
222 Get test results of one task
225 http://<SERVER IP>:<PORT>/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
227 This API will return a list of test case result
230 /api/v2/yardstick/openrcs
231 -------------------------
233 Description: This API provides functionality of handling OpenStack credential
234 file (openrc). For Euphrates, it supports:
236 1. Upload an openrc file for an OpenStack environment;
238 3. Get openrc file information;
239 4. Delete an openrc file.
241 Which API to call will depend on the parameters.
247 Upload an openrc file for an OpenStack environment
251 'action': 'upload_openrc',
254 'environment_id': environment_id
262 Update an openrc file
266 'action': 'update_openrc',
269 "EXTERNAL_NETWORK": "ext-net",
270 "OS_AUTH_URL": "http://192.168.23.51:5000/v3",
271 "OS_IDENTITY_API_VERSION": "3",
272 "OS_IMAGE_API_VERSION": "2",
273 "OS_PASSWORD": "console",
274 "OS_PROJECT_DOMAIN_NAME": "default",
275 "OS_PROJECT_NAME": "admin",
276 "OS_USERNAME": "admin",
277 "OS_USER_DOMAIN_NAME": "default"
279 'environment_id': environment_id
284 /api/v2/yardstick/openrcs/<openrc_id>
285 -------------------------------------
287 Description: This API provides functionality of handling OpenStack credential file (openrc). For Euphrates, it supports:
289 1. Get openrc file information;
290 2. Delete an openrc file.
295 Get openrc file information
298 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
307 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
310 /api/v2/yardstick/pods
311 ----------------------
313 Description: This API provides functionality of handling Yardstick pod file
314 (pod.yaml). For Euphrates, it supports:
316 1. Upload a pod file;
318 Which API to call will depend on the parameters.
324 Upload a pod.yaml file
328 'action': 'upload_pod_file',
331 'environment_id': environment_id
336 /api/v2/yardstick/pods/<pod_id>
337 -------------------------------
339 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
341 1. Get pod file information;
342 2. Delete an openrc file.
346 Get pod file information
349 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
357 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
360 /api/v2/yardstick/images
361 ------------------------
363 Description: This API is used to do some work related to Yardstick VM images.
364 For Euphrates, it supports:
366 1. Load Yardstick VM images;
368 Which API to call will depend on the parameters.
378 'action': 'load_image',
380 'name': 'yardstick-image'
385 /api/v2/yardstick/images/<image_id>
386 -----------------------------------
388 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
390 1. Get image's information;
395 Get image information
398 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
406 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
409 /api/v2/yardstick/tasks
410 -----------------------
412 Description: This API is used to do some work related to yardstick tasks. For
413 Euphrates, it supports:
415 1. Create a Yardstick task;
417 Which API to call will depend on the parameters.
423 Create a Yardstick task
427 'action': 'create_task',
430 'project_id': project_id
435 /api/v2/yardstick/tasks/<task_id>
436 --------------------------------
438 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
440 1. Add a environment to a task
441 2. Add a test case to a task;
442 3. Add a test suite to a task;
443 4. run a Yardstick task;
444 5. Get a tasks' information;
450 Add a environment to a task
455 'action': 'add_environment',
457 'environment_id': 'e3cadbbb-0419-4fed-96f1-a232daa0422a'
464 Add a test case to a task
468 'action': 'add_case',
470 'case_name': 'opnfv_yardstick_tc002',
471 'case_content': case_content
479 Add a test suite to a task
483 'action': 'add_suite',
485 'suite_name': 'opnfv_smoke',
486 'suite_content': suite_content
505 Get a task's information
508 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
517 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
520 /api/v2/yardstick/testcases
521 ---------------------------
523 Description: This API is used to do some work related to Yardstick testcases.
524 For Euphrates, it supports:
526 1. Upload a test case;
527 2. Get all released test cases' information;
529 Which API to call will depend on the parameters.
539 'action': 'upload_case',
549 Get all released test cases' information
552 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases
555 /api/v2/yardstick/testcases/<case_name>
556 ---------------------------------------
558 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
560 1. Get certain released test case's information;
561 2. Delete a test case.
566 Get certain released test case's information
569 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
575 Delete a certain test case
578 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
581 /api/v2/yardstick/testsuites
582 ----------------------------
584 Description: This API is used to do some work related to yardstick test suites.
585 For Euphrates, it supports:
587 1. Create a test suite;
588 2. Get all test suites;
590 Which API to call will depend on the parameters.
600 'action': 'create_suite',
602 'name': <suite_name>,
604 'opnfv_yardstick_tc002'
616 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites
619 /api/v2/yardstick/testsuites
620 ----------------------------
622 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
624 1. Get certain test suite's information;
625 2. Delete a test case.
630 Get certain test suite's information
633 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
639 Delete a certain test suite
642 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
645 /api/v2/yardstick/projects
646 --------------------------
648 Description: This API is used to do some work related to Yardstick test
649 projects. For Euphrates, it supports:
651 1. Create a Yardstick project;
654 Which API to call will depend on the parameters.
660 Create a Yardstick project
664 'action': 'create_project',
674 Get all projects' information
677 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects
680 /api/v2/yardstick/projects
681 --------------------------
683 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
685 1. Get certain project's information;
691 Get certain project's information
694 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
700 Delete a certain project
703 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
706 /api/v2/yardstick/containers
707 ----------------------------
709 Description: This API is used to do some work related to Docker containers.
710 For Euphrates, it supports:
712 1. Create a Grafana Docker container;
713 2. Create an InfluxDB Docker container;
715 Which API to call will depend on the parameters.
721 Create a Grafana Docker container
725 'action': 'create_grafana',
727 'environment_id': <environment_id>
735 Create an InfluxDB Docker container
739 'action': 'create_influxdb',
741 'environment_id': <environment_id>
746 /api/v2/yardstick/containers/<container_id>
747 -------------------------------------------
749 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
751 1. Get certain container's information;
752 2. Delete a container.
757 Get certain container's information
760 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>
766 Delete a certain container
769 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>