-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcounterreports.raml
217 lines (212 loc) · 6.43 KB
/
counterreports.raml
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
#%RAML 1.0
title: Counter Reports
version: v3.0
baseUri: http://localhost/mod-erm-usage
documentation:
- title: mod-erm-usage API
content: This documents the API calls that can be made to query and manage counter reports
types:
counterReportDocument: !include ./schemas/counterreport_document.json
counterReport: !include ./schemas/counterreport.json
counterReports: !include ./schemas/counterreports.json
counterReportsSorted: !include ./schemas/counterreports_sorted.json
errorCodes: !include ./schemas/errorcodes.json
reportTypes: !include ./schemas/reporttypes.json
reportReleases: !include ./schemas/reportreleases.json
errors: !include ./raml-util/schemas/errors.schema
traits:
orderable: !include ./raml-util/traits/orderable.raml
pageable: !include ./raml-util/traits/pageable.raml
searchable: !include ./raml-util/traits/searchable.raml
validate: !include ./raml-util/traits/validation.raml
resourceTypes:
collection: !include ./raml-util/rtypes/collection.raml
collection-item: !include ./raml-util/rtypes/item-collection.raml
/counter-reports:
displayName: Counter Reports
type:
collection:
exampleCollection: !include ./examples/counterreport_collection.sample
exampleItem: !include ./examples/counterreport.sample
schemaCollection: counterReports
schemaItem: counterReport
get:
is: [
searchable: {description: "", example: "yearMonth=\"2018-03\" and reportName=\"JR1\""},
orderable: {fieldsList: ""},
pageable
]
queryParameters:
tiny:
type: boolean
required: false
default: false
description: Get all reports. If query parameter tiny is set to true, the reports' metadata is returned without the actual counter reports.
post:
is: [validate]
description: Post new report
/{id}:
type:
collection-item:
exampleItem: !include ./examples/counterreport.sample
schema: counterReport
get:
description: Get one report identified by id
delete:
description: Delete report identified by id
put:
description: Put report identified by id
/download:
get:
description: Download report in its original format
responses:
200:
description: OK
body:
application/xml:
application/json:
404:
description: Not Found
500:
description: Server Error
body:
text/plain:
/sorted:
/{udpId}:
get:
description: Get counter reports sorted by year and report
responses:
200:
description: counter reports sorted by year and report
body:
application/json:
example: !include examples/counterreports_sorted.sample
schema: counterReportsSorted
400:
body:
text/plain:
500:
body:
text/plain:
/export:
/{id}:
get:
queryParameters:
format:
type: string
required: false
default: "csv"
description: Get the report identified by id as specified format (default is CSV)
responses:
200:
body:
text/csv:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
400:
body:
text/plain:
404:
422:
body:
text/plain:
500:
description: Server Error
body:
text/plain:
/provider/{id}/report/{name}/version/{aversion}/from/{begin}/to/{end}:
get:
queryParameters:
format:
type: string
required: false
default: "csv"
description: Get report for several months as specified format (default is CSV)
responses:
200:
body:
text/csv:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
400:
body:
text/plain:
500:
description: Server Error
body:
text/plain:
/multipartupload/provider/{id}:
description: Upload a report from file via multipart-form for a provider identified by id
post:
queryParameters:
overwrite:
description: Overwrite existing reports?
type: boolean
default: false
is: [validate]
body:
multipart/form-data:
responses:
200:
body:
text/plain:
400:
body:
text/plain:
500:
body:
text/plain:
/errors/codes:
get:
description: Get counter/sushi error codes existent in counter reports
responses:
200:
description: error codes existent in counter reports
body:
application/json:
example: !include examples/errorcodes.sample
schema: errorCodes
500:
body:
text/plain:
/reports/types:
get:
description: Get report types of available counter reports
responses:
200:
description: available report types
body:
application/json:
example: !include examples/reporttypes.sample
schema: reportTypes
500:
body:
text/plain:
/reports/releases:
get:
description: Get report release versions of available counter reports
responses:
200:
description: available report release versions
body:
application/json:
example: !include examples/reportreleases.sample
schema: reportReleases
500:
body:
text/plain:
/reports/delete:
post:
description: Delete multiple counter reports
body:
application/json:
type: array
items:
type: string
example: ["e05e1089-7810-4f07-844f-5c4b8db7395e", "ed05a906-c36e-4c3b-a37d-2a52ca8580da"]
responses:
204:
400:
body:
text/plain:
500:
body:
text/plain: