forked from folio-org/mod-eusage-reports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheusage-reports-1.0.yaml
374 lines (372 loc) · 12.5 KB
/
eusage-reports-1.0.yaml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
openapi: 3.0.0
info:
title: EUsage Reports
version: v1
paths:
/eusage-reports/report-titles:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/facets.yaml
- $ref: parameters/limit.yaml
- $ref: parameters/query.yaml
- $ref: parameters/offset.yaml
- in: query
name: counterReportId
required: false
description: limit titles associated with counter report (UUID)
schema:
type: string
- in: query
name: providerId
required: false
description: limit titles associated with usage provider (UUID)
schema:
type: string
get:
description: Get titles with links to KB. The response contains facets response with facet type "status"
and counts for values "matched", "ignored", "unmatched. The resulting set can be limited by parameter
query (CQL) as well as counterReportId and providerId (these are NOT part of CQL). The CQL query itself
supports fields "cql.allRecords", "id", "counterReportTitle", "ISBN", "printISSN", "onlineISSN",
"kbTitleId" and "kbManualMatch".
operationId: getReportTitles
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/reportTitles.json
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
post:
description: POST titles with links to KB
operationId: postReportTitles
requestBody:
content:
application/json:
schema:
$ref: schemas/reportTitles.json
responses:
"204":
description: OK
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/report-packages:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/offset.yaml
- $ref: parameters/limit.yaml
- $ref: parameters/query.yaml
get:
description: Get KB title - package relationship.
operationId: getReportPackages
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/reportPackages.json
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/report-titles/from-counter:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
post:
description: Parse counter reports
operationId: postFromCounter
requestBody:
content:
application/json:
schema:
$ref: schemas/fromCounterRequest.json
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/fromCounterResponse.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/title-data:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/offset.yaml
- $ref: parameters/limit.yaml
- $ref: parameters/query.yaml
get:
description: Get counter report title data.
operationId: getTitleData
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/titleDataEntries.json
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/report-data:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/offset.yaml
- $ref: parameters/limit.yaml
- $ref: parameters/query.yaml
get:
description: This returns data for parsed agreements.
operationId: getReportData
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/reportDataEntries.json
"400":
$ref: "#/components/responses/trait_400"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/report-data/from-agreement:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
post:
description: Parse agreements and populate report data
operationId: postFromAgreement
requestBody:
content:
application/json:
schema:
$ref: schemas/fromAgreementRequest.json
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/fromAgreementResponse.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/stored-reports/use-over-time:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/access-count-period.yaml
- $ref: parameters/agreement-id.yaml
- $ref: parameters/csv.yaml
- $ref: parameters/start-date.yaml
- $ref: parameters/end-date.yaml
- $ref: parameters/format.yaml
- $ref: parameters/include-oa.yaml
- $ref: parameters/full.yaml
get:
description: Return usage data over time, where usageDateRange falls within startDate, endDate
operationId: getUseOverTime
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/report.json
example:
$ref: examples/report.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/stored-reports/reqs-by-date-of-use:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/access-count-period.yaml
- $ref: parameters/agreement-id.yaml
- $ref: parameters/csv.yaml
- $ref: parameters/start-date.yaml
- $ref: parameters/end-date.yaml
- $ref: parameters/format.yaml
- $ref: parameters/include-oa.yaml
- $ref: parameters/yop-interval.yaml
- $ref: parameters/full.yaml
get:
description: Return requests by date of use; this is like use over time but additionally groups by publication year.
operationId: getReqsByDateOfUse
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/report.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/stored-reports/reqs-by-pub-year:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/access-count-period.yaml
- $ref: parameters/agreement-id.yaml
- $ref: parameters/csv.yaml
- $ref: parameters/start-date.yaml
- $ref: parameters/end-date.yaml
- $ref: parameters/format.yaml
- $ref: parameters/include-oa.yaml
- $ref: parameters/period-of-use.yaml
- $ref: parameters/full.yaml
get:
description: Return requests by publication year where usageDateRange falls within startDate, endDate.
Grouping controlled by periodOfUse.
"accessCountPeriods" array lists the publication years to be used as column labels for numbers in the
"totalItemRequestsByPeriod", "uniqueItemRequestsByPeriod" and "accessCountsByPeriod" arrays.
operationId: getReqsByPubYear
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/report.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/stored-reports/cost-per-use:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: parameters/access-count-period.yaml
- $ref: parameters/agreement-id.yaml
- $ref: parameters/csv.yaml
- $ref: parameters/start-date.yaml
- $ref: parameters/end-date.yaml
- $ref: parameters/format.yaml
- $ref: parameters/include-oa.yaml
- $ref: parameters/full.yaml
get:
description: Return cost per where usageDateRange falls within startDate, endDate.
The report is structured in periods, typically months, and the cost-per-use in a period is
invoiced amount divided by download count (unique or total) and further divided in number of
periods where any title has downloads. This way the cost for download is divided into periods
(with non-zero use) and then evenly divided across titles within those periods.
Consider agreement that has two titles, titleA and titleB where titleA has
downloads in May and June. titleB has downloads in June only. In May, the title count is 1.
In June, the title count is 2. The total periods where any title occurs is p = 2+1 = 3.
Cost per download for titleA in May is (paidAmount/p) / downloads(TitleA,May) and in
June (paidAmount/p) / downloads(TitleA,June).
Cost per download for titleB in June is paidAmount/p / downloads(TitleB,June).
operationId: getCostPerUse
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/reportCost.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/eusage-reports/report-data/status/{id}:
parameters:
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- in: path
name: id
required: true
description: agreement identifier
schema:
type: string
format: uuid
get:
description: Return status of operation associated with identifier.
operationId: getReportStatus
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: schemas/reportStatus.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
components:
responses:
trait_400:
description: Bad request
content:
text/plain:
schema:
type: string
example: Invalid JSON in request
application/json:
schema:
type: object
example: {"error":"Invalid JSON in request"}
trait_404:
description: Not Found
content:
text/plain:
schema:
type: string
example: Identifier 596d9f60-cda3-44d2-a4a1-2f48b7d4d23c not found
application/json:
schema:
type: object
example: {"error":"Identifier 596d9f60-cda3-44d2-a4a1-2f48b7d4d23c not found"}
trait_500:
description: Internal error
content:
text/plain:
schema:
type: string
example: Internal server error, contact administrator
schemas:
errors:
$ref: schemas/errors.json