summaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/08-api.rst
blob: 1d9ea6d64ee1ce9ee882968a30d8bd41f4666081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
.. This work is licensed under a Creative Commons Attribution 4.0 International
.. License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) OPNFV, Huawei Technologies Co.,Ltd and others.

Yardstick Restful API
======================


Abstract
--------

Yardstick support restful API in danube.


Available API
-------------

/yardstick/env/action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Description: This API is used to do some work related to environment. For now, we support:

1. Prepare yardstick environment(Including fetch openrc file, get external network and load images)
2. Start a InfluxDB docker container and config yardstick output to InfluxDB.
3. Start a Grafana docker container and config with the InfluxDB.

Which API to call will depend on the Parameters.


Method: POST


Prepare Yardstick Environment
Example::

    {
        'action': 'prepareYardstickEnv'
    }

This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.


Start and Config InfluxDB docker container
Example::

    {
        'action': 'createInfluxDBContainer'
    }

This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.


Start and Config Grafana docker container
Example::

    {
        'action': 'createGrafanaContainer'
    }

This is an asynchronous API. You need to call /yardstick/asynctask API to get the task result.


/yardstick/asynctask
^^^^^^^^^^^^^^^^^^^^

Description: This API is used to get the status of asynchronous task


Method: GET


Get the status of asynchronous task
Example::

    http://localhost:8888/yardstick/asynctask?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c

The returned status will be 0(running), 1(finished) and 2(failed).


/yardstick/testcases
^^^^^^^^^^^^^^^^^^^^

Description: This API is used to list all release test cases now in yardstick.


Method: GET


Get a list of release test cases
Example::

    http://localhost:8888/yardstick/testcases


/yardstick/testcases/release/action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Description: This API is used to run a yardstick release test case.


Method: POST


Run a release test case
Example::

    {
        'action': 'runTestCase',
        'args': {
            'opts': {},
            'testcase': 'tc002'
        }
    }

This is an asynchronous API. You need to call /yardstick/results to get the result.


/yardstick/testcases/samples/action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Description: This API is used to run a yardstick sample test case.


Method: POST


Run a sample test case
Example::

    {
        'action': 'runTestCase',
        'args': {
            'opts': {},
            'testcase': 'ping'
        }
    }

This is an asynchronous API. You need to call /yardstick/results to get the result.


/yardstick/testsuites/action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Description: This API is used to run a yardstick test suite.


Method: POST


Run a test suite
Example::

    {
        'action': 'runTestSuite',
        'args': {
            'opts': {},
            'testcase': 'smoke'
        }
    }

This is an asynchronous API. You need to call /yardstick/results to get the result.


/yardstick/results
^^^^^^^^^^^^^^^^^^


Description: This API is used to get the test results of certain task. 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.


Get test results of one task
Example::

    http://localhost:8888/yardstick/results?task_id=3f3f5e03-972a-4847-a5f8-154f1b31db8c

This API will return a list of test case result