-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.yaml
More file actions
551 lines (532 loc) · 20 KB
/
api.yaml
File metadata and controls
551 lines (532 loc) · 20 KB
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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
openapi: 3.0.0
servers:
- description: SwaggerHub API Auto Mocking
url: https://localhost:8080/
info:
title: DataFeeder API
description: This API covers dataset upload and publishing features of the application
version: "1.0.0"
contact:
email: psc@georchestra.org
tags:
- name: File Upload
description: 'API to control jobs related to form based file upload of geospatial datasets'
- name: Data Publishing
description: 'API to control jobs related to publishing geospatial datasets previously uploaded'
paths:
/config/frontend:
get:
tags:
- Config
description: 'Get the front-end application configuration object'
operationId: getFrontendConfig
responses:
200:
description: Front-end application configuration object
content:
application/json:
schema:
type: object
401:
description: 'Not authenticated'
/upload:
post:
tags:
- File Upload
description: Upload one or multiple files to the server, and get a handle to the job.
Once the files are uploaded, the analysis process is automatically triggered. Its status can be polled with GET /upload/{jobId}
operationId: uploadFiles
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
filename:
type: array
items:
type: string
format: binary
responses:
200:
$ref: '#/components/responses/UploadStatusResponse'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges to upload files'
get:
tags:
- File Upload
description: 'Poll the status of all the upload jobs owned by the calling user'
operationId: findUserUploadJobs
responses:
200:
$ref: '#/components/responses/UploadStatusResponseList'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges to query other users jobs'
/upload/all:
get:
tags:
- File Upload
description: 'Poll the status of all the upload jobs. Access restricted to administrators'
operationId: findAllUploadJobs
responses:
200:
$ref: '#/components/responses/UploadStatusResponseList'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges to upload files'
/upload/{jobId}:
get:
tags:
- File Upload
description: 'Poll the status of a given upload job by id'
operationId: findUploadJob
parameters:
- $ref: '#/components/parameters/jobId'
responses:
200:
$ref: '#/components/responses/UploadStatusResponse'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
delete:
tags:
- File Upload
description: 'Remove a job and all its resources (e.g. temporary files). Does not unpublish. Use abort=true to abort a running analysis or publishing job'
operationId: removeJob
parameters:
- $ref: '#/components/parameters/jobId'
- name: abort
in: query
description: If true, abort the dataset analysis or publishing, if running. Defaults to false
required: false
schema:
type: boolean
default: false
responses:
204:
description: 'Job removed.'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
409:
description: 'Conflict. The abort=true parameter was not provided and the analysis or publishing job is running'
/upload/{jobId}/{typeName}/sampleFeature:
get:
tags:
- File Upload
operationId: getSampleFeature
description: Obtain a sample dataset feature in GeoJSON format, optionally specifying a feature index, crs, and/or dataset's character encoding.
The response encoding is always UTF-8. The 'encoding' parameter can be used to force reading the native data in a different charset.
The returned geometry CRS is controlled by the "srs", and "srsOverride" query parameters.
If none is provided, the geometry is returned as-is, in the dataset's native CRS (possibly null).
The "srsOverride" parameter allows to override the dataset's native CRS, which also means assuming a native CRS when the
dataset didn't provide a native CRS (e.g. a shapefile uploaded without .prj side-car file).
The "srs" parameter specifies the output geometry CRS. The geometry will be reprojected from the source CRS to the output CRS.
parameters:
- $ref: '#/components/parameters/jobId'
- $ref: '#/components/parameters/typeName'
- name: featureIndex
in: query
description: Optional feature index, if unspecified, the first feature (index 0) is returned
required: false
schema:
type: integer
format: int32
minimum: 0
- name: encoding
in: query
description: Optional, force dataset encoding
required: false
schema:
type: string
- name: srs
in: query
description: Optional, coordinate reference system (e.g. 'EPSG:3857')
required: false
schema:
type: string
- name: srsOverride
in: query
description: Optional, EPSG SRS used to override the native CRS, or assume a native SRS when the native CRS is unknown (for example, a shapefile uploaded without .prj side-car file).
This allows to request a feature using a source CRS for datasets that do not specify a native CRS, and still get a reprojected response to
another CRS in combination with the "srs" parameter.
required: false
schema:
type: string
example: EPSG:4326
responses:
202:
$ref: '#/components/responses/SampleFeatureResponse'
400:
description: 'Bad request. Some parameter is not acceptable or missing'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
/upload/{jobId}/{typeName}/bounds:
get:
tags:
- File Upload
operationId: getBounds
description: Get the bounding box of the dataset, optionally indicating the CRS and whether to reproject from the native CRS to the new one
The returned geometry CRS is controlled by the "srs", and "srsOverride" query parameters.
If none is provided, the geometry is returned as-is, in the dataset's native CRS (possibly null).
The "srsOverride" parameter allows to override the dataset's native CRS, which also means assuming a native CRS when the
dataset didn't provide a native CRS (e.g. a shapefile uploaded without .prj side-car file).
The "srs" parameter specifies the output geometry CRS. The geometry will be reprojected from the source CRS to the output CRS.
parameters:
- $ref: '#/components/parameters/jobId'
- $ref: '#/components/parameters/typeName'
- name: srs
in: query
description: Optional, output coordinate reference system (e.g. 'EPSG:3857')
required: false
schema:
type: string
- name: srsOverride
in: query
description: Optional, EPSG SRS used to override the native CRS, or assume a native SRS when the native CRS is unknown (for example, a shapefile uploaded without .prj side-car file).
This allows to request the dataset bounds using a user defined native CRS for datasets that do not specify a native CRS,
and still get a reprojected response to another CRS in combination with the "srs" parameter.
required: false
schema:
type: string
example: EPSG:4326
responses:
202:
$ref: '#/components/responses/BoundingBoxResponse'
400:
description: 'Bad request. Some parameter is not acceptable or missing'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
/upload/{jobId}/publish:
post:
tags:
- Data Publishing
description: 'Publish the dataset(s) from the given upload'
operationId: publish
parameters:
- $ref: '#/components/parameters/jobId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PublishRequest'
responses:
202:
$ref: '#/components/responses/PublishStatusResponse'
400:
description: 'Bad request. Some parameter is not acceptable or missing'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
409:
description: 'Conflict. The upload is not ready for publishing.'
get:
tags:
- Data Publishing
description: 'Poll the publishing staus of the given job'
operationId: getPublishingStatus
parameters:
- $ref: '#/components/parameters/jobId'
responses:
200:
$ref: '#/components/responses/PublishStatusResponse'
400:
description: 'Bad request. Some parameter is not acceptable or missing'
401:
description: 'Not authenticated'
403:
description: 'Forbidden. User has no priviledges access the requested job'
components:
parameters:
jobId:
name: jobId
in: path
description: Unique job identifier
required: true
schema:
type: string
format: uuid
typeName:
name: typeName
in: path
description: Feature type name
required: true
schema:
type: string
responses:
UploadStatusResponseList:
description: Processing status of a list of dataset upload job
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UploadJobStatus'
UploadStatusResponse:
description: Processing status of a dataset upload job
content:
application/json:
schema:
$ref: '#/components/schemas/UploadJobStatus'
PublishStatusResponse:
description: Processing status of a dataset publishing job
content:
application/json:
schema:
$ref: '#/components/schemas/PublishJobStatus'
SampleFeatureResponse:
description: Sample feature for an uploaded dataset
content:
application/geo+json:
schema:
type: object
BoundingBoxResponse:
description: dataset bounds in the requested CRS, if given, defaults to the native CRS
content:
application/json:
schema:
$ref: '#/components/schemas/BoundingBox'
schemas:
AnalysisStatusEnum:
type: string
enum: [PENDING, ANALYZING, DONE, ERROR]
description: aggregate of status of all datasets in the upload package. If any dataset status is PENDING, ANALYZING, or ERROR, that's the job's status.
If at least one dataset status is ERROR, then the job status is ERROR. If no datasets where recognized in the upload, status is ERROR.
PublishStatusEnum:
type: string
enum: [PENDING, RUNNING, DONE, ERROR]
PublishStepEnum:
type: string
enum: [SKIPPED, SCHEDULED, DATA_IMPORT_STARTED, DATA_IMPORT_FINISHED, OWS_PUBLISHING_STARTED, OWS_PUBLISHING_FINISHED, METADATA_PUBLISHING_STARTED, METADATA_PUBLISHING_FINISHED, OWS_METADATA_UPDATE_STARTED, OWS_METADATA_UPDATE_FINISHED, COMPLETED]
UploadJobStatus:
type: object
description: Describes the status of processing a dataset upload
properties:
jobId:
type: string
format: uuid
description: Identifier for the upload processing job
progress:
description: Estimated completion progress, from 0 to 1.
type: number
format: double
minimum: 0.0
maximum: 1.0
default: 0.0
status:
$ref: '#/components/schemas/AnalysisStatusEnum'
error:
type: string
description: short description of the error that prevents the job to complete successfully
datasets:
type: array
items:
$ref: '#/components/schemas/DatasetUploadStatus'
DatasetUploadStatus:
type: object
description: Describes a recognized uploaded dataset
properties:
name:
type: string
description: Name of the dataset in the uploaded package
status:
$ref: '#/components/schemas/AnalysisStatusEnum'
error:
type: string
description: short description of the error that prevents the dataset to be analysed
featureCount:
type: integer
format: int32
description: Number of features in the dataset
nativeBounds:
$ref: '#/components/schemas/BoundingBox'
encoding:
type: string
description: detected charset
options:
type: object
additionalProperties: true
description: Extra options provided for the dataset
format:
type: string
description: either SHP or CSV
Property:
type: object
properties:
name:
type: string
value:
type: string
type:
type: string
CRS:
type: object
description: Coordinate Reference System
properties:
srs:
type: string
description: Coordinate Reference System's EPSG identifier.
Can be null if a matching reference system couldn't be found in the EPSG database.
wkt:
type: string
description: Coordinate Reference System's Well Known Text representation. Despite the 'srs' identifier being found or not, the WKT representation is still available.
BoundingBox:
type: object
properties:
crs:
$ref: '#/components/schemas/CRS'
minx:
type: number
format: double
maxx:
type: number
format: double
miny:
type: number
format: double
maxy:
type: number
format: double
PublishRequest:
type: object
properties:
datasets:
type: array
items:
$ref: '#/components/schemas/DatasetPublishRequest'
DatasetMetadata:
type: object
description: User supplied dataset metadata information
required:
- title
- abstract
properties:
title:
type: string
description: Metadata title for the dataset
abstract:
type: string
description: Metadata abtract text for the dataset
maxLength: 4096
tags:
type: array
description: metadata keyworkds for the dataset
items:
type: string
creationDate:
description: Dataset creation date, in RFC3339 format
type: string
format: date
example: 2017-07-21
scale:
description: Optional, scale the data was created for (e.g. 500000 for a 1:500000 scale)
type: integer
format: int32
example: 25000
creationProcessDescription:
type: string
description: textual description of dataset lineage
maxLength: 4096
options:
type: object
additionalProperties: true
description: optional, extra options on the file format, mainly used for CSV.
DatasetPublishRequest:
type: object
description: Name of the dataset in the uploaded package, necessary to identify which dataset to publish from the UploadJobStatus
required:
- nativeName
- metadata
properties:
nativeName:
type: string
description: Name of the dataset in the uploaded package, necessary to identify which dataset to publish from the UploadJobStatus
publishedName:
type: string
description: Name under which the dataset is published to GeoServer, defaults to nativeName. It can be modified by the system to avoid duplicated layer names.
encoding:
type: string
description: Specify which charset (e.g. ISO-8859-1, UTF-8, etc.) to interpret the dataset alphanumeric properties with. Takes effect only for uploaded shapefiles.
srs:
description: Optional, Coordinate Reference System identifier to publish the dataset in. If not provided, the dataset is published using the CRS inferred
during the upload analysis process. If no CRS identifier was determined, the job will fail.
type: string
srs_reproject:
description: Optional, whether to reproject from the native CRS to the one provided in the srs parameter.
If false or not provided, the srs parameter overrides the native CRS without reprojection.
type: boolean
default: false
metadata:
$ref: '#/components/schemas/DatasetMetadata'
PublishJobStatus:
type: object
description: Describes the processing status of a publishing job for a given upload
properties:
jobId:
type: string
format: uuid
description: Identifier for the upload processing job
progress:
description: Estimated completion progress, from 0 to 1.
type: number
format: double
minimum: 0.0
maximum: 1.0
default: 0.0
status:
$ref: '#/components/schemas/PublishStatusEnum'
error:
type: string
description: short description of the error that prevents the job to complete successfully
datasets:
type: array
items:
$ref: '#/components/schemas/DatasetPublishingStatus'
DatasetPublishingStatus:
type: object
description: Describes the status of publishing a given dataset
properties:
nativeName:
type: string
description: Name of the dataset in the uploaded package, necessary to identify which dataset to publish from the UploadJobStatus
publishedWorkspace:
type: string
description: Name of the GeoServer workspace under which the dataset has been published.
publishedName:
type: string
description: Final name under which the layer was published to GeoServer. It may have been modified from the requested layer name
in order to avoid duplication if a layer with such name already exists in the target GeoServer workspace.
metadataRecordId:
type: string
description: Identifier for the metadta record created while publishing the dataset's metadata to GeoNetwork.
title:
type: string
status:
$ref: '#/components/schemas/PublishStatusEnum'
error:
type: string
description: short description of the error that prevents the dataset to be published
publish:
type: boolean
description: true if this dataset is scheduled to be published (as requested through a PublishRequest)
progress:
description: Estimated completion progress, from 0 to 1.
type: number
format: double
minimum: 0.0
maximum: 1.0
default: 0.0
progressStep:
$ref: '#/components/schemas/PublishStepEnum'