-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathswagger.yaml
629 lines (629 loc) · 16.1 KB
/
swagger.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
basePath: /v1/api
consumes:
- application/json
definitions:
Camera:
description: Camera represents a singular camera which is accessible over the network
properties:
auth:
$ref: '#/definitions/CameraAuth'
host:
description: an ip address or domain
type: string
x-go-name: Host
location:
$ref: '#/definitions/Location'
model:
$ref: '#/definitions/CameraModel'
name:
description: a custom name given to the camera (a short description)
type: string
x-go-name: Name
proxy:
$ref: '#/definitions/Proxy'
uuid:
description: an auto generated unique identifier for the camera
type: string
x-go-name: UUID
required:
- name
- host
- auth
- model
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
CameraAuth:
description: CameraAuth contains the camera authentication information, such as it's username and password
properties:
password:
description: password
type: string
x-go-name: Password
username:
description: username
type: string
x-go-name: Username
required:
- username
- password
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
CameraModel:
properties:
name:
description: the name such as RLC-411WS
type: string
x-go-name: Name
uuid:
description: an auto generated unique identifier for the model
type: string
x-go-name: UUID
required:
- name
title: CameraModel is the model/type of the camera. Many cameras can have the same model e.g. RLC-411WS.
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
Location:
description: Used to map cameras on.
properties:
addressLine1:
type: string
x-go-name: AddressLine1
addressLine2:
type: string
x-go-name: AddressLine2
addressLine3:
type: string
x-go-name: AddressLine3
city:
type: string
x-go-name: City
country:
type: string
x-go-name: Country
latitude:
description: Coordinates
format: double
type: number
x-go-name: Latitude
longitude:
format: float
type: number
x-go-name: Longitude
province:
type: string
x-go-name: Province
uuid:
description: The unique identifier for this Location
type: string
x-go-name: UUID
title: Location is a physical address.
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
Proxy:
description: Proxy is a network configuration for connecting to a proxy server
properties:
host:
type: string
x-go-name: Host
password:
type: string
x-go-name: Password
port:
type: string
x-go-name: Port
protocol:
type: string
x-go-name: Protocol
scheme:
type: string
x-go-name: Scheme
username:
type: string
x-go-name: Username
uuid:
type: string
x-go-name: UUID
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
User:
properties:
username:
description: Username is a unique name used by the user to log in to the system
type: string
x-go-name: Username
uuid:
description: UUID is an auto generated unique identifier for the user
type: string
x-go-name: UUID
type: object
x-go-package: github.com/ReolinkCameraAPI/noctilucago/internal/pkg/database/models
host: 0.0.0.0, localhost
info:
contact:
email: alano@oleaintueri.com
name: Alano Terblanche
url: https://oleaintueri.com
description: |-
Package controllers
Contains all the api controllers
license:
name: GPLv3
url: https://opensource.org/licenses/GPL-3.0
paths:
/private/auth/refresh:
get:
consumes:
- application/json
description: The refresh token is set according to the `noctiluca` config `Refresh` option.
operationId: AuthRefresh
produces:
- application/json
responses:
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Refresh the JWT token
tags:
- auth
/private/camera:
delete:
consumes:
- application/json
description: Use the cameras' UUID to delete it
operationId: DeleteCamera
produces:
- application/json
responses:
"200":
$ref: '#/responses/genericResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Delete specified camera
tags:
- camera
get:
consumes:
- application/json
description: Get an array of created cameras
operationId: GetAllCameras
produces:
- application/json
responses:
"200":
$ref: '#/responses/cameraModelArrayResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get all cameras created
tags:
- camera
put:
consumes:
- application/json
description: Update an existing cameras' settings
operationId: UpdateCamera
produces:
- application/json
responses:
"200":
$ref: '#/responses/cameraResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Update the specified camera
tags:
- camera
/private/camera/:model:
post:
consumes:
- application/json
description: |-
Pass the model uuid as a parameter and the rest of the information in the body.
A new camera will be returned.
operationId: CreateCamera
produces:
- application/json
responses:
"200":
$ref: '#/responses/cameraResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Create a new Camera
tags:
- camera
/private/model:
get:
consumes:
- application/json
description: Get an array of created models, such as [RLC-411WS, RLC-510, ...].
operationId: GetAllModel
produces:
- application/json
responses:
"200":
$ref: '#/responses/cameraModelArrayResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get all camera models
tags:
- model
post:
consumes:
- application/json
description: |-
Create a Camera Model such as RLC-411WS.
This will also return the newly created model.
operationId: CreateModel
produces:
- application/json
responses:
"200":
$ref: '#/responses/cameraModelResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Create a Camera Model
tags:
- model
/private/network/protocols:
get:
consumes:
- application/json
description: A protocol can be UDP or TCP
operationId: GetAllProtocols
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProtocolResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get all the protocols accepted by the server
tags:
- protocols
/private/network/proxies:
get:
consumes:
- application/json
description: Get all the created proxies
operationId: GetAllProxies
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProxyArrayResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get all the proxies
tags:
- proxy
/private/network/proxies/schemes:
get:
consumes:
- application/json
description: The scheme can be HTTP, HTTPS or SOCKS5
operationId: GetAllSchemes
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProxySchemeResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get all the proxy schemes accepted by the server
tags:
- schemes
/private/network/proxy:
post:
consumes:
- application/json
description: |-
The proxy setting is a reusable setting that can be
re-applied to created cameras.
operationId: CreateProxy
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProxyResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Create a new proxy setting
tags:
- proxy
/private/network/proxy/:uuid:
get:
consumes:
- application/json
description: Get the proxy settings object using its UUID
operationId: GetOneProxy
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProxyResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Get a singular proxy using its UUID
tags:
- proxy
put:
consumes:
- application/json
description: Pass the proxy's UUID with the updated proxy information
operationId: UpdateProxy
produces:
- application/json
responses:
"200":
$ref: '#/responses/networkProxyResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Update a proxy setting
tags:
- proxy
/private/user:
delete:
consumes:
- application/json
description: Delete an existing user account
operationId: DeleteUser
produces:
- application/json
responses:
"200":
$ref: '#/responses/genericResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Delete User
tags:
- user
get:
consumes:
- application/json
description: Get all the User Accounts
operationId: GetAllUsers
produces:
- application/json
responses:
"200":
$ref: '#/responses/userArrayResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
tags:
- user
post:
consumes:
- application/json
description: Create a new User account for managing cameras
operationId: CreateUser
produces:
- application/json
responses:
"200":
$ref: '#/responses/userResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Create a new User account
tags:
- user
/private/user/:uuid:
put:
consumes:
- application/json
description: Update an existing user's credentials
operationId: UpdateUser
produces:
- application/json
responses:
"200":
$ref: '#/responses/userResponse'
"500":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: Update User
tags:
- user
/public/auth/login:
post:
consumes:
- application/json
description: Log in with a username and password
operationId: AuthLogin
produces:
- application/json
responses:
"403":
$ref: '#/responses/genericResponse'
default:
$ref: '#/responses/genericResponse'
schemes:
- http
- https
summary: User Login
tags:
- auth
/public/version:
get:
consumes:
- application/json
description: The version follows the semVer structure e.g. v0.0.1
operationId: version
produces:
- application/json
responses:
"200":
$ref: '#/responses/versionResponse'
default:
$ref: '#/responses/versionResponse'
schemes:
- http
- https
summary: Get the current server version
tags:
- server
produces:
- application/json
responses:
cameraArrayResponse:
description: CameraArrayResponse used when retrieving multiple camera models
schema:
items:
$ref: '#/definitions/Camera'
type: array
cameraModelArrayResponse:
description: CameraModelArrayResponse is used when retrieving multiple camera models
schema:
items:
$ref: '#/definitions/CameraModel'
type: array
cameraModelResponse:
description: CameraModelResponse used when creating and updating a camera model
schema:
$ref: '#/definitions/CameraModel'
cameraResponse:
description: CameraResponse used when creating and updating a camera
schema:
$ref: '#/definitions/Camera'
genericResponse:
description: |-
A GenericResponse is used to send back information to the client with a general status,
could be an error or a success message.
headers:
message:
type: string
status:
type: string
networkProtocolResponse:
description: NetworkProtocolResponse is used when returning the supported server protocols
schema:
properties:
protocols:
items:
type: string
type: array
x-go-name: Protocols
type: object
networkProxyArrayResponse:
description: NetworkProxyArrayResponse is used when returning multiple proxy settings
schema:
items:
$ref: '#/definitions/Proxy'
type: array
networkProxyResponse:
description: NetworkProxyResponse is used when creating and updating a proxy setting
schema:
$ref: '#/definitions/Proxy'
networkProxySchemeResponse:
description: NetworkProxySchemeResponse is used when returning the supported server schemes
schema:
properties:
schemes:
items:
type: string
type: array
x-go-name: Schemes
type: object
sessionResponse:
description: A SessionResponse is used to send back jwt tokens to the client.
headers:
token:
type: string
userArrayResponse:
description: UserArrayResponse is used when retrieving multiple user accounts
schema:
items:
$ref: '#/definitions/User'
type: array
userResponse:
description: UserResponse is used when creating or updating a user account
schema:
$ref: '#/definitions/User'
versionResponse:
description: |-
A VersionResponse is used to send back information to the client with a general status,
could be an error or a success message.
headers:
version:
type: string
schemes:
- http
- https
swagger: "2.0"