-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
555 lines (555 loc) · 14.8 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
openapi: 3.0.0
info:
title: SDX LC
description: SDX Topology validation
version: '1.0.0'
contact:
email: lmarinve@fiu.edu
servers:
- url: 'https://atlanticwave-sdx.github.io'
tags:
- name: topology
description: Everything about your domain topology
externalDocs:
description: Find out more
url: https://www.atlanticwave-sdx.net
- name: node
description: everything about a node in your domain
- name: link
description: everything about a link in your domain
- name: user
description: Operations about user
externalDocs:
description: Find out more about our store
url: https://www.atlanticwave-sdx.net
paths:
/v1/topology/{topology_id}:
parameters:
- schema:
type: integer
name: topology_id
in: path
required: true
description: Id of an existing topology.
get:
tags:
- topology
summary: get an existing topology
description: ID of the topology
operationId: get_topology_id
responses:
"200":
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
examples:
Get Topology:
value:
topology_id: urn:sdx:topology:amlight.net
name: AmLight-OXP
version: 2
model_version: 1.0.0
time_stamp: '2021-07-07 21:19:40'
nodes: []
links: []
"400":
description: Invalid ID supplied
"404":
description: Topology not found
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
patch:
tags:
- topology
summary: Update an existing topology
description: "ID of topology that needs to be updated."
operationId: update_topology
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
"400":
description: Invalid ID supplied
"404":
description: Topology not found
"405":
description: Validation exception
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
delete:
summary: Delete a Topology
description: id of topology that nedds to be deleted.
tags: []
operationId: delete_topology
responses:
"200":
description: OK
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/v1/topology:
get:
tags:
- topology
summary: get an existing topology
description: ID of the topology
operationId: get_topology_list
responses:
"200":
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
post:
tags:
- topology
summary: Send a new topology to SDX-LC
description: Create a topology
operationId: add_topology
requestBody:
description: placed for adding a new topology
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
examples:
post Topology:
value:
topology_id: urn:sdx:topology:amlight.net
name: AmLight-OXP
version: 2
model_version: 1.0.0
time_stamp: '2021-07-07 21:19:40'
nodes: []
links: []
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/topology'
"400":
description: Invalid Connection
"405":
description: Invalid input
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/users/{user_id}:
parameters:
- schema:
type: string
name: user_id
in: path
required: true
description: Id of an existing user.
get:
tags: []
summary: Get User Info by User ID
description: Retrieve the information of the user with the matching user ID.
operationId: get_user_user_id
responses:
'200':
description: User Found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
Get User Alice Smith:
value:
user_id: 142
user_name: asmith
first_name: Alice
last_name: Smith
email: alice.smith@gmail.com
password: '1997-10-31'
user_status: true
created_date: '2019-08-24'
'404':
description: User Not Found
'default':
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
patch:
tags: []
summary: Update User Information
description: Update the information of an existing user.
operationId: patch_users_user_id
responses:
'200':
description: User Updated
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
Updated User Rebecca Baker:
value:
topology_id: 13
user_name: rbaker
first_name: Rebecca
last_name: Baker
email: rebecca@gmail.com
password: '1985-10-02'
user_status: false
created_date: '2019-08-24'
'404':
description: User Not Found
'409':
description: Email Already Taken
'default':
description: Unexpected error
content:
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
requestBody:
content:
application/json:
schema:
type: object
properties:
user_name:
type: string
first_name:
type: string
last_name:
type: string
email:
type: string
description: 'If a new email is given, the user status property will be set to false.'
password:
type: string
user_status:
type: boolean
examples:
Update user_name:
value:
user_name: rbecca
Update First Name:
value:
first_name: Rebecca
Update Email:
value:
email: rebecca@gmail.com
Update Last Name & Password:
value:
last_name: Baker
password: '1985-10-02'
description: Patch user properties to update.
/user:
post:
tags: []
summary: Create New User
description: Create a new user
operationId: post_user
responses:
'200':
description: User Created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
examples:
New User Bob Fellow:
value:
topology_id: 12
user_name: bfellow
first_name: Bob
last_name: Fellow
email: bob.fellow@gmail.com
password: '1996-08-24'
user_status: false
created_date: '2020-11-18'
'400':
description: Missing Required Information
'409':
description: Email Already Taken
'default':
description: Unexpected error
content:
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
requestBody:
content:
application/json:
schema:
type: object
properties:
user_name:
type: string
first_name:
type: string
last_name:
type: string
email:
type: string
password:
type: string
required:
- user_name
- email
- password
examples:
Create User Bob Fellow:
value:
user_name: bob
first_name: Bob
last_name: Fellow
email: bob.fellow@gmail.com
password: '1996-08-24'
description: Post the necessary fields for the API to create a new user.
components:
schemas:
topology:
type: object
required:
- topology_id
- name
- version
- model_version
- time_stamp
- nodes
- links
properties:
topology_id:
type: string
pattern: '^((urn:sdx:topology:)[A-Za-z_.-]*$)'
name:
type: string
minLength: 3
maxLength: 30
pattern: '^[A-Za-z_.-]*$'
example: amLight
version:
type: integer
format: int64
example: 1
model_version:
type: string
time_stamp:
type: string
format: date-time
nodes:
type: array
items:
$ref: '#/components/schemas/node'
links:
type: array
items:
$ref: '#/components/schemas/link'
node:
type: object
required:
- node_id
- name
- location
- ports
properties:
node_id:
type: string
pattern: '^((urn:sdx:node:)[A-Za-z_.-]*$)'
name:
type: string
minLength: 3
maxLength: 30
pattern: '^[A-Za-z_.-]*$'
example: amLight
location:
$ref: '#/components/schemas/location'
ports:
type: array
items:
$ref: '#/components/schemas/port'
link:
type: object
required:
- link_id
- name
- ports
- bandwidth
- type
- status
- state
properties:
link_id:
type: string
pattern: '^((urn:sdx:link:)[A-Za-z_.-]*$)'
name:
type: string
minLength: 3
maxLength: 30
pattern: '^[A-Za-z_.-]*$'
ports:
type: array
items:
$ref: '#/components/schemas/port'
type:
type: string
enum: ['intra','inter']
bandwidth:
type: number
minimum: 1
maximum: 1000000
residual_bandwidth:
type: number
minimum: 0
maximum: 100
latency:
type: number
minimum: 1
maximum: 1000000
packet_loss:
type: number
minimum: 0
maximum: 100
availability:
type: number
minimum: 0
maximum: 100
status:
type: string
enum: ['up','down','error']
state:
type: string
enum: ['enabled','disabled','maintenance']
port:
type: object
required:
- port_id
- name
- node
- type
- status
- state
properties:
port_id:
type: string
pattern: '^((urn:sdx:port:)[A-Za-z_.-]*$)'
name:
type: string
minLength: 3
maxLength: 30
pattern: '^[A-Za-z_.-]*$'
node:
type: string
type:
type: string
enum: ['100FE','1GE','10GE','25GE','40GE','50GE','100GE','400GE','Other']
mtu:
type: integer
format: int32
status:
type: string
enum: ['up','down','error']
state:
type: string
enum: ['enabled','disabled']
location:
type: object
required:
- address
- latitude
- longitude
properties:
address:
type: string
latitude:
type: number
minimum: -90.0
maximum: 90.0
longitude:
type: number
minimum: -90.0
maximum: 90.0
User:
title: User
type: object
description: 'Users'
x-examples:
Alice Smith:
user_id: 142
user_name: asmith
first_name: Alice
last_name: Smith
email: alice.smith@gmail.com
password: '1997-10-31'
user_status: true
required:
- user_name
- email
- password
properties:
user_id:
type: integer
format: int64
description: Unique identifier for the given user.
user_name:
type: string
pattern: '^[A-Za-z]*$'
minLength: 3
first_name:
type: string
pattern: '^[A-Za-z]*$'
minLength: 3
last_name:
type: string
pattern: '^[A-Za-z]*$'
minLength: 3
email:
type: string
format: email
password:
type: string
pattern: '^[A-Za-z0-9!@#$%^&*_.-]*$'
minLength: 8
example: '1997-10-31'
user_status:
type: boolean
description: Set to true if the user's email has been verified.
created_date:
type: string
format: date
description: The date that the user was created.
ErrorMessage:
type: object
required:
- error_code
- error_message
properties:
error_code:
type: string
error_message:
type: string