forked from kytos/mef_eline
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathopenapi.yml
842 lines (816 loc) · 24 KB
/
openapi.yml
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
openapi: 3.0.0
info:
version: '2.3.1'
title: Kytos Circuit Provisioning
description: Kytos NApp for provisioning of SDN circuits.
servers:
- url: /api/kytos/mef_eline
paths:
/v2/evc/:
get:
summary: List all circuits stored.
description: List all circuits stored.
operationId: list_circuits
parameters:
- name: archived
in: query
schema:
type: string
description: "Filter for archived value, if not null. It's false by default"
required: false
- name: metadata
in: query
schema:
oneOf:
- type: string
- type: integer
- type: boolean
description: Filter for metadata values with format metadata.key=value, e.g. "metadata.required=false"
required: false
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
items:
$ref: '#/components/schemas/Circuit'
post:
summary: Creates a new circuit
operationId: create_circuit
requestBody:
description: Creates a new circuit based on the endpoints and
constraints given.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewCircuit'
responses:
'201':
description: EVC created. The circuit ID is being returned.
content:
application/json:
schema:
type: object
properties:
circuit_id: # the unique circuit id
type: string
deployed:
type: boolean
'400':
description: Request do not have a valid JSON or same necessary
interface does not yet exists.
'409':
description: Not Acceptable. This evc already exists.
'415':
description: The request body mimetype is not application/json.
/v2/evc/{circuit_id}:
get:
summary: Get details of a circuit
description: Get the details of a single circuit
operationId: get_circuit
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Circuit'
'400':
description: Circuit id not found.
patch:
summary: Update a circuit
description: Update a circuit based on payload. The EVC required
attributes (creation_time, active, current_path,
failover_path, _id, archived) can't be updated.
operationId: update
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
requestBody:
description: Update a circuit based on the circuit_id and payload given
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCircuit'
responses:
'200':
description: OK
'404':
description: Circuit id not found.
'400':
description: Bad request.
delete:
summary: Delete a circuit
description: The flows are removed from the switches, and then the EVC is
disabled.
operationId: delete
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
/v2/evc/{circuit_id}/redeploy:
patch:
summary: Redeploy an EVC
description: Redeploy an EVC removing and then recreating the flows.
operationId: redeploy
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
- name: try_avoid_same_s_vlan
description: Avoid tags from currently deployed current_path.
in: query
schema:
type: boolean
required: false
responses:
'202':
description: Accepted
'409':
description: Circuit disabled
/v2/evc/{circuit_id}/metadata:
get:
summary: Get the metadata from en EVC
operationId: get_metadata
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
'404':
description: EVC not found
post:
summary: Add metadata to an EVC
operationId: add_metadata
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
requestBody:
description: Metadata to in the form of key:value
required: true
content:
application/json:
schema:
type: object
responses:
'201':
description: Successful
'400':
description: Request problem
'404':
description: EVC not found
'415':
description: Wrong type
/v2/evc/{circuit_id}/metadata/{key}:
delete:
summary: Remove a metadata
operationId: delete_metadata
parameters:
- name: circuit_id
in: path
required: true
schema:
type: string
- name: key
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful
'404':
description: EVC not found
/v2/evc/schedule/:
get:
summary: List all schedules stored for all circuits .
description: List all schedules stored for all circuits .
operationId: list_circuit_schedules
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CircuitScheduleList'
post:
summary: Creates a new circuit schedule
operationId: create_schedule
requestBody:
description: Creates a new circuit schedule.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewCircuitSchedule'
responses:
'201':
description: Schedule created. The Schedule object is being returned.
content:
application/json:
schema:
$ref: '#/components/schemas/CircuitSchedule'
'400':
description: Request do not have a JSON or JSON format do not match
the Schedule object or some parameters are missing.
'404':
description: Circuit id not found.
'403':
description: Can´t change data. Circuit is deleted and archived.
'409':
description: Not Acceptable.
/v2/evc/schedule/{schedule_id}:
patch:
summary: Update a circuit schedule
description: Update a circuit schedule based on payload. The schedule_id are required.
operationId: update_schedule
parameters:
- name: schedule_id
in: path
required: true
schema:
type: string
requestBody:
description: Update a circuit schedule based on the schedule_id and payload given
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CircuitSchedule'
responses:
'200':
description: OK
'400':
description: Bad request. Invalid format or some parameters are missing.
'403':
description: Can´t change data. Circuit is deleted and archived.
'404':
description: Schedule id not found.
delete:
summary: Delete a circuit schedule
description: Delete a schedule from a circuit.
operationId: delete_schedule
parameters:
- name: schedule_id
in: path
required: true
schema:
type: string
responses:
'200':
description: OK
'403':
description: Can´t change data. Circuit is deleted and archived.
'404':
description: Schedule id not found.
/v2/evc/metadata:
post:
summary: Add metadata to a bulk of EVCs
description: Add metadata to multiple EVCs based on the body content
operationId: bulk_add_metadata
requestBody:
description: Metadata to be added to the EVCs
required: true
content:
application/json:
schema:
type: object
required:
- circuit_ids
properties:
circuit_ids:
type: array
minItems: 1
items:
type: string
responses:
'200':
description: Operation successful
'400':
description: The request body is not a well-formed JSON or circuit_ids is missing
'404':
description: There were EVCs not found.
content:
aplication/json:
schema:
type: array
items:
type: string
'415':
description: The request body mimetype is not application/json
/v2/evc/metadata/{key}:
delete:
summary: Delete metadata to a bulk of EVCs
description: Delete metadata from multiple EVCs based on the given key
operationId: bulk_delete_metadata
requestBody:
description: Metadata to be deleted from the EVCs
required: true
content:
application/json:
schema:
type: object
required:
- circuit_ids
properties:
circuit_ids:
type: array
items:
type: string
parameters:
- name: key
in: path
required: true
schema:
type: string
responses:
'200':
description: Operation successful
'400':
description: The request body is not a well-formed JSON or circuit_ids is missing
'404':
description: There were EVCs not found.
content:
aplication/json:
schema:
type: array
items:
type: string
'415':
description: The request body mimetype is not application/json
components:
#-------------------------------
# Reusable schemas (data models)
#-------------------------------
schemas:
NewCircuit: # Can be referenced via '#/components/schemas/NewCircuit'
type: object
required:
- name
- uni_a
- uni_z
additionalProperties: false
properties:
name:
type: string
frequency:
type: string
uni_a:
$ref: '#/components/schemas/Endpoint'
uni_z:
$ref: '#/components/schemas/Endpoint'
start_date:
type: string
format: date-time
end_date:
type: string
format: date-time
bandwidth:
type: integer
format: int64
primary_links:
type: array
items:
$ref: '#/components/schemas/Link'
backup_links:
type: array
items:
$ref: '#/components/schemas/Link'
primary_path:
type: array
items:
$ref: '#/components/schemas/Link'
backup_path:
type: array
items:
$ref: '#/components/schemas/Link'
primary_constraints:
$ref: '#/components/schemas/PathConstraints'
secondary_constraints:
$ref: '#/components/schemas/PathConstraints'
dynamic_backup_path:
type: boolean
circuit_scheduler:
type: array
items:
$ref: '#/components/schemas/CircuitSchedule'
sb_priority:
type: integer
nullable: true
format: int32
description: "Southbound priority value"
minimum: 0
service_level:
type: integer
format: int32
description: "Service level provided for network convergence. The higher the better"
default: 0
minimum: 0
maximum: 7
queue_id:
type: integer
nullable: true
format: int32
description: "QoS Egress Queue ID. Value -1 can be use to set this field to default."
minimum: -1
maximum: 7
enabled:
type: boolean
metadata:
type: object
NewLink: # Can be referenced via '#/components/schemas/NewLink'
type: object
required:
- endpoint_a
- endpoint_b
properties:
endpoint_a:
$ref: '#/components/schemas/NewEndpoint'
endpoint_b:
$ref: '#/components/schemas/NewEndpoint'
NewEndpoint:
type: object
required:
- id
properties:
id:
type: string
minLength: 25
maxLength: 30
pattern: '^([0-9A-Fa-f]{2}[:-]){8}(\d{1,5})$'
Endpoint: # Can be referenced via '#/components/schemas/Endpoint'
type: object
required:
- interface_id
properties:
interface_id:
type: string
minLength: 25
maxLength: 30
pattern: '^([0-9A-Fa-f]{2}[:-]){8}(\d{1,5})$'
tag:
$ref: '#/components/schemas/Tag'
Link: # Can be referenced via '#/components/schemas/Link'
type: object
required:
- endpoint_a
- endpoint_b
properties:
id:
type: string
endpoint_a:
type: object
additionalProperties: false
properties:
id:
type: string
endpoint_b:
type: object
additionalProperties: false
properties:
id:
type: string
Path: # Can be referenced via '#/components/schemas/Path'
type: object
required:
- endpoints
properties:
id:
type: integer
format: int32
endpoints:
type: array
items:
$ref: '#/components/schemas/Endpoint'
PathConstraints:
type: object
properties:
undesired_links:
type: array
description: List of link IDs that should not be in the path, excluded as a logical OR.
items:
type: string
example:
- "f13e8308-ecb2-49be-b507-3823af9cc409"
- "ee8d9017-1efd-49ac-9149-4cbeea86f751"
spf_attribute:
type: string
description: Link metadata attribute that will be used as link cost by SPF. If it's not set, the default value will be settings.SPF_ATTRIBUTE, which defaults to "hop"
default: "hop"
enum:
- "hop"
- "delay"
- "priority"
spf_max_path_cost:
type: number
description: Maximum accumulated path cost to be consireded. You should only set this value if you want to set an upper bound accumulated cost.
minimum: 1
mandatory_metrics:
description: Constraint in the form of a set that contains attributes. Paths will have every attribute specified in this set. Links metadata must be set for the metrics to be considered.
allOf:
- $ref: "#/components/schemas/Attributes"
example:
bandwidth: 100
ownership: "Bill"
flexible_metrics:
description: Constraint in the form of a set that contains attributes. Paths will have a user-specified minimum number of attributes specified in this set. Links metadata must be set for the metrics to be considered.
allOf:
- $ref: "#/components/schemas/Attributes"
example:
delay: 81
utilization: 100
reliability: 3
minimum_flexible_hits:
type: integer
description: Minimum number of attributes listed in flexible_metrics that a path will meet.
example: 2
minimum: 0
maximum: 6
Attributes:
type: object
properties:
bandwidth:
type: number
description: Minimum speed of the link in Gbps. It should be a positive float number.
example: 100
minimum: 0.1
utilization:
type: number
description: Maximum average percentage of utilization of the link. Utilization as 100 means the link does not have capacity left.
example: 70
minimum: 0
maximum: 100
priority:
type: number
description: Maximum priority of the link. The priority of the link could be set based on certain administrative traffic-engineering criteria.
example: 1
minimum: 0
reliability:
type: number
description: Minimum percentage of the reliability of the link. Reliability as 0 means always down.
example: 95
minimum: 1
maximum: 100
delay:
type: number
description: Maximum propagation delay of the link in milliseconds. It should be a positive float number.
example: 200
minimum: 0.1
ownership:
type: string
description: The exact user who should have ownership or be authorized to use the link.
example: "Bill"
not_ownership:
type: array
items:
type: string
description: The list of users whose links should not be used.
example: ["Ted"]
Circuit: # Can be referenced via '#/components/schemas/Circuit'
type: object
properties:
id:
type: integer
format: int32
name:
type: string
uni_a:
$ref: '#/components/schemas/Endpoint'
uni_z:
$ref: '#/components/schemas/Endpoint'
start_date:
type: string
format: date-time
end_date:
type: string
format: date-time
bandwidth:
type: integer
format: int64
primary_links:
type: array
items:
$ref: '#/components/schemas/Link'
backup_links:
type: array
items:
$ref: '#/components/schemas/Link'
current_path:
type: array
items:
$ref: '#/components/schemas/NewLink'
failover_path:
type: array
items:
$ref: '#/components/schemas/NewLink'
primary_path:
type: array
items:
$ref: '#/components/schemas/Link'
backup_path:
type: array
items:
$ref: '#/components/schemas/Link'
primary_constraints:
$ref: '#/components/schemas/PathConstraints'
secondary_constraints:
$ref: '#/components/schemas/PathConstraints'
dynamic_backup_path:
type: boolean
creation_time:
type: string
format: date-time
enabled:
type: boolean
active:
type: boolean
owner:
type: string
sb_priority:
type: integer
format: int32
nullable: true
description: "Southbound priority value"
minimum: 0
service_level:
type: integer
format: int32
description: "Service level provided for network convergence. The higher the better"
default: 0
minimum: 0
maximum: 7
queue_id:
type: integer
format: int32
nullable: true
description: "QoS Egress Queue ID. Value -1 can be use to set this field to default."
minimum: -1
maximum: 7
circuit_scheduler:
type: array
items:
$ref: '#/components/schemas/CircuitSchedule'
request_time:
type: string
format: date-time
UpdateCircuit: # Can be referenced via '#/components/schemas/UpdateCircuit'
type: object
additionalProperties: false
properties:
uni_a:
$ref: '#/components/schemas/Endpoint'
uni_z:
$ref: '#/components/schemas/Endpoint'
name:
type: string
start_date:
type: string
format: date-time
end_date:
type: string
format: date-time
queue_id:
type: integer
format: int32
nullable: true
description: "QoS Egress Queue ID. Value -1 can be use to set this field to default."
minimum: -1
maximum: 7
bandwidth:
type: integer
format: int64
primary_path:
type: array
items:
$ref: '#/components/schemas/Link'
backup_path:
type: array
items:
$ref: '#/components/schemas/Link'
primary_links:
type: array
items:
$ref: '#/components/schemas/Link'
backup_links:
type: array
items:
$ref: '#/components/schemas/Link'
dynamic_backup_path:
type: boolean
primary_constraints:
$ref: '#/components/schemas/PathConstraints'
secondary_constraints:
$ref: '#/components/schemas/PathConstraints'
owner:
type: string
sb_priority:
type: integer
format: int32
nullable: true
description: "Southbound priority value"
minimum: 0
service_level:
type: integer
format: int32
description: "Service level provided for network convergence. The higher the better"
default: 0
minimum: 0
maximum: 7
circuit_scheduler:
type: array
items:
$ref: '#/components/schemas/CircuitSchedule'
metadata:
type: object
enabled:
type: boolean
Tag: # Can be referenced via '#/components/schemas/Tag'
type: object
properties:
tag_type:
oneOf:
- type: string
- type: integer
enum: ['vlan', 1]
value:
oneOf:
- type: integer
format: int32
- type: string
- type: array
minItems: 1
items:
anyOf:
- type: array
minItems: 1
items:
anyOf:
- type: integer
- type: integer
example: [[1, 500], 2096, [3001]]
CircuitSchedule: # Can be referenced via '#/components/schemas/CircuitSchedule'
type: object
properties:
date:
type: string
format: date-time
interval:
type: string
frequency:
type: string
action:
type: string
#------------------------------------------
# Reusable schemas for request or responses
#------------------------------------------
NewCircuitSchedule: # Can be referenced via '#/components/schemas/NewCircuitSchedule'
type: object
required:
- circuit_id
- schedule
properties:
circuit_id:
type: string
schedule: {
"$ref": "#/components/schemas/CircuitSchedule"
}
CircuitScheduleList: # Can be referenced via '#/components/schemas/CircuitScheduleList'
type: object
properties:
circuit_id:
type: string
schedule_id:
type: integer
format: int32
schedule: {
"$ref": "#/components/schemas/CircuitSchedule"
}