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 GET /api/v1.0/waivers/
60 Get waiver records.
61
62 Sample request:
63
64 GET /api/v1.0/waivers/ HTTP/1.1
65 Host: localhost:5004
66 User-Agent: curl/7.51.0
67 Accept: application/json
68
69 Sample response:
70
71 HTTP/1.1 200 OK
72 Content-Type: application/json
73 Content-Length: 184
74 Server: Werkzeug/0.12.1 Python/2.7.13
75 Date: Thu, 16 Mar 2017 13:53:14 GMT
76
77 {
78 "data": [],
79 "first": "http://localhost:5004/api/v1.0/waivers/?page=1",
80 "last": "http://localhost:5004/api/v1.0/waivers/?page=0",
81 "next": null,
82 "prev": null
83 }
84
85 Query Parameters
86
87 · page (int) – The page to get.
88
89 · limit (int) – Limit the number of items returned.
90
91 · subject_type (string) – Only include waivers for the
92 given subject type.
93
94 · subject_identifier (string) – Only include waivers for
95 the given subject identifier.
96
97 · testcase (string) – Only include waivers for the given
98 test case name.
99
100 · product_version (string) – Only include waivers for the
101 given product version.
102
103 · username (string) – Only include waivers which were
104 submitted by the given user.
105
106 · proxied_by (string) – Only include waivers which were
107 proxied on behalf of someone else by the given user.
108
109 · since (string) – An ISO 8601 formatted datetime (e.g.
110 2017-03-16T13:40:05+00:00) to filter results by.
111 Optionally provide a second ISO 8601 datetime separated
112 by a comma to retrieve a range (e.g.
113 2017-03-16T13:40:05+00:00, 2017-03-16T13:40:15+00:00)
114
115 · include_obsolete (boolean) – If true, obsolete waivers
116 will be included.
117
118 Status Codes
119
120 · 200 OK – If the query was valid and no problems were
121 encountered. Note that the response may still contain
122 0 waivers.
123
124 · 400 Bad Request – The request was malformed and could
125 not be processed.
126
127 POST /api/v1.0/waivers/
128 Create a new waiver or multiple waivers.
129
130 To create multiple waivers, pass list of dict instead. Response
131 also contains list on success.
132
133 Sample request:
134
135 POST /api/v1.0/waivers/ HTTP/1.1
136 Host: localhost:5004
137 Accept-Encoding: gzip, deflate
138 Accept: application/json
139 Connection: keep-alive
140 User-Agent: HTTPie/0.9.4
141 Content-Type: application/json
142 Content-Length: 91
143
144 {
145 "subject_type": "compose",
146 "subject_identifier": "Fedora-9000-19700101.n.18",
147 "testcase": "compose.install_no_user",
148 "waived": false,
149 "product_version": "Parrot",
150 "comment": "This is fine"
151 }
152
153 Sample response:
154
155 HTTP/1.0 201 CREATED
156 Content-Length: 228
157 Content-Type: application/json
158 Date: Thu, 16 Mar 2017 17:42:04 GMT
159 Server: Werkzeug/0.12.1 Python/2.7.13
160
161 {
162 "comment": "This is fine",
163 "id": 15,
164 "product_version": "Parrot",
165 "subject_type": "compose",
166 "subject_identifier": "Fedora-9000-19700101.n.18",
167 "testcase": "compose.install_no_user",
168 "timestamp": "2017-03-16T17:42:04.209638",
169 "username": "jcline",
170 "waived": false,
171 "proxied_by": null
172 }
173
174 JSON Parameters
175
176 · subject_type (string) – The type of thing which this
177 waiver is for.
178
179 · subject_identifier (string) – The identifier of the
180 thing this waiver is for. The semantics of this identi‐
181 fier depend on the “subject_type”. For example, Koji
182 builds are identified by their NVR.
183
184 · testcase (string) – The result testcase for the waiver.
185
186 · waived (boolean) – Whether or not the result is waived.
187
188 · product_version (string) – The product version string.
189
190 · comment (string) – A comment explaining the waiver.
191
192 · username (string) – Username on whose behalf the caller
193 is proxying.
194
195 Status Codes
196
197 · 201 Created – The waiver was successfully created.
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 2020, Red Hat, Inc. and others
339
340
341
342
3431.1 Mar 10, 2020 WAIVERDB(7)