-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQNA_REST_API.yaml
More file actions
812 lines (812 loc) · 22.1 KB
/
QNA_REST_API.yaml
File metadata and controls
812 lines (812 loc) · 22.1 KB
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
openapi: 3.0.0
info:
description: >-
API containing available commands to operate QNA600. You can use the api
key `special-key` to test the authorization filters.
version: 1.0.0
title: QNA600 REST interface
termsOfService: 'https://www.example.com/TermsOfService'
license:
name: ''
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
servers:
- url: '{qnaIP}:{port}{apiBase}'
variables:
qnaIP:
default: 10.0.120.12
port:
default: '51000'
apiBase:
default: '/api/v1'
tags:
- name: REST Commands
description: ''
- name: ping
description: 'Simple ping function'
- name: config
description: 'QNA600 configuration commands'
- name: data
description: 'QNA600 data commands'
paths:
/ping:
get:
tags:
- ping
summary: 'Responds to ping petition with a pong'
description: ''
operationId: ping
responses:
'200':
description: 'Successful operation'
content:
text/plain:
schema:
type: string
example: 'pong'
/config/measure:
get:
tags:
- config
summary: 'Returns QNA600 measure parameters'
description: ''
operationId: configGet
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: '#/components/schemas/MeasureConfig'
post:
tags:
- config
summary: 'Configures QNA600 measure parameters'
description: ''
operationId: configPost
requestBody:
description: "JSON containing new QNA600 measure configuration"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeasureConfig'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid measure configuration, please check configuration JSON file'
'500':
description: 'Measure configuration change failed'
put:
tags:
- config
summary: 'Configures QNA600 measure parameters'
description: ''
operationId: configPut
requestBody:
description: "json containing new QNA600 measure configuration"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeasureConfig'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid measure configuration, please check configuration json file'
'500':
description: 'Measure configuration change failed'
/config/scheduled:
get:
tags:
- config
summary: 'Returns QNA600 scheduled parameters'
description: ''
operationId: scheduledGet
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: '#/components/schemas/ScheduledConfig'
put:
tags:
- config
summary: 'Configures QNA600 scheduled parameters'
description: ''
operationId: scheduledPut
requestBody:
description: "JSON containing new QNA600 scheduled configuration"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ScheduledConfig'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Scheduled configuration change failed'
'500':
description: 'Scheduled configuration change failed'
/data/periodic:
post:
tags:
- data
summary: 'Recorded periodic values in JSON or CSV format'
description: 'A specific time frame and set of periodic variables are requested in JSON format. The output is made of time series vectors in JSON format or a single table in CSV'
operationId: periodicPost
requestBody:
description: 'Input parameters are the time frame for data extraction and the requested variables. Time must be written in ISO 8601 format'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataPeriodic'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'404':
description: 'Item not found in database'
'500':
description: 'Internal server error'
/data/events/list:
post:
tags:
- data
summary: 'Events list with associated data in JSON format'
description: 'It gives a list of events for a certain time frame. If any of these events has an associated waveform, its id is also returned. Any event and waveform has a unique id, either numeric or alphanumeric'
operationId: eventsPost
requestBody:
description: 'Simple JSON with start and end time request'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataEvent'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'404':
description: 'Item not found in database'
'500':
description: 'Internal server error'
/data/delete:
post:
tags:
- data
summary: 'Delete periodic, event or waveform data'
description: 'Recorded data between two timestamps may be deleted. This function shall be used for keeping the internal database within certain size limits'
operationId: deletePost
requestBody:
description: 'Recorded data in internal database is deleted. Time frames and type of data are input parameters'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataDelete'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'500':
description: 'Internal server error'
/data/online:
post:
tags:
- data
summary: 'Online values in JSON or CSV format'
description: 'Request of online measurements. Timestamp is included in the result'
operationId: onlinePost
requestBody:
description: 'Input parameters are the requested variables'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataOnline'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'404':
description: 'Item not found in database'
'500':
description: 'Internal server error'
/data/waveform:
post:
tags:
- data
summary: 'Waveform datapoints in JSON, CSV or ZIP+COMTRADE format'
description: 'It returns the full time series data of any waveform given by a single id'
operationId: waveformPost
requestBody:
description: 'It consists of a very simple JSON dictionary with a unique waveform id and the requested output format'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataWaveform'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'500':
description: 'Internal server error'
/data/report:
post:
tags:
- data
summary: 'Recorded data values in PQDIF or EN50160 format'
description: 'A specific time frame and format are requested in JSON format'
operationId: reportPost
requestBody:
description: 'Input parameters are the time frame for data extraction and the format'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataReport'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
'500':
description: 'Internal server error'
/data/tags:
post:
tags:
- data
summary: 'Returns list of tags of the request'
description: ''
operationId: tagsPost
requestBody:
description: ''
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataTags'
responses:
'200':
description: 'Successful operation'
'400':
description: 'Invalid parameters configuration'
/data/info:
get:
tags:
- data
summary: 'Returns measure info data'
description: ''
operationId: infoGet
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: '#/components/schemas/MeasureInfo'
/io:
get:
tags:
- io
summary: 'Gets QNA600 I/O status'
description: ''
operationId: ioGet
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: '#/components/schemas/IO'
put:
tags:
- io
summary: 'Sets QNA600 I/O status'
description: ''
operationId: ioPut
requestBody:
description: "JSON containing new QNA600 I/O status"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IO'
responses:
'200':
description: 'Successful operation'
'400':
description: 'I/O set failed'
'500':
description: 'I/O set failed'
components:
schemas:
MeasureConfig:
type: object
properties:
PrimaryVoltage:
type: number
minimum: 1
maximum: 2000000
example: 1
SecondaryVoltage:
type: number
minimum: 1
maximum: 2000000
example: 1
PrimaryCurrent:
type: number
minimum: 1
maximum: 2000000
example: 5
SecondaryCurrent:
type: number
minimum: 1
maximum: 5
example: 5
PrimaryNeutral:
type: number
minimum: 1
maximum: 2000000
example: 5
SecondaryNeutral:
type: number
minimum: 1
maximum: 5
example: 5
NominalVoltage:
type: number
minimum: 50
maximum: 2000000
example: 230
NominalCurrent:
type: number
minimum: 0.05
maximum: 20000
example: 5
NominalFrequency:
type: integer
enum: [50, 60]
example: 50
ConnectionMode:
type: string
enum: ['1PH2W', '2PH3W', '3PH4W', '3PH3W', 'ARON']
example: '3PH4W'
Block200msReport:
type: array
items:
$ref: '#/components/schemas/MeasureBlock'
example: ['Voltage', 'Current', 'Power']
Block3sReport:
type: array
items:
$ref: '#/components/schemas/MeasureBlock'
example: ['Voltage', 'Current', 'Power', 'Phasors', 'HarmonicTHD']
BlockUserReport:
type: array
items:
$ref: '#/components/schemas/MeasureBlock'
example: ['Voltage', 'Current', 'Power', 'Unbalance', 'Frequency', 'HarmonicTHD', 'HarmonicVoltage', 'HarmonicCurrent', 'Flicker']
BlocksMaxReport:
type: array
items:
$ref: '#/components/schemas/MeasureBlock'
example: ['Voltage', 'Current', 'Power', 'Frequency']
BlocksMinReport:
type: array
items:
$ref: '#/components/schemas/MeasureBlock'
example: ['Voltage', 'Current', 'Power', 'Frequency']
NumberHarmonicsTHD:
type: integer
minimum: 2
maximum: 64
example: 40
InterruptDipSwellEnable:
type: boolean
format: bool
example: true
PolyphaseInterruptDipSwell:
type: boolean
format: bool
example: true
VoltageInterruptThreshold:
type: number
minimum: 1
maximum: 20
example: 10
VoltageInterruptHysteresis:
type: number
minimum: 0
maximum: 100
example: 2
VoltageDipThreshold:
type: number
minimum: 50
maximum: 97
example: 90
VoltageDipHysteresis:
type: number
minimum: 0
maximum: 100
example: 2
VoltageSwellThreshold:
type: number
minimum: 100
maximum: 150
example: 110
VoltageSwellHysteresis:
type: number
minimum: 0
maximum: 100
example: 2
SlidingReference:
type: boolean
format: bool
example: false
RapidVoltageChangeEnable:
type: boolean
format: bool
example: false
RapidVoltageChangeThreshold:
type: number
minimum: 0
maximum: 100
example: 5
RapidVoltageChangeHysteresis:
type: number
minimum: 0
maximum: 100
example: 2.5
SignalVoltageEnable:
type: boolean
format: bool
example: false
SignalVoltageFreq:
type: number
minimum: 0
maximum: 3000
example: 1060
SignalVoltageThreshold:
type: number
minimum: 0.3
maximum: 100
example: 0.5
SignalVoltageDuration:
type: integer
minimum: 1
maximum: 120
example: 15
TransientVoltageEnable:
type: boolean
format: bool
example: false
TransientVoltageSensitivity:
type: integer
minimum: 0
maximum: 100
example: 100
TransientVoltageSamples:
type: integer
minimum: 1
maximum: 10
example: 1
TransientCurrentEnable:
type: boolean
format: bool
example: false
TransientCurrentSlowSensitivity:
type: integer
minimum: 1
maximum: 4
example: 1
TransientCurrentSlowInhibitCycles:
type: integer
minimum: 1
maximum: 10
example: 10
TransientCurrentSlowThreshold:
type: number
minimum: 1
maximum: 100
example: 50
TransientCurrentFastSensitivity:
type: integer
minimum: 1
maximum: 4
example: 1
TransientCurrentFastInhibitCycles:
type: integer
minimum: 1
maximum: 10
example: 10
TransientCurrentFastThreshold:
type: number
minimum: 1
maximum: 100
example: 4
AggregationPeriod:
type: integer
enum: [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60]
example: 10
MeterPeriod:
type: integer
enum: [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60]
example: 15
FullLoadCurrentL1:
type: number
minimum: 0.05
maximum: 20000
example: 5
FullLoadCurrentL2:
type: number
minimum: 0.05
maximum: 20000
example: 5
FullLoadCurrentL3:
type: number
minimum: 0.05
maximum: 20000
example: 5
FullLoadCurrentLN:
type: number
minimum: 0.05
maximum: 20000
example: 5
CurrentReversed:
type: array
items:
type: boolean
format: bool
minItems: 3
maxItems: 3
example: [false, false, false]
VoltagePhasesSquence:
type: string
enum: ['L1L2L3', 'L1L3L2', 'L2L1L3', 'L2L3L1', 'L3L1L2', 'L3L2L1']
example: 'L1L2L3'
CurrentPhasesSequence:
type: string
enum: ['L1L2L3', 'L1L3L2', 'L2L1L3', 'L2L3L1', 'L3L1L2', 'L3L2L1']
example: 'L1L2L3'
PhaseColorProfile:
type: string
maxLength: 50
example: ''
OscType:
type: string
enum: ['Disabled', 'Waveform', 'RMS']
example: 'Waveform'
OscPreTriggerTime:
type: integer
minimum: 20
maximum: 1000
example: 60
OscPostTriggerTime:
type: integer
minimum: 100
maximum: 4000
example: 300
OscMaxDuration:
type: integer
minimum: 1000
maximum: 60000
example: 5000
ScheduledConfig:
type: object
properties:
Enabled:
type: boolean
format: bool
example: false
FtpIP:
type: string
maxLength: 50
example: ''
FtpPort:
type: integer
minimum: 1
maximum: 65535
example: 22
FtpUserName:
type: string
maxLength: 50
example: ''
FtpPassword:
type: string
maxLength: 50
example: ''
FtpPath:
type: string
maxLength: 50
example: ''
TimePush:
type: string
pattern: '^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$'
example: '01:00'
RandomPush:
type: integer
minimum: 0
maximum: 720
example: 180
Report:
type: string
enum: ['PQDIF', 'EN50160']
example: 'PQDIF'
PrefixName:
type: string
maxLength: 20
example: 'QNA600'
DataPeriodic:
type: object
properties:
start:
type: string
format: date-time
example: '2018-10-14T10:52:18.99Z'
end:
type: string
format: date-time
example: '2018-11-14T10:52:18.99Z'
vars:
type: array
items:
type: string
example: ['v_AN_avg', 'v_BN_avg', 'v_CN_avg']
format:
type: string
enum: ['json', 'csv']
example: 'json'
required:
- start
- end
- vars
- format
DataEvent:
type: object
properties:
start:
type: string
format: date-time
example: '2018-10-14T10:52:18.99Z'
end:
type: string
format: date-time
example: '2018-11-14T10:52:18.99Z'
required:
- start
- end
DataDelete:
type: object
properties:
start:
type: string
format: date-time
example: '2018-10-14T10:52:18.99Z'
end:
type: string
format: date-time
example: '2018-11-14T10:52:18.99Z'
format:
type: string
enum: ['any', 'periodic', 'event', 'waveform']
example: 'periodic'
required:
- start
- end
- format
DataOnline:
type: object
properties:
vars:
type: array
items:
format: string
example: ['v_AN_avg', 'v_BN_avg', 'v_CN_avg']
format:
type: string
enum: ['json', 'csv']
example: 'json'
required:
- vars
- format
DataWaveform:
type: object
properties:
waveform_id:
type: string
example: 'f67d75f3-1b09-4ced-a55b-04f09cbd3d9f'
format:
type: string
enum: ['json', 'csv', 'zipcomtrade']
example: 'json'
required:
- waveform_id
- format
DataReport:
type: object
properties:
start:
type: string
format: date-time
example: '2018-10-14T10:52:18.99Z'
end:
type: string
format: date-time
example: '2018-11-14T10:52:18.99Z'
format:
type: string
enum: ['pqdif', 'en50160']
example: 'pqdif'
required:
- start
- end
- format
DataTags:
type: object
properties:
block:
$ref: '#/components/schemas/MeasureBlock'
tagType:
type: string
enum: ['max', 'min', 'avg']
example: 'avg'
harmInit:
type: integer
minimum: 0
maximum: 50
example: 2
harmEnd:
type: integer
minimum: 0
maximum: 50
example: 25
required:
- block
- tagType
MeasureBlock:
type: string
enum: ['Voltage', 'Current', 'Power', 'Unbalance', 'Phasors', 'Frequency', 'Flicker', 'HarmonicTHD', 'HarmonicVoltage', 'HarmonicCurrent', 'InterharmonicVoltage', 'InterharmonicCurrent', 'CrestFactor', 'KFactor', 'VDeviation', 'VSignalling', 'PInst', 'BlockNumber', 'DetachedPower', 'Temperature', 'Energy']
example: 'Voltage'
MeasureInfo:
type: object
properties:
MeasureVersion:
type: string
example: '1.0.0'
IO:
type: object
properties:
input:
type: array
readOnly: true
items:
type: boolean
minItems: 12
maxItems: 12
example: [ true, true, true, false, false, false, true, true, true, false, false, false ]
output:
type: array
items:
type: boolean
minItems: 2
maxItems: 2
example: [ true, true ]
analog:
type: array
items:
type: integer
minItems: 4
maxItems: 4
example: [ 0, 123, 0, 456 ]