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': 'prepareYardstickEnv'
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': 'createInfluxDBContainer'
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': 'createGrafanaContainer'
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://localhost:8888/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
78 The returned status will be 0(running), 1(finished) and 2(failed).
84 Description: This API is used to list all released Yardstick test cases.
90 Get a list of released test cases
93 http://localhost:8888/yardstick/testcases
96 /yardstick/testcases/release/action
97 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99 Description: This API is used to run a Yardstick released test case.
105 Run a released test case
109 'action': 'runTestCase',
116 This is an asynchronous API. You need to call /yardstick/results to get the result.
119 /yardstick/testcases/samples/action
120 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122 Description: This API is used to run a Yardstick sample test case.
128 Run a sample test case
132 'action': 'runTestCase',
139 This is an asynchronous API. You need to call /yardstick/results to get the result.
142 /yardstick/testcases/<testcase_name>/docs
143 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145 Description: This API is used to the documentation of a certain released test case.
151 Get the documentation of a certain test case
154 http://localhost:8888/yardstick/taskcases/opnfv_yardstick_tc002/docs
157 /yardstick/testsuites/action
158 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160 Description: This API is used to run a Yardstick test suite.
170 'action': 'runTestSuite',
177 This is an asynchronous API. You need to call /yardstick/results to get the result.
180 /yardstick/tasks/<task_id>/log
182 Description: This API is used to get the real time log of test case execution.
188 Get real time of test case execution
191 http://localhost:8888/yardstick/tasks/14795be8-f144-4f54-81ce-43f4e3eab33f/log?index=0
197 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.
203 Get test results of one task
206 http://localhost:8888/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c
208 This API will return a list of test case result
211 /api/v2/yardstick/openrcs/action
213 Description: This API provides functionality of handling OpenStack credential file (openrc). For Euphrates, it supports:
215 1. Upload an openrc file for an OpenStack environment;
216 2. Update an openrc file;
217 3. Get openrc file information;
218 4. Delete an openrc file.
220 Which API to call will depend on the parameters.
226 Upload an openrc file for an OpenStack environment
230 'action': 'upload_openrc',
233 'environment_id': environment_id
241 Update an openrc file
245 'action': 'update_openrc',
248 "EXTERNAL_NETWORK": "ext-net",
249 "OS_AUTH_URL": "http://192.168.23.51:5000/v3",
250 "OS_IDENTITY_API_VERSION": "3",
251 "OS_IMAGE_API_VERSION": "2",
252 "OS_PASSWORD": "console",
253 "OS_PROJECT_DOMAIN_NAME": "default",
254 "OS_PROJECT_NAME": "admin",
255 "OS_USERNAME": "admin",
256 "OS_USER_DOMAIN_NAME": "default"
258 'environment_id': environment_id
265 Get openrc file information
268 http://localhost:8888/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
277 http://localhost:8888/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
280 /api/v2/yardstick/pods/action
282 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
284 1. Upload a pod file;
285 2. Get pod file information;
286 3. Delete an openrc file.
288 Which API to call will depend on the parameters.
294 Upload a pod.yaml file
298 'action': 'upload_pod_file',
301 'environment_id': environment_id
308 Get pod file information
311 http://localhost:8888/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
319 http://localhost:8888/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
322 /api/v2/yardstick/images/action
324 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
326 1. Load Yardstick VM images;
327 2. Get image's information;
330 Which API to call will depend on the parameters.
340 'action': 'load_images'
346 Get image information
349 http://localhost:8888/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
357 http://localhost:8888/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
360 /api/v2/yardstick/tasks/action
362 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
364 1. Create a Yardstick task;
365 2. run a Yardstick task;
366 3. Add a test case to a task;
367 4. Add a test suite to a task;
368 5. Get a tasks' information;
371 Which API to call will depend on the parameters.
377 Create a Yardstick task
381 'action': 'create_task',
384 'project_id': project_id
403 Add a test case to a task
407 'action': 'add_case',
409 'case_name': 'opnfv_yardstick_tc002',
410 'case_content': case_content
418 Add a test suite to a task
422 'action': 'add_suite',
424 'suite_name': 'opnfv_smoke',
425 'suite_content': suite_content
432 Get a task's information
435 http://localhost:8888/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
442 http://localhost:8888/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
445 /api/v2/yardstick/testcases/action
447 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
449 1. Upload a test case;
450 2. Get all released test cases' information;
451 3. Get a certain released test case's information;
452 4. Delete a test case.
454 Which API to call will depend on the parameters.
464 'action': 'upload_case',
474 Get all released test cases' information
477 http://localhost:8888/api/v2/yardstick/testcases
483 Get a certain released test case's information
486 http://localhost:8888/api/v2/yardstick/testcases/opnfv_yardstick_tc002
492 Delete a certain test case
494 http://localhost:8888/api/v2/yardstick/testcases/opnfv_yardstick_tc002
497 /api/v2/yardstick/testsuites/action
499 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
501 1. Create a test suite;
502 2. Get a certain test suite's information;
503 3. Get all test suites;
504 4. Delete a test case.
506 Which API to call will depend on the parameters.
516 'action': 'create_sutie',
518 'name': <suite_name>,
520 'opnfv_yardstick_tc002'
529 Get a certain test suite's information
532 http://localhost:8888/api/v2/yardstick/testsuites/<suite_name>
541 http://localhost:8888/api/v2/yardstick/testsuites
547 Delete a certain test suite
550 http://localhost:8888/api/v2/yardstick/testsuites/<suite_name>
553 /api/v2/yardstick/projects/action
555 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
557 1. Create a Yardstick project;
558 2. Get a certain project's information;
562 Which API to call will depend on the parameters.
568 Create a Yardstick project
572 'action': 'create_project',
582 Get a certain project's information
585 http://localhost:8888/api/v2/yardstick/projects/<project_id>
591 Get all projects' information
594 http://localhost:8888/api/v2/yardstick/projects
600 Delete a certain project
603 http://localhost:8888/api/v2/yardstick/projects/<project_id>
606 /api/v2/yardstick/containers/action
608 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
610 1. Create a Grafana Docker container;
611 2. Create an InfluxDB Docker container;
612 3. Get a certain container's information;
613 4. Delete a container.
615 Which API to call will depend on the parameters.
621 Create a Grafana Docker container
625 'action': 'create_grafana',
627 'environment_id': <environment_id>
635 Create an InfluxDB Docker container
639 'action': 'create_influxdb',
641 'environment_id': <environment_id>
649 Get a certain container's information
652 http://localhost:8888/api/v2/yardstick/containers/<container_id>
658 Delete a certain container
661 http://localhost:8888/api/v2/yardstick/containers/<container_id>