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