1WAIVERDB(7)                        WaiverDB                        WAIVERDB(7)
2
3
4

NAME

6       waiverdb - WaiverDB REST API
7
8       WavierDB offers a HTTP REST API.
9

REST API

11       GET /api/v1.0/about
12              Returns  the current running version and the method used for au‐
13              thentication.
14
15              Sample response:
16
17                 HTTP/1.0 200 OK
18                 Content-Length: 55
19                 Content-Type: application/json
20                 Date: Tue, 31 Oct 2017 04:29:19 GMT
21                 Server: Werkzeug/0.11.10 Python/2.7.13
22
23                 {
24                   "auth_method": "OIDC",
25                   "version": "0.3.1"
26                 }
27
28              Status Codes
29
30200 OK – Currently running  waiverdb  software  version
31                       and authentication are returned.
32
33       GET /api/v1.0/config
34              Returns  the current configuration (PERMISSION_MAPPING and SUPE‐
35              RUSERS).
36
37              Note: PERMISSION_MAPPING is deprecated, use  GET  /api/v1.0/per‐
38              missions instead.
39
40              Sample response:
41
42                 HTTP/1.0 200 OK
43                 Content-Length: 55
44                 Content-Type: application/json
45                 Date: Tue, 31 Oct 2017 04:29:19 GMT
46                 Server: Werkzeug/0.11.10 Python/2.7.13
47
48                 {
49                   "permission_mapping": {
50                       "^kernel-qe": {
51                           "groups": ["devel", "qa"],
52                           "users": []
53                       }
54                   },
55                   "superusers": ["alice", "bob"]
56                 }
57
58              Status Codes
59
60200 OK – Configuration is returned.
61
62       GET /api/v1.0/permissions
63              Returns the waiver permissions.
64
65              Sample response:
66
67                 HTTP/1.0 200 OK
68                 Content-Length: 999
69                 Content-Type: application/json
70                 Server: gunicorn/20.0.4
71                 Date: Wed, 10 Mar 2021 08:00:00 GMT
72
73                 [
74                     {
75                         "name": "kernel-qe",
76                         "maintainers": ["alice@example.com"],
77                         "testcases": ["kernel-qe.*"],
78                         "groups": ["devel", "qa"],
79                         "users": ["alice@example.com"]
80                     },
81                     {
82                         "name": "Greenwave Tests",
83                         "maintainers": ["greenwave-dev@example.com"],
84                         "testcases": ["greenwave-tests.*"],
85                         "groups": [],
86                         "users": ["HTTP/greenwave-dev.tests.example.com"]
87                     }
88                 ]
89
90              JSON Parameters
91
92testcase  (string) – If specified, only permissions for
93                       given test case is returned.
94
95              Status Codes
96
97200 OK – Permissions are returned.
98
99       POST /api/v1.0/waivers/
100              Create a new waiver or multiple waivers.
101
102              To create multiple waivers, pass list of dict instead.  Response
103              also contains list on success.
104
105              Sample request:
106
107                 POST /api/v1.0/waivers/ HTTP/1.1
108                 Host: localhost:5004
109                 Accept-Encoding: gzip, deflate
110                 Accept: application/json
111                 Connection: keep-alive
112                 User-Agent: HTTPie/0.9.4
113                 Content-Type: application/json
114                 Content-Length: 91
115
116                 {
117                     "subject_type": "compose",
118                     "subject_identifier": "Fedora-9000-19700101.n.18",
119                     "testcase": "compose.install_no_user",
120                     "waived": false,
121                     "product_version": "Parrot",
122                     "comment": "This is fine"
123                 }
124
125              Sample response:
126
127                 HTTP/1.0 201 CREATED
128                 Content-Length: 228
129                 Content-Type: application/json
130                 Date: Thu, 16 Mar 2017 17:42:04 GMT
131                 Server: Werkzeug/0.12.1 Python/2.7.13
132
133                 {
134                     "comment": "This is fine",
135                     "id": 15,
136                     "product_version": "Parrot",
137                     "subject_type": "compose",
138                     "subject_identifier": "Fedora-9000-19700101.n.18",
139                     "testcase": "compose.install_no_user",
140                     "scenario": null,
141                     "timestamp": "2017-03-16T17:42:04.209638",
142                     "username": "jcline",
143                     "waived": false,
144                     "proxied_by": null
145                 }
146
147              JSON Parameters
148
149subject_type  (string)  –  The type of thing which this
150                       waiver is for.
151
152subject_identifier (string) –  The  identifier  of  the
153                       thing this waiver is for. The semantics of this identi‐
154                       fier depend on the “subject_type”.  For  example,  Koji
155                       builds are identified by their NVR.
156
157testcase (string) – The result testcase for the waiver.
158
159scenario (string) – The result scenario for the waiver.
160
161waived (boolean) – Whether or not the result is waived.
162
163product_version (string) – The product version string.
164
165comment (string) – A comment explaining the waiver.
166
167username (string) – Username on whose behalf the caller
168                       is proxying.
169
170              Status Codes
171
172201 Created – The waiver was successfully created.
173
174       GET /api/v1.0/waivers/
175              Get waiver records.
176
177              Sample request:
178
179                 GET /api/v1.0/waivers/ HTTP/1.1
180                 Host: localhost:5004
181                 User-Agent: curl/7.51.0
182                 Accept: application/json
183
184              Sample response:
185
186                 HTTP/1.1 200 OK
187                 Content-Type: application/json
188                 Content-Length: 184
189                 Server: Werkzeug/0.12.1 Python/2.7.13
190                 Date: Thu, 16 Mar 2017 13:53:14 GMT
191
192                 {
193                     "data": [],
194                     "first": "http://localhost:5004/api/v1.0/waivers/?page=1",
195                     "last": "http://localhost:5004/api/v1.0/waivers/?page=0",
196                     "next": null,
197                     "prev": null
198                 }
199
200              Query Parameters
201
202page (int) – The page to get.
203
204limit (int) – Limit the number of items returned.
205
206subject_type (string) – Only include  waivers  for  the
207                       given subject type.
208
209subject_identifier  (string) – Only include waivers for
210                       the given subject identifier.
211
212testcase (string) – Only include waivers for the  given
213                       test case name.
214
215scenario  (string) – Only include waivers for the given
216                       scenario name.
217
218product_version (string) – Only include waivers for the
219                       given product version.
220
221username  (string)  –  Only  include waivers which were
222                       submitted by the given user.
223
224proxied_by (string) – Only include waivers  which  were
225                       proxied on behalf of someone else by the given user.
226
227since  (string)  – An ISO 8601 formatted datetime (e.g.
228                       2017-03-16T13:40:05+00:00) to filter  results  by.  Op‐
229                       tionally  provide  a second ISO 8601 datetime separated
230                       by   a   comma    to    retrieve    a    range    (e.g.
231                       2017-03-16T13:40:05+00:00, 2017-03-16T13:40:15+00:00)
232
233include_obsolete  (boolean) – If true, obsolete waivers
234                       will be included.
235
236              Status Codes
237
238200 OK – If the query was valid and  no  problems  were
239                       encountered.   Note that the response may still contain
240                       0 waivers.
241
242400 Bad Request – The request was malformed  and  could
243                       not be processed.
244
245       POST /api/v1.0/waivers/+by-subjects-and-testcases
246              Deprecated. Use POST /api/v1.0/waivers/+filtered instead.
247
248              Instead of making a deprecated request like this:
249
250                 POST /api/v1.0/waivers/+by-subjects-and-testcases HTTP/1.1
251                 Content-Type: application/json
252
253                 {
254                      "results": [
255                          {
256                              "subject": {"productmd.compose.id": "Fedora-9000-19700101.n.18"},
257                              "testcase": "compose.install_no_user"
258                          },
259                          {
260                              "subject": {"item": "gzip-1.9-1.fc28", "type": "koji_build"},
261                              "testcase": "dist.rpmlint"
262                          }
263                      ]
264                 }
265
266              make the following equivalent request:
267
268                 POST /api/v1.0/waivers/+filtered HTTP/1.1
269                 Content-Type: application/json
270
271                 {
272                      "filters": [
273                          {
274                              "subject_type": "compose",
275                              "subject_identifier": "Fedora-9000-19700101.n.18",
276                              "testcase": "compose.install_no_user"
277                          },
278                          {
279                              "subject_type": "koji_build",
280                              "subject_identifier": "gzip-1.9-1.fc28",
281                              "testcase": "dist.rpmlint"
282                          }
283                      ]
284                 }
285
286       POST /api/v1.0/waivers/+filtered
287              Get waiver records, filtered by some criteria.
288
289              This  API behaves the same way as GET /api/v1.0/waivers/, but it
290              allows for longer or more complex filter criteria that cannot be
291              expressed in the query string.
292
293              Note  that  the  response is not paginated (that is, all waivers
294              are returned in the ‘data’ key, even if there is a large  number
295              of them).
296
297              Sample request:
298
299                 POST /api/v1.0/waivers/+filtered HTTP/1.1
300                 Accept: application/json
301                 Content-Type: application/json
302
303                 {
304                      "filters": [
305                          {
306                              "subject_type": "compose",
307                              "subject_identifier": "Fedora-9000-19700101.n.18",
308                              "testcase": "compose.install_no_user"
309                          },
310                          {
311                              "subject_type": "koji_build",
312                              "subject_identifier": "gzip-1.9-1.fc28",
313                              "testcase": "dist.rpmlint"
314                          }
315                      ]
316                 }
317
318              Sample response:
319
320                 HTTP/1.1 200 OK
321                 Content-Type: application/json
322
323                 {
324                      "data": [
325                          {
326                              "id": 15,
327                              "comment": "The tests broke",
328                              "product_version": "fedora-27",
329                              "subject_type": "compose",
330                              "subject_identifier": "Fedora-9000-19700101.n.18",
331                              "testcase": "compose.install_no_user",
332                              "scenario": null,
333                              "timestamp": "2017-03-16T17:42:04.209638",
334                              "username": "jcline",
335                              "waived": true,
336                              "proxied_by": null
337                          }
338                      ]
339                 }
340
341              JSON Parameters
342
343filters (list) – List of filter dicts. If the list con‐
344                       tains multiple filter dicts,  they  are  combined  with
345                       logical  OR.  Within each filter dict, the criteria are
346                       combined with logical AND. Keys within the filter  dict
347                       are  the  same  as the filtering parameters accepted by
348                       GET /api/v1.0/waivers/.
349
350include_obsolete (boolean) – If true, obsolete  waivers
351                       will be included.
352
353              Status Codes
354
355200 OK – Returns matching waivers, if any.
356
357400  Bad  Request  – The request was malformed (invalid
358                       filter critera).
359
360       GET /api/v1.0/waivers/(int: waiver_id)
361              Get a single waiver by waiver ID.
362
363              Parameters
364
365waiver_id (int) – The waiver’s database ID.
366
367              Status Codes
368
369200 OK – The waiver was found and returned.
370
371404 Not Found – No waiver exists with that ID.
372
373       GET /healthcheck
374              Request  handler  for  performing  an  application-level  health
375              check. This is not part of the published API, it is intended for
376              use by OpenShift or other monitoring tools.
377
378              Returns a 200 response if the application is alive and  able  to
379              serve requests.
380

AUTHOR

382       Red Hat, Inc. and others
383
385       2021, Red Hat, Inc. and others
386
387
388
389
3901.4                              Nov 10, 2021                      WAIVERDB(7)
Impressum