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_TENANT_NAME": "admin",
256 "OS_USERNAME": "admin",
257 "OS_USER_DOMAIN_NAME": "default"
259 'environment_id': environment_id
266 Get openrc file information
269 http://localhost:8888/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
278 http://localhost:8888/api/v2/yardstick/openrcs/5g6g3e02-155a-4847-a5f8-154f1b31db8c
281 /api/v2/yardstick/pods/action
283 Description: This API provides functionality of handling Yardstick pod file (pod.yaml). For Euphrates, it supports:
285 1. Upload a pod file;
286 2. Get pod file information;
287 3. Delete an openrc file.
289 Which API to call will depend on the parameters.
295 Upload a pod.yaml file
299 'action': 'upload_pod_file',
302 'environment_id': environment_id
309 Get pod file information
312 http://localhost:8888/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
320 http://localhost:8888/api/v2/yardstick/pods/5g6g3e02-155a-4847-a5f8-154f1b31db8c
323 /api/v2/yardstick/images/action
325 Description: This API is used to do some work related to Yardstick VM images. For Euphrates, it supports:
327 1. Load Yardstick VM images;
328 2. Get image's information;
331 Which API to call will depend on the parameters.
341 'action': 'load_images'
347 Get image information
350 http://localhost:8888/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
358 http://localhost:8888/api/v2/yardstick/images/5g6g3e02-155a-4847-a5f8-154f1b31db8c
361 /api/v2/yardstick/tasks/action
363 Description: This API is used to do some work related to yardstick tasks. For Euphrates, it supports:
365 1. Create a Yardstick task;
366 2. run a Yardstick task;
367 3. Add a test case to a task;
368 4. Add a test suite to a task;
369 5. Get a tasks' information;
372 Which API to call will depend on the parameters.
378 Create a Yardstick task
382 'action': 'create_task',
385 'project_id': project_id
404 Add a test case to a task
408 'action': 'add_case',
410 'case_name': 'opnfv_yardstick_tc002',
411 'case_content': case_content
419 Add a test suite to a task
423 'action': 'add_suite',
425 'suite_name': 'opnfv_smoke',
426 'suite_content': suite_content
433 Get a task's information
436 http://localhost:8888/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
443 http://localhost:8888/api/v2/yardstick/tasks/5g6g3e02-155a-4847-a5f8-154f1b31db8c
446 /api/v2/yardstick/testcases/action
448 Description: This API is used to do some work related to yardstick testcases. For Euphrates, it supports:
450 1. Upload a test case;
451 2. Get all released test cases' information;
452 3. Get a certain released test case's information;
453 4. Delete a test case.
455 Which API to call will depend on the parameters.
465 'action': 'upload_case',
475 Get all released test cases' information
478 http://localhost:8888/api/v2/yardstick/testcases
484 Get a certain released test case's information
487 http://localhost:8888/api/v2/yardstick/testcases/opnfv_yardstick_tc002
493 Delete a certain test case
495 http://localhost:8888/api/v2/yardstick/testcases/opnfv_yardstick_tc002
498 /api/v2/yardstick/testsuites/action
500 Description: This API is used to do some work related to yardstick test suites. For Euphrates, it supports:
502 1. Create a test suite;
503 2. Get a certain test suite's information;
504 3. Get all test suites;
505 4. Delete a test case.
507 Which API to call will depend on the parameters.
517 'action': 'create_sutie',
519 'name': <suite_name>,
521 'opnfv_yardstick_tc002'
530 Get a certain test suite's information
533 http://localhost:8888/api/v2/yardstick/testsuites/<suite_name>
542 http://localhost:8888/api/v2/yardstick/testsuites
548 Delete a certain test suite
551 http://localhost:8888/api/v2/yardstick/testsuites/<suite_name>
554 /api/v2/yardstick/projects/action
556 Description: This API is used to do some work related to yardstick test projects. For Euphrates, it supports:
558 1. Create a Yardstick project;
559 2. Get a certain project's information;
563 Which API to call will depend on the parameters.
569 Create a Yardstick project
573 'action': 'create_project',
583 Get a certain project's information
586 http://localhost:8888/api/v2/yardstick/projects/<project_id>
592 Get all projects' information
595 http://localhost:8888/api/v2/yardstick/projects
601 Delete a certain project
604 http://localhost:8888/api/v2/yardstick/projects/<project_id>
607 /api/v2/yardstick/containers/action
609 Description: This API is used to do some work related to Docker containers. For Euphrates, it supports:
611 1. Create a Grafana Docker container;
612 2. Create an InfluxDB Docker container;
613 3. Get a certain container's information;
614 4. Delete a container.
616 Which API to call will depend on the parameters.
622 Create a Grafana Docker container
626 'action': 'create_grafana',
628 'environment_id': <environment_id>
636 Create an InfluxDB Docker container
640 'action': 'create_influxdb',
642 'environment_id': <environment_id>
650 Get a certain container's information
653 http://localhost:8888/api/v2/yardstick/containers/<container_id>
659 Delete a certain container
662 http://localhost:8888/api/v2/yardstick/containers/<container_id>