-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathopenapi.yaml
10390 lines (10359 loc) · 265 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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: OSRD Editoast
description: All HTTP endpoints of Editoast
license:
name: LGPL
url: https://www.gnu.org/licenses/lgpl-3.0.html
version: 0.1.0
paths:
/documents:
post:
tags:
- documents
summary: Post a new document (content_type by header + binary data)
parameters:
- name: content_type
in: header
description: The document's content type
required: true
schema:
type: string
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
required: true
responses:
'201':
description: The document was created
content:
application/json:
schema:
$ref: '#/components/schemas/NewDocumentResponse'
/documents/{document_key}:
get:
tags:
- documents
summary: Returns a document of any type
parameters:
- name: document_key
in: path
description: The document's key
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The document's binary content
content:
application/octet-stream:
schema:
type: string
format: binary
'404':
description: Document not found
content:
application/json:
schema:
$ref: '#/components/schemas/InternalError'
delete:
tags:
- documents
summary: Delete an existing document
parameters:
- name: document_key
in: path
description: The document's key
required: true
schema:
type: integer
format: int64
responses:
'204':
description: The document was deleted
'404':
description: Document not found
content:
application/json:
schema:
$ref: '#/components/schemas/InternalError'
/electrical_profile_set:
get:
tags:
- electrical_profiles
summary: Retrieve the list of ids and names of electrical profile sets available
responses:
'200':
description: The list of ids and names of electrical profile sets available
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/LightElectricalProfileSet'
post:
tags:
- electrical_profiles
summary: import a new electrical profile set
parameters:
- name: name
in: query
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ElectricalProfileSetData'
required: true
responses:
'200':
description: The list of ids and names of electrical profile sets available
content:
application/json:
schema:
$ref: '#/components/schemas/ElectricalProfileSet'
/electrical_profile_set/{electrical_profile_set_id}:
get:
tags:
- electrical_profiles
summary: Return a specific set of electrical profiles
parameters:
- name: electrical_profile_set_id
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The list of electrical profiles in the set
content:
application/json:
schema:
$ref: '#/components/schemas/ElectricalProfileSetData'
'404':
description: The requested electrical profile set was not found
content:
application/json:
schema:
$ref: '#/components/schemas/InternalError'
delete:
tags:
- electrical_profiles
summary: Delete an electrical profile set
parameters:
- name: electrical_profile_set_id
in: path
required: true
schema:
type: integer
format: int64
responses:
'204':
description: The electrical profile was deleted successfully
'404':
description: The requested electrical profie was not found
content:
application/json:
schema:
$ref: '#/components/schemas/InternalError'
/electrical_profile_set/{electrical_profile_set_id}/level_order:
get:
tags:
- electrical_profiles
summary: Return the electrical profile value order for this set
parameters:
- name: electrical_profile_set_id
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: A dictionary mapping electrification modes to a list of electrical profiles ordered by decreasing strength
content:
application/json:
schema:
type: object
additionalProperties:
$ref: '#/components/schemas/LevelValues'
example:
1500V:
- A
- B
- C
25000V:
- 25000V
- 22500V
- 20000V
'404':
description: The requested electrical profile set was not found
content:
application/json:
schema:
$ref: '#/components/schemas/InternalError'
/health:
get:
responses:
'200':
description: Check if Editoast is running correctly
content:
text/plain:
schema:
type: string
/infra:
get:
tags:
- infra
summary: Lists all infras along with their current loading state in Core
parameters:
- name: page
in: query
required: false
schema:
type: integer
format: int64
default: 1
minimum: 1
- name: page_size
in: query
required: false
schema:
type: integer
format: int64
default: 25
nullable: true
minimum: 1
responses:
'200':
description: All infras, paginated
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PaginationStats'
- type: object
required:
- results
properties:
results:
type: array
items:
$ref: '#/components/schemas/InfraWithState'
post:
tags:
- infra
summary: Creates an empty infra
description: The infra may be edited by batch later via the `POST /infra/ID` or `POST /infra/ID/railjson` endpoints.
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
description: The name to give to the new infra
additionalProperties: false
required: true
responses:
'201':
description: The created infra
content:
application/json:
schema:
$ref: '#/components/schemas/Infra'
/infra/railjson:
post:
tags:
- infra
summary: Import an infra from railjson
parameters:
- name: name
in: query
description: The name of the infrastructure.
required: true
schema:
type: string
- name: generate_data
in: query
description: Flag indicating whether to generate data.
required: false
schema:
type: boolean
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RailJson'
required: true
responses:
'201':
description: The imported infra id
content:
application/json:
schema:
type: object
required:
- infra
properties:
infra:
type: integer
format: int64
'404':
description: The infra was not found
/infra/refresh:
post:
tags:
- infra
summary: Refresh infra generated geographic layers
parameters:
- name: force
in: query
required: false
schema:
type: boolean
- name: infras
in: query
description: |-
A comma-separated list of infra IDs to refresh
If not provided, all available infras will be refreshed.
required: false
schema:
type: array
items:
type: integer
format: int64
minimum: 0
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
required:
- infra_refreshed
properties:
infra_refreshed:
type: array
items:
type: integer
format: int64
description: The list of infras that were refreshed successfully
'404':
description: Invalid infra ID query parameters
/infra/voltages:
get:
tags:
- infra
- rolling_stock
summary: Returns the set of voltages for all infras and rolling_stocks modes.
responses:
'200':
description: Voltages list
content:
application/json:
schema:
type: array
items:
type: string
example:
- 750V
- 1500V
- 2500.5V
'404':
description: The infra was not found
/infra/{infra_id}:
get:
tags:
- infra
summary: Retrieve a specific infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The infra
content:
application/json:
schema:
$ref: '#/components/schemas/InfraWithState'
'404':
description: Infra ID not found
post:
tags:
- infra
summary: Edit the content of an infrastructure
description: |-
Takes a batch of operations. An operation is a JSON patch document that will
be applied to the RailJSON description of the appropriate infra object.
The consistency of the patch with the RailJSON schema is checked. If a patch
is erroneous, the whole batch is rejected.
After editing the object, the generated cartographic layers are invalidated and
regenerated. The edition step fails if the regeneration fails.
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Operation'
required: true
responses:
'200':
description: The result of the operations
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/InfraObject'
put:
tags:
- infra
summary: Rename an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
description: The new name to give the infra
required: true
responses:
'200':
description: The infra has been renamed
content:
application/json:
schema:
$ref: '#/components/schemas/Infra'
'404':
description: Infra ID not found
delete:
tags:
- infra
summary: Delete an infra and all entities linked to it.
description: |-
This operation cannot be undone.
So beware.
You've been warned.
This operation may take a while to complete.
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: The infra has been deleted
'404':
description: Infra ID not found
/infra/{infra_id}/attached/{track_id}:
get:
tags:
- infra
summary: Retrieve all objects attached to a given track
parameters:
- name: infra_id
in: path
description: An infra ID
required: true
schema:
type: integer
format: int64
- name: track_id
in: path
description: A track section ID
required: true
schema:
type: string
responses:
'200':
description: All objects attached to the given track (arranged by types)
content:
application/json:
schema:
type: object
additionalProperties:
type: array
items:
type: string
/infra/{infra_id}/auto_fixes:
get:
tags:
- infra
summary: Retrieve a list of operations to fix infra issues
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The list of suggested operations
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Operation'
/infra/{infra_id}/clone:
post:
tags:
- infra
summary: Duplicate an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: name
in: query
description: The name of the new infra
required: true
schema:
type: string
responses:
'200':
description: The new infra ID
content:
text/plain:
schema:
type: integer
format: int64
minimum: 0
'404':
description: Infra ID not found
/infra/{infra_id}/errors:
get:
tags:
- infra
summary: A paginated list of errors related to an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: page
in: query
required: false
schema:
type: integer
format: int64
default: 1
minimum: 1
- name: page_size
in: query
required: false
schema:
type: integer
format: int64
default: 25
nullable: true
minimum: 1
- name: level
in: query
description: Whether the response should include errors or warnings
required: false
schema:
type: string
enum:
- warnings
- errors
- all
- name: error_type
in: query
description: The type of error to filter on
required: false
schema:
allOf:
- $ref: '#/components/schemas/InfraErrorTypeLabel'
nullable: true
- name: object_id
in: query
description: Filter errors and warnings related to a given object
required: false
schema:
type: string
nullable: true
responses:
'200':
description: A paginated list of errors
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PaginationStats'
- type: object
required:
- results
properties:
results:
type: array
items:
type: object
required:
- information
properties:
information:
$ref: '#/components/schemas/InfraError'
/infra/{infra_id}/lines/{line_code}/bbox:
get:
tags:
- infra
summary: Returns the BBoxes of a line
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: line_code
in: path
description: A line code
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The BBox of the line
content:
application/json:
schema:
$ref: '#/components/schemas/BoundingBox'
/infra/{infra_id}/load:
post:
tags:
- infra
summary: Instructs Core to load an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: The infra was loaded successfully
'404':
description: The infra was not found
/infra/{infra_id}/lock:
post:
tags:
- infra
summary: Lock an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'204':
description: The infra was locked successfully
'404':
description: The infra was not found
/infra/{infra_id}/objects/{object_type}:
post:
tags:
- infra
summary: Retrieves specific infra objects
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: object_type
in: path
required: true
schema:
$ref: '#/components/schemas/ObjectType'
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
required: true
responses:
'200':
description: The list of objects
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/InfraObjectWithGeometry'
'400':
description: Duplicate object ids provided
'404':
description: Object ID or infra ID invalid
/infra/{infra_id}/path_properties:
post:
tags:
- pathfinding
summary: Compute path properties
parameters:
- name: infra_id
in: path
description: The infra id
required: true
schema:
type: integer
format: int64
- name: props
in: query
description: Path properties
required: true
schema:
type: array
items:
$ref: '#/components/schemas/Property'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PathPropertiesInput'
required: true
responses:
'200':
description: Path properties
content:
application/json:
schema:
$ref: '#/components/schemas/PathProperties'
/infra/{infra_id}/pathfinding:
post:
tags:
- infra
- pathfinding
summary: This endpoint search path between starting and ending track locations
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: number
in: query
required: false
schema:
type: integer
format: int32
nullable: true
minimum: 0
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InfraPathfindingInput'
required: true
responses:
'200':
description: A list of shortest paths between starting and ending track locations
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PathfindingOutput'
/infra/{infra_id}/pathfinding/blocks:
post:
tags:
- pathfinding
summary: Compute a pathfinding
parameters:
- name: infra_id
in: path
description: The infra id
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PathfindingInput'
required: true
responses:
'200':
description: Pathfinding Result
content:
application/json:
schema:
$ref: '#/components/schemas/PathfindingResult'
/infra/{infra_id}/railjson:
get:
tags:
- infra
summary: Serialize an infra
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
responses:
'200':
description: The infra in railjson format
content:
application/json:
schema:
$ref: '#/components/schemas/RailJson'
'404':
description: The infra was not found
/infra/{infra_id}/routes/nodes:
post:
tags:
- infra
- routes
summary: Returns the list of routes crossing the specified nodes, along with the available positions for each of them.
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
requestBody:
description: A mapping node_id -> node_state | null
content:
application/json:
schema:
type: object
additionalProperties:
type: string
nullable: true
required: true
responses:
'200':
description: A list of route IDs along with available positions for each specified node
content:
application/json:
schema:
type: object
required:
- routes
- available_node_positions
properties:
available_node_positions:
type: object
description: List of available positions for each node on the corresponding routes
additionalProperties:
type: array
items:
type: string
uniqueItems: true
routes:
type: array
items:
type: string
description: List of route ids crossing a selection of nodes
/infra/{infra_id}/routes/track_ranges:
get:
tags:
- infra
- routes
summary: Compute the track ranges through which routes passes.
parameters:
- name: infra_id
in: path
description: An existing infra ID
required: true
schema:
type: integer
format: int64
- name: routes
in: query
description: A list of comma-separated route ids
required: true
schema:
type: string
responses:
'200':
description: Foreach route, either tracks_ranges + switches found on the route, or an error
content:
application/json:
schema:
type: array
items:
oneOf:
- allOf:
- $ref: '#/components/schemas/RoutePath'
- type: object
required:
- type
properties:
type:
type: string
enum:
- Computed
- type: object
required:
- type
properties:
type:
type: string
enum:
- NotFound
- type: object
required:
- type
properties:
type:
type: string
enum:
- CantComputePath
/infra/{infra_id}/routes/{waypoint_type}/{waypoint_id}:
get:
tags:
- infra
- routes
summary: Retrieve all routes that starting and ending by the given waypoint (detector or buffer stop)
parameters:
- name: infra_id
in: path
description: Infra ID
required: true
schema:
type: integer
format: int64
- name: waypoint_type
in: path
description: Type of the waypoint
required: true
schema:
type: string
enum:
- Detector
- BufferStop
- name: waypoint_id