-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yaml
535 lines (535 loc) · 16.9 KB
/
openapi.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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
swagger: '2.0'
info:
title: Data Usage API
description: >-
The SASHIMI API represents a RESTful implementation of SUSHI
automation intended to returns COUNTER Research Data Release 1 reports
termsOfService: ''
contact:
name: DataCite Data Usage API
url: 'https://metrics.stage.datacite.org'
email: support@datacite.org
license:
name: MIT
url: 'https://raw.githubusercontent.com/datacite/sashimi/master/LICENSE'
version: "1.0.0"
schemes:
- https
securityDefinitions:
Bearer:
type: apiKey
description: >-
Unique code assigned by Content Provider to grant you access to this API. This apikey needs to be in the header.
name: Authorization
in: header
security:
- Bearer: []
paths:
/status:
get:
tags:
- status
description: >-
This resource returns the current status of the reporting service supported by this API.
produces:
- application/json
parameters:
- name: platform
in: query
description: >-
Name of the Platform the report data is being requested for. This can be omitted if the service provides report data for only one platform.
type: string
responses:
'200':
description: Status of the reporting service(s) supported by this API.
schema:
type: array
items:
$ref: '#/definitions/Status'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/heartbeat:
get:
tags:
- heartbeat
description: >-
This resource returns the current status of the reporting service supported by this API.
produces:
- text/plain
parameters:
- name: status
in: query
description: >-
Name of the Platform the report data is being requested for. This can be omitted if the service provides report data for only one platform.
type: string
responses:
'200':
description: Status of the services provided by this API.
schema:
type: array
items:
$ref: '#/definitions/Status'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/report_types:
get:
tags:
- report_types
description: >-
This resource returns a list of reports supported by the API for a given application.
produces:
- application/json
parameters:
- name: platform
in: query
description: >-
The name of the Platform the report data is being requested for. This can be omitted if the service provides report data for only one platform.
type: string
responses:
'200':
description: List of reports supported by this service for this application.
schema:
type: array
items:
$ref: '#/definitions/Report_Types'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/reports:
get:
tags:
- reports
description: 'This resource returns a collection of Dataset reports.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: platform
in: query
description: >-
Name of the Platform the usage is being requested for. This can be omitted if the service provides usage for only one platform.
type: string
- name: report_name
in: query
type: string
description: The long name of the report.
- name: report_id
type: string
in: query
description: >-
The report ID or code or shortname. Typically this will be the same code provided in the Report parameter of the request.
- name: release
type: string
in: query
description: The release or version of the report.
- name: created
type: string
in: query
format: dateTime
description: Time the report was prepared. Format as defined by date-time - RFC3339
- name: created_by
type: string
in: query
description: Name of the organization producing the report.
responses:
'200':
description: 'Dataset Master Report (DSR).'
schema:
$ref: '#/definitions/Report'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
post:
tags:
- reports
description: 'This resource returns a collection of Dataset reports.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: report
in: body
description: >-
Report of metrics proccesed in SUSHI format.
schema:
$ref: "#/definitions/Report"
responses:
'200':
description: 'Collection of Dataset Reports'
schema:
$ref: '#/definitions/Report'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/reports/{id}:
get:
tags:
- reports
description: 'This resource returns a specific Dataset report.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Report Unique ID. Identifier of a specific usage report is being requested for. If omitted, all reports on the platform with usage will be returned.
required: true
type: string
responses:
'200':
description: 'Usage Report Instance'
schema:
$ref: '#/definitions/Report'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
delete:
tags:
- reports
description: 'This resource deletes a specific Dataset report.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Report Unique ID. Identifier of a specific usage report is being deleted. If omitted, there should be a error.
required: true
type: string
responses:
'204':
description: The resource was deleted successfully.
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
put:
tags:
- reports
description: 'This resource returns an updated Dataset report.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Report Unique ID. Identifier of a specific usage report is being modified. If omitted, there should be a error.
required: true
type: string
responses:
'200':
description: 'Report Updated.'
schema:
$ref: '#/definitions/Report'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/publishers:
get:
tags:
- publishers
description: 'This resource returns a collection of reports publishers.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: platform
in: query
description: >-
Name of the Platform the usage is being requested for. This can be omitted if the service provides usage for only one platform.
type: string
- name: report_id
type: string
in: query
description: >-
The report ID or code or shortname. Typically this will be the same code provided in the Report parameter of the request.
responses:
'200':
description: 'Collections of Usage Reports.'
schema:
$ref: '#/definitions/Publisher'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
post:
tags:
- publishers
description: 'This resource creates a new of report publisher.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: publisher_id
in: body
description: >-
The ID of the organisation Content providers implementing the Code of Practice for Research Data.
schema:
$ref: '#/definitions/Publisher'
responses:
'200':
description: 'Publisher entity'
schema:
$ref: '#/definitions/Publisher'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
/publishers/{id}:
get:
tags:
- publishers
description: 'This resource returns a specific report publisher.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Publisher Unique ID. Identifier of a specific report publisher.
required: true
type: string
responses:
'200':
description: 'Publisher Instance'
schema:
$ref: '#/definitions/Publisher'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
delete:
tags:
- publishers
description: 'This resource deletes a Publisher.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Publisher Unique ID. Identifier of a specific report publisher.
required: true
type: string
responses:
'204':
description: The resource was deleted successfully.
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
put:
tags:
- publishers
description: 'This resource returns an updated Publisher Record.'
consumes:
- application/json
produces:
- application/json
parameters:
- name: id
in: path
description: >-
Publisher Unique ID. Identifier of a specific report publisher.
required: true
type: string
responses:
'200':
description: 'Report Updated.'
schema:
$ref: '#/definitions/Publisher'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error_Model'
definitions:
Error_Model:
type: object
description: Generalized format for presenting errors and exceptions.
required:
- code
- severity
- message
properties:
code:
type: integer
format: int32
description: Error number. See table of error.
example: 3040
severity:
type: string
description: Severity of the error.
example: Warning
enum:
- Warning
- Fatal
- Debug
- Info
message:
type: string
description: Text describing the error.
example: Partial Data Returned.
help_url:
type: string
description: URL describing error details.
cata:
type: string
description: Additional data provided by the server to clarify the error.
example: Usage data has not been processed for all requested months.
Publisher:
type: object
required:
- publisher_id
- publisher_name
properties:
publisher_name:
type: string
description: The long name of the publisher
example: CDL
publisher_id:
type: string
description: >-
The PID of the publisher.
example: CDLS3232323
Path:
type: string
description: The path to use when requesting this report on this service.
example: /publishers
Status:
type: object
required:
- serviceactive
properties:
description:
type: string
description: Description of the service.
example: COUNTER Research Data Usage Reports for the UK Data Service - ReShare.
serviceActive:
type: boolean
description: Indicator if the service is currently able to deliver reports.
example: true
registryURL:
type: string
description: >-
If available, the URL separate registry with additional information about the service.
example: 'https://www.projectcounter.org/counter-user/ebsco-database/'
note:
type: string
description: A general note about the service.
example: >-
A given customer can request a maximum of 5 requests per day for a given report
alerts:
type: array
description: Any alerts related to service interuptions and status.
items:
type: object
properties:
date_time:
type: string
format: dateTime
description: Date-time of the alert.
example: '2016-08-02: 12:54'
alert:
type: string
description: Text of the alert.
example: Service will be unavailable Sunday midnight...
Report:
type: object
description: Describes the formatting needs for the COUNTER Dataset Report. Response may include the Report_Header (optional), Report_Datasets (usage stats).
required:
- report_datasets
- report_id
- report_name
- release
- created_by
- reporting_period
properties:
id:
type: string
example: "0000-0000-0000-0000"
report_name:
type: string
description: The long name of the report.
example: Dataset Report
report_id:
type: string
description: >-
The report ID or code or shortname. Typically this will be the same code provided in the Report parameter of the request.
example: DSR
release:
type: string
description: The release or version of the report.
example: 'RD1'
created:
type: string
format: dateTime
description: Time the report was prepared. Format as defined by date-time - RFC3339
example: '2016-09-08T22:47:31Z'
created_by:
type: string
description: Name of the organization producing the report.
example: 'DataONE'
report_filters:
type: string
description: Zero or more report filters used for this report. Typically reflect filters provided on the Request. Filters limit the data to be reported on.
report_attributes:
type: string
description: Zero or more additional attributes applied to the report. Attributes inform the level of detail in the report.
reporting_period:
type: string
description: Time the report was prepared.
report_datasets:
type: string
description: Defines the output for the Report_Datasets being returned in a Dataset Report. Collection of datasets from the report.
exceptions:
type: array
description: Series of exceptions encounted when preparing the report.
items:
$ref: '#/definitions/Error_Model'
Report_Types:
type: object
required:
- report_id
- report_name
properties:
report_id:
type: string
description: >-
The code, ID or short name of the report that is be used in the request to identify the report.
example: DSR
release:
type: string
description: The release or version number of the report.
example: 'RD1'
report_description:
type: string
description: A short sentence describing the report.
example: Usage by Month and Dataset
Path:
type: string
description: The path to use when requesting this report on this service.
example: /report_types/dsr
host: metrics.stage.datacite.org