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.
13 Yardstick support restful API since Danube.
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 Description: This API is used to prepare Yardstick test environment. For Euphrates, it supports:
24 1. Prepare yardstick test environment, including set external network environment variable, load Yardstick VM images and create flavors;
25 2. Start an InfluxDB Docker container and config Yardstick output to InfluxDB;
26 3. Start a Grafana Docker container and config it with the InfluxDB.
28 Which API to call will depend on the parameters.
34 Prepare Yardstick test environment
38 'action': 'prepare_env'
41 This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.
44 Start and config an InfluxDB docker container
48 'action': 'create_influxdb'
51 This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.
54 Start and config a Grafana docker container
58 'action': 'create_grafana'
61 This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.
67 Description: This API is used to get the status of asynchronous tasks
73 Get the status of asynchronous tasks
76 http://<SERVER IP>:<PORT>/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
78 The returned status will be 0(running), 1(finished) and 2(failed).
82 <SERVER IP>: The ip of the host where you start your yardstick container
83 <PORT>: The outside port of port mapping which set when you start start yardstick container
89 Description: This API is used to list all released Yardstick test cases.
95 Get a list of released test cases
98 http://<SERVER IP>:<PORT>/yardstick/testcases
101 /yardstick/testcases/release/action
102 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104 Description: This API is used to run a Yardstick released test case.
110 Run a released test case
114 'action': 'run_test_case',
117 'testcase': 'opnfv_yardstick_tc002'
121 This is an asynchronous API. You need to call /yardstick/results to get the result.
124 /yardstick/testcases/samples/action
125 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127 Description: This API is used to run a Yardstick sample test case.
133 Run a sample test case
137 'action': 'run_test_case',
144 This is an asynchronous API. You need to call /yardstick/results to get the result.
147 /yardstick/testcases/<testcase_name>/docs
148 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150 Description: This API is used to the documentation of a certain released test case.
156 Get the documentation of a certain test case
159 http://<SERVER IP>:<PORT>/yardstick/taskcases/opnfv_yardstick_tc002/docs
162 /yardstick/testsuites/action
163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165 Description: This API is used to run a Yardstick test suite.
175 'action': 'run_test_suite',
178 'testsuite': 'opnfv_smoke'
182 This is an asynchronous API. You need to call /yardstick/results to get the result.
185 /yardstick/tasks/<task_id>/log
186 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188 Description: This API is used to get the real time log of test case execution.
194 Get real time of test case execution
197 http://<SERVER IP>:<PORT>/yardstick/tasks/14795be8-f144-4f54-81ce-43f4e3eab33f/log?index=0
203 Description: This API is used to get the test results of tasks. 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.
209 Get test results of one task
212 http://<SERVER IP>:<PORT>/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
214 This API will return a list of test case result
217 /api/v2/yardstick/openrcs
218 ^^^^^^^^^^^^^^^^^^^^^^^^^
220 Description: This API provides functionality of handling OpenStack credential file (openrc). For Euphrates, it supports:
222 1. Upload an openrc file for an OpenStack environment;
224 3. Get openrc file information;
225 4. Delete an openrc file.
227 Which API to call will depend on the parameters.
233 Upload an openrc file for an OpenStack environment
237 'action': 'upload_openrc',
240 'environment_id': environment_id
248 Update an openrc file
252 'action': 'update_openrc',
255 "EXTERNAL_NETWORK": "ext-net",
256 "OS_AUTH_URL": "http://192.168.23.51:5000/v3",
257 "OS_IDENTITY_API_VERSION": "3",
258 "OS_IMAGE_API_VERSION": "2",
259 "OS_PASSWORD": "console",
260 "OS_PROJECT_DOMAIN_NAME": "default",
261 "OS_PROJECT_NAME": "admin",
262 "OS_USERNAME": "admin",
263 "OS_USER_DOMAIN_NAME": "default"
265 'environment_id': environment_id
270 /api/v2/yardstick/openrcs/<openrc_id>
271 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273 Description: This API provides functionality of handling OpenStack credential file (openrc). For Euphrates, it supports:
275 1. Get openrc file information;
276 2. Delete an openrc file.
281 Get openrc file information
284 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
293 http://<SERVER IP>:<PORT>/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
296 /api/v2/yardstick/pods
297 ^^^^^^^^^^^^^^^^^^^^^^
299 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
301 1. Upload a pod file;
303 Which API to call will depend on the parameters.
309 Upload a pod.yaml file
313 'action': 'upload_pod_file',
316 'environment_id': environment_id
321 /api/v2/yardstick/pods/<pod_id>
322 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
324 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
326 1. Get pod file information;
327 2. Delete an openrc file.
331 Get pod file information
334 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
342 http://<SERVER IP>:<PORT>/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
345 /api/v2/yardstick/images
346 ^^^^^^^^^^^^^^^^^^^^^^^^
348 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
350 1. Load Yardstick VM images;
352 Which API to call will depend on the parameters.
362 'action': 'load_image',
364 'name': 'yardstick-image'
369 /api/v2/yardstick/images/<image_id>
370 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
372 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
374 1. Get image's information;
379 Get image information
382 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
390 http://<SERVER IP>:<PORT>/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
393 /api/v2/yardstick/tasks
394 ^^^^^^^^^^^^^^^^^^^^^^^
396 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
398 1. Create a Yardstick task;
400 Which API to call will depend on the parameters.
406 Create a Yardstick task
410 'action': 'create_task',
413 'project_id': project_id
418 /api/v2/yardstick/tasks/<task_id>
419 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
421 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
423 1. Add a environment to a task
424 2. Add a test case to a task;
425 3. Add a test suite to a task;
426 4. run a Yardstick task;
427 5. Get a tasks' information;
433 Add a environment to a task
438 'action': 'add_environment',
440 'environment_id': 'e3cadbbb-0419-4fed-96f1-a232daa0422a'
447 Add a test case to a task
451 'action': 'add_case',
453 'case_name': 'opnfv_yardstick_tc002',
454 'case_content': case_content
462 Add a test suite to a task
466 'action': 'add_suite',
468 'suite_name': 'opnfv_smoke',
469 'suite_content': suite_content
488 Get a task's information
491 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
499 http://<SERVER IP>:<PORT>/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
502 /api/v2/yardstick/testcases
503 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
505 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
507 1. Upload a test case;
508 2. Get all released test cases' information;
510 Which API to call will depend on the parameters.
520 'action': 'upload_case',
530 Get all released test cases' information
533 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases
536 /api/v2/yardstick/testcases/<case_name>
537 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
539 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
541 1. Get certain released test case's information;
542 2. Delete a test case.
547 Get certain released test case's information
550 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
556 Delete a certain test case
558 http://<SERVER IP>:<PORT>/api/v2/yardstick/testcases/opnfv_yardstick_tc002
561 /api/v2/yardstick/testsuites
562 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
564 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
566 1. Create a test suite;
567 2. Get all test suites;
569 Which API to call will depend on the parameters.
579 'action': 'create_suite',
581 'name': <suite_name>,
583 'opnfv_yardstick_tc002'
595 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites
598 /api/v2/yardstick/testsuites
599 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
601 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
603 1. Get certain test suite's information;
604 2. Delete a test case.
609 Get certain test suite's information
612 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
618 Delete a certain test suite
621 http://<SERVER IP>:<PORT>/api/v2/yardstick/testsuites/<suite_name>
624 /api/v2/yardstick/projects
625 ^^^^^^^^^^^^^^^^^^^^^^^^^^
627 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
629 1. Create a Yardstick project;
632 Which API to call will depend on the parameters.
638 Create a Yardstick project
642 'action': 'create_project',
652 Get all projects' information
655 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects
658 /api/v2/yardstick/projects
659 ^^^^^^^^^^^^^^^^^^^^^^^^^^
661 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
663 1. Get certain project's information;
669 Get certain project's information
672 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
678 Delete a certain project
681 http://<SERVER IP>:<PORT>/api/v2/yardstick/projects/<project_id>
684 /api/v2/yardstick/containers
685 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
687 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
689 1. Create a Grafana Docker container;
690 2. Create an InfluxDB Docker container;
692 Which API to call will depend on the parameters.
698 Create a Grafana Docker container
702 'action': 'create_grafana',
704 'environment_id': <environment_id>
712 Create an InfluxDB Docker container
716 'action': 'create_influxdb',
718 'environment_id': <environment_id>
723 /api/v2/yardstick/containers/<container_id>
724 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
726 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
728 1. Get certain container's information;
729 2. Delete a container.
734 Get certain container's information
737 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>
743 Delete a certain container
746 http://<SERVER IP>:<PORT>/api/v2/yardstick/containers/<container_id>