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.
5 .. Convention for heading levels in Yardstick documentation:
7 ======= Heading 0 (reserved for the title in a document)
13 Avoid deeper levels because they do not render well.
23 Yardstick support restful API since Danube.
32 Description: This API is used to prepare Yardstick test environment.
33 For Euphrates, it supports:
35 1. Prepare yardstick test environment, including setting the
36 ``EXTERNAL_NETWORK`` environment variable, load Yardstick VM images and
38 2. Start an InfluxDB Docker container and config Yardstick output to InfluxDB;
39 3. Start a Grafana Docker container and config it with the InfluxDB.
41 Which API to call will depend on the parameters.
47 Prepare Yardstick test environment
51 'action': 'prepare_env'
54 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
58 Start and config an InfluxDB docker container
62 'action': 'create_influxdb'
65 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
69 Start and config a Grafana docker container
73 'action': 'create_grafana'
76 This is an asynchronous API. You need to call ``/yardstick/asynctask`` API to
83 Description: This API is used to get the status of asynchronous tasks
89 Get the status of asynchronous tasks
92 http://<SERVER IP>:<PORT>/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
94 The returned status will be 0(running), 1(finished) and 2(failed).
98 <SERVER IP>: The ip of the host where you start your yardstick container
99 <PORT>: The outside port of port mapping which set when you start start yardstick container
105 Description: This API is used to list all released Yardstick test cases.
111 Get a list of released test cases
114 http://<SERVER IP>:<PORT>/yardstick/testcases
117 /yardstick/testcases/release/action
118 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120 Description: This API is used to run a Yardstick released test case.
126 Run a released test case
130 'action': 'run_test_case',
133 'testcase': 'opnfv_yardstick_tc002'
137 This is an asynchronous API. You need to call ``/yardstick/results`` to get the
141 /yardstick/testcases/samples/action
142 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144 Description: This API is used to run a Yardstick sample test case.
150 Run a sample test case
154 'action': 'run_test_case',
161 This is an asynchronous API. You need to call ``/yardstick/results`` to get
165 /yardstick/testcases/<testcase_name>/docs
166 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168 Description: This API is used to the documentation of a certain released test
175 Get the documentation of a certain test case
178 http://<SERVER IP>:<PORT>/yardstick/taskcases/opnfv_yardstick_tc002/docs
181 /yardstick/testsuites/action
182 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184 Description: This API is used to run a Yardstick test suite.
194 'action': 'run_test_suite',
197 'testsuite': 'opnfv_smoke'
201 This is an asynchronous API. You need to call /yardstick/results to get the
205 /yardstick/tasks/<task_id>/log
206 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208 Description: This API is used to get the real time log of test case execution.
214 Get real time of test case execution
217 http://<SERVER IP>:<PORT>/yardstick/tasks/14795be8-f144-4f54-81ce-43f4e3eab33f/log?index=0
223 Description: This API is used to get the test results of tasks. If you call
224 /yardstick/testcases/samples/action API, it will return a task id. You can use
225 the returned task id to get the results by using this API.
231 Get test results of one task
234 http://<SERVER IP>:<PORT>/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
236 This API will return a list of test case result
239 /api/v2/yardstick/openrcs
240 ^^^^^^^^^^^^^^^^^^^^^^^^^
242 Description: This API provides functionality of handling OpenStack credential
243 file (openrc). For Euphrates, it supports:
245 1. Upload an openrc file for an OpenStack environment;
247 3. Get openrc file information;
248 4. Delete an openrc file.
250 Which API to call will depend on the parameters.
256 Upload an openrc file for an OpenStack environment
260 'action': 'upload_openrc',
263 'environment_id': environment_id
271 Update an openrc file
275 'action': 'update_openrc',
278 "EXTERNAL_NETWORK": "ext-net",
279 "OS_AUTH_URL": "http://192.168.23.51:5000/v3",
280 "OS_IDENTITY_API_VERSION": "3",
281 "OS_IMAGE_API_VERSION": "2",
282 "OS_PASSWORD": "console",
283 "OS_PROJECT_DOMAIN_NAME": "default",
284 "OS_PROJECT_NAME": "admin",
285 "OS_USERNAME": "admin",
286 "OS_USER_DOMAIN_NAME": "default"
288 'environment_id': environment_id
293 /api/v2/yardstick/openrcs/<openrc_id>
294 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296 Description: This API provides functionality of handling OpenStack credential file (openrc). For Euphrates, it supports:
298 1. Get openrc file information;
299 2. Delete an openrc file.
304 Get openrc file information
307 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
316 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
319 /api/v2/yardstick/pods
320 ^^^^^^^^^^^^^^^^^^^^^^
322 Description: This API provides functionality of handling Yardstick pod file
323 (pod.yaml). For Euphrates, it supports:
325 1. Upload a pod file;
327 Which API to call will depend on the parameters.
333 Upload a pod.yaml file
337 'action': 'upload_pod_file',
340 'environment_id': environment_id
345 /api/v2/yardstick/pods/<pod_id>
346 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
348 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
350 1. Get pod file information;
351 2. Delete an openrc file.
355 Get pod file information
358 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
366 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
369 /api/v2/yardstick/images
370 ^^^^^^^^^^^^^^^^^^^^^^^^
372 Description: This API is used to do some work related to Yardstick VM images.
373 For Euphrates, it supports:
375 1. Load Yardstick VM images;
377 Which API to call will depend on the parameters.
387 'action': 'load_image',
389 'name': 'yardstick-image'
394 /api/v2/yardstick/images/<image_id>
395 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
397 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
399 1. Get image's information;
404 Get image information
407 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
415 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
418 /api/v2/yardstick/tasks
419 ^^^^^^^^^^^^^^^^^^^^^^^
421 Description: This API is used to do some work related to yardstick tasks. For
422 Euphrates, it supports:
424 1. Create a Yardstick task;
426 Which API to call will depend on the parameters.
432 Create a Yardstick task
436 'action': 'create_task',
439 'project_id': project_id
444 /api/v2/yardstick/tasks/<task_id>
445 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
447 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
449 1. Add a environment to a task
450 2. Add a test case to a task;
451 3. Add a test suite to a task;
452 4. run a Yardstick task;
453 5. Get a tasks' information;
459 Add a environment to a task
464 'action': 'add_environment',
466 'environment_id': 'e3cadbbb-0419-4fed-96f1-a232daa0422a'
473 Add a test case to a task
477 'action': 'add_case',
479 'case_name': 'opnfv_yardstick_tc002',
480 'case_content': case_content
488 Add a test suite to a task
492 'action': 'add_suite',
494 'suite_name': 'opnfv_smoke',
495 'suite_content': suite_content
514 Get a task's information
517 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
526 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
529 /api/v2/yardstick/testcases
530 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
532 Description: This API is used to do some work related to Yardstick testcases.
533 For Euphrates, it supports:
535 1. Upload a test case;
536 2. Get all released test cases' information;
538 Which API to call will depend on the parameters.
548 'action': 'upload_case',
558 Get all released test cases' information
561 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases
564 /api/v2/yardstick/testcases/<case_name>
565 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
567 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
569 1. Get certain released test case's information;
570 2. Delete a test case.
575 Get certain released test case's information
578 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
584 Delete a certain test case
587 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
590 /api/v2/yardstick/testsuites
591 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
593 Description: This API is used to do some work related to yardstick test suites.
594 For Euphrates, it supports:
596 1. Create a test suite;
597 2. Get all test suites;
599 Which API to call will depend on the parameters.
609 'action': 'create_suite',
611 'name': <suite_name>,
613 'opnfv_yardstick_tc002'
625 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites
628 /api/v2/yardstick/testsuites
629 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
631 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
633 1. Get certain test suite's information;
634 2. Delete a test case.
639 Get certain test suite's information
642 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
648 Delete a certain test suite
651 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
654 /api/v2/yardstick/projects
655 ^^^^^^^^^^^^^^^^^^^^^^^^^^
657 Description: This API is used to do some work related to Yardstick test
658 projects. For Euphrates, it supports:
660 1. Create a Yardstick project;
663 Which API to call will depend on the parameters.
669 Create a Yardstick project
673 'action': 'create_project',
683 Get all projects' information
686 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects
689 /api/v2/yardstick/projects
690 ^^^^^^^^^^^^^^^^^^^^^^^^^^
692 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
694 1. Get certain project's information;
700 Get certain project's information
703 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
709 Delete a certain project
712 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
715 /api/v2/yardstick/containers
716 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
718 Description: This API is used to do some work related to Docker containers.
719 For Euphrates, it supports:
721 1. Create a Grafana Docker container;
722 2. Create an InfluxDB Docker container;
724 Which API to call will depend on the parameters.
730 Create a Grafana Docker container
734 'action': 'create_grafana',
736 'environment_id': <environment_id>
744 Create an InfluxDB Docker container
748 'action': 'create_influxdb',
750 'environment_id': <environment_id>
755 /api/v2/yardstick/containers/<container_id>
756 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
758 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
760 1. Get certain container's information;
761 2. Delete a container.
766 Get certain container's information
769 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>
775 Delete a certain container
778 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>