forked from sonic-net/sonic-restapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sonic_api.yaml
2318 lines (2306 loc) · 76.9 KB
/
sonic_api.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
#
# Current rules
# 1. All requests are sync.
#
# responses:
# post:
# 201 - Created
# 400 - Bad Request. Malformed arguments for API call
# 401 - Unauthorized. Invalid authentication credentials
# 403 - Forbidden (capacity isssues)
# 404 - Object is not found
# 409 - Conflict. Request cannot be completed due to conflict with current state of target resource.
# 500 - Internal Server Error
# 503 - Service Unavailable
# patch:
# 207 - Multi-Status. Consult object body to determine status on a per element basis for the Bulk API.
# 400 - Bad Request. Malformed arguments for API call
# 401 - Unauthorized. Invalid authentication credentials
# 403 - Forbidden (capacity isssues)
# 404 - Object is not found
# 500 - Internal Server Error
# 503 - Service Unavailable
# get:
# 200 - OK
# 400 - Bad Request. Malformed arguments for API call
# 401 - Unauthorized. Invalid authentication credentials
# 404 - Object is not found
# 500 - Internal Server Error
# 503 - Service Unavailable
# delete:
# 200 - OK
# 204 - No Content
# 207 - Multi-Status. Consult object body to determine status on a per element basis for the Bulk API.
# 400 - Bad Request. Malformed arguments for API call
# 401 - Unauthorized. Invalid authentication credentials
# 404 - Object is not found
# 409 - Conflict. Request cannot be completed due to conflict with current state of target resource.
# 500 - Internal Server Error
# 503 - Service Unavailable
#
# dictionary:
# vnet_id
# vnid
# vlan_id
# ip_prefix
# ip_addr
#
# SONiC REST API v1. Defines API for controlling data path on the SONiC TOR for Baremetal scenarios.
# Baremetal scenario description:
# Every "baremetal server" port is connected to one baremetal server. Baremetals that reside on
# the same subnet+vnet are defined to be on a particular vlan interface. The vlan interface acts
# as the gateway and as such must be programmed with the gateway IP. Traffic inbound/outbound
# from the TOR is via a VxLAN tunnel. Customer separation is provided using Vnet, vrf and unique vxlan vnid.
#
# Our dataplane is designed as follow
# 1. We have virtual routers which represents a "virtual network" for a customer. Virtual networks are
# defined using a string vnet_id, this internally creates a virtual router to maintain separate routing/forwarding domain.
# The virtual routers are used to bind the customer's unique vnid and customer's local baremetal device ports
# and as a result provide Virtual Network connectivity with the rest of Azure
# 2. We have a virtual routing table which is unique and separated for every virtual router.
# 3. We have tunnels which represent "Azure" next hops for virtual routing tables.
# 4. We have vlan specific APIs to define parameters for client ports
#
# POST Requests:
# REST API creation(POST) dependency list:
# 1. VxLAN VTEP: /config/tunnel/decap/vxlan OR Day 0 configuration. No dependency.
# 2. Vrouter/VNET: /config/vrouter/{vnet_id} depends on 1(VxLAN VTEP)
# 3. VLAN: /config/interface/vlan Depends on 2(VNET) if vlan needs association to vrf/vnet
# 4. Vlan member: /config/interface/vlan/{vlan_id}/member Depends on 3(VLAN)
# 5. Vlan Neighbor: /config/interface/vlan/{vlan_id}/neighbor Depends on 3(VLAN)
# 6. Vrouter/VNET Routes: /config/vrouter/{vnet_id}/routes depends on 2(VNET)
#
# DELETE Requests:
# All children/dependent elements must be deleted prior to deleting any parent config elements
# This is required for data integrity and sanity of DBs.
# eg: Vlan Neighbors and Vlan members should be deleted before deleting the Vlan itself
# REST API deletion(DELETE) dependency list:
# 1. Vrouter/VNET Routes: /config/vrouter/{vnet_id}/routes. No dependency
# 2. Vlan Neighbor: /config/interface/vlan/{vlan_id}/neighbor. No dependency
# 3. Vlan member: /config/interface/vlan/{vlan_id}/member. No dependency
# 4. VLAN: /config/interface/vlan Depends on 2(VNET). Dependes on successful deletion on all child elements 2(Vlan Neighbor) and 3(Vlan member)
# 5. Vrouter/VNET: /config/vrouter/{vnet_id}. Depends on successful deletion of all child elements 4(Vlan) and 1(Routes)
# 6. VxLAN VTEP: /config/tunnel/decap/vxlan. Depends on successful deletion of all child elements 5(VRF/VNET)
#
# Some details about '40X' error responses:
# - '400' http error returns when there're one or more malformed arguments (wrong type, format, size) in the request.
# - '404' http error returns when there're one or more references to non-existent values in the request.
# - '409' HTTP Request cannot be completed due to conflict with current state of target resource:
# - Error sub-code 0: Conflict because the resource already exists
# - Error sub-code 1: Conflict because of a missing dependency/parent
# - Error sub-code 2: Conflict because the caller tries to delete a resource with a dependency/child
# - Error format: '#/definitions/Error'
# In case of bulk API (vroute API):
# - If a request has a malformed argument (arguments) or a reference (references) to non-existent values
# in its path the API must return '400' or '404' respectively.
# - if a request has the same error in the attributes of the request, the API must:
# - run the request with the valid attributes
# - return '207' http status code to inform the caller to look within the body to confirm success/failure
# for each of the routes
# - put malformed attributes into the list of 'failed' attributes.
swagger: '2.0'
info:
title: SONiC REST API
description: SONiC REST API for Baremetal Scenarios
version: 1.0.0
schemes:
- http
- https
basePath: /v1
produces:
- application/json
consumes:
- application/json
paths:
#----------------------------------------------
# Server level API
#----------------------------------------------
'/state/heartbeat':
get:
summary: the heartbeat API for caller to check the status of the server
description: Returns Ok when server is live. Also returns API version, config reset time info of the server and available routes.
responses:
'200':
description: OK
schema:
type: object
required:
- server_version
- reset_GUID
- reset_time
- routes_available
properties:
server_version:
type: string
description: version of the restful server.
reset_GUID:
type: string
description: a GUID which will change after each time server restart from scratch.
reset_time:
type: string
format: date-time
description: time of server restartting from scratch, in a human readable format.
routes_available:
type: int
description: Remaining routes available to be programmed. Returns -1 if CRM:STATS is unavailable. Continue programming routes and check back later.
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# Config Reset Status API
#----------------------------------------------
'/config/resetstatus':
get:
summary: API for caller to check the status of the config in the DB
description: Returns a JSON response with the config reset status
responses:
'200':
description: OK
schema:
type: object
required:
- reset_status
properties:
reset_status:
type: string
description: configuration reset status.
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
post:
summary: API for caller to set the status of the config in the DB
description: Returns a JSON response with the config reset status after the change
parameters:
- name: reset_status
in: body
required: true
type: string
description: The value of configuration reset status. Only true or false accepted
responses:
'200':
description: OK
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# Operations
#----------------------------------------------
'/operations/ping':
post:
summary: pings an ip address from a VRF context, if provided
description: Returns a JSON response object with packets transmitted, received, maxRTT, minRTT, avgRTT. When specified vnet_id doesn't exist in the config_db, returns 404 Object not found.
parameters:
- name: ip_address
in: body
required: true
type: string
description: IP address of the device to ping
- name: vnet_id
in: body
required: false
type: string
description: vnet_id containing the vnet guid as a string
- name: count
in: body
required: false
type: string
description: value for -c parameter of ping
responses:
'200':
description: OK
'404':
description: Object not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# Virtual router object
#----------------------------------------------
'/config/vrouter/{vnet_id}':
post:
summary: Create a new virtual network router
description: If a virtual network router/vnet with specified vnet_id doesn't exist, new vnet with empty virtual table would be created. If a vnet exists already, it will return error '409', sub-code '0'. If this API is called without a vxlan local vtep created(should be created as a Day 0 config), there will be a failure with code '409' sub-code '1'.
parameters:
- name: vnet_id
in: path
required: true
type: string
description: vnet_id containing the vnet guid as a string
- name: attr
in: body
required: true
description: attributes for virtual network router
schema:
$ref: '#/definitions/VnetEntry'
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'403':
description: Capacity insufficient
schema:
$ref: '#/definitions/Error'
'409':
description: Resource Conflict. Virtual network router /VNET already exists OR dependency VxLAN VTEP not found.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
get:
summary: Get information about an existing virtual network router
description: Returns attributes for requested vnet_id. If the vnet is not defined it returns '404' error.
parameters:
- name: vnet_id
in: path
required: true
type: string
description: vnet_id containing the vnet guid as a string
responses:
'200':
description: OK
schema:
type: object
required:
- vnet_id
- attr
properties:
vnet_id:
type: string
description: vnet_id containing the vnet guid as a string
attr:
$ref: '#/definitions/VnetEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Virtual network router is not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
delete:
summary: Remove a virtual network router
description: Remove a virtual network router which is defined by vnet_id. If a vnet with 'vnet_id' is not defined the API will return '404'. If the delete is called before all associated VNET routes or Vlans are deleted, it will return error '409' sub-code 2
parameters:
- name: vnet_id
in: path
required: true
type: string
description: vnet_id containing the vnet guid as a string
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Virtual network router is not found
schema:
$ref: '#/definitions/Error'
'409':
description: Resource Conflict. Routes exist on Virtual network router/VNET and it may not be deleted prior to deleting all routes.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# VLAN interface
#----------------------------------------------
'/config/interface/vlan/{vlan_id}':
post:
summary: Create a new vlan interface
description: Create a new vlan interface with name Vlan{vlan_id} and vlanid set to vlan_id. If such a vlan interface already exists then this method returns the error '409' sub-code 0. If a vnet with specified vnet_id in attr does not exist this function will return error '409' sub-code 1. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: attr
in: body
required: true
description: attributes for vlan interface
schema:
$ref: '#/definitions/VlanEntry'
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'403':
description: Capacity insufficient
schema:
$ref: '#/definitions/Error'
'404':
description: Resource not found
schema:
$ref: '#/definitions/Error'
'409':
description: Resource Conflict. VLAN already exists OR dependency VRF/VNET not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
get:
summary: Get information about an existing vlan interface
description: Returns attributes for requested vlan. If the vlan interface does not exist on SONiC it returns a '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
responses:
'200':
description: OK
schema:
type: object
required:
- vlan_id
- attr
properties:
vlan_id:
type: integer
format: int12
description: vlan id
attr:
$ref: '#/definitions/VlanEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
delete:
summary: Remove a vlan interface
description: Remove a vlan interface which is defined by vlan_id. If the vlan interface does not exist on SONiC it returns a '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'. If the delete is called before all associated vlan neighbors/members are deleted, this will return error '409' conflict with sub-code 2.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlanid
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found
schema:
$ref: '#/definitions/Error'
'409':
description:
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
'/config/interface/vlans':
get:
summary: Get information about existing vlan interfaces for given vnet_id
description: Returns attributes for vlans of requested vnet_id. If the vnet_id does not exist, it returns a '404' error.
parameters:
- name: vnet_id
in: path
type: string
required: true
description: vnet_id containing the vnet guid as a string
responses:
'200':
description: OK
schema:
type: object
required:
- vnet_id
- attr
properties:
vnet_id:
type: string
description: vnet_id containing the vnet guid as a string
attr:
type: array
$ref: '#/definitions/VlansEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vnet_id is not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
'/config/interface/vlans/all':
get:
summary: Get information about all existing vlans configured in the system
description: Returns attributes for vlans. If no vlans exist, it returns a '404' error.
responses:
'200':
description: OK
schema:
type: object
properties:
attr:
type: array
$ref: '#/definitions/VlansAllEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vnet_id is not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# VLAN interface member
#----------------------------------------------
'/config/interface/vlan/{vlan_id}/member/{if_name}':
post:
summary: Add a physical port to a vlan interface
description: Add a member to interface Vlan{vlan_id}. If the vlan interface does not exist on SONiC it returns a '404' error. If such a member is already present on this Vlan interface the API returns '409' sub-code 0. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'. If attr with tagging mode is provided it will be honored in config, if not, the default tagging mode will be set to 'untagged'. Vlan members may be tagged or untagged, but, the Vlan member port may be untagged in only one Vlan interface, deviations from this will cause the API to return '409' sub-code 0.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: if_name
in: path
required: true
type: string
description: Physical port name
- name: attr
in: body
required: true
description: attribute for vlan member
schema:
$ref: '#/definitions/VlanMemberEntry'
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'403':
description: Capacity insufficient
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not defined
schema:
$ref: '#/definitions/Error'
'409':
description: Resource Conflict. VLAN member already exists on this VLAN interface OR Vlan member is being added to 2nd Vlan inteface as an untagged member.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
get:
summary: Get information about an existing vlan port member on an existing vlan interface
description: Returns attributes for requested vlan member. If the vlan/vlan member is not defined/present on SONiC it returns '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: if_name
in: path
required: true
type: string
description: Physical port name
responses:
'200':
description: OK
schema:
type: object
required:
- vlan_id
- if_name
- attr
properties:
vlan_id:
type: integer
format: int32
description: 12 bit vlan_id
if_name:
type: string
description: Physical port name
attr:
$ref: '#/definitions/VlanMemberEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not defined/Vlan member is not found on this interface.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
delete:
summary: Remove a vlan member from a vlan interface
description: Remove a vlan member from a vlan interface which is defined by vlan_id. If the Vlan interface does not exist on SONiC OR a vlan member 'if_name' is not present on the interface the API will return '404'. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: if_name
in: path
required: true
type: string
description: Physical port name
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not defined/Vlan member is not found on this Vlan interface
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
'/config/interface/vlan/{vlan_id}/members':
get:
summary: Get information about all existing vlan port member interfaces for an existing vlan interface
description: Returns attributes of all the member interfaces for given vlan. If the vlan is not defined/present on SONiC it returns '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
responses:
'200':
description: OK
schema:
type: object
required:
- vlan_id
properties:
vlan_id:
type: integer
format: int32
description: 12 bit vlan_id
attr:
type: array
$ref: '#/definitions/VlanMembersEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not defined.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# VLAN interface neighbor
#----------------------------------------------
'/config/interface/vlan/{vlan_id}/neighbor/{ip_addr}':
post:
summary: Add the connected end host's IP address to the vlan interface for arp assist and neighbor discovery
description: Add the connected end host's IP address to the vlan interface for arp assist and neighbor discovery. If such a neighbor already exists on this Vlan interface then this method returns the error '409' sub-code 0, if the Vlan interface doesn't exist on SONiC this returns error '404'. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: ip_addr
in: path
required: true
type: string
description: Connected end device IP address
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'403':
description: Capacity insufficient
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found
schema:
$ref: '#/definitions/Error'
'409':
description: VLAN neighbor already exists on the interface
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
get:
summary: Get information about an existing vlan neighbor on an existing vlan interface
description: Returns HTTP success/failure code for requested neighbor. If the vlan interface/vlan neighbor does not exist on SONiC it returns '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: ip_addr
in: path
required: true
type: string
description: Connected end device IP address
responses:
'200':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found/Vlan neighbor is not found on this interface.
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
delete:
summary: Remove a vlan neighbor from a vlan interface
description: Remove a vlan neighbor from a vlan interface which is defined by vlan_id. If a vlan interface with 'vlan_id' is not present on SONiC OR a vlan neighbor 'ip_addr' is not present on the interface the API will return '404'. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
- name: ip_addr
in: path
required: true
type: string
description: Connected end device IP address
responses:
'204':
description: OK
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found/Vlan neighbor is not found on this Vlan interface
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
'/config/interface/vlan/{vlan_id}/neighbors':
get:
summary: Get information about all vlan neighbors on an existing vlan interface
description: Returns all the neighbors associated with requested vlan. If the vlan interface does not exist on SONiC it returns '404' error. If the vlan_id passed is less than 2 or greater than 4094 the API will respond with error '400'.
parameters:
- name: vlan_id
in: path
required: true
type: integer
format: int32
description: 12 bit vlan_id
responses:
'200':
description: OK
schema:
type: object
required:
- vlan_id
properties:
vlan_id:
type: integer
format: int32
description: 12 bit vlan_id
attr:
type: array
$ref: '#/definitions/VlanNeighborsEntry'
'400':
description: Malformed arguments for API call
schema:
$ref: '#/definitions/Error'
'401':
description: Invalid authentication credentials
schema:
$ref: '#/definitions/Error'
'404':
description: Vlan interface is not found
schema:
$ref: '#/definitions/Error'
'500':
description: Internal service error
schema:
$ref: '#/definitions/Error'
'503':
description: Maintanence mode
schema:
$ref: '#/definitions/Error'
#----------------------------------------------
# vxlan tunnel encap object
#----------------------------------------------
'/config/tunnel/encap/vxlan/{vnid}':
post:
description: Return success for now
responses:
'204':
description: OK
description: Return success for now
get:
responses:
'204':
description: OK
delete:
description: Return success for now
responses:
'204':
description: OK
#----------------------------------------------
# route object
#----------------------------------------------
'/config/vrouter/{vnet_id}/routes':
patch:
summary: Update/modify IP routes for a virtual network router
description: This API call receives a list of route entries to be added/modified/deleted from the virtual routing table defined by 'vnet_id'. If an object with vnet_id doesn't exist this will return an error code '404'. The 'cmd' attribute will determine whether this is an add or delete request. For 'add' operations the API will try to insert every route entry individually. If a route entry already exists in the virtual routing table, the attributes of the rouing entry will be updated. If a route entry doesn't exist in the routing table yet, it will be inserted there. If something went wrong the route entry will be returned as member of "failed" list with "error_code" attr set to some HTTP error code and "error_msg" attr set to some custom error string. Similarly for 'delete' operations the API will try to delete every route entry individually, if the delete fails it will be returned as a member of the "failed" list with attrs "error_code" and "error_msg" set
parameters:
- name: vnet_id
in: path
type: string
required: true
description: vnet_id containing the vnet guid as a string
- name: attr
in: body
required: true
description: attributes for virtual network router IP prefix
schema:
type: array
items:
$ref: '#/definitions/RouteEntry'
responses:
'204':
description: OK
'207':
description: Multi-Status
schema:
type: object
required: